Skip to content

Commit 82fbd3e

Browse files
committedSep 9, 2016
doc: CCBs, applet setup from experiment
1 parent 3876883 commit 82fbd3e

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
 

Diff for: ‎artiq/dashboard/applets_ccb.py

+39
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,31 @@ def locate_applet(self, name, group, create_groups):
142142
return parent, applet
143143

144144
def ccb_create_applet(self, name, command, group=None, code=None):
145+
"""Requests the creation of a new applet.
146+
147+
An applet is identified by its name and an optional list of groups that
148+
represent a path (nested groups). If ``group`` is a string, it
149+
corresponds to a single group. If ``group`` is ``None`` or an empty
150+
list, it corresponds to the root.
151+
152+
``command`` gives the command line used to run the applet, as if it
153+
was started from a shell. The dashboard substitutes variables such as
154+
``$python`` that gives the complete file name of the Python
155+
interpreter running the dashboard.
156+
157+
If the name already exists (after following any specified groups), the
158+
command or code of the existing applet with that name is replaced, and
159+
the applet is shown at its previous position. If not, a new applet
160+
entry is created and the applet is shown at any position on the screen.
161+
162+
If the group(s) do not exist, they are created.
163+
164+
If ``code`` is not ``None``, it should be a string that contains the
165+
full source code of the applet. In this case, ``command`` is used to
166+
specify (optional) command-line arguments to the applet.
167+
168+
This function is called when a CCB ``create_applet`` is issued.
169+
"""
145170
if group is None:
146171
group = []
147172
elif isinstance(group, str):
@@ -163,6 +188,13 @@ def ccb_create_applet(self, name, command, group=None, code=None):
163188
applet.setCheckState(0, QtCore.Qt.Checked)
164189

165190
def ccb_disable_applet(self, name, group=None):
191+
"""Disables an applet.
192+
193+
The applet is identified by its name, after following any specified
194+
groups.
195+
196+
This function is called when a CCB ``disable_applet`` is issued.
197+
"""
166198
if group is None:
167199
group = []
168200
elif isinstance(group, str):
@@ -176,6 +208,13 @@ def ccb_disable_applet(self, name, group=None):
176208
applet.setCheckState(0, QtCore.Qt.Unchecked)
177209

178210
def ccb_disable_applet_group(self, group):
211+
"""Disables all the applets in a group.
212+
213+
If the group is nested, ``group`` should be a list, with the names
214+
of the parents preceding the name of the group to disable.
215+
216+
This function is called when a CCB ``disable_applet_group`` is issued.
217+
"""
179218
if isinstance(group, str):
180219
group = [group]
181220

Diff for: ‎doc/manual/management_system.rst

+10
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ The scheduler virtual device also contains the attributes ``rid``, ``pipeline_na
124124
.. autoclass:: artiq.master.scheduler.Scheduler
125125
:members:
126126

127+
Client control broadcasts (CCBs)
128+
********************************
129+
130+
Client control broadcasts are requests made by experiments for clients to perform some action. Experiments do so by requesting the ``ccb`` virtual device and calling its ``issue`` method. The first argument of the issue method is the name of the broadcast, and any further positional and keyword arguments are passed to the broadcast.
131+
132+
CCBs are used by experiments to configure applets in the dashboard, for example for plotting purposes.
133+
134+
.. autoclass:: artiq.dashboard.applets_ccb.AppletsCCBDock
135+
:members:
136+
127137
Front-end tool reference
128138
************************
129139

0 commit comments

Comments
 (0)
Please sign in to comment.