Contents:
Device class for a SST Luminox Oxygen sensor. This device can measure the oxygen concentration between 0 % and 25 %.
Furthermore, it measures the barometric pressure and internal temperature. The device supports two operating modes: in streaming mode the device measures all parameters every second, in polling mode the device measures only after a query.
Technical specification and documentation for the device can be found a the manufacturer’s page: https://www.sstsensing.com/product/luminox-optical-oxygen-sensors-2/
Luminox
Bases: hvl_ccb.dev.base.SingleCommDevice
hvl_ccb.dev.base.SingleCommDevice
Luminox oxygen sensor device class.
activate_output
activate the selected output mode of the Luminox Sensor. :param mode: polling or streaming
config_cls
Return the default configdataclass class.
a reference to the default configdataclass class
default_com_cls
Get the class for the default communication protocol used with this device.
the type of the standard communication protocol for this device
query_polling
Query a value or values of Luminox measurements in the polling mode, according to a given measurement type.
measurement – type of measurement
value of requested measurement
ValueError – when a wrong key for LuminoxMeasurementType is provided
LuminoxOutputModeError – when polling mode is not activated
LuminoxMeasurementTypeError – when expected measurement value is not read
read_streaming
Read values of Luminox in the streaming mode. Convert the single string into separate values.
dictionary with LuminoxMeasurementType.all_measurements_types() keys and accordingly type-parsed values.
LuminoxOutputModeError – when streaming mode is not activated
LuminoxMeasurementTypeError – when any of expected measurement values is not read
start
Start this device. Opens the communication protocol.
stop
Stop the device. Closes also the communication protocol.
LuminoxConfig
Bases: object
object
Configuration for the SST Luminox oxygen sensor.
clean_values
force_value
Forces a value to a dataclass field despite the class being frozen.
NOTE: you can define post_force_value method with same signature as this method to do extra processing after value has been forced on fieldname.
fieldname – name of the field
value – value to assign
is_configdataclass
keys
Returns a list of all configdataclass fields key-names.
a list of strings containing all keys.
nr_trials_activate
optional_defaults
Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.
a list of strings containing all optional keys.
required_keys
Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.
a list of strings containing all required keys.
wait_sec_post_activate
wait_sec_trials_activate
LuminoxMeasurementType
Bases: hvl_ccb.utils.enum.ValueEnum
hvl_ccb.utils.enum.ValueEnum
Measurement types for LuminoxOutputMode.polling.
The all_measurements type will read values for the actual measurement types as given in LuminoxOutputMode.all_measurements_types(); it parses multiple single values using regexp’s for other measurement types, therefore, no regexp is defined for this measurement type.
all_measurements
all_measurements_types
A tuple of LuminoxMeasurementType enum instances which are actual measurements, i.e. not date of manufacture or software revision.
barometric_pressure
command
date_of_manufacture
parse_read_measurement_value
partial_pressure_o2
percent_o2
sensor_status
serial_number
software_revision
temperature_sensor
LuminoxMeasurementTypeDict
A typing hint for a dictionary holding LuminoxMeasurementType values. Keys are allowed as strings because LuminoxMeasurementType is of a StrEnumBase type.
alias of Dict[Union[str, LuminoxMeasurementType], Union[float, int, str]]
LuminoxMeasurementTypeError
Bases: Exception
Exception
Wrong measurement type for requested data
LuminoxMeasurementTypeValue
A typing hint for all possible LuminoxMeasurementType values as read in either streaming mode or in a polling mode with LuminoxMeasurementType.all_measurements.
Beware: has to be manually kept in sync with LuminoxMeasurementType instances cast_type attribute values.
alias of Union[float, int, str]
LuminoxOutputMode
Bases: enum.Enum
enum.Enum
output mode.
polling
streaming
LuminoxOutputModeError
Wrong output mode for requested data
LuminoxSerialCommunication
Bases: hvl_ccb.comm.serial.SerialCommunication
hvl_ccb.comm.serial.SerialCommunication
Specific communication protocol implementation for the SST Luminox oxygen sensor. Already predefines device-specific protocol parameters in config.
LuminoxSerialCommunicationConfig
Bases: hvl_ccb.comm.serial.SerialCommunicationConfig
hvl_ccb.comm.serial.SerialCommunicationConfig
baudrate
Baudrate for SST Luminox is 9600 baud
bytesize
One byte is eight bits long
parity
SST Luminox does not use parity
stopbits
SST Luminox does use one stop bit
terminator
The terminator is CR LF
timeout
use 3 seconds timeout as default