Open xtrojak opened 5 years ago
The implementation needs to be slightly modified according to the initial description (https://czechglobe-doab.slack.com/archives/CLN16B9CH/p1571978282001000), i.e. I would
do it following way:
OD = measure_od()
while OD > min_OD:
setAux2(1) # this turns on the pump (works only if the pump goes from 0 to 1)
time.sleep(20) # sleep 20 seconds, should be enough to accomplish steps 1. and 2.
setAux2(0) # reset the pump to zero state that is necessary for success of next set of the pump
time.sleep(20)
OD = measure_od()
It was just a testing close, the issue has not been resolved by implementation yet.
I tried to address this in this commit. I expect bugs to occur, but I do not have the resources to test it at the moment. @xtrojak could possibly try it out?
Basically, I added a pump manager which manages the pump state for ePBRs in its own thread - log messages should be consistent with other device classes.
The pump manager is working, but will be possibly modified to more general usage.
TODO: move pump manager to Phenometrics\PBR
Compared to PSI PBR, the change of the state of pump in ePBR is more complicated. It cannot be simply switched on and off. The pump works as following:
The problem with point 2. is that the extraction pump is possibly shared with other devices.
Considering the given information, we propose the following implementation of
set_pump_state
forePBR
(has to be verified)such that min_OD is given to
ePBR
during initialisation.Question for Jan:
We are still not sure how correctly use
setAux1
. It takes as argument0/1
, which should turnoff/on
the pump. As described above it is quite clear howsetAux1(1)
should be used. What is not clear, however, is whether after the "40 seconds" the state is set back to0
. Also it is not clear whethersetAux1(0)
has any effect at all - and if it does, what does it actually mean in the context of steps described above and on the pseudo-code provided above.