Browse Source

Code clean, and added software update option.

master
Carlos Reding 1 year ago
parent
commit
09ea85e5b8
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      limoControl/_controller.py

+ 7
- 3
limoControl/_controller.py View File

@@ -1,6 +1,7 @@
import threading, sys, queue
from .puppeteer import Controller, HardwareTest, TemperatureTest,\
ProtocolTest, ExportData, QueueStatus, CancelProtocol
ProtocolTest, ExportData, QueueStatus, CancelProtocol,\
UpdateSoftWare
from .pupuicon import InitNetwork, NetworkOperator

# Hack
@@ -87,8 +88,7 @@ def main():
# like HEATER can be left ON.
print("Cancel Protocol.")
if 'LiMO' in locals():
Box._stop() # Force-stop thread.
Box.join()
# Server will be force to restart, no need to turn off heating here...
CancelProtocol(with_device=LiMO)
else:
# Restart light modulator without anything running.
@@ -104,6 +104,10 @@ def main():
ExportData(Protocol, False, QueueFile,
Box_Socket.Connection, gui_status)
protocol_status.clear()
elif GUI.command == "Update Firmware":
UpdateSoftware(Box_Socket.Connection, BUFFER_SIZE=64)
# Restart light modulator to apply changes
CancelProtocol()
else:
# GUI _always_ expects something coming back.
# By returning a message, the interface won't stall.

Loading…
Cancel
Save