Test devices
PBR
- class app.workspace.devices.PSI.test.classes.PBR.PBR(*args, **kwargs)
Bases:
ConnectorCommands:
“1”: self.get_temp_settings,
“2”: self.get_temp,
“3”: self.set_temp,
“4”: self.get_ph,
“5”: self.measure_od,
“6”: self.get_pump_params,
“7”: self.set_pump_params,
“8”: self.set_pump_state,
“9”: self.get_light_intensity,
“10”: self.set_light_intensity,
“11”: self.turn_on_light,
“12”: self.get_pwm_settings,
“13”: self.set_pwm,
“14”: self.get_o2,
“15”: self.set_thermoregulator_state,
“16”: self.measure_ft,
“17”: self.get_co2,
“18”: self.measure_all,
“19”: self.measure_AUX,
“20”: self.flash_LED,
“21”: self.get_hardware_address,
“22”: self.get_cluster_name
- disconnect() None
Terminate the connection between the application and physical device.
- flash_LED()
Triggers a flashing sequence and is used to physically identify the PBR.
- Returns
True if was successful, False otherwise
- get_cluster_name()
The name of the bioreactor array / cluster.
- Returns
the cluster name
- get_co2(raw=True, repeats=5)
Measure dissolved CO2 concentration.
- Parameters
raw – True for raw data, False for calibrated data
repeats – the number of measurement repeats
- Returns
averaged CO2 concentration
- get_hardware_address()
Get the MAC address of the PBR.
- Returns
the MAC address
- get_light_intensity(attribute)
Checks for current (max?) light intensity.
Items:
“intensity”: current light intensity (float) in μE,
“max”: maximal intensity (float) in μE,
“on”: True if light is turned on (bool)
- Parameters
attribute – Given attribute ID
- Returns
The current settings structured in a dictionary.
- get_o2(raw=True, repeats=5, wait=0)
Checks for concentration of dissociated O2.
Items:
“pulse”: current stirring in %,
“min”: minimal stirring in %,
“max”: maximal stirring in %,
“on”: True if stirring is turned on (bool)
- Parameters
raw – True for raw data, False for data calculated according to temperature calibration
repeats – the number of measurement repeats
wait – waiting time between individual repeats
- Returns
The current settings structured in a dictionary.
- get_ph(repeats=5, wait=0)
Get current pH (dimensionless.)
- Parameters
repeats – the number of measurement repeats
wait – waiting time between individual repeats
- Returns
The current pH.
- get_pump_params(pump)
Get parameters for given pump.
- Parameters
pump – Given pump
- Returns
The current settings structured in a dictionary.
- get_pwm_settings()
Checks for current stirring settings.
Items:
“pulse”: current stirring in %,
“min”: minimal stirring in %,
“max”: maximal stirring in %,
“on”: True if stirring is turned on (bool)
- Returns
The current settings structured in a dictionary.
- get_temp()
Get current temperature in Celsius degree.
- Returns
The current temperature.
- get_temp_settings()
Get information about currently set temperature, maximal and minimal allowed temperature.
- Returns
The current settings structured in a dictionary.
- get_thermoregulator_settings()
Get current settings of thermoregulator.
Items:
“temp”: current temperature in Celsius degrees,
“min”: minimal allowed temperature,
“max”: maximal allowed temperature,
“on”: state of thermoregulator (1 -> on, 0 -> freeze, -1 -> off)
- Returns
The current settings structured in a dictionary.
- measure_AUX(attribute)
Values of AUX auxiliary input voltage.
- Parameters
attribute –
???
- Returns
???
- measure_all(ft_attribute=5, pump_id=5)
Measures all basic measurable values.
- Parameters
ft_attribute – attribute for ft_measure
pump_id – id of particular pump
- Returns
dictionary of all measured values
- measure_ft(attribute)
Measure steady-state terminal fluorescence.
- Parameters
attribute – 0 -> blue (455 nm) measuring LEDs, 1 -> red (627 nm) measuring LEDs
- Returns
fluorescence value in arbitrary units
- measure_od(attribute=0, repeats=5)
Measure current Optical Density (OD, dimensionless).
- Parameters
attribute – which attribute should be measured
repeats – the number of measurement repeats
- Returns
Measured OD
- set_light_intensity(attribute, intensity)
Control LED panel on photobioreactor.
- Parameters
attribute – Given attribute (0 for red light, 1 for blue light)
intensity – Desired intensity
- Returns
True if was successful, False otherwise.
- set_pump_params(pump, direction, flow)
Set up the rotation direction and flow for given pump.
- Parameters
pump – Given pump
direction – Rotation direction (1 right, -1 left)
flow – Desired flow rate
- Returns
True if was successful, False otherwise.
- set_pump_state(pump, on)
Turns on/off given pump.
- Parameters
pump – ID of a pump
on – True to turn on, False to turn off
- Returns
True if was successful, False otherwise.
- set_pwm(value, on)
Set stirring settings.
- Parameters
value – desired stirring pulse
on – True turns on, False turns off
- Returns
True if was successful, False otherwise.
- set_ratio_light_intensity(intensity, ratio=0.5)
Set target light intensity as a sum of red and blue lights, mixed according to given ratio.
- Parameters
intensity – target light intensity
ratio – (red/ratio) == (blue/(1-ratio))
- Returns
True if both were successful, False otherwise.
- set_temp(temp)
Set desired temperature in Celsius degree.
- Parameters
temp – The temperature.
- Returns
True if was successful, False otherwise.
- set_thermoregulator_state(on)
Set state of thermoregulator.
- Parameters
on – 1 -> on, 0 -> freeze, -1 -> off
- Returns
True if was successful, False otherwise.
- test_connection() bool
Test the connection between the application and physical device.
- turn_on_light(attribute, on)
Turn on/off LED panel on photobioreactor.
- Parameters
attribute – Given attribute
on – True turns on, False turns off
- Returns
True if was successful, False otherwise.
- app.workspace.devices.PSI.test.classes.PBR.random() x in the interval [0, 1).
GAS
- class app.workspace.devices.PSI.test.classes.GAS.GAS(*args, **kwargs)
Bases:
ConnectorCommands:
“1”: self.get_flow,
“2”: self.get_flow_target,
“3”: self.set_flow_target,
“4”: self.get_flow_max,
“5”: self.get_pressure,
“6”: self.measure_all,
“7”: self.get_co2_air,
“8”: self.get_small_valves,
“9”: self.set_small_valves,
- disconnect() None
Terminate the connection between the application and physical device.
- get_co2_air()
Measures CO2 in air.
- Returns
measured CO2 in air
- get_flow(repeats)
Actual flow being send from GAS to the PBR.
- Parameters
repeats – the number of measurement repeats
- Returns
The current flow in L/min.
- get_flow_max()
Maximal allowed flow.
- Returns
The maximal flow in L/min
- get_flow_target()
Actual desired flow.
- Returns
The desired flow in L/min.
- get_pressure(repeats=5, wait=0)
Current pressure.
- Parameters
repeats – the number of measurement repeats
wait – waiting time between individual repeats
- Returns
Current pressure in ???
- get_small_valves()
Obtain settings of individual vents of GAS device.
Represented as one byte, where first 6 bits represent vents indexed as in a picture scheme available here: https://i.imgur.com/jSeFFaO.jpg
- Returns
byte representation of vents settings.
- measure_all()
Measures all basic measurable values.
- Returns
dictionary of all measured values
- set_flow_target(flow)
Set flow we want to achieve.
- Parameters
flow – flow in L/min we want to achieve (max given by get_flow_max)
- Returns
True if was successful, False otherwise.
- set_small_valves(mode)
Changes settings of individual vents of GAS device.
Can be set by one byte (converted to int), where first 6 bits represent vents indexed as in a picture scheme available here: https://i.imgur.com/jSeFFaO.jpg
Mode 0 - normal mode, output from GMS goes to PBR (255) Mode 1 - reset mode, N2 (nitrogen) goes to PBR (239) Mode 2 - no gas input to PBR (249) Mode 3 - output of PBR goes to input of PBR (246)
- Parameters
mode – chosen mode (0 to 3)
- Returns
True if was successful, False otherwise.
- test_connection() bool
Test the connection between the application and physical device.
GMS
- class app.workspace.devices.PSI.test.classes.GMS.GMS(*args, **kwargs)
Bases:
ConnectorCommands:
“1”: self.get_info,
“2”: self.get_valve_flow,
“3”: self.set_valve_flow,
- disconnect() None
Terminate the connection between the application and physical device.
- get_valve_flow(valve)
Get value (L/min) of current flow in the given valve.
- Parameters
valve – ID of the valve (0 for CO2, 1 for Air)
- Returns
The current settings of the valve flow and actual value, both in (L/min).
- get_valve_info(valve)
Gives information about the valve
- Parameters
valve – ID of the valve (0 for CO2, 1 for Air)
- Returns
A dictionary with gas type and maximal allowed flow.
- set_valve_flow(valve, value)
Set value (L/min) of current flow in the given valve.
- Parameters
valve – ID of the valve (0 for CO2, 1 for Air)
value – desired value for valve flow in (L/min).
- Returns
True if was successful, False otherwise.
- test_connection() bool
Test the connection between the application and physical device.