Skip to content

Commit

Permalink
debugging docs
Browse files Browse the repository at this point in the history
  • Loading branch information
drewmee committed Sep 3, 2021
1 parent fe72c4e commit 90355f2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version: 2

build:
image: testing

python:
version: 3.9
install:
Expand Down
37 changes: 27 additions & 10 deletions openflowthrough/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

class OpenFlowThrough:
def __init__(self, usb_port="/dev/arduino_nano"):
"""[summary]
"""The finite state machine (FSM) object which controls the Open Flow Through device.
Args:
usb_port (str, optional): [description]. Defaults to "/dev/arduino_nano".
usb_port (str, optional): The USB port which the device is connected to. Defaults to "/dev/arduino_nano".
"""
self.duration = 10
self.board = ArduinoNano(usb_port)
Expand All @@ -32,15 +32,15 @@ def __init__(self, usb_port="/dev/arduino_nano"):
self.machine = Machine(model=self, send_event=True, **fsm_config)

def load_flowcell_routine(self, measurement_type, flush_delay, fill_delay):
"""[summary]
"""Routine to load the flowcell of the connected sensor with either a blank or sample.
Args:
measurement_type ([type]): [description]
flush_delay ([type]): [description]
fill_delay ([type]): [description]
measurement_type (str): blank (through filter) or sample (bypass filter).
flush_delay (int): Amount of time (seconds) to wait while flushing the connected sensor.
fill_delay (int): Amount of time (seconds) to wait while fill the connected sensor.
Raises:
ValueError: [description]
ValueError: measurement_type must be either "blank" or "filter"
"""
print("loading %s" % measurement_type)

Expand All @@ -66,22 +66,35 @@ def load_flowcell_routine(self, measurement_type, flush_delay, fill_delay):
self.board.digital[self.pin_dict["diverter_valve_2"]].write(0)

def load_blank_routine(self, event):
"""[summary]
Args:
event ([type]): [description]
"""
flush_delay = event.kwargs.get("flush_delay", 20)
fill_delay = event.kwargs.get("fill_delay", 10)
self.load_flowcell_routine(
"blank", flush_delay=flush_delay, fill_delay=fill_delay
)

def load_sample_routine(self, event):
"""[summary]"""
"""[summary]
Args:
event ([type]): [description]
"""
flush_delay = event.kwargs.get("flush_delay", 10)
fill_delay = event.kwargs.get("fill_delay", 10)
self.load_flowcell_routine(
"sample", flush_delay=flush_delay, fill_delay=fill_delay
)

def measurement_routine(self, event):
"""[summary]"""
"""[summary]
Args:
event ([type]): [description]
"""
self.board.digital[self.pin_dict["pump"]].write(0)

# Route flow around filter
Expand All @@ -92,7 +105,11 @@ def measurement_routine(self, event):
self.board.digital[self.pin_dict["on_off_valve"]].write(1)

def safety_routine(self, event):
"""[summary]"""
"""[summary]
Args:
event ([type]): [description]
"""
self.board.digital[self.pin_dict["pump"]].write(0)

# Route flow around filter
Expand Down

0 comments on commit 90355f2

Please sign in to comment.