Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ documentation page "CustomApp and CustomExt" (`docs/src/developer_folder/custom_
here.
- Long-running work (a scan, a sequence, a ramp) goes in an `ExtensionWorker` subclass run in a thread, started and
stopped from the extension's workflow actions, as in `sequencer.py` and `ramping.py`.
- `__init__(self, parent: DockArea, dashboard)`: call `super().__init__(parent, dashboard)`, then `self.setup_ui()`.
- `__init__(self, parent: DockArea, dashboard)`: call `super().__init__(parent, dashboard, add_toolbar_break=False)`,
then `self.setup_ui()`. An extension has two toolbars: its own, created by the base class (`CustomApp.__init__`,
`add_toolbar_break` is `True` by default), and the Dashboard one created by `create_dashboard_toolbar(add_break=False)`
in `setup_menus_and_toolbars`. The extensions of PyMoDAQ (scan, sequencer, ramping...) add a break before neither.
- **Experiment and state belong to the Dashboard.** The *experiment* is the list of instruments (actuators and
detectors) the Dashboard manages and controls; the *state* is the state of that experiment, mostly the values of the
instruments' settings and of the Dashboard's actuators. An extension must use the managers it gets through its
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ class CustomExtensionTemplate(CustomExt):
params = []

def __init__(self, parent: gutils.DockArea, dashboard):
super().__init__(parent, dashboard) # also creates self.modules_manager for this extension
# also creates self.modules_manager for this extension, and the extension's own toolbar (named after the
# class). Like the PyMoDAQ extensions (scan, sequencer...), no break is added before it
super().__init__(parent, dashboard, add_toolbar_break=False)

self.setup_ui() # calls, in this order: setup_docks_and_widgets, setup_menus_and_toolbars,
# setup_actions, connect_things and do_things_after_ui_setup
Expand Down Expand Up @@ -77,7 +79,7 @@ def setup_menus_and_toolbars(self, menubar: QtWidgets.QMenuBar = None):
--------
pymodaq.utils.managers.action_manager.ActionManager
"""
# adds the toolbar showing/hiding the Dashboard, loading an experiment and a state
# adds a second toolbar, the Dashboard one: show/hide the Dashboard, load an experiment and a state
self.create_dashboard_toolbar(add_break=False)

def setup_actions(self):
Expand Down
Loading