|
|
@@ -53,7 +53,7 @@ def Controller(USR_INSTRUCTIONS, Connection, cancel_switch, ConnectionStatus, |
|
|
|
Protocol = SetProtocol(with_device=Box, filters=user_filters, |
|
|
|
and_wavelenghts=USR_INSTRUCTIONS.user_wavelengths, |
|
|
|
well_number=96, protocol_name='default_protocol') |
|
|
|
BoxQueue.put([Protocol, USR_INSTRUCTIONS.QueueFile]) # Export `Protocol' before Run begins. |
|
|
|
BoxQueue.put([Box, Protocol, USR_INSTRUCTIONS.QueueFile]) # Export `Protocol' before Run begins. |
|
|
|
# Run Protocol. `Connection' is no longer a dependency of this method as |
|
|
|
# the log messages produced interfere with the GUI during a protocol run. |
|
|
|
Protocol.Run(assay_length=USR_INSTRUCTIONS.length, |
|
|
@@ -172,19 +172,20 @@ def ExportData(Protocol, ProcessData, QueueFile, Connection, Status, |
|
|
|
# House keeping. Always. Test or not. |
|
|
|
house_keeper(Protocol._dir_info, QueueFile, Connection, BUFFER_SIZE) |
|
|
|
|
|
|
|
def CancelProtocol(): |
|
|
|
def CancelProtocol(with_device=None, Connection=None, ConnectionStatus=None): |
|
|
|
""" |
|
|
|
Cancels a running protocol with IMMEDIATE effect. The use of flags with |
|
|
|
multithreading cannot cancel a running protocol until the next iteration |
|
|
|
be it within a minute or an hour. `CancelProtocol' soft-restarts the |
|
|
|
light modulator and, therefore, protocols are cancelled immediately. |
|
|
|
""" |
|
|
|
# Stop hardware |
|
|
|
# Protocol._device._camera.close() |
|
|
|
# Protocol._device._heater.stop() |
|
|
|
# Protocol._device._servo.stop() |
|
|
|
# Protocol._device._light_panel.stop() |
|
|
|
# Restart it all... |
|
|
|
Box = with_device |
|
|
|
# Stop hardware. Fixes heating being left on. Note that Connection and |
|
|
|
# ConnectionStatus are set to `None', meaning no logs will be reported back |
|
|
|
# to the GUI. |
|
|
|
if Box is not None: |
|
|
|
Box.terminate_device(Connection, ConnectionStatus) |
|
|
|
# Restart server (workaround, as python won't recognise BASH functions). |
|
|
|
LiMO_Path = "/home/client/.srv/" |
|
|
|
Routine=".cancel_protocol.sh" |
|
|
|
subprocess.call(["bash", "-c", LiMO_Path + Routine]) |