imager bug if object_date is not set

This commit is contained in:
Romain Bazile 2020-12-03 16:45:01 +01:00
parent d9aab5fc0b
commit b3d417e3b9
2 changed files with 39 additions and 0 deletions

View file

@ -7918,5 +7918,30 @@
[],
[]
]
},
{
"id": "2dc762df.08cd7e",
"type": "inject",
"z": "baa1e3d9.cb29d",
"name": "Default: 0.01",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "0.05",
"payloadType": "num",
"x": 310,
"y": 320,
"wires": [
[
"df1ea904.cd261"
]
]
}
]

View file

@ -581,6 +581,20 @@ class ImagerProcess(multiprocessing.Process):
# Concat the local metadata and the metadata from Node-RED
self.__global_metadata = {**self.__global_metadata, **local_metadata}
if "object_date" not in self.__global_metadata:
# If this path exists, then ids are reused when they should not
logger.error(f"The metadata did not contain object_date!")
self.imager_client.client.publish(
"status/imager",
'{"status":"Configuration update error: object_date is missing!"}',
)
# Reset the counter to 0
self.__img_done = 0
# Change state towards stop
self.__imager.change(planktoscope.imager_state_machine.Stop)
planktoscope.light.error()
return
logger.info("Setting up the directory structure for storing the pictures")
self.__export_path = os.path.join(
self.__base_path,