ControlWidgets
ControlWidgets add interactive elements to the SweepMe! dashboard to allow for user interaction and more flexibility during measurements. Users can integrate sliders, dials, and buttons into the dashboard to modify parameters in real time.
Elements
Each element is added with one of the buttons at the end of the module: New slider, New dial, or New button box. You can add each element multiple times. These buttons are disabled during a run. After adding an element, a widget is added to the dashboard.
All elements of the module are listed under Created widgets with their type and title. Right-click an element to:
- Rename it. The name is the title of the widget in the dashboard. You can also double-click the element to rename it.
- Configure it. You can also double-click the widget in the dashboard to configure it.
- Hide or Show its widget in the dashboard.
- Remove it.
Sliders, Dials, and the toggle and dropdown buttons add variables to the system that can be used as sweep value in other modules or via the parameter syntax {...}. The name of each variable starts with the title of the widget, e.g. "Slider1 Var".
Slider
A Slider sets a value on a linear scale between an upper and a lower limit. You can move the slider with the mouse, the mouse wheel, or the keys, or type the new value into the field next to the slider. All values are restricted to the range between the limits. Double-click the widget to configure:
- Variable and Unit: name and unit of the variable that the slider adds to the system
- Upper and Lower: the limits of the slider
- Initial: an optional value that is restored at the beginning of each run
- Points: the number of points between the limits (default 1000). It defines the step width when using the arrow keys. The Page Up / Page Down keys move by ten steps.
Dial
A Dial works like a Slider, but has a round shape. It has the same settings as the Slider.
ButtonBox
The ButtonBox holds one or more buttons of four different types. Double-click the widget to configure it:
- Alignment: arranges the buttons "Left to right", "Right to left", "Top to bottom", or "Bottom to top".
- Add trigger button, Add single toggle button, Add double toggle button, and Add dropdown button add a new button of the respective type. Each button has its own section with its settings and a Remove button.
Buttons cannot be added or removed during a run.
Trigger button
A button that triggers one or more actions, such as run, stop, pause, but also actions provided by modules, drivers, widgets, and CustomFunction scripts. For example, a "Zero thickness" button could be used to trigger a function of a QCM instrument driver to zero the thickness of a thin-film thickness monitor. Settings:
- Label: the text shown on the button
- Function clicked: the actions that are performed when the button is clicked. Right-click into the list and select Add function... to add an action. The list contains the same actions as in the Condition module, except for skip_point. Several actions are performed from top to bottom.
- Enabled: "always", "running" (only during a run), or "stopped" (only if no run is active)
- Execution: "synchronous" performs the actions within the measurement thread at the next possible step of the ControlWidgets module, which might block the measurement procedure. "asynchronous" performs the actions immediately within the GUI thread, independent of the measurement. Buttons that need to work while no run is active must use "asynchronous".
Single toggle button
A button that adds a variable with two states to the system. For State 1 and State 2, you define the Label shown on the button and the Value that is returned to the system (default: "Off" with 0 and "On" with 1). The button changes its label when it is clicked. The name of the variable is set with Variable.
Values are handed over as number if possible. If both values are True or False, they are handed over as boolean values. Otherwise, the values are handed over as text.
Double toggle button
This button is similar to the single toggle button with the difference that two buttons are shown: one for each state. The button of the current state is inactive, so only the other state can be selected. This prevents an accidental switch, because clicking the same button twice does not change the state again. The settings are the same as for the single toggle button.
Dropdown button
This button is basically a drop-down box that allows the user to select one from many options. Enter the options under Values, separated by a | sign, e.g. "Option 1 | Option 2 | Option 3". The selected option is handed over as text to the variable set with Variable. It is very similar to the Selection field of the Form module, but is larger and thus each option is easier to select.
Run Controls and Save Bar
Until SweepMe! 1.5.8.2, the ControlWidgets module also offered the elements MainControls (Run, Pause, and Stop buttons) and SaveBar. From SweepMe! 1.5.8.3, these are permanent widgets of SweepMe! called Run Controls and Save Bar. They no longer require a ControlWidgets module. Sequences that still contain the old elements can be loaded.
Application Example
The image shows how variations of sliders and buttons can be configured to control device parameters, start/stop the measurement, or save data directly from the dashboard.
Typical applications are:
- Using a Slider to set a temperature of a temperature controller or the voltage of a power supply.
- Using a Trigger button to call a function of an instrument driver like reset or a sequencer control function like "skip_sweeps_below".
- Using a Double toggle button to switch an output between two defined values, e.g. 0 V and an operating voltage.
- Combining ControlWidgets with the Run Controls and Save Bar widgets so that the whole measurement can be operated from the dashboard.
