trspectrometer.hardware module¶
Module for management of various spectrometer hardware devices.
This does not actually control any hardware itself, but instead stores references to plugin modules which do the hard work.
A hardware plugin is a normal plugin module, but must also:
Implement a
init()method to connect to and initialise the device(s).Implement a
close()method to disconnect from devices and free any used resources.Implement a
statuspanelproperty to return a QWidget class type (not an instance of the class!) to display device status information in the hardware status panel. This may beNoneif no panel is required.Add a reference to itself to the
modulesdictionary, for example usinghardware.modules[__name__] = sys.modules[__name__].
Calling of the plugin’s init() and close() methods will be handled automatically,
as will creation and display of the statuspanel if provided.
- class trspectrometer.hardware.HardwareStatusPanel(parent=None)[source]¶
Bases:
QScrollAreaWindow in which to place the individual hardware status panels.
- staticMetaObject = PySide6.QtCore.QMetaObject("HardwareStatusPanel" inherits "QScrollArea": )¶
- trspectrometer.hardware.modules = {}¶
Dictionary of configured hardware device modules. The keys are strings containing the name of the module, with values being the loaded module instance. Hardware plugin modules should add themselves to this, for example by using
hardware.modules[__name__] = sys.modules[__name__].