Skip to content

Commit

Permalink
#20 outlier factor for when pump is on must be supplied with the prot…
Browse files Browse the repository at this point in the history
…ocol if the PBR class is Phenometrics
  • Loading branch information
DanDayne committed Dec 12, 2019
1 parent 05ec414 commit 3aeae88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions HWdevices/Phenometrics/PBR.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def run(self):
while not self.stop_request.isSet(): # if we set this flag but never set start_pumping_event_flag, will the thread truly exit?
self.start_pumping_event.clear()

self.device_details['setup']['lower_outlier_tol'] *= 2
self.device_details['setup']['lower_outlier_tol'] *= \
self.device_details['setup']['pump_on_outlier_tolerance_factor']

self.pump_state[0] = True # is this necessary?

Expand All @@ -356,7 +357,8 @@ def run(self):
continue
self.od_changed.wait() # we wait until OD has changed

self.device_details['setup']['lower_outlier_tol'] /= 2
self.device_details['setup']['lower_outlier_tol'] /= \
self.device_details['setup']['pump_on_outlier_tolerance_factor']

self.start_pumping_event.wait()

Expand Down
7 changes: 6 additions & 1 deletion server/protocolChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class Protocol:
'max_OD',
'pump_id',
'ft_channel',
'OD_channel']
'OD_channel',
'pump_on_outlier_tolerance_factor']

phenometrics_keys = ['device_id',
'host_port',
Expand Down Expand Up @@ -47,8 +48,12 @@ def check_protocol(self, protocol):
"VirtualDevice %d on Node %s is missing %s. " % (device_counter, node, device_key))

if 'device_type' in device and device['device_type'] == 'PBR':

for setup_key in self.PBR_setup:

if setup_key not in device.get('setup', {}):
if setup_key == 'pump_on_outlier_tolerance_factor' and device['class'] != 'Phenometrics':
continue
missing.append(
"PBR on Node %s is missing %s in its setup. " % (node, setup_key))
if 'device_class' in device:
Expand Down

0 comments on commit 3aeae88

Please sign in to comment.