Python: add/remove todos
This commit is contained in:
parent
06d9facb3d
commit
1530c71fb0
|
@ -3,6 +3,6 @@
|
||||||
"focus_steps_per_mm" : 40,
|
"focus_steps_per_mm" : 40,
|
||||||
"pump_steps_per_ml" : 507,
|
"pump_steps_per_ml" : 507,
|
||||||
"focus_max_speed" : 0.5,
|
"focus_max_speed" : 0.5,
|
||||||
"pump_max_speed" : 30,
|
"pump_max_speed" : 30,
|
||||||
"stepper_type" : "adafruit"
|
"stepper_type" : "adafruit"
|
||||||
}
|
}
|
|
@ -99,6 +99,7 @@ class StreamingHandler(http.server.BaseHTTPRequestHandler):
|
||||||
output.condition.wait()
|
output.condition.wait()
|
||||||
frame = output.frame
|
frame = output.frame
|
||||||
self.wfile.write(b"--FRAME\r\n")
|
self.wfile.write(b"--FRAME\r\n")
|
||||||
|
# TODO exception BrokenPipeError here
|
||||||
self.send_header("Content-Type", "image/jpeg")
|
self.send_header("Content-Type", "image/jpeg")
|
||||||
self.send_header("Content-Length", len(frame))
|
self.send_header("Content-Length", len(frame))
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
@ -158,10 +159,6 @@ class ImagerProcess(multiprocessing.Process):
|
||||||
self.__export_path = ""
|
self.__export_path = ""
|
||||||
self.__global_metadata = None
|
self.__global_metadata = None
|
||||||
|
|
||||||
# TODO implement a way to receive directly the metadata from Node-Red via MQTT
|
|
||||||
# FIXME We should save the metadata to a file in the folder too
|
|
||||||
# TODO create a directory structure per day/per imaging session
|
|
||||||
|
|
||||||
logger.success("planktoscope.imager is initialised and ready to go!")
|
logger.success("planktoscope.imager is initialised and ready to go!")
|
||||||
|
|
||||||
@logger.catch
|
@logger.catch
|
||||||
|
|
|
@ -87,6 +87,8 @@ class MQTT_Client:
|
||||||
@logger.catch
|
@logger.catch
|
||||||
def connect(self):
|
def connect(self):
|
||||||
logger.info(f"trying to connect to {self.server}:{self.port}")
|
logger.info(f"trying to connect to {self.server}:{self.port}")
|
||||||
|
# TODO add try: except ConnectionRefusedError: block here
|
||||||
|
# This is a symptom that Mosquitto may have failed to start
|
||||||
self.client.connect(self.server, self.port, 60)
|
self.client.connect(self.server, self.port, 60)
|
||||||
self.client.on_connect = self.on_connect
|
self.client.on_connect = self.on_connect
|
||||||
self.client.on_subscribe = self.on_subscribe
|
self.client.on_subscribe = self.on_subscribe
|
||||||
|
@ -122,6 +124,7 @@ class MQTT_Client:
|
||||||
# Run this function in order to subscribe to all the topics begining by actuator
|
# Run this function in order to subscribe to all the topics begining by actuator
|
||||||
def on_subscribe(self, client, obj, mid, granted_qos):
|
def on_subscribe(self, client, obj, mid, granted_qos):
|
||||||
# Print when subscribed
|
# Print when subscribed
|
||||||
|
# TODO Fix bug when this is called outside of this init function (for example when the imager subscribe to status/pump)
|
||||||
logger.success(
|
logger.success(
|
||||||
f"{self.name} subscribed to {self.topic}! - mid:{str(mid)} qos:{str(granted_qos)}"
|
f"{self.name} subscribed to {self.topic}! - mid:{str(mid)} qos:{str(granted_qos)}"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue