Task System#

The task system in devctrl lets you run multiple configurable actions in sequence. This is mainly aimed at GUI development, since you can just call the functions in order in a command-line environment.

For example, a task sequence for an optical setup could be

  • wait for user to confirm with a message ‘Have you turned on the laser warning light?’

  • start a laser power calibration

  • measure the sample with laser power 1

  • measure the sample with laser power 2

  • shut down the setup

Each Task is simply a SettingsClass, which are basically just python dataclasses with yaml load/save functionality. The real logic must be implemented in the task manager, which runs the tasks. This is because the same task must be executed differently depending on the software and environment. For example, the UserConfirmTask should prompt the user on the command line if in a CLI setting, while it should probably display a diolog witha button in a GUI environment.

GUI#

The GUI task module devctrl.gui.task contains a default implementation of a task manager, which lets the user add, remove, configure and run tasks. To run a measurement software on your setup, you should implement a measurement task and a measurement task runner widget. The widget is then configured with the task manager via devctrl.gui.task.manager.TaskManagerWidget.set_runner().