radloggerpy.device.device module
- class radloggerpy.device.device.Device(info: Type[_U], condition: Condition)[source]
Bases:
object
Abstract class all radiation monitoring devices should implement
- INTERFACE = None
Each radiation monitoring device should use a specific interface
- NAME = 'Device'
Each radiation monitoring device should have a unique name
- TYPE = 1
Each radiation monitoring device should define its type
- class _U
Bound to
radloggerpy.database.objects.device.DeviceObject
alias of TypeVar(‘_U’, bound=
DeviceObject
)
- _abc_impl = <_abc._abc_data object>
- abstract _init()[source]
Method to perform device initialization
Devices are allowed to clear any flags or variables set when stop() was called previously inside of this method.
- abstract _run()[source]
Method to be called to run continuously in its own thread
Devices should not return from this method unless the intent is for the device to stop retrieving data. Data can be gathered by either polling or using events / wait if the external system supports to do so. Timers may also be used, please be sure to honor: CONF.devices.minimal_polling_delay
- get_data()[source]
Return a collection of radiation monitoring data if any is available
Retrieves the currently stored collection of radiation monitoring data and subsequently clears it.
- Returns:
Collection of RadiationReading objects
- Return type:
List of :py:class: ‘~.RadiationReading’ instances
- abstract is_stopping()[source]
Should return true if in the progress of stopping false otherwise
- Returns:
True if stopping, false otherwise