Process manager

A distributed process panel: starts and stops background processes grouped as Servers/Driver/GUI/Viewer/Monitor.

Overview

quatm/GUI/entries/processmanager.py provides the process manager: it reads the configuration by category (Servers / Driver / GUI / Viewer / Monitor) and generates a SingleProcess start/stop button panel for each script entry, so the whole experiment software suite is managed from one place. Processes are launched with the current interpreter, either as a script or as a module (python -m), carrying the project root and the parent-process watchdog environment.

Process categories

CategoryDescriptionTypical processes
ServersCommunication / property / data servicesData centre, property service, etc.
DriverHardware driver processesFPGA and other device drivers
GUIGraphical interface processesExperiment browser, data manager, etc.
ViewerData viewing processesLive plotting, scroll window, image viewer, etc.
MonitorMonitoring / checking processesProperty checker, message monitor, etc.

Components

ComponentDescription
ProcessManagerCategory panel: reads the configuration and generates start/stop buttons for each entry
SingleProcessSingle-entry panel: start / asynchronous termination / status polling with coloring
resolve_scriptResolves the script entry from the configuration into a launch target (file path or module)

Key methods (SingleProcess)

MethodDescription
startProcessStops the old instance and then starts the subprocess with the current interpreter
stopProcessTerminates the subprocess asynchronously without blocking the GUI thread
updateStatusPeriodically polls the exit status and colors it (running / exited normally / crashed)

Usage

from quatm.GUI.entries.processmanager import ProcessManager

pm = ProcessManager(parent=parent)
pm.show()

The entries to manage are defined by the scripts in the configuration file; each entry is started and stopped through its own button panel.