From 0bdb95b60714192432b2f076f26e5181f999e8d2 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Thu, 17 Dec 2020 17:33:42 +0100 Subject: [PATCH] light: fix typo imager: format metadata.json --- scripts/planktoscope/imager.py | 4 +++- scripts/planktoscope/light.py | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/planktoscope/imager.py b/scripts/planktoscope/imager.py index 85d53b0..d817b91 100644 --- a/scripts/planktoscope/imager.py +++ b/scripts/planktoscope/imager.py @@ -606,7 +606,7 @@ class ImagerProcess(multiprocessing.Process): logger.info("Exporting the metadata to a metadata.json") metadata_filepath = os.path.join(self.__export_path, "metadata.json") with open(metadata_filepath, "w") as metadata_file: - json.dump(self.__global_metadata, metadata_file) + json.dump(self.__global_metadata, metadata_file, indent="4") logger.debug( f"Metadata dumped in {metadata_file} are {self.__global_metadata}" ) @@ -654,6 +654,8 @@ class ImagerProcess(multiprocessing.Process): logger.debug(f"Copying the image from the temp file to {filename_path}") shutil.copy("/dev/shm/mjpeg/image.jpg", filename_path) + # TODO Try to stop the camera streaming and display instead each captured image + # os.rename("/dev/shm/mjpeg/image.jpg", "/dev/shm/mjpeg/cam.jpg") logger.debug("Syncing the disk") os.sync() diff --git a/scripts/planktoscope/light.py b/scripts/planktoscope/light.py index 87566d8..3e156b2 100644 --- a/scripts/planktoscope/light.py +++ b/scripts/planktoscope/light.py @@ -144,8 +144,6 @@ def error(): def interrupted(): with smbus.SMBus(1) as bus: - setRGBOff() - time.sleep(1) setRGBColor(bus, EffectColor.Yellow) setRGBSpeed(bus, 3) setRGBEffect(bus, Effect.Water)