diff --git a/README.md b/README.md index 2731a86..327bb86 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # PlanktoScop Main Repository The PlanktoScop is an open and affordable modular imaging platform for citizen oceanography. -It's a high-throughtput microscope platform, designed with an open-hardware and open-software mentality. +This GitHub is part of a community that you can find on [its website](https://www.planktonscope.org/). -You can learn more about the PlantoScop [on its website](https://www.planktonscope.org/discover). +# Fast Setup +Before going further, notice that you can download the image disk already setup without having to deal with all these command lines. +Jump here : http://planktonscope.su.domains/Images_raspberry/Raspbian_Buster_Morphocut_WiFi.img -# PlanktoScop Raspberry Pi Setup -After getting your kit and finding the necessary components, but before assembling your kit, you should take the time to do a mockup build and setup your Raspberry! +# Expert Setup +After getting your kit and finding the necessary components, but before assembling your kit, you should take the time to do a mockup build and setup your Raspberry. ## Install and setup Raspbian on your Raspberry Pi @@ -197,13 +199,13 @@ https://www.pyimagesearch.com/2019/09/16/install-opencv-4-on-raspberry-pi-4-and- ### Install MorphoCut - -_Installing MorphoCut `_ +[Installing MorphoCut](https://morphocut.readthedocs.io/en/stable/installation.html) MorphoCut is packaged on PyPI and can be installed with pip: -``` + +```sh sudo apt-get install python3-scipy -pip3 install -U git+https://github.com/morphocut/morphocut.git@pyrocystis +pip3 install -U git+https://github.com/morphocut/morphocut.git ``` ## Finishing the install diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 2f7efbe..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-minimal \ No newline at end of file diff --git a/config.txt b/config.json similarity index 100% rename from config.txt rename to config.json diff --git a/flows/flow_mqtt.json b/flows/flow_mqtt.json deleted file mode 100644 index 3619162..0000000 --- a/flows/flow_mqtt.json +++ /dev/null @@ -1,3502 +0,0 @@ -[ - { - "id": "259c8713.b50e28", - "type": "tab", - "label": "Main", - "disabled": false, - "info": "" - }, - { - "id": "6d0d6fc7.d30bb", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 3, - "width": 12, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_ship", - "x": 1370, - "y": 140, - "wires": [ - [ - "de9708c2.d00068" - ] - ] - }, - { - "id": "43b12fe4.c5aa3", - "type": "ui_dropdown", - "z": "259c8713.b50e28", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "3e1ba03d.f01d8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "Plankton net", - "value": "net", - "type": "str" - }, - { - "label": "Niskin bottle 12L", - "value": "niskin_12L", - "type": "str" - }, - { - "label": "Niskin bottle 24L", - "value": "niskin_24L", - "type": "str" - }, - { - "label": "Pass Hull", - "value": "pass_hull", - "type": "str" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 1330, - "y": 220, - "wires": [ - [ - "3c6a723.145778e" - ] - ] - }, - { - "id": "458408d7.2b3b68", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 4, - "width": 12, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 1350, - "y": 180, - "wires": [ - [ - "a2ae6c99.188f2" - ] - ] - }, - { - "id": "a163194f.0b17c8", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 1, - "width": 12, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_project", - "x": 1360, - "y": 60, - "wires": [ - [ - "1c2c7439.47115c" - ] - ] - }, - { - "id": "914752eb.af1b", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "sample_id", - "label": "ID of the station*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 2, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "sample_id", - "x": 1370, - "y": 100, - "wires": [ - [ - "30648de6.8ebc52" - ] - ] - }, - { - "id": "8a735175.23927", - "type": "ui_date_picker", - "z": "259c8713.b50e28", - "name": "acq_date", - "label": "Date :", - "group": "52159161.72187", - "order": 2, - "width": 12, - "height": 1, - "passthru": true, - "topic": "", - "x": 1380, - "y": 1141, - "wires": [ - [ - "86aa9817.45a2e8" - ] - ] - }, - { - "id": "16d7de1c.b0c892", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "acq_time", - "label": "Time :", - "tooltip": "", - "group": "52159161.72187", - "order": 3, - "width": 12, - "height": 1, - "passthru": true, - "mode": "time", - "delay": 300, - "topic": "", - "x": 1380, - "y": 1181, - "wires": [ - [ - "9b1b260f.e4b338" - ] - ] - }, - { - "id": "9b1b260f.e4b338", - "type": "function", - "z": "259c8713.b50e28", - "name": "set object_time", - "func": "var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute+\"00\";\nglobal.set('object_time',time_UTC);\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1544, - "y": 1181, - "wires": [ - [ - "829cc940.327648" - ] - ] - }, - { - "id": "86aa9817.45a2e8", - "type": "function", - "z": "259c8713.b50e28", - "name": "set object_date", - "func": "var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1544, - "y": 1141, - "wires": [ - [ - "c93577b9.a1e438" - ] - ] - }, - { - "id": "e001a28.555566", - "type": "function", - "z": "259c8713.b50e28", - "name": "get global", - "func": "msg.payload={\n \n \"generic_nb_step\":global.get(\"generic_nb_step\"),\n \"generic_flowrate\":global.get(\"generic_flowrate\"),\n \"generic_manual_volume\":global.get(\"generic_manual_volume\"),\n \"generic_sleep_before\":global.get(\"generic_sleep_before\"),\n \"generic_volume_before\":global.get(\"generic_volume_before\"),\n \"generic_path\":global.get(\"generic_path\"),\n \"generic_nb_frame\":global.get(\"generic_nb_frame\"),\n \"generic_sleep_during\":global.get(\"generic_sleep_during\"),\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1880, - "y": 60, - "wires": [ - [ - "76a6e6bb.a08b98" - ] - ] - }, - { - "id": "f25890f5.f2549", - "type": "file", - "z": "259c8713.b50e28", - "name": "", - "filename": "/home/pi/PlanktonScope/config.txt", - "appendNewline": true, - "createDir": true, - "overwriteFile": "true", - "encoding": "none", - "x": 2233, - "y": 60, - "wires": [ - [] - ] - }, - { - "id": "f5c1aa13.3cfbf8", - "type": "function", - "z": "259c8713.b50e28", - "name": "set optical config", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1550, - "y": 1041, - "wires": [ - [ - "72e1e23b.a8a67c" - ] - ] - }, - { - "id": "eb9181d8.25e01", - "type": "ui_dropdown", - "z": "259c8713.b50e28", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "52159161.72187", - "order": 7, - "width": 12, - "height": 1, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 1326, - "y": 1041, - "wires": [ - [ - "f5c1aa13.3cfbf8" - ] - ] - }, - { - "id": "5aba848a.7a861c", - "type": "ui_numeric", - "z": "259c8713.b50e28", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 8, - "width": 12, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 1336, - "y": 841, - "wires": [ - [ - "510bd72a.b42ea8" - ] - ] - }, - { - "id": "7cea16e.c42ace8", - "type": "ui_numeric", - "z": "259c8713.b50e28", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 9, - "width": 12, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 1336, - "y": 881, - "wires": [ - [ - "a3f18257.8a55e" - ] - ] - }, - { - "id": "6ecc9468.0271dc", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "52159161.72187", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_id", - "x": 1386, - "y": 721, - "wires": [ - [ - "b26183bf.aa217" - ] - ] - }, - { - "id": "259fd49a.160a3c", - "type": "ui_dropdown", - "z": "259c8713.b50e28", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "52159161.72187", - "order": 6, - "width": 12, - "height": 1, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 1366, - "y": 801, - "wires": [ - [ - "d96d32ec.f88b9" - ] - ] - }, - { - "id": "66a3425c.79aabc", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "acq_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "52159161.72187", - "order": 5, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_volume", - "x": 1366, - "y": 921, - "wires": [ - [ - "a3ec68a2.889ca8" - ] - ] - }, - { - "id": "6722bc48.d4f354", - "type": "comment", - "z": "259c8713.b50e28", - "name": "sample", - "info": "SAMPLE: a collection event\n\n sample_id [t] : unique identifier\n sample_*** [f] or [t] : other fields relative to the sample\n", - "x": 810, - "y": 60, - "wires": [] - }, - { - "id": "f93037f1.6a6238", - "type": "comment", - "z": "259c8713.b50e28", - "name": "acquisition", - "info": "ACQUISITION: metadata relative to the image acquisition\n\n acq_id [t] : unique identifier. If your acquisition differ for each sample you must have different identifier.\n acq_instrument [t] : name of the instrument (UVP, ZOOSCAN, FLOWCAM, etc.)\n acq_*** [f] or [t] : other fields relative to the acquisition\n", - "x": 800, - "y": 720, - "wires": [] - }, - { - "id": "734ba3db.3f82fc", - "type": "comment", - "z": "259c8713.b50e28", - "name": "object", - "info": "OBJECT: one object to be classified, usually one organism. One object can be represented by several images. In this tsv file, there is one line per image which means the object data gets repeated on several lines.\n\n object_id [t] : unique object name (will be displayed in Ecotaxa object page)\n object_link [f] : URL of an associated website\n object_lat [f] : latitude, decimal degrees\n object_lon [f] : longitude, decimal degrees\n object_date [f] : ISO8601 YYYYMMJJ UTC\n object_time [f] : ISO8601 HHMMSS UTC\n object_depth_min [f] : minimum depth of object, meters\n object_depth_max [f] : maximum depth of object, meters\n\nAnd, for already classified objects\n\n object_annotation_date [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_time [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_category [t] : class of the object with optionnaly its direct parent following separated by left angle bracket without whitespace \"Cnidaria", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1210, - "y": 300, - "wires": [ - [] - ] - }, - { - "id": "b7d9455c.026588", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/focus", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1670, - "y": 400, - "wires": [ - [ - "fdb3b132.8b341" - ], - [ - "b9d996d6.37c2f8" - ] - ] - }, - { - "id": "b9d996d6.37c2f8", - "type": "ui_toast", - "z": "259c8713.b50e28", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1830, - "y": 420, - "wires": [ - [] - ] - }, - { - "id": "ca38a11d.0ee54", - "type": "function", - "z": "259c8713.b50e28", - "name": "init LED", - "func": "msg.payload=1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 240, - "y": 161, - "wires": [ - [ - "1d58e86f.a3a9e8" - ] - ] - }, - { - "id": "75701b99.c6e974", - "type": "exec", - "z": "259c8713.b50e28", - "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "RPi Temp.", - "x": 2190, - "y": 1080, - "wires": [ - [ - "aac61390.c13c6" - ], - [], - [] - ] - }, - { - "id": "1780384d.718198", - "type": "inject", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "10", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 2030, - "y": 1080, - "wires": [ - [ - "75701b99.c6e974" - ] - ] - }, - { - "id": "aac61390.c13c6", - "type": "python3-function", - "z": "259c8713.b50e28", - "name": "fan.py", - "func": "#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)", - "outputs": 1, - "x": 2370, - "y": 1060, - "wires": [ - [] - ] - }, - { - "id": "603d5fab.08f56", - "type": "comment", - "z": "259c8713.b50e28", - "name": "save config.txt", - "info": "", - "x": 1690, - "y": 20, - "wires": [] - }, - { - "id": "72e1e23b.a8a67c", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04", - "d473399b.081ae8" - ], - "x": 1675, - "y": 1040, - "wires": [] - }, - { - "id": "d473399b.081ae8", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "72e1e23b.a8a67c", - "c93577b9.a1e438", - "829cc940.327648" - ], - "x": 1635, - "y": 100, - "wires": [ - [ - "e001a28.555566" - ] - ] - }, - { - "id": "c93577b9.a1e438", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04", - "d473399b.081ae8" - ], - "x": 1675, - "y": 1140, - "wires": [] - }, - { - "id": "829cc940.327648", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04", - "d473399b.081ae8" - ], - "x": 1675, - "y": 1180, - "wires": [] - }, - { - "id": "98e2e9e0.fb7418", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/pump", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1670, - "y": 600, - "wires": [ - [ - "61fb057d.3c251c" - ], - [ - "46a536f0.c83138" - ] - ] - }, - { - "id": "46a536f0.c83138", - "type": "ui_toast", - "z": "259c8713.b50e28", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1830, - "y": 620, - "wires": [ - [] - ] - }, - { - "id": "24ffcf03.2a51b", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "stop pump", - "group": "707d9797.c8e798", - "order": 5, - "width": 4, - "height": 1, - "passthru": true, - "label": "STOP PUMP", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 1370, - "y": 660, - "wires": [ - [ - "e2a7220a.09d43" - ] - ] - }, - { - "id": "7eb16c3b.294e54", - "type": "comment", - "z": "259c8713.b50e28", - "name": "turn ON the LED", - "info": "", - "x": 260, - "y": 121, - "wires": [] - }, - { - "id": "4f74f017.00a58", - "type": "function", - "z": "259c8713.b50e28", - "name": "focus.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1520, - "y": 400, - "wires": [ - [ - "b7d9455c.026588" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "52cc1de5.b78e84", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "stop focus", - "group": "fbd92986.1028c8", - "order": 5, - "width": 4, - "height": 1, - "passthru": true, - "label": "STOP FOCUS", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 1370, - "y": 460, - "wires": [ - [ - "e46763fe.7fc83" - ] - ] - }, - { - "id": "39cad6fb.1503ca", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "", - "group": "8cfadfab.327d7", - "order": 9, - "width": 11, - "height": 1, - "passthru": false, - "label": "Reboot", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "reboot", - "x": 2060, - "y": 960, - "wires": [ - [ - "95b876d4.07c708", - "99d61fbe.b244b" - ] - ] - }, - { - "id": "1f53f29b.feee4d", - "type": "exec", - "z": "259c8713.b50e28", - "command": "sudo", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "2", - "oldrc": false, - "name": "cmd", - "x": 2370, - "y": 960, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "e325458b.95bff8", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "", - "group": "8cfadfab.327d7", - "order": 10, - "width": 13, - "height": 1, - "passthru": false, - "label": "Shutdown", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "shutdown", - "x": 2060, - "y": 1020, - "wires": [ - [ - "95b876d4.07c708", - "99d61fbe.b244b" - ] - ] - }, - { - "id": "95b876d4.07c708", - "type": "python3-function", - "z": "259c8713.b50e28", - "name": "action", - "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", - "outputs": 1, - "x": 2230, - "y": 980, - "wires": [ - [ - "d348474b.d756a8", - "1f53f29b.feee4d" - ] - ] - }, - { - "id": "d348474b.d756a8", - "type": "exec", - "z": "259c8713.b50e28", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 2390, - "y": 1020, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "99d61fbe.b244b", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "3517d063.27073" - ], - "x": 2175, - "y": 920, - "wires": [] - }, - { - "id": "cdd1b550.da18e8", - "type": "mqtt in", - "z": "259c8713.b50e28", - "name": "", - "topic": "receiver/#", - "qos": "0", - "datatype": "auto", - "broker": "b77ffa1b.942258", - "x": 2340, - "y": 720, - "wires": [ - [ - "6920281d.dc9b48" - ] - ] - }, - { - "id": "6920281d.dc9b48", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "receiver/pump", - "vt": "str" - }, - { - "t": "eq", - "v": "receiver/focus", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 2490, - "y": 720, - "wires": [ - [ - "2f66e917.fee586" - ], - [ - "363ee47e.ed522c" - ] - ] - }, - { - "id": "2f66e917.fee586", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Done", - "vt": "str" - }, - { - "t": "eq", - "v": "Interrompted", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 3, - "x": 2650, - "y": 640, - "wires": [ - [ - "5c0d0c35.3bcf14" - ], - [ - "cd01157d.0892d8" - ], - [ - "68e02bf4.7013e4" - ] - ] - }, - { - "id": "5c0d0c35.3bcf14", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has started", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 600, - "wires": [ - [ - "61cf0388.fb10cc" - ] - ] - }, - { - "id": "cd01157d.0892d8", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has finished.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 640, - "wires": [ - [ - "61cf0388.fb10cc" - ] - ] - }, - { - "id": "68e02bf4.7013e4", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has been stopped.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 680, - "wires": [ - [ - "61cf0388.fb10cc" - ] - ] - }, - { - "id": "61cf0388.fb10cc", - "type": "debug", - "z": "259c8713.b50e28", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "payload", - "targetType": "msg", - "x": 3030, - "y": 640, - "wires": [] - }, - { - "id": "363ee47e.ed522c", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Done", - "vt": "str" - }, - { - "t": "eq", - "v": "Interrompted", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 3, - "x": 2650, - "y": 780, - "wires": [ - [ - "c088b72f.326d98" - ], - [ - "36934381.14442c" - ], - [ - "89329cfe.c8f4" - ] - ] - }, - { - "id": "c088b72f.326d98", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has started", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 740, - "wires": [ - [ - "d11ec8dd.ad71d8" - ] - ] - }, - { - "id": "36934381.14442c", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has finished.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 780, - "wires": [ - [ - "d11ec8dd.ad71d8" - ] - ] - }, - { - "id": "89329cfe.c8f4", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has been stopped.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 820, - "wires": [ - [ - "d11ec8dd.ad71d8" - ] - ] - }, - { - "id": "d11ec8dd.ad71d8", - "type": "debug", - "z": "259c8713.b50e28", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "payload", - "targetType": "msg", - "x": 3030, - "y": 780, - "wires": [] - }, - { - "id": "fdb3b132.8b341", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1810, - "y": 380, - "wires": [] - }, - { - "id": "e46763fe.7fc83", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1510, - "y": 460, - "wires": [] - }, - { - "id": "61fb057d.3c251c", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1810, - "y": 580, - "wires": [] - }, - { - "id": "e2a7220a.09d43", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1510, - "y": 660, - "wires": [] - }, - { - "id": "577f7f72.6b68b", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "", - "group": "8cfadfab.327d7", - "order": 7, - "width": 0, - "height": 0, - "passthru": false, - "label": "Start Acquisition", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "actuator/image", - "x": 1360, - "y": 1560, - "wires": [ - [ - "5218ba30.bbe844" - ] - ] - }, - { - "id": "d5111b87.2a64a8", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_sleep_before", - "label": "Sleep duration before acquisition (s)", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 1, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "generic_sleep_before", - "x": 1340, - "y": 1360, - "wires": [ - [ - "3d141631.d548ba" - ] - ] - }, - { - "id": "3d141631.d548ba", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1360, - "wires": [] - }, - { - "id": "74c89905.79d968", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_sleep_during", - "label": "Sleep duration between acquisition (s)", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 2, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "generic_sleep_during", - "x": 1340, - "y": 1520, - "wires": [ - [ - "644e95b9.04b7ac" - ] - ] - }, - { - "id": "644e95b9.04b7ac", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1520, - "wires": [] - }, - { - "id": "b50cf2f4.bfb84", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 501, - "wires": [] - }, - { - "id": "1e75fd6c.234753", - "type": "ui_slider", - "z": "259c8713.b50e28", - "name": "flowrate", - "label": "Flowrate (ml/min)*", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "outs": "end", - "topic": "flowrate", - "min": 0, - "max": "20", - "step": "0.1", - "x": 1380, - "y": 501, - "wires": [ - [ - "b50cf2f4.bfb84" - ] - ] - }, - { - "id": "3345fc41.8341b4", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic.flowrate", - "func": "msg.payload = msg.payload.generic_flowrate;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1030, - "y": 501, - "wires": [ - [ - "1e75fd6c.234753" - ] - ] - }, - { - "id": "32510458.f42f9c", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 501, - "wires": [ - [ - "3345fc41.8341b4" - ] - ] - }, - { - "id": "3cd0a17b.0cc42e", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1440, - "wires": [] - }, - { - "id": "62fea790.2840a8", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_path", - "label": "DIrectory to store the images", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 3, - "width": 12, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "generic_path", - "x": 1370, - "y": 1440, - "wires": [ - [ - "3cd0a17b.0cc42e" - ] - ] - }, - { - "id": "73e051a8.5875e", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_volume_before", - "label": "Volume to pass before to begin", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 5, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "generic_volume_before", - "x": 1330, - "y": 1400, - "wires": [ - [ - "5ea01613.8cc9d8" - ] - ] - }, - { - "id": "5ea01613.8cc9d8", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1400, - "wires": [] - }, - { - "id": "26549e4b.5dbf72", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_nb_frame", - "label": "Number of frame per acquisition", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 4, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "generic_nb_frame", - "x": 1350, - "y": 1480, - "wires": [ - [ - "61382d0b.60c534" - ] - ] - }, - { - "id": "61382d0b.60c534", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1480, - "wires": [] - }, - { - "id": "d5df5489.6523e8", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_sleep_before", - "func": "msg.payload = msg.payload.generic_sleep_before;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1050, - "y": 1360, - "wires": [ - [ - "d5111b87.2a64a8" - ] - ] - }, - { - "id": "835c262e.00b468", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1360, - "wires": [ - [ - "d5df5489.6523e8" - ] - ] - }, - { - "id": "9b2fe59b.be48c8", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_volume_before", - "func": "msg.payload = msg.payload.generic_volume_before;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1060, - "y": 1400, - "wires": [ - [ - "73e051a8.5875e" - ] - ] - }, - { - "id": "a07dad70.7c48", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1400, - "wires": [ - [ - "9b2fe59b.be48c8" - ] - ] - }, - { - "id": "54dfe4df.c6837c", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_path", - "func": "msg.payload = msg.payload.generic_path;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1030, - "y": 1440, - "wires": [ - [ - "62fea790.2840a8" - ] - ] - }, - { - "id": "9fb166d6.86f908", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1440, - "wires": [ - [ - "54dfe4df.c6837c" - ] - ] - }, - { - "id": "1aa409a4.7b3866", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_nb_frame", - "func": "msg.payload = msg.payload.generic_nb_frame;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1040, - "y": 1480, - "wires": [ - [ - "26549e4b.5dbf72" - ] - ] - }, - { - "id": "51e769aa.92a138", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1480, - "wires": [ - [ - "1aa409a4.7b3866" - ] - ] - }, - { - "id": "ce6ded0a.8ee37", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_sleep_during", - "func": "msg.payload = msg.payload.generic_sleep_during;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1050, - "y": 1520, - "wires": [ - [ - "74c89905.79d968" - ] - ] - }, - { - "id": "3fa20f41.11e61", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1520, - "wires": [ - [ - "ce6ded0a.8ee37" - ] - ] - }, - { - "id": "5218ba30.bbe844", - "type": "function", - "z": "259c8713.b50e28", - "name": "image.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar generic_sleep_before= global.get(\"generic_sleep_before\");\nvar generic_volume_before= global.get(\"generic_volume_before\");\nvar generic_path= global.get(\"generic_path\");\nvar generic_nb_frame= global.get(\"generic_nb_frame\");\nvar generic_sleep_during= global.get(\"generic_sleep_during\");\n\nif (generic_sleep_before === undefined || generic_sleep_before === \"\" || generic_sleep_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before start the acquisition\";\n \n}else if (generic_volume_before === undefined || generic_volume_before === \"\" || generic_volume_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume before acquisition\";\n \n}else if (generic_path === undefined || generic_path === \"\" || generic_path === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Directory to store the images\";\n \n}else if (generic_nb_frame === undefined || generic_nb_frame === \"\" || generic_nb_frame === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of frames per acquisition\";\n \n}else if (generic_sleep_during === undefined || generic_sleep_during === \"\" || generic_sleep_during === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration in between each acquisition\";\n \n}else {\n generic_nb_step = 507*generic_volume_before\n msg.payload=generic_sleep_before+' '+generic_nb_step+' '+generic_path+' '+generic_nb_frame+' '+generic_sleep_during;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1520, - "y": 1560, - "wires": [ - [ - "8142bee4.882c2" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "8142bee4.882c2", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/image", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1670, - "y": 1560, - "wires": [ - [ - "a4b8aae3.cc3ad8" - ], - [ - "54420752.4a4ab8" - ] - ] - }, - { - "id": "54420752.4a4ab8", - "type": "ui_toast", - "z": "259c8713.b50e28", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1830, - "y": 1580, - "wires": [ - [] - ] - }, - { - "id": "a4b8aae3.cc3ad8", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1810, - "y": 1540, - "wires": [] - }, - { - "id": "d7445228.4f765", - "type": "mqtt in", - "z": "259c8713.b50e28", - "name": "", - "topic": "receiver/#", - "qos": "0", - "datatype": "auto", - "broker": "b77ffa1b.942258", - "x": 2194.28564453125, - "y": 401.4285888671875, - "wires": [ - [ - "f1a6bef0.cfb" - ] - ] - }, - { - "id": "f1a6bef0.cfb", - "type": "debug", - "z": "259c8713.b50e28", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 2460, - "y": 400, - "wires": [] - }, - { - "id": "3e1ba03d.f01d8", - "type": "ui_group", - "z": "", - "name": "Sample Identification", - "tab": "737ec584.2eea2c", - "order": 1, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "52159161.72187", - "type": "ui_group", - "name": "Group 1", - "tab": "737ec584.2eea2c", - "order": 5, - "disp": true, - "width": 24 - }, - { - "id": "8cfadfab.327d7", - "type": "ui_group", - "z": "", - "name": "Commad", - "tab": "737ec584.2eea2c", - "order": 6, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "cef1e703.bcf3c8", - "type": "ui_group", - "z": "", - "name": "Spatio Temporal", - "tab": "737ec584.2eea2c", - "order": 4, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "fbd92986.1028c8", - "type": "ui_group", - "z": "", - "name": "Focus Adjustment", - "tab": "737ec584.2eea2c", - "order": 2, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "707d9797.c8e798", - "type": "ui_group", - "z": "", - "name": "Fluidic Manual Manipulation", - "tab": "737ec584.2eea2c", - "order": 3, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "b77ffa1b.942258", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "cb2f36fe.1c7038", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "737ec584.2eea2c", - "type": "ui_tab", - "z": "", - "name": "Sample", - "icon": "fa-eyedropper", - "order": 2, - "disabled": false, - "hidden": false - } -] diff --git a/flows/flow_villefranche.json b/flows/flow_villefranche.json deleted file mode 100644 index 55de97d..0000000 --- a/flows/flow_villefranche.json +++ /dev/null @@ -1,4807 +0,0 @@ -[ - { - "id": "eaae323a.31b3", - "type": "tab", - "label": "Home", - "disabled": false, - "info": "" - }, - { - "id": "b771c342.49603", - "type": "tab", - "label": "Sample", - "disabled": false, - "info": "" - }, - { - "id": "bccd1f23.87219", - "type": "tab", - "label": "Optic Configuration", - "disabled": false, - "info": "" - }, - { - "id": "baa1e3d9.cb29d", - "type": "tab", - "label": "Fluidic Acquisition", - "disabled": false, - "info": "" - }, - { - "id": "cb95299c.2817c8", - "type": "tab", - "label": "Segmentation", - "disabled": false, - "info": "" - }, - { - "id": "c1660bc.e7ff7f8", - "type": "tab", - "label": "Gallery", - "disabled": false, - "info": "" - }, - { - "id": "1371dec5.76e671", - "type": "tab", - "label": "Settings", - "disabled": false, - "info": "" - }, - { - "id": "da2c279f.cbe318", - "type": "ui_group", - "z": "", - "name": "Controller", - "tab": null, - "order": 6, - "disp": true, - "width": 6, - "collapse": false - }, - { - "id": "833bc5bb.217ba8", - "type": "ui_group", - "z": "", - "name": "Preview", - "tab": "181bb236.1e94be", - "order": 1, - "disp": true, - "width": 14, - "collapse": false - }, - { - "id": "3a6bb13f.c9703e", - "type": "ui_tab", - "z": "", - "name": "Home", - "icon": "home", - "order": 1, - "disabled": false, - "hidden": false - }, - { - "id": "181bb236.1e94be", - "type": "ui_tab", - "z": "", - "name": "Optic Configuration", - "icon": "fa-eye", - "order": 3, - "disabled": false, - "hidden": false - }, - { - "id": "c9194f02.9d5e9", - "type": "ui_tab", - "z": "", - "name": "Fluidic Acquisition", - "icon": "fa-flask", - "order": 4, - "disabled": false, - "hidden": false - }, - { - "id": "8d16beb8.9b3fb", - "type": "ui_tab", - "z": "", - "name": "Segmentation", - "icon": "fa-crop", - "order": 5, - "disabled": false, - "hidden": false - }, - { - "id": "d9cd733b.ab73d", - "type": "ui_tab", - "z": "", - "name": "Settings", - "icon": "fa-cogs", - "order": 7, - "disabled": false, - "hidden": false - }, - { - "id": "4248342d.e55fac", - "type": "ui_group", - "z": "", - "name": "Optic Characterization", - "tab": "181bb236.1e94be", - "order": 2, - "disp": true, - "width": 10, - "collapse": false - }, - { - "id": "858a0e3c.987fe", - "type": "ui_group", - "z": "", - "name": "Preview", - "tab": "c9194f02.9d5e9", - "order": 1, - "disp": true, - "width": "14", - "collapse": false - }, - { - "id": "64903b47.4034e4", - "type": "ui_group", - "name": "Group 1", - "tab": "8d16beb8.9b3fb", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "3da7da8f.179606", - "type": "ui_group", - "z": "", - "name": "Processor", - "tab": "d9cd733b.ab73d", - "order": 1, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "cc8bc4eb.651868", - "type": "ui_base", - "theme": { - "name": "theme-dark", - "lightTheme": { - "default": "#0094CE", - "baseColor": "#5900ce", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": false, - "reset": false - }, - "darkTheme": { - "default": "#097479", - "baseColor": "#097479", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "customTheme": { - "name": "Untitled Theme 1", - "default": "#4B7930", - "baseColor": "#4B7930", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - }, - "themeState": { - "base-color": { - "default": "#097479", - "value": "#097479", - "edited": true - }, - "page-titlebar-backgroundColor": { - "value": "#097479", - "edited": false - }, - "page-backgroundColor": { - "value": "#111111", - "edited": false - }, - "page-sidebar-backgroundColor": { - "value": "#000000", - "edited": false - }, - "group-textColor": { - "value": "#0eb8c0", - "edited": false - }, - "group-borderColor": { - "value": "#555555", - "edited": false - }, - "group-backgroundColor": { - "value": "#333333", - "edited": false - }, - "widget-textColor": { - "value": "#eeeeee", - "edited": false - }, - "widget-backgroundColor": { - "value": "#097479", - "edited": false - }, - "widget-borderColor": { - "value": "#333333", - "edited": false - }, - "base-font": { - "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - } - }, - "angularTheme": { - "primary": "indigo", - "accents": "blue", - "warn": "red", - "background": "grey" - } - }, - "site": { - "name": "Node-RED Dashboard", - "hideToolbar": "false", - "allowSwipe": "false", - "lockMenu": "true", - "allowTempTheme": "true", - "dateFormat": "DD/MM/YYYY", - "sizes": { - "sx": 56, - "sy": 56, - "gx": 5, - "gy": 5, - "cx": 5, - "cy": 5, - "px": 5, - "py": 5 - } - } - }, - { - "id": "36739a35.7cce36", - "type": "ui_tab", - "z": "", - "name": "Gallery", - "icon": "fa fa-file-image-o", - "order": 6, - "disabled": false, - "hidden": false - }, - { - "id": "c0ebfc57.42527", - "type": "ui_group", - "name": "Group 1", - "tab": "36739a35.7cce36", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "737ec584.2eea2c", - "type": "ui_tab", - "z": "", - "name": "Sample", - "icon": "fa-eyedropper", - "order": 2, - "disabled": false, - "hidden": false - }, - { - "id": "6f97e7ae.270c48", - "type": "ui_group", - "z": "", - "name": "Group 1", - "tab": "3a6bb13f.c9703e", - "order": 1, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "3e1ba03d.f01d8", - "type": "ui_group", - "z": "", - "name": "Sample Identification", - "tab": "737ec584.2eea2c", - "order": 1, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "4e0cd5ea.17e59c", - "type": "ui_group", - "z": "", - "name": "Group 2", - "tab": "3a6bb13f.c9703e", - "order": 2, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "ef590206.24f6", - "type": "ui_group", - "z": "", - "name": "Group 3", - "tab": "3a6bb13f.c9703e", - "order": 3, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "ae8f6620.073358", - "type": "ui_group", - "z": "", - "name": "Group 4", - "tab": "3a6bb13f.c9703e", - "order": 4, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "196518b2.4d53b7", - "type": "ui_group", - "z": "", - "name": "Group 5", - "tab": "3a6bb13f.c9703e", - "order": 5, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "777a7c33.fcd804", - "type": "ui_group", - "z": "", - "name": "Group 6", - "tab": "3a6bb13f.c9703e", - "order": 6, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "cef1e703.bcf3c8", - "type": "ui_group", - "z": "", - "name": "Spatio Temporal", - "tab": "737ec584.2eea2c", - "order": 2, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "5517c651.b2f668", - "type": "ui_group", - "z": "", - "name": "Validation", - "tab": "737ec584.2eea2c", - "order": 3, - "disp": false, - "width": 24, - "collapse": false - }, - { - "id": "fbd92986.1028c8", - "type": "ui_group", - "z": "", - "name": "Focus Adjustment", - "tab": "181bb236.1e94be", - "order": 3, - "disp": true, - "width": 10, - "collapse": false - }, - { - "id": "707d9797.c8e798", - "type": "ui_group", - "z": "", - "name": "Fluidic Manual Manipulation", - "tab": "181bb236.1e94be", - "order": 4, - "disp": true, - "width": 14, - "collapse": false - }, - { - "id": "7a0b4877.a5d268", - "type": "ui_group", - "z": "", - "name": "Validation", - "tab": "181bb236.1e94be", - "order": 5, - "disp": false, - "width": "10", - "collapse": false - }, - { - "id": "567a49a4.244cb8", - "type": "ui_group", - "z": "", - "name": "Generic Information", - "tab": "c9194f02.9d5e9", - "order": 4, - "disp": true, - "width": 10, - "collapse": false - }, - { - "id": "404c301a.19c4e", - "type": "ui_group", - "z": "", - "name": "Fraction size", - "tab": "c9194f02.9d5e9", - "order": 3, - "disp": true, - "width": "10", - "collapse": false - }, - { - "id": "4322c187.e73e5", - "type": "ui_group", - "z": "", - "name": "Acquisition", - "tab": "c9194f02.9d5e9", - "order": 4, - "disp": true, - "width": 10, - "collapse": false - }, - { - "id": "b7919ae2.c01788", - "type": "ui_group", - "z": "", - "name": "Validation", - "tab": "c9194f02.9d5e9", - "order": 5, - "disp": false, - "width": 14, - "collapse": false - }, - { - "id": "b5d61bc7.54fe48", - "type": "ui_group", - "z": "", - "name": "Group 6", - "tab": "c9194f02.9d5e9", - "order": 6, - "disp": false, - "width": 10, - "collapse": false - }, - { - "id": "1be83144.4fe4bf", - "type": "ui_group", - "z": "", - "name": "Group 2", - "tab": "d9cd733b.ab73d", - "order": 6, - "disp": false, - "width": 24, - "collapse": false - }, - { - "id": "3ca00bf9.e5cac4", - "type": "ui_group", - "z": "", - "name": "Group 3", - "tab": "d9cd733b.ab73d", - "order": 5, - "disp": false, - "width": "24", - "collapse": false - }, - { - "id": "b5ba3f26.2e722", - "type": "ui_group", - "z": "", - "name": "CPU Temperature", - "tab": "d9cd733b.ab73d", - "order": 2, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "806d69c8.67fc58", - "type": "ui_group", - "z": "", - "name": "Memory", - "tab": "d9cd733b.ab73d", - "order": 3, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "405183bc.d8991c", - "type": "ui_group", - "z": "", - "name": "Disk Usage", - "tab": "d9cd733b.ab73d", - "order": 4, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "4e78af2d.90be7", - "type": "ui_ui_control", - "z": "eaae323a.31b3", - "name": "", - "events": "change", - "x": 520, - "y": 60, - "wires": [ - [] - ] - }, - { - "id": "2a65c3ec.49a6bc", - "type": "function", - "z": "eaae323a.31b3", - "name": "swtich tab", - "func": "\nmsg.payload={\"tab\":msg.payload};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 360, - "y": 60, - "wires": [ - [ - "4e78af2d.90be7" - ] - ] - }, - { - "id": "9d6abe67.6bb3d", - "type": "ui_button", - "z": "cb95299c.2817c8", - "name": "", - "group": "64903b47.4034e4", - "order": 0, - "width": 0, - "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "home", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "7be6422d.73949c" - ] - ] - }, - { - "id": "f0fb77cf.8f1c28", - "type": "ui_ui_control", - "z": "cb95299c.2817c8", - "name": "", - "events": "change", - "x": 380, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "7be6422d.73949c", - "type": "function", - "z": "cb95299c.2817c8", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "f0fb77cf.8f1c28" - ] - ] - }, - { - "id": "a66e925b.4155c", - "type": "ui_button", - "z": "1371dec5.76e671", - "name": "", - "group": "3ca00bf9.e5cac4", - "order": 1, - "width": 4, - "height": 1, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "home", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "75975366.93d6cc" - ] - ] - }, - { - "id": "60fd157b.8a5aac", - "type": "ui_ui_control", - "z": "1371dec5.76e671", - "name": "", - "events": "change", - "x": 380, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "75975366.93d6cc", - "type": "function", - "z": "1371dec5.76e671", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "60fd157b.8a5aac" - ] - ] - }, - { - "id": "2c8c45ab.610c0a", - "type": "ui_gauge", - "z": "1371dec5.76e671", - "name": "", - "group": "b5ba3f26.2e722", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "CPU Temperature", - "label": "C", - "format": "{{value}}", - "min": "35", - "max": "55", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 510, - "y": 80, - "wires": [] - }, - { - "id": "ddcbbfa5.cd158", - "type": "exec", - "z": "1371dec5.76e671", - "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "RPi Temp.", - "x": 310, - "y": 100, - "wires": [ - [ - "bc503fa5.f46dd", - "2c8c45ab.610c0a", - "cef370c7.1f7a" - ], - [], - [] - ] - }, - { - "id": "704faf02.a00b8", - "type": "inject", - "z": "1371dec5.76e671", - "name": "", - "topic": "ouquoi", - "payload": "", - "payloadType": "date", - "repeat": "10", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 110, - "y": 100, - "wires": [ - [ - "ddcbbfa5.cd158", - "55749fd8.3aca5", - "c2b8d8b.0d90328" - ] - ] - }, - { - "id": "cef370c7.1f7a", - "type": "ui_chart", - "z": "1371dec5.76e671", - "name": "", - "group": "b5ba3f26.2e722", - "order": 2, - "width": 0, - "height": 0, - "label": "", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": "20", - "removeOlderPoints": "200", - "removeOlderUnit": "60", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": true, - "outputs": 1, - "x": 470, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "55749fd8.3aca5", - "type": "exec", - "z": "1371dec5.76e671", - "command": "top -d 0.5 -b -n2 | grep \"Cpu(s)\"|tail -n 1 | awk '{print $2 + $4}' | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "CPU Load", - "x": 270, - "y": 200, - "wires": [ - [ - "e046247c.c466e8", - "4b2b9a70.6a9af4" - ], - [], - [] - ] - }, - { - "id": "c2b8d8b.0d90328", - "type": "exec", - "z": "1371dec5.76e671", - "command": "free | grep Mem | awk '{print 100*($4+$6+$7)/$2}' | awk -F \".\" '{print $1}' | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "Free Memory", - "x": 280, - "y": 300, - "wires": [ - [ - "e84f6e08.5d147", - "c7c8d192.3df27" - ], - [], - [] - ] - }, - { - "id": "e046247c.c466e8", - "type": "ui_gauge", - "z": "1371dec5.76e671", - "name": "", - "group": "3da7da8f.179606", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "Processor", - "label": "CPU", - "format": "{{value}}", - "min": 0, - "max": "100", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 480, - "y": 180, - "wires": [] - }, - { - "id": "e84f6e08.5d147", - "type": "ui_gauge", - "z": "1371dec5.76e671", - "name": "", - "group": "806d69c8.67fc58", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "Memory", - "label": "RAM", - "format": "{{value}}", - "min": 0, - "max": "200", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 480, - "y": 280, - "wires": [] - }, - { - "id": "3910d662.fa1f7a", - "type": "exec", - "z": "1371dec5.76e671", - "command": "df -h | grep /dev/root | awk -F ' ' '{print $3}' | tr -d G | tr \"\\n$\" \"\\ \" | sed 's/,/./' | tr -d \" \" ", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "Disk Usage", - "x": 270, - "y": 400, - "wires": [ - [ - "45e1912a.36a23", - "84ac8611.1a6ac8" - ], - [], - [] - ] - }, - { - "id": "45e1912a.36a23", - "type": "ui_gauge", - "z": "1371dec5.76e671", - "name": "", - "group": "405183bc.d8991c", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "Disk", - "label": "Go", - "format": "{{value}}", - "min": 0, - "max": "256", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 470, - "y": 380, - "wires": [] - }, - { - "id": "4b2b9a70.6a9af4", - "type": "ui_chart", - "z": "1371dec5.76e671", - "name": "", - "group": "3da7da8f.179606", - "order": 2, - "width": 0, - "height": 0, - "label": "", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": "20", - "removeOlderPoints": "", - "removeOlderUnit": "60", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": true, - "outputs": 1, - "x": 470, - "y": 220, - "wires": [ - [] - ] - }, - { - "id": "c7c8d192.3df27", - "type": "ui_chart", - "z": "1371dec5.76e671", - "name": "", - "group": "806d69c8.67fc58", - "order": 2, - "width": 0, - "height": 0, - "label": "", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": "20", - "removeOlderPoints": "", - "removeOlderUnit": "60", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": true, - "outputs": 1, - "x": 470, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "84ac8611.1a6ac8", - "type": "ui_chart", - "z": "1371dec5.76e671", - "name": "", - "group": "405183bc.d8991c", - "order": 2, - "width": 0, - "height": 0, - "label": "", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": "4", - "removeOlderPoints": "", - "removeOlderUnit": "3600", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": true, - "outputs": 1, - "x": 470, - "y": 420, - "wires": [ - [] - ] - }, - { - "id": "1cd5b4c0.46af9b", - "type": "inject", - "z": "1371dec5.76e671", - "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "60", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 90, - "y": 280, - "wires": [ - [ - "3910d662.fa1f7a" - ] - ] - }, - { - "id": "96bbe41d.ee7928", - "type": "ui_switch", - "z": "1371dec5.76e671", - "name": "light_state", - "label": "Light", - "tooltip": "", - "group": "3ca00bf9.e5cac4", - "order": 2, - "width": 3, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "on", - "onvalueType": "str", - "onicon": "wb_incandescent", - "oncolor": "red", - "offvalue": "off", - "offvalueType": "str", - "officon": "", - "offcolor": "blue", - "x": 1050, - "y": 140, - "wires": [ - [ - "51145654.0ce2d8" - ] - ] - }, - { - "id": "8485d05.444903", - "type": "ui_switch", - "z": "1371dec5.76e671", - "name": "fan_state", - "label": "Fan", - "tooltip": "", - "group": "3ca00bf9.e5cac4", - "order": 3, - "width": 3, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "on", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "off", - "offvalueType": "str", - "officon": "", - "offcolor": "", - "x": 1040, - "y": 80, - "wires": [ - [ - "2549f778.4eb828" - ] - ] - }, - { - "id": "2549f778.4eb828", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "fan.py", - "func": "#!/usr/bin/python\nimport smbus\nimport sys\n\nstate = msg[\"payload\"]\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif state == \"off\":\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif state == \"on\":\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)", - "outputs": 1, - "x": 1190, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "a113b518.830008", - "type": "ui_button", - "z": "1371dec5.76e671", - "name": "", - "group": "3ca00bf9.e5cac4", - "order": 4, - "width": 7, - "height": 1, - "passthru": false, - "label": "Reboot", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "reboot", - "x": 720, - "y": 320, - "wires": [ - [ - "ee57d11c.ed1dd", - "d9234d01.e630d" - ] - ] - }, - { - "id": "d9a924bc.0ca078", - "type": "exec", - "z": "1371dec5.76e671", - "command": "sudo", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "2", - "oldrc": false, - "name": "cmd", - "x": 1030, - "y": 320, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "51145654.0ce2d8", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "light.py", - "func": "import RPi.GPIO as GPIO\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setwarnings(False)\nGPIO.setup(21,GPIO.OUT)\n\nstate = msg[\"payload\"]\n\n \nif state == \"on\":\n GPIO.output(21,GPIO.HIGH)\nif state == \"off\":\n GPIO.output(21,GPIO.LOW)", - "outputs": 1, - "x": 1200, - "y": 140, - "wires": [ - [] - ] - }, - { - "id": "552d8bbb.cc4ca4", - "type": "ui_button", - "z": "1371dec5.76e671", - "name": "", - "group": "3ca00bf9.e5cac4", - "order": 5, - "width": 7, - "height": 1, - "passthru": false, - "label": "Shutdown", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "shutdown", - "x": 720, - "y": 380, - "wires": [ - [ - "ee57d11c.ed1dd", - "d9234d01.e630d" - ] - ] - }, - { - "id": "3517d063.27073", - "type": "link in", - "z": "1371dec5.76e671", - "name": "", - "links": [ - "ec8da7a8.0eb558", - "d9234d01.e630d" - ], - "x": 895, - "y": 140, - "wires": [ - [ - "96bbe41d.ee7928", - "8485d05.444903" - ] - ] - }, - { - "id": "ee57d11c.ed1dd", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "action", - "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", - "outputs": 1, - "x": 870, - "y": 340, - "wires": [ - [ - "b7ab1ada.1f4158", - "d9a924bc.0ca078" - ] - ] - }, - { - "id": "b7ab1ada.1f4158", - "type": "exec", - "z": "1371dec5.76e671", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 1050, - "y": 380, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "d9234d01.e630d", - "type": "link out", - "z": "1371dec5.76e671", - "name": "", - "links": [ - "3517d063.27073" - ], - "x": 835, - "y": 280, - "wires": [] - }, - { - "id": "bc503fa5.f46dd", - "type": "switch", - "z": "1371dec5.76e671", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "gt", - "v": "45", - "vt": "num" - }, - { - "t": "lte", - "v": "38", - "vt": "num" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 670, - "y": 80, - "wires": [ - [ - "a25d6486.e1ce28" - ], - [ - "5d4f3e71.1bad4" - ] - ] - }, - { - "id": "5d4f3e71.1bad4", - "type": "change", - "z": "1371dec5.76e671", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "off", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 840, - "y": 100, - "wires": [ - [ - "8485d05.444903" - ] - ] - }, - { - "id": "a25d6486.e1ce28", - "type": "change", - "z": "1371dec5.76e671", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "on", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 840, - "y": 60, - "wires": [ - [ - "8485d05.444903" - ] - ] - }, - { - "id": "37507791.4d5508", - "type": "http request", - "z": "1371dec5.76e671", - "name": "toggle timelapse", - "method": "GET", - "ret": "txt", - "paytoqs": false, - "url": "http://127.0.0.1/html/cmd_pipe.php?cmd={{{payload}}}", - "tls": "", - "persist": false, - "proxy": "", - "authType": "", - "x": 240, - "y": 780, - "wires": [ - [] - ] - }, - { - "id": "b9ff73e.19bd49", - "type": "ui_switch", - "z": "1371dec5.76e671", - "d": true, - "name": "timelapse", - "label": "toggle acquisition", - "tooltip": "", - "group": "1be83144.4fe4bf", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "decouple": "false", - "topic": "toggle", - "style": "", - "onvalue": "tl 1", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "tl 0", - "offvalueType": "str", - "officon": "", - "offcolor": "", - "x": 80, - "y": 660, - "wires": [ - [ - "37507791.4d5508", - "df47f1bb.1b0bf" - ] - ] - }, - { - "id": "9a52e6b.cbbc118", - "type": "exec", - "z": "1371dec5.76e671", - "command": "ls -l /var/www/html/media | grep \"th\" | tail -1 | awk -F \" \" '{print $9}' | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "get thumbail name", - "x": 770, - "y": 720, - "wires": [ - [ - "ca6bfbdf.4a71e8" - ], - [], - [] - ] - }, - { - "id": "df47f1bb.1b0bf", - "type": "switch", - "z": "1371dec5.76e671", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "tl 0", - "vt": "str" - }, - { - "t": "eq", - "v": "tl 1", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 230, - "y": 660, - "wires": [ - [ - "1cf57a24.20b176" - ], - [ - "faa67658.8edf18", - "c4524676.63b608" - ] - ] - }, - { - "id": "faa67658.8edf18", - "type": "delay", - "z": "1371dec5.76e671", - "name": "", - "pauseType": "delay", - "timeout": "1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 420, - "y": 720, - "wires": [ - [ - "9a52e6b.cbbc118" - ] - ] - }, - { - "id": "ca6bfbdf.4a71e8", - "type": "ui_template", - "z": "1371dec5.76e671", - "d": true, - "group": "1be83144.4fe4bf", - "name": "", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n\n\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 980, - "y": 700, - "wires": [ - [] - ] - }, - { - "id": "3e73267.51682da", - "type": "exec", - "z": "1371dec5.76e671", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 750, - "y": 620, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "e8c9d8e.f1d5428", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "wait RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\n \nreturn msg;", - "outputs": 1, - "x": 560, - "y": 600, - "wires": [ - [ - "3e73267.51682da" - ] - ] - }, - { - "id": "1cf57a24.20b176", - "type": "function", - "z": "1371dec5.76e671", - "name": "set free", - "func": "global.set(\"state\",\"free\");\nreturn msg", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 600, - "wires": [ - [ - "e8c9d8e.f1d5428" - ] - ] - }, - { - "id": "e3b347e3.b19f98", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "actuate RGB", - "func": "import smbus\nbus = smbus.SMBus(1)\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nreturn msg;", - "outputs": 1, - "x": 570, - "y": 660, - "wires": [ - [ - "3e73267.51682da" - ] - ] - }, - { - "id": "c4524676.63b608", - "type": "function", - "z": "1371dec5.76e671", - "name": "set busy", - "func": "global.set(\"state\",\"busy\");\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 660, - "wires": [ - [ - "e3b347e3.b19f98" - ] - ] - }, - { - "id": "6a84252a.d52a0c", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "833bc5bb.217ba8", - "name": "Stream Pi Camera", - "order": 1, - "width": 14, - "height": 9, - "format": "
\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 110, - "y": 100, - "wires": [ - [] - ] - }, - { - "id": "dc48dc42.98d18", - "type": "function", - "z": "bccd1f23.87219", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 1480, - "y": 400, - "wires": [ - [] - ] - }, - { - "id": "5b043fe6.df031", - "type": "function", - "z": "bccd1f23.87219", - "name": "focus.js", - "func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of step\"\n}\n\nelse {\n\n if(msg.topic === \"up\" & state ===\"free\"){\n nb_step = global.get(\"nb_step\");\n msg.nb_step = nb_step;\n msg.orientation = \"up\";\n msg.rgb = {r:255, g:0, b:255}\n msg.topic = \"Focus\"\n return msg;\n }\n \n if(msg.topic === \"down\" & state ===\"free\"){\n nb_step = global.get(\"nb_step\");\n msg.nb_step = nb_step;\n msg.orientation = \"down\";\n msg.rgb = {r:255, g:0, b:255}\n msg.topic = \"Focus\"\n return msg;\n }\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 980, - "y": 280, - "wires": [ - [ - "e7f18662.70dcf8" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "8c19fb64.8a1828", - "type": "python3-function", - "z": "bccd1f23.87219", - "name": "focus.py", - "func": "\nimport sys\n\nfrom adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nnb_step = int(msg[\"nb_step\"])\norientation = msg[\"orientation\"]\n\nkit = MotorKit()\n\nstage = kit.stepper2\n\nstage.release()\n\n#0.25mm/step\n#31um/microsteps\n\n \nif orientation == 'up':\n for i in range(nb_step):\n stage.onestep(direction=stepper.FORWARD, style=stepper.MICROSTEP)\n sleep(0.001)\n \nif orientation == 'down':\n for i in range(nb_step):\n stage.onestep(direction=stepper.BACKWARD, style=stepper.MICROSTEP)\n sleep(0.001)\n \nstage.release()\n\nmsg[\"topic\"] = \"focus\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 1280, - "y": 260, - "wires": [ - [ - "7b23bbd5.4483d4" - ] - ] - }, - { - "id": "21816a62.827a56", - "type": "python3-function", - "z": "bccd1f23.87219", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\nkit = MotorKit()\n\npump_stepper = kit.stepper1\n\npump_stepper.release()\n\n \nif orientation == \"forward\":\n orientation=stepper.BACKWARD\nif orientation == \"backward\":\n orientation=stepper.FORWARD\n \nnb_step=volume*507 #if sleep(0.05) in between 2 steps\n#35000steps for 69g\n \n#nb_step=vol*460 if sleep(0) in between 2 steps\nduration=(volume*60)/flowrate\n \ndelay=(duration/nb_step)-0.005\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=orientation, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 580, - "y": 220, - "wires": [ - [ - "90fc64b2.db5df8" - ] - ] - }, - { - "id": "7b68bdbe.e57094", - "type": "function", - "z": "bccd1f23.87219", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"manual_volume\");\nvar flowrate= global.get(\"flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n if(msg.topic === \"forward\" & state===\"free\"){\n volume = global.get(\"manual_volume\");\n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = global.get(\"flowrate\");\n msg.rgb = {r:0, g:255, b:255};\n msg.topic = \"Pump\"\n }\n if(msg.topic === \"backward\" & state===\"free\"){\n volume = global.get(\"manual_volume\");\n msg.volume = volume;\n msg.orientation = \"backward\";\n msg.flowrate = global.get(\"flowrate\");\n msg.rgb = {r:0, g:255, b:255};\n msg.topic = \"Pump\";\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 280, - "y": 240, - "wires": [ - [ - "7994feb9.fcfc9" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "c0199136.20bd7", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "a208caf.0d23338", - "d17415a3.fca5c8" - ], - "x": 1235, - "y": 220, - "wires": [] - }, - { - "id": "da53c4c2.6b17b8", - "type": "python3-function", - "z": "bccd1f23.87219", - "name": "actuate RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;", - "outputs": 1, - "x": 1490, - "y": 460, - "wires": [ - [ - "1276a75f.d8d1a9" - ] - ] - }, - { - "id": "8778c73a.ddc6e8", - "type": "exec", - "z": "bccd1f23.87219", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 1830, - "y": 500, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "a208caf.0d23338", - "type": "link in", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "c0199136.20bd7", - "2dff3966.a5b2d6" - ], - "x": 1375, - "y": 460, - "wires": [ - [ - "da53c4c2.6b17b8" - ] - ] - }, - { - "id": "9b5cac2c.6de57", - "type": "python3-function", - "z": "bccd1f23.87219", - "name": "wait RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nreturn msg;", - "outputs": 1, - "x": 1480, - "y": 540, - "wires": [ - [ - "8479740e.6373c8" - ] - ] - }, - { - "id": "7b23bbd5.4483d4", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4351408.b0b288", - "2bc762dd.1115ce", - "a50134c.ed45ac8" - ], - "x": 1395, - "y": 260, - "wires": [] - }, - { - "id": "e4351408.b0b288", - "type": "link in", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "7b23bbd5.4483d4", - "90fc64b2.db5df8" - ], - "x": 1375, - "y": 540, - "wires": [ - [ - "9b5cac2c.6de57" - ] - ] - }, - { - "id": "2dff3966.a5b2d6", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "a208caf.0d23338", - "d17415a3.fca5c8" - ], - "x": 535, - "y": 180, - "wires": [] - }, - { - "id": "90fc64b2.db5df8", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4351408.b0b288", - "2bc762dd.1115ce", - "a50134c.ed45ac8" - ], - "x": 695, - "y": 220, - "wires": [] - }, - { - "id": "1276a75f.d8d1a9", - "type": "function", - "z": "bccd1f23.87219", - "name": "set busy", - "func": "global.set(\"state\",\"busy\");\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1640, - "y": 460, - "wires": [ - [ - "8778c73a.ddc6e8" - ] - ] - }, - { - "id": "8479740e.6373c8", - "type": "function", - "z": "bccd1f23.87219", - "name": "set free", - "func": "global.set(\"state\",\"free\");\nreturn msg", - "outputs": 1, - "noerr": 0, - "x": 1640, - "y": 540, - "wires": [ - [ - "8778c73a.ddc6e8" - ] - ] - }, - { - "id": "17a53f92.824d2", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "567a49a4.244cb8", - "name": "Instrument", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n Instrument :\n \n PlanktonScope V2.1\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 150, - "y": 400, - "wires": [ - [] - ] - }, - { - "id": "d2b74a01.166498", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "567a49a4.244cb8", - "name": "Software", - "order": 3, - "width": 0, - "height": 0, - "format": "
\n Software :\n \n Node-RED Dashboard V2.0\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 440, - "wires": [ - [] - ] - }, - { - "id": "a5c019f.91d15e8", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "567a49a4.244cb8", - "name": "Camera", - "order": 1, - "width": 0, - "height": 0, - "format": "
\n Camera :\n \n Pi Camera v2.1\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 480, - "wires": [ - [] - ] - }, - { - "id": "f59a2f0d.5e9af", - "type": "ui_numeric", - "z": "baa1e3d9.cb29d", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "404c301a.19c4e", - "order": 2, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 120, - "y": 100, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "6008a8bb.259f08", - "type": "ui_numeric", - "z": "baa1e3d9.cb29d", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "404c301a.19c4e", - "order": 3, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 120, - "y": 160, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "6b34c456.83178c", - "type": "ui_text_input", - "z": "baa1e3d9.cb29d", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "4322c187.e73e5", - "order": 2, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "acq_id", - "x": 170, - "y": 300, - "wires": [ - [ - "a39af546.4c30c8" - ] - ] - }, - { - "id": "314ebbc0.040b84", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "store generic", - "func": "global.set(\"acq_instrument\",\"PlanktonScope V2.1\");\nglobal.set(\"acq_software\",\"Node-RED Dashboard\");\nglobal.set(\"acq_camera\",\"Pi Camera V2.1\");\nglobal.set(\"acq_instrument_ID\",\"copepode\");", - "outputs": 1, - "noerr": 0, - "x": 370, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "109cf039.1ca8d", - "type": "ui_button", - "z": "baa1e3d9.cb29d", - "name": "cancel", - "group": "b7919ae2.c01788", - "order": 3, - "width": 4, - "height": 1, - "passthru": false, - "label": "Cancel Acquisition", - "tooltip": "", - "color": "#AD1625", - "bgcolor": "white", - "icon": "pause_circle_filled", - "payload": "stop", - "payloadType": "str", - "topic": "cancel", - "x": 570, - "y": 120, - "wires": [ - [ - "c339e7a4.7e7608", - "995fa523.83cba8" - ] - ] - }, - { - "id": "dae10d44.76f08", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}", - "outputs": 1, - "noerr": 0, - "x": 1140, - "y": 560, - "wires": [ - [ - "d3ab1a14.86b8b8", - "ff805ffc.f9134" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "7789839d.69b48c", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "4e0cd5ea.17e59c", - "name": "Optic Configuration", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Optic Configuration
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 130, - "y": 100, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "6ea6c306.f9c12c", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "ef590206.24f6", - "name": "Fluidic Acquisition", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Fluidic Acquisition
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 130, - "y": 140, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "bb9eb153.9e36c", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "ae8f6620.073358", - "name": "Segmentation", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Segmentation
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 140, - "y": 180, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "eaf8ee7f.96f44", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "196518b2.4d53b7", - "name": "Gallery", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Gallery
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 220, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "f37444ff.d17068", - "type": "ui_text_input", - "z": "bccd1f23.87219", - "name": "nb_step", - "label": "Number of step(s)", - "tooltip": "", - "group": "fbd92986.1028c8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "nb_step", - "x": 820, - "y": 340, - "wires": [ - [ - "2f51f4e2.4dcaec" - ] - ] - }, - { - "id": "811cd88c.daf528", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "down", - "group": "fbd92986.1028c8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_downward", - "payload": "down", - "payloadType": "str", - "topic": "down", - "x": 830, - "y": 300, - "wires": [ - [ - "5b043fe6.df031" - ] - ] - }, - { - "id": "edda4df4.76de2", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "up", - "group": "fbd92986.1028c8", - "order": 1, - "width": 0, - "height": 0, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_upwards", - "payload": "up", - "payloadType": "str", - "topic": "up", - "x": 830, - "y": 260, - "wires": [ - [ - "5b043fe6.df031" - ] - ] - }, - { - "id": "bb667f4c.06e44", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4892a16.664bf8" - ], - "x": 235, - "y": 300, - "wires": [] - }, - { - "id": "e4892a16.664bf8", - "type": "link in", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "bb667f4c.06e44", - "2f51f4e2.4dcaec", - "4a0baa98.618744" - ], - "x": 1375, - "y": 400, - "wires": [ - [ - "dc48dc42.98d18" - ] - ] - }, - { - "id": "2f51f4e2.4dcaec", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4892a16.664bf8" - ], - "x": 975, - "y": 340, - "wires": [] - }, - { - "id": "68962547.34a67c", - "type": "ui_text_input", - "z": "bccd1f23.87219", - "name": "manual_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 3, - "width": 4, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "manual_volume", - "x": 100, - "y": 340, - "wires": [ - [ - "4a0baa98.618744" - ] - ] - }, - { - "id": "4a0baa98.618744", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4892a16.664bf8" - ], - "x": 235, - "y": 340, - "wires": [] - }, - { - "id": "34c81624.df1cea", - "type": "ui_slider", - "z": "bccd1f23.87219", - "name": "flowrate", - "label": "Flowrate (ml/min)*", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "outs": "end", - "topic": "flowrate", - "min": 0, - "max": "20", - "step": "0.1", - "x": 120, - "y": 300, - "wires": [ - [ - "bb667f4c.06e44" - ] - ] - }, - { - "id": "c1b1469.9650eb8", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "777a7c33.fcd804", - "name": "Settings", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Settings
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 260, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "18afe75e.288219", - "type": "ui_gauge", - "z": "c1660bc.e7ff7f8", - "name": "", - "group": "c0ebfc57.42527", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "gauge", - "label": "units", - "format": "{{value}}", - "min": 0, - "max": 10, - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 720, - "y": 280, - "wires": [] - }, - { - "id": "abafd6e6.04a5f8", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "6f97e7ae.270c48", - "name": "Sample", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Sample
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 60, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "4557d689.a4fa88", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_ship", - "x": 190, - "y": 80, - "wires": [ - [ - "f37a955f.9eee88" - ] - ] - }, - { - "id": "fcfc31ae.af3af", - "type": "ui_dropdown", - "z": "b771c342.49603", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "3e1ba03d.f01d8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "Plankton net", - "value": "net", - "type": "str" - }, - { - "label": "Niskin bottle 12L", - "value": "niskin_12L", - "type": "str" - }, - { - "label": "Niskin bottle 24L", - "value": "niskin_24L", - "type": "str" - }, - { - "label": "Pass Hull", - "value": "pass_hull", - "type": "str" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 150, - "y": 200, - "wires": [ - [ - "9f501f49.45645" - ] - ] - }, - { - "id": "82c5fc77.59c97", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 170, - "y": 160, - "wires": [ - [ - "f37a955f.9eee88" - ] - ] - }, - { - "id": "9c882b37.fde668", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_project", - "x": 180, - "y": 40, - "wires": [ - [ - "f37a955f.9eee88" - ] - ] - }, - { - "id": "94eb4221.9b92c", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_id", - "label": "ID of the station*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_id", - "x": 190, - "y": 120, - "wires": [ - [ - "f37a955f.9eee88" - ] - ] - }, - { - "id": "f37a955f.9eee88", - "type": "function", - "z": "b771c342.49603", - "name": "set global join", - "func": "var value = msg.payload.split(' ').join('_');\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "9f501f49.45645", - "type": "function", - "z": "b771c342.49603", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 400, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "cc0ca68b.4263a8", - "type": "ui_dropdown", - "z": "baa1e3d9.cb29d", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "404c301a.19c4e", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 150, - "y": 40, - "wires": [ - [ - "fb887036.12429", - "314ebbc0.040b84" - ] - ] - }, - { - "id": "fb887036.12429", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 360, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "222c851d.5d0a3a", - "type": "ui_ui_control", - "z": "b771c342.49603", - "name": "", - "events": "change", - "x": 360, - "y": 480, - "wires": [ - [] - ] - }, - { - "id": "52f6b103.1efb6", - "type": "ui_toast", - "z": "b771c342.49603", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 790, - "y": 580, - "wires": [ - [] - ] - }, - { - "id": "986d960a.c75908", - "type": "function", - "z": "b771c342.49603", - "name": "Check form", - "func": "var sample_project= global.get(\"sample_project\");\nvar sample_ship= global.get(\"sample_ship\");\nvar sample_id= global.get(\"sample_id\");\nvar sample_operator= global.get(\"sample_operator\");\nvar sample_sampling_gear= global.get(\"sample_sampling_gear\");\nvar object_lat= global.get(\"object_lat\");\nvar object_lon= global.get(\"object_lon\");\nvar sample_day= global.get(\"sample_day\");\nvar sample_hour= global.get(\"sample_hour\");\n\nif (sample_project === undefined || sample_project === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample project\"\n}\n\nelse if (sample_ship === undefined || sample_ship === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ship\"\n}\n\nelse if (sample_id === undefined || sample_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ID\"\n}\n\nelse if (sample_operator === undefined || sample_operator === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample operator\"\n}\n\nelse if (sample_sampling_gear === undefined || sample_sampling_gear === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample sampling gear\"\n}\n\nelse if (object_lat === undefined || object_lat === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample latitude\"\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample longitude\"\n}\n\nelse if (sample_day === undefined || sample_day === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date\"\n}\n\nelse if (sample_hour === undefined || sample_hour === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time\"\n}\n\nelse {\n msg.topic = \"Change Tab\"\n msg.payload={\"tab\":\"Optic Configuration\"};\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 370, - "y": 540, - "wires": [ - [ - "f5e66a2f.0d09d8" - ] - ] - }, - { - "id": "18f44504.cac66b", - "type": "gpsd", - "z": "b771c342.49603", - "name": "", - "hostname": "localhost", - "port": "2947", - "tpv": true, - "sky": false, - "info": false, - "device": false, - "gst": false, - "att": false, - "x": 630, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "726a7822.cd6298", - "type": "ui_ui_control", - "z": "b771c342.49603", - "name": "", - "events": "change", - "x": 780, - "y": 520, - "wires": [ - [] - ] - }, - { - "id": "f5e66a2f.0d09d8", - "type": "switch", - "z": "b771c342.49603", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Change Tab", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 550, - "y": 540, - "wires": [ - [ - "726a7822.cd6298" - ], - [ - "52f6b103.1efb6" - ] - ] - }, - { - "id": "2d128018.6a809", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lat", - "label": "Lattitude (decimal degrees)", - "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 1, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "object_lat", - "x": 200, - "y": 260, - "wires": [ - [ - "9f501f49.45645" - ] - ] - }, - { - "id": "4626c0da.e0dd5", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lon", - "label": "Longitude (decimal degrees)", - "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 2, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "object_lon", - "x": 190, - "y": 300, - "wires": [ - [ - "9f501f49.45645" - ] - ] - }, - { - "id": "f00f321f.77d76", - "type": "ui_date_picker", - "z": "b771c342.49603", - "name": "", - "label": "Date", - "group": "cef1e703.bcf3c8", - "order": 4, - "width": 12, - "height": 1, - "passthru": true, - "topic": "", - "x": 210, - "y": 340, - "wires": [ - [ - "3dba84a2.0de1bc" - ] - ] - }, - { - "id": "207fbdbb.2fe2a2", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "", - "label": "Time :", - "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 3, - "width": 7, - "height": 1, - "passthru": true, - "mode": "time", - "delay": 300, - "topic": "", - "x": 210, - "y": 380, - "wires": [ - [ - "61f9d7df.83ffe8" - ] - ] - }, - { - "id": "61f9d7df.83ffe8", - "type": "function", - "z": "b771c342.49603", - "name": "set time global", - "func": "var dt = new Date(msg.payload);\nglobal.set('sample_hour',dt.getHours()-1);\nglobal.set('sample_min',dt.getMinutes());", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 380, - "wires": [ - [] - ] - }, - { - "id": "3dba84a2.0de1bc", - "type": "function", - "z": "b771c342.49603", - "name": "set date global", - "func": "var dt = new Date(msg.payload);\n\nglobal.set('sample_month',dt.getMonth() + 1);\nglobal.set('sample_day',dt.getDate());\nglobal.set('sample_year',dt.getFullYear());\n", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 340, - "wires": [ - [] - ] - }, - { - "id": "6c792043.b6ff9", - "type": "ui_ui_control", - "z": "bccd1f23.87219", - "name": "", - "events": "change", - "x": 700, - "y": 520, - "wires": [ - [] - ] - }, - { - "id": "902429eb.ceacb8", - "type": "ui_toast", - "z": "bccd1f23.87219", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 930, - "y": 620, - "wires": [ - [] - ] - }, - { - "id": "fe840e05.b46f3", - "type": "function", - "z": "bccd1f23.87219", - "name": "Check form", - "func": "var acq_fnumber_objective= global.get(\"acq_fnumber_objective\");\n\nif (acq_fnumber_objective === undefined || acq_fnumber_objective === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Focal Length of the objective\"\n}\n\nelse {\n msg.topic = \"Change Tab\"\n msg.payload={\"tab\":\"Fluidic Acquisition\"};\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 510, - "y": 580, - "wires": [ - [ - "652d812a.7d808" - ] - ] - }, - { - "id": "f58a0c4.e207df", - "type": "ui_ui_control", - "z": "bccd1f23.87219", - "name": "", - "events": "change", - "x": 920, - "y": 560, - "wires": [ - [] - ] - }, - { - "id": "652d812a.7d808", - "type": "switch", - "z": "bccd1f23.87219", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Change Tab", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 690, - "y": 580, - "wires": [ - [ - "f58a0c4.e207df" - ], - [ - "902429eb.ceacb8" - ] - ] - }, - { - "id": "5846b1d4.7971b", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "backward", - "group": "707d9797.c8e798", - "order": 2, - "width": 5, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_back", - "payload": "backward", - "payloadType": "str", - "topic": "backward", - "x": 120, - "y": 220, - "wires": [ - [ - "7b68bdbe.e57094" - ] - ] - }, - { - "id": "2cab680b.baf888", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "foward", - "group": "707d9797.c8e798", - "order": 4, - "width": 5, - "height": 1, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_forward", - "payload": "forward", - "payloadType": "str", - "topic": "forward", - "x": 130, - "y": 260, - "wires": [ - [ - "7b68bdbe.e57094" - ] - ] - }, - { - "id": "961d27e7.da65c8", - "type": "ui_switch", - "z": "bccd1f23.87219", - "name": "light_state", - "label": "Light", - "tooltip": "", - "group": "4248342d.e55fac", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "1", - "onvalueType": "num", - "onicon": "", - "oncolor": "", - "offvalue": "0", - "offvalueType": "num", - "officon": "", - "offcolor": "", - "x": 90, - "y": 40, - "wires": [ - [ - "cbb8afed.0a026" - ] - ], - "icon": "font-awesome/fa-lightbulb-o" - }, - { - "id": "cc966678.da8d08", - "type": "ui_dropdown", - "z": "bccd1f23.87219", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "4248342d.e55fac", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 870, - "y": 40, - "wires": [ - [ - "8038414a.34461" - ] - ] - }, - { - "id": "9b515beb.4aea48", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "Magnification", - "order": 3, - "width": 0, - "height": 0, - "format": "
\n Magnification : X\n \n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1430, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "8038414a.34461", - "type": "function", - "z": "bccd1f23.87219", - "name": "calculate", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1060, - "y": 40, - "wires": [ - [ - "ad87820f.b1d1e", - "d68a52ee.82e8e", - "238f26b1.e2089a", - "6e0f6d36.a6b854" - ] - ] - }, - { - "id": "eca088f.6ceed78", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "Pi Camera settings", - "order": 7, - "width": 0, - "height": 0, - "format": "\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 850, - "y": 100, - "wires": [ - [] - ] - }, - { - "id": "3d2360ad.e41e7", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "process_pixel", - "order": 4, - "width": 0, - "height": 0, - "format": "
\n Pixel resolution :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1440, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "8e66977b.9166a8", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "min_size", - "order": 5, - "width": 0, - "height": 0, - "format": "
\n Smallest cells to explore :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1420, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "26b32f2c.c64fc", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "max_size", - "order": 6, - "width": 0, - "height": 0, - "format": "
\n Biggest cells to explore :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1420, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "ad87820f.b1d1e", - "type": "function", - "z": "bccd1f23.87219", - "name": "get magnification", - "func": "var magnification = global.get(\"magnification\");\nmsg.payload = magnification;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1250, - "y": 40, - "wires": [ - [ - "9b515beb.4aea48" - ] - ] - }, - { - "id": "d68a52ee.82e8e", - "type": "function", - "z": "bccd1f23.87219", - "name": "get process_pixel", - "func": "var process_pixel = global.get(\"process_pixel\");\nmsg.payload = process_pixel;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1250, - "y": 80, - "wires": [ - [ - "3d2360ad.e41e7" - ] - ] - }, - { - "id": "238f26b1.e2089a", - "type": "function", - "z": "bccd1f23.87219", - "name": "get sug_min", - "func": "var sug_min = global.get(\"sug_min\");\nmsg.payload = sug_min;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1230, - "y": 120, - "wires": [ - [ - "8e66977b.9166a8" - ] - ] - }, - { - "id": "6e0f6d36.a6b854", - "type": "function", - "z": "bccd1f23.87219", - "name": "get sug_max", - "func": "var sug_max = global.get(\"sug_max\");\nmsg.payload = sug_max;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1230, - "y": 160, - "wires": [ - [ - "26b32f2c.c64fc" - ] - ] - }, - { - "id": "bb2bb7ce.1d1458", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "858a0e3c.987fe", - "name": "Stream Pi Camera", - "order": 1, - "width": 14, - "height": 11, - "format": "
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 590, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "d0c5b57d.590818", - "type": "ui_ui_control", - "z": "baa1e3d9.cb29d", - "name": "", - "events": "change", - "x": 700, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "2fb129de.024a06", - "type": "ui_toast", - "z": "baa1e3d9.cb29d", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 650, - "y": 540, - "wires": [ - [] - ] - }, - { - "id": "61b4993e.1f3fb8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "Check form", - "func": "var acq_celltype= global.get(\"acq_celltype\");\nvar acq_minimum_mesh= global.get(\"acq_minimum_mesh\");\nvar acq_maximum_mesh= global.get(\"acq_maximum_mesh\");\nvar acq_volume= global.get(\"acq_volume\");\nvar acq_id= global.get(\"acq_id\");\n\nif (acq_celltype === undefined || acq_celltype === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Type of the flowcell\"\n}\nelse if (acq_minimum_mesh === undefined || acq_minimum_mesh === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Lower fraction size\"\n}\nelse if (acq_maximum_mesh === undefined || acq_maximum_mesh === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Upper fraction size\"\n}\nelse if (acq_volume === undefined || acq_volume === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to image\"\n}\nelse if (acq_id === undefined || acq_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Acquisition ID\"\n}\nelse {\n msg.topic = \"Start\";\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 730, - "y": 280, - "wires": [ - [ - "9e7bd689.f9c278" - ] - ] - }, - { - "id": "9e7bd689.f9c278", - "type": "switch", - "z": "baa1e3d9.cb29d", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 870, - "y": 280, - "wires": [ - [ - "f7fa6acf.f6ed28" - ], - [ - "2fb129de.024a06" - ] - ] - }, - { - "id": "16de754c.cc969b", - "type": "ui_button", - "z": "b771c342.49603", - "name": "", - "group": "5517c651.b2f668", - "order": 1, - "width": 12, - "height": 1, - "passthru": false, - "label": "Previous", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_return", - "payload": "{\"tab\":\"Home\"}", - "payloadType": "json", - "topic": "", - "x": 220, - "y": 480, - "wires": [ - [ - "222c851d.5d0a3a" - ] - ] - }, - { - "id": "84f3d040.5f7ea", - "type": "ui_button", - "z": "b771c342.49603", - "name": "", - "group": "5517c651.b2f668", - "order": 2, - "width": 12, - "height": 1, - "passthru": false, - "label": "Continue", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_tab", - "payload": "{\"tab\":\"Home\"}", - "payloadType": "json", - "topic": "", - "x": 220, - "y": 540, - "wires": [ - [ - "986d960a.c75908" - ] - ] - }, - { - "id": "f61aaed5.1e64", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "", - "group": "7a0b4877.a5d268", - "order": 1, - "width": 5, - "height": 1, - "passthru": false, - "label": "Previous", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_return", - "payload": "{\"tab\":\"Sample\"}", - "payloadType": "json", - "topic": "", - "x": 360, - "y": 520, - "wires": [ - [ - "6c792043.b6ff9" - ] - ] - }, - { - "id": "9ba6ec0a.22c96", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "", - "group": "7a0b4877.a5d268", - "order": 2, - "width": 5, - "height": 1, - "passthru": false, - "label": "Continue", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_tab", - "payload": "{\"tab\":\"Home\"}", - "payloadType": "json", - "topic": "", - "x": 360, - "y": 580, - "wires": [ - [ - "fe840e05.b46f3" - ] - ] - }, - { - "id": "c72f8fae.23bd4", - "type": "ui_button", - "z": "baa1e3d9.cb29d", - "name": "", - "group": "b7919ae2.c01788", - "order": 2, - "width": 5, - "height": 1, - "passthru": false, - "label": "Previous", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_return", - "payload": "{\"tab\":\"Optic Configuration\"}", - "payloadType": "json", - "topic": "", - "x": 560, - "y": 80, - "wires": [ - [ - "d0c5b57d.590818" - ] - ] - }, - { - "id": "cf48a0b9.7f208", - "type": "ui_button", - "z": "baa1e3d9.cb29d", - "name": "", - "group": "b7919ae2.c01788", - "order": 5, - "width": 0, - "height": 0, - "passthru": false, - "label": "Start", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_tab", - "payload": "{\"tab\":\"Home\"}", - "payloadType": "json", - "topic": "", - "x": 570, - "y": 280, - "wires": [ - [ - "61b4993e.1f3fb8" - ] - ] - }, - { - "id": "389bef3.d94c61", - "type": "ui_text_input", - "z": "baa1e3d9.cb29d", - "name": "acq_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "4322c187.e73e5", - "order": 1, - "width": 5, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_volume", - "x": 150, - "y": 220, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "a39af546.4c30c8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set global join", - "func": "var value = msg.payload.split(' ').join('_');\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 380, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "75b738f0.cea208", - "type": "ui_toast", - "z": "bccd1f23.87219", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1290, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "e7f18662.70dcf8", - "type": "switch", - "z": "bccd1f23.87219", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Focus", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1130, - "y": 280, - "wires": [ - [ - "c0199136.20bd7", - "8c19fb64.8a1828" - ], - [ - "75b738f0.cea208" - ] - ] - }, - { - "id": "c2aeba5f.a2ac98", - "type": "ui_toast", - "z": "bccd1f23.87219", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 590, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "7994feb9.fcfc9", - "type": "switch", - "z": "bccd1f23.87219", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Pump", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 430, - "y": 240, - "wires": [ - [ - "21816a62.827a56", - "2dff3966.a5b2d6" - ], - [ - "c2aeba5f.a2ac98" - ] - ] - }, - { - "id": "201ad81d.4a6d78", - "type": "http request", - "z": "baa1e3d9.cb29d", - "name": "Start timelapse", - "method": "GET", - "ret": "txt", - "paytoqs": false, - "url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%201", - "tls": "", - "persist": false, - "proxy": "", - "authType": "", - "x": 980, - "y": 800, - "wires": [ - [] - ] - }, - { - "id": "c339e7a4.7e7608", - "type": "http request", - "z": "baa1e3d9.cb29d", - "name": "Stop timelapse", - "method": "GET", - "ret": "txt", - "paytoqs": false, - "url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%200", - "tls": "", - "persist": false, - "proxy": "", - "authType": "", - "x": 720, - "y": 120, - "wires": [ - [ - "eaab9f19.c68ba" - ] - ] - }, - { - "id": "b4d324de.a2bd28", - "type": "ui_worldmap", - "z": "b771c342.49603", - "group": "cef1e703.bcf3c8", - "order": 6, - "width": 0, - "height": 0, - "name": "", - "lat": "1.5", - "lon": "1.5", - "zoom": "4", - "layer": "OSM grey", - "cluster": "1", - "maxage": "", - "usermenu": "hide", - "layers": "hide", - "panit": "false", - "panlock": "false", - "zoomlock": "false", - "hiderightclick": "true", - "coords": "deg", - "showgrid": "false", - "path": "/worldmap", - "x": 780, - "y": 400, - "wires": [] - }, - { - "id": "cf3e1477.25af68", - "type": "function", - "z": "b771c342.49603", - "name": "set point", - "func": "var sample_id= global.get(\"sample_id\");\nvar object_lat= global.get(\"object_lat\");\nvar object_lon= global.get(\"object_lon\");\n\nif (sample_id === undefined || sample_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ID\"\n}\nelse if (object_lat === undefined || object_lat === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample latitude\"\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample longitude\"\n}\n\nelse {\n msg.topic = \"Place\"\n msg.payload={\"name\":sample_id, \"lat\":object_lat, \"lon\":object_lon}\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 360, - "y": 440, - "wires": [ - [ - "105e9b1b.725865" - ] - ] - }, - { - "id": "d7a44df2.0fb29", - "type": "ui_button", - "z": "b771c342.49603", - "name": "", - "group": "cef1e703.bcf3c8", - "order": 5, - "width": 5, - "height": 1, - "passthru": false, - "label": "Place", - "tooltip": "", - "color": "#333333", - "bgcolor": "white", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 210, - "y": 440, - "wires": [ - [ - "cf3e1477.25af68" - ] - ] - }, - { - "id": "105e9b1b.725865", - "type": "switch", - "z": "b771c342.49603", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Place", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 550, - "y": 440, - "wires": [ - [ - "b4d324de.a2bd28" - ], - [ - "10c9c12a.feae6f" - ] - ] - }, - { - "id": "10c9c12a.feae6f", - "type": "ui_toast", - "z": "b771c342.49603", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 790, - "y": 460, - "wires": [ - [] - ] - }, - { - "id": "32f57168.89cbae", - "type": "comment", - "z": "baa1e3d9.cb29d", - "name": "generic info", - "info": "", - "x": 150, - "y": 360, - "wires": [] - }, - { - "id": "44094d9d.62c6c4", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 1170, - "y": 120, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "eaab9f19.c68ba", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "wait RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nreturn msg;", - "outputs": 1, - "x": 880, - "y": 120, - "wires": [ - [ - "154d5ce1.81ed03" - ] - ] - }, - { - "id": "154d5ce1.81ed03", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set free", - "func": "global.set(\"state\",\"free\");\nreturn msg", - "outputs": 1, - "noerr": 0, - "x": 1020, - "y": 120, - "wires": [ - [ - "44094d9d.62c6c4" - ] - ] - }, - { - "id": "f07dec1d.147ce", - "type": "ui_text_input", - "z": "baa1e3d9.cb29d", - "name": "comment", - "label": "Comment", - "tooltip": "", - "group": "b7919ae2.c01788", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "comment", - "x": 160, - "y": 260, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "8bd55b54.8e3938", - "type": "file", - "z": "baa1e3d9.cb29d", - "name": "logs.json", - "filename": "/var/www/logs.json", - "appendNewline": false, - "createDir": false, - "overwriteFile": "false", - "encoding": "none", - "x": 2000, - "y": 1340, - "wires": [ - [ - "20a2d27e.7ccafe" - ] - ] - }, - { - "id": "99fd2803.0843a8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get global", - "func": "msg.payload = {\n \"comment\":global.get(\"comment\"),\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"sample_hour\":global.get(\"sample_hour\"),\n \"sample_minute\":global.get(\"sample_minute\"),\n \"sample_day\":global.get(\"sample_day\"),\n \"sample_month\":global.get(\"sample_month\"),\n \"sample_year\":global.get(\"sample_year\"),\n \n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \n \"acq_camera\":global.get(\"acq_camera\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_instrument_ID\":global.get(\"acq_instrument_ID\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_flowrate\":global.get(\"sug_flowrate\")\n }\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1820, - "y": 1340, - "wires": [ - [ - "8bd55b54.8e3938" - ] - ] - }, - { - "id": "ae692178.d44d1", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 1240, - "y": 1260, - "wires": [ - [ - "783209c7.51c5a8" - ] - ] - }, - { - "id": "a3fd6b29.2ef5f8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}", - "outputs": 1, - "noerr": 0, - "x": 1040, - "y": 1360, - "wires": [ - [ - "ae692178.d44d1", - "e0f9efda.fa4ce" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "e0f9efda.fa4ce", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "actuate RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;", - "outputs": 1, - "x": 1250, - "y": 1200, - "wires": [ - [ - "3b498e72.6e6292" - ] - ] - }, - { - "id": "7baf5071.dc3b2", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 1570, - "y": 1200, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "783209c7.51c5a8", - "type": "link out", - "z": "baa1e3d9.cb29d", - "name": "", - "links": [ - "e1354861.0bb648", - "2bc762dd.1115ce", - "a50134c.ed45ac8", - "f0ef065a.362028" - ], - "x": 1335, - "y": 1260, - "wires": [] - }, - { - "id": "3b498e72.6e6292", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set busy", - "func": "global.set(\"state\",\"busy\");\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1420, - "y": 1200, - "wires": [ - [ - "7baf5071.dc3b2" - ] - ] - }, - { - "id": "cd56bb1c.8ce378", - "type": "ui_toast", - "z": "baa1e3d9.cb29d", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1010, - "y": 1200, - "wires": [ - [] - ] - }, - { - "id": "c82e467c.99e208", - "type": "switch", - "z": "baa1e3d9.cb29d", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - }, - { - "t": "eq", - "v": "Start", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 850, - "y": 1220, - "wires": [ - [ - "cd56bb1c.8ce378" - ], - [ - "a3fd6b29.2ef5f8", - "a642fc0b.b6dd7" - ] - ] - }, - { - "id": "c6bd5987.c48f78", - "type": "http request", - "z": "baa1e3d9.cb29d", - "name": "Start timelapse", - "method": "GET", - "ret": "txt", - "paytoqs": false, - "url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%201", - "tls": "", - "persist": false, - "proxy": "", - "authType": "", - "x": 1100, - "y": 1600, - "wires": [ - [] - ] - }, - { - "id": "8c15fd05.81b5", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get duration acquisition", - "func": "msg.delay = global.get(\"duration\");\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1290, - "y": 1360, - "wires": [ - [ - "2ff9c0cb.7288b", - "34929df1.bfe602" - ] - ] - }, - { - "id": "2ff9c0cb.7288b", - "type": "delay", - "z": "baa1e3d9.cb29d", - "name": "wait duration", - "pauseType": "delayv", - "timeout": "1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 1510, - "y": 1360, - "wires": [ - [ - "99fd2803.0843a8", - "3475ecd5.6655f4", - "8f991d2e.6e8f3", - "e6a12f33.c7768" - ] - ] - }, - { - "id": "a642fc0b.b6dd7", - "type": "delay", - "z": "baa1e3d9.cb29d", - "name": "", - "pauseType": "delay", - "timeout": "500", - "timeoutUnits": "milliseconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 810, - "y": 1540, - "wires": [ - [ - "c6bd5987.c48f78", - "8c15fd05.81b5" - ] - ] - }, - { - "id": "6aaa3bc6.b7dda4", - "type": "ui_gauge", - "z": "baa1e3d9.cb29d", - "name": "", - "group": "b5d61bc7.54fe48", - "order": 1, - "width": 10, - "height": 2, - "gtype": "donut", - "title": "", - "label": "%", - "format": "{{value}}", - "min": 0, - "max": "100", - "colors": [ - "#ffffff", - "#ffffff", - "#097479" - ], - "seg1": "", - "seg2": "", - "x": 2250, - "y": 1500, - "wires": [] - }, - { - "id": "34929df1.bfe602", - "type": "trigger", - "z": "baa1e3d9.cb29d", - "op1": "1", - "op2": "0", - "op1type": "str", - "op2type": "str", - "duration": "-1", - "extend": false, - "units": "s", - "reset": "done", - "bytopic": "all", - "name": "", - "x": 1960, - "y": 1600, - "wires": [ - [ - "e98903d2.f35c1" - ] - ] - }, - { - "id": "3475ecd5.6655f4", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "stop", - "func": "global.set(\"time_to_wait\",0);\nmsg.payload=\"done\";\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1810, - "y": 1500, - "wires": [ - [ - "34929df1.bfe602", - "6aaa3bc6.b7dda4" - ] - ] - }, - { - "id": "e98903d2.f35c1", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "pulse", - "func": "var time_to_wait= global.get(\"time_to_wait\");\n\nif (time_to_wait === undefined || time_to_wait === \"\"|| time_to_wait == NaN) {\n time_to_wait=0\n global.set(\"time_to_wait\",time_to_wait);\n}else {\n time_to_wait++;\n global.set(\"time_to_wait\",time_to_wait);\n duration=global.get(\"duration\")/1000;\n percent=(100* time_to_wait/duration).toFixed(0)\n msg.payload=percent;\n return msg;\n \n}", - "outputs": 1, - "noerr": 0, - "x": 2110, - "y": 1600, - "wires": [ - [ - "6aaa3bc6.b7dda4" - ] - ] - }, - { - "id": "f0ef065a.362028", - "type": "link in", - "z": "baa1e3d9.cb29d", - "name": "", - "links": [ - "a61d4164.135dd", - "783209c7.51c5a8", - "260e60f3.878ad", - "c5ee25c5.3c1848" - ], - "x": 1635, - "y": 1560, - "wires": [ - [ - "3475ecd5.6655f4" - ] - ] - }, - { - "id": "8f991d2e.6e8f3", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "ls -l /var/www/html/media | grep \"th\" | tail -1 | awk -F \" \" '{print $9}' | awk -F \"_\" '{print $1\"_\"$2}'| tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "get thumbail name", - "x": 1850, - "y": 1280, - "wires": [ - [ - "9dcdbf1f.4aa21" - ], - [], - [] - ] - }, - { - "id": "e6a12f33.c7768", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "mkdir", - "func": "acq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/\"+acq_id\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1770, - "y": 1140, - "wires": [ - [ - "43c69256.b9633c" - ] - ] - }, - { - "id": "43c69256.b9633c", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "mkdir", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "mkdir acq_id", - "x": 1910, - "y": 1140, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "517f13e8.e0793c", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "move", - "func": "file_prefix=msg.payload;\nacq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/html/media/\"+file_prefix+\"* /var/www/\"+acq_id+\"/\";\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 2330, - "y": 1240, - "wires": [ - [ - "83a1d49e.a29a48" - ] - ] - }, - { - "id": "9dcdbf1f.4aa21", - "type": "delay", - "z": "baa1e3d9.cb29d", - "name": "", - "pauseType": "delay", - "timeout": "200", - "timeoutUnits": "milliseconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 2090, - "y": 1260, - "wires": [ - [ - "517f13e8.e0793c" - ] - ] - }, - { - "id": "83a1d49e.a29a48", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "mv", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 2480, - "y": 1260, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "20a2d27e.7ccafe", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "move", - "func": "file_prefix=msg.payload;\nacq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/logs.json /var/www/\"+acq_id+\"/\";\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 2330, - "y": 1320, - "wires": [ - [ - "87cff57.f6d3708" - ] - ] - }, - { - "id": "87cff57.f6d3708", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "mv", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 2480, - "y": 1340, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "d91229e3.bf0f18", - "type": "while-loop", - "z": "baa1e3d9.cb29d", - "name": "", - "condi": "global.get(\"job\")===\"run\"", - "x": 1330, - "y": 200, - "wires": [ - [ - "427871db.b4902", - "a61b71c3.afaf" - ], - [ - "427871db.b4902", - "a61b71c3.afaf" - ] - ] - }, - { - "id": "217ff214.a25c2e", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "Run", - "func": "global.set(\"job\",\"run\")\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1030, - "y": 220, - "wires": [ - [ - "d91229e3.bf0f18" - ] - ] - }, - { - "id": "995fa523.83cba8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "Stop", - "func": "global.set(\"job\",\"stop\")\nmsg.payload=\"stop\"\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1030, - "y": 180, - "wires": [ - [ - "d91229e3.bf0f18" - ] - ] - }, - { - "id": "d3ab1a14.86b8b8", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 1380, - "y": 520, - "wires": [ - [ - "444587e4.dc23a8" - ] - ] - }, - { - "id": "ff805ffc.f9134", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "actuate RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;", - "outputs": 1, - "x": 1390, - "y": 460, - "wires": [ - [ - "a27b3163.19c31" - ] - ] - }, - { - "id": "444587e4.dc23a8", - "type": "link out", - "z": "baa1e3d9.cb29d", - "name": "", - "links": [ - "e1354861.0bb648", - "2bc762dd.1115ce", - "a50134c.ed45ac8", - "17d09d70.b50223" - ], - "x": 1475, - "y": 520, - "wires": [] - }, - { - "id": "a27b3163.19c31", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set busy", - "func": "global.set(\"state\",\"busy\");\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1560, - "y": 460, - "wires": [ - [] - ] - }, - { - "id": "7c974057.4d3f", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get duration acquisition", - "func": "msg.delay = global.get(\"duration\");\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1430, - "y": 620, - "wires": [ - [] - ] - }, - { - "id": "482c8e09.a77df", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\n\npump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.SIMPLE)\nsleep(0.1)", - "outputs": 1, - "x": 1820, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "427871db.b4902", - "type": "debug", - "z": "baa1e3d9.cb29d", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 1850, - "y": 220, - "wires": [] - }, - { - "id": "a61b71c3.afaf", - "type": "trigger", - "z": "baa1e3d9.cb29d", - "op1": "1", - "op2": "0", - "op1type": "str", - "op2type": "str", - "duration": "-250", - "extend": false, - "units": "ms", - "reset": "stop", - "bytopic": "all", - "name": "", - "x": 1620, - "y": 280, - "wires": [ - [ - "482c8e09.a77df" - ] - ] - }, - { - "id": "f7fa6acf.f6ed28", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}", - "outputs": 1, - "noerr": 0, - "x": 1100, - "y": 340, - "wires": [ - [ - "dd817ccf.04ec" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "dd817ccf.04ec", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 1280, - "y": 340, - "wires": [ - [] - ] - }, - { - "id": "7a5b8294.92ad3c", - "type": "ui_button", - "z": "baa1e3d9.cb29d", - "name": "", - "group": "b7919ae2.c01788", - "order": 4, - "width": 5, - "height": 1, - "passthru": false, - "label": "Show", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_tab", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 470, - "y": 380, - "wires": [ - [ - "e2919164.70927" - ] - ] - }, - { - "id": "29be525e.0c87fe", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "b5d61bc7.54fe48", - "name": "show global", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 750, - "y": 380, - "wires": [ - [] - ] - }, - { - "id": "e2919164.70927", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get global", - "func": "msg.payload = {\n \"comment\":global.get(\"comment\"),\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"sample_hour\":global.get(\"sample_hour\"),\n \"sample_minute\":global.get(\"sample_minute\"),\n \"sample_day\":global.get(\"sample_day\"),\n \"sample_month\":global.get(\"sample_month\"),\n \"sample_year\":global.get(\"sample_year\"),\n \n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \n \"acq_camera\":global.get(\"acq_camera\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_instrument_ID\":global.get(\"acq_instrument_ID\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_flowrate\":global.get(\"sug_flowrate\")\n }\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 600, - "y": 380, - "wires": [ - [ - "29be525e.0c87fe", - "295bd912.8d2556" - ] - ] - }, - { - "id": "295bd912.8d2556", - "type": "debug", - "z": "baa1e3d9.cb29d", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 760, - "y": 440, - "wires": [] - }, - { - "id": "7ca7754c.0f731c", - "type": "inject", - "z": "eaae323a.31b3", - "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "x": 120, - "y": 420, - "wires": [ - [ - "4c6d21e3.0173c" - ] - ] - }, - { - "id": "cbb8afed.0a026", - "type": "rpi-gpio out", - "z": "bccd1f23.87219", - "name": "", - "pin": "40", - "set": "", - "level": "0", - "freq": "", - "out": "out", - "x": 280, - "y": 80, - "wires": [] - }, - { - "id": "4c6d21e3.0173c", - "type": "function", - "z": "eaae323a.31b3", - "name": "", - "func": "var d = new Date();\nvar t = d.getTime();\npayload={\"time\":\"message\",\"timestamp\":msg.payload}\nmsg.payload=payload;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 250, - "y": 420, - "wires": [ - [ - "c82b48ad.8b5478" - ] - ] - }, - { - "id": "a256071b.25a008", - "type": "file", - "z": "eaae323a.31b3", - "name": "", - "filename": "/home/pi/Desktop/log/test.log", - "appendNewline": true, - "createDir": true, - "overwriteFile": "false", - "encoding": "none", - "x": 600, - "y": 420, - "wires": [ - [ - "3cd4bf1e.11ae3" - ] - ] - }, - { - "id": "3cd4bf1e.11ae3", - "type": "debug", - "z": "eaae323a.31b3", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 950, - "y": 420, - "wires": [] - }, - { - "id": "c82b48ad.8b5478", - "type": "csv", - "z": "eaae323a.31b3", - "name": "", - "sep": ",", - "hdrin": true, - "hdrout": "", - "multi": "one", - "ret": "\\n", - "temp": "timestamp,time", - "skip": "0", - "strings": true, - "x": 390, - "y": 420, - "wires": [ - [ - "a256071b.25a008" - ] - ] - } -] diff --git a/flows/flows.json b/flows/flows.json deleted file mode 100644 index efc88fd..0000000 --- a/flows/flows.json +++ /dev/null @@ -1,612 +0,0 @@ -[ - { - "id": "7f885510.6173fc", - "type": "tab", - "label": "Home", - "disabled": false, - "info": "" - }, - { - "id": "55a31f5b.d4ec5", - "type": "tab", - "label": "Static Observation", - "disabled": false, - "info": "" - }, - { - "id": "c04dcc2a.47862", - "type": "tab", - "label": "Fluidic Acquisition", - "disabled": false, - "info": "" - }, - { - "id": "300f077.33624f8", - "type": "tab", - "label": "Segmentation", - "disabled": false, - "info": "" - }, - { - "id": "121f01ae.4c4abe", - "type": "tab", - "label": "Dashboard Control", - "disabled": false, - "info": "" - }, - { - "id": "56d9742b.9ed99c", - "type": "ui_base", - "theme": { - "name": "theme-dark", - "lightTheme": { - "default": "#0094CE", - "baseColor": "#0094CE", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": false, - "reset": false - }, - "darkTheme": { - "default": "#097479", - "baseColor": "#097479", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "customTheme": { - "name": "Untitled Theme 1", - "default": "#4B7930", - "baseColor": "#4B7930", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - }, - "themeState": { - "base-color": { - "default": "#097479", - "value": "#097479", - "edited": false - }, - "page-titlebar-backgroundColor": { - "value": "#097479", - "edited": false - }, - "page-backgroundColor": { - "value": "#111111", - "edited": false - }, - "page-sidebar-backgroundColor": { - "value": "#000000", - "edited": false - }, - "group-textColor": { - "value": "#0eb8c0", - "edited": false - }, - "group-borderColor": { - "value": "#555555", - "edited": false - }, - "group-backgroundColor": { - "value": "#333333", - "edited": false - }, - "widget-textColor": { - "value": "#eeeeee", - "edited": false - }, - "widget-backgroundColor": { - "value": "#097479", - "edited": false - }, - "widget-borderColor": { - "value": "#333333", - "edited": false - }, - "base-font": { - "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - } - }, - "angularTheme": { - "primary": "indigo", - "accents": "blue", - "warn": "red", - "background": "grey" - } - }, - "site": { - "name": "Node-RED Dashboard", - "hideToolbar": "false", - "allowSwipe": "false", - "lockMenu": "false", - "allowTempTheme": "true", - "dateFormat": "DD/MM/YYYY", - "sizes": { - "sx": 48, - "sy": 48, - "gx": 6, - "gy": 6, - "cx": 6, - "cy": 6, - "px": 0, - "py": 0 - } - } - }, - { - "id": "c18fae15.516ce", - "type": "ui_tab", - "z": "", - "name": "Home", - "icon": "dashboard", - "order": 1, - "disabled": false, - "hidden": false - }, - { - "id": "29a78fc9.b034c", - "type": "ui_group", - "z": "", - "name": "Static Observation", - "tab": "c18fae15.516ce", - "order": 1, - "disp": false, - "width": "12", - "collapse": false - }, - { - "id": "10d36e29.c78b42", - "type": "ui_group", - "z": "", - "name": "Fluidic Acquisition", - "tab": "c18fae15.516ce", - "order": 2, - "disp": false, - "width": "12", - "collapse": false - }, - { - "id": "8c1b4542.a177a8", - "type": "ui_group", - "z": "", - "name": "Segmentation", - "tab": "c18fae15.516ce", - "order": 3, - "disp": false, - "width": "12", - "collapse": false - }, - { - "id": "edb89598.853498", - "type": "ui_group", - "z": "", - "name": "Gallery", - "tab": "c18fae15.516ce", - "order": 4, - "disp": false, - "width": "12", - "collapse": false - }, - { - "id": "98e9fd1a.1bbe5", - "type": "ui_tab", - "z": "", - "name": "Static Observation", - "icon": "dashboard", - "order": 2, - "disabled": false, - "hidden": false - }, - { - "id": "2e62c9a8.c191f6", - "type": "ui_tab", - "z": "", - "name": "Fluidic Acquisition", - "icon": "", - "order": 3, - "disabled": false, - "hidden": false - }, - { - "id": "609b39b5.d91f28", - "type": "ui_tab", - "z": "", - "name": "Segmentation", - "icon": "dashboard", - "order": 4, - "disabled": false, - "hidden": false - }, - { - "id": "b253b89c.1c4458", - "type": "ui_tab", - "z": "", - "name": "Dashboard Control", - "icon": "dashboard", - "order": 5, - "disabled": false, - "hidden": false - }, - { - "id": "498d73e3.d1c94c", - "type": "ui_group", - "name": "Group 1", - "tab": "98e9fd1a.1bbe5", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "72fe0cc7.df9fd4", - "type": "ui_group", - "name": "Group 1", - "tab": "2e62c9a8.c191f6", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "54c8e6e0.223fc8", - "type": "ui_group", - "name": "Group 1", - "tab": "609b39b5.d91f28", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "5841eafd.95e5e4", - "type": "ui_group", - "name": "Group 1", - "tab": "b253b89c.1c4458", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "df3ac001.1d82a", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "", - "group": "29a78fc9.b034c", - "order": 1, - "width": 12, - "height": 6, - "passthru": false, - "label": "Static Observation", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Static Observation", - "x": 210, - "y": 260, - "wires": [ - [ - "82696634.821678" - ] - ] - }, - { - "id": "113ae8d3.b52867", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "", - "group": "8c1b4542.a177a8", - "order": 1, - "width": 12, - "height": 6, - "passthru": false, - "label": "Segmentation", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Segmentation", - "x": 220, - "y": 300, - "wires": [ - [ - "82696634.821678" - ] - ] - }, - { - "id": "ec028844.198c98", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "", - "group": "10d36e29.c78b42", - "order": 1, - "width": 12, - "height": 6, - "passthru": false, - "label": "Fluidic Acquisition", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Fluidic Acquisition", - "x": 210, - "y": 340, - "wires": [ - [ - "82696634.821678" - ] - ] - }, - { - "id": "47a9f575.dc2c8c", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "", - "group": "edb89598.853498", - "order": 1, - "width": 12, - "height": 6, - "passthru": false, - "label": "Dashboard Control", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Dashboard Control", - "x": 270, - "y": 380, - "wires": [ - [ - "82696634.821678" - ] - ] - }, - { - "id": "c0f2a501.1677c8", - "type": "ui_ui_control", - "z": "7f885510.6173fc", - "name": "", - "events": "change", - "x": 540, - "y": 260, - "wires": [ - [] - ] - }, - { - "id": "c52be0d9.e6412", - "type": "ui_button", - "z": "55a31f5b.d4ec5", - "name": "", - "group": "498d73e3.d1c94c", - "order": 0, - "width": 0, - "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "66e609a2.2d57d8" - ] - ] - }, - { - "id": "82696634.821678", - "type": "function", - "z": "7f885510.6173fc", - "name": "swtich tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 400, - "y": 260, - "wires": [ - [ - "c0f2a501.1677c8" - ] - ] - }, - { - "id": "8059df68.0963c", - "type": "ui_ui_control", - "z": "55a31f5b.d4ec5", - "name": "", - "events": "change", - "x": 380, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "66e609a2.2d57d8", - "type": "function", - "z": "55a31f5b.d4ec5", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "8059df68.0963c" - ] - ] - }, - { - "id": "f8c2a4c7.928f88", - "type": "ui_button", - "z": "c04dcc2a.47862", - "name": "", - "group": "72fe0cc7.df9fd4", - "order": 0, - "width": 0, - "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "6715b713.0ea1e8" - ] - ] - }, - { - "id": "16edbf14.c67bb1", - "type": "ui_ui_control", - "z": "c04dcc2a.47862", - "name": "", - "events": "change", - "x": 380, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "6715b713.0ea1e8", - "type": "function", - "z": "c04dcc2a.47862", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "16edbf14.c67bb1" - ] - ] - }, - { - "id": "e46b58fd.671568", - "type": "ui_button", - "z": "300f077.33624f8", - "name": "", - "group": "54c8e6e0.223fc8", - "order": 0, - "width": 0, - "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "5c885d69.f82f74" - ] - ] - }, - { - "id": "c492a6c.3ff6558", - "type": "ui_ui_control", - "z": "300f077.33624f8", - "name": "", - "events": "change", - "x": 380, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "5c885d69.f82f74", - "type": "function", - "z": "300f077.33624f8", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "c492a6c.3ff6558" - ] - ] - }, - { - "id": "cb7440f4.3efff", - "type": "ui_button", - "z": "121f01ae.4c4abe", - "name": "", - "group": "5841eafd.95e5e4", - "order": 0, - "width": 0, - "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "b0b1ec9.5371e1" - ] - ] - }, - { - "id": "a4505700.60eb18", - "type": "ui_ui_control", - "z": "121f01ae.4c4abe", - "name": "", - "events": "change", - "x": 380, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "b0b1ec9.5371e1", - "type": "function", - "z": "121f01ae.4c4abe", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "a4505700.60eb18" - ] - ] - } -] diff --git a/flows/flows_planktonscope.json b/flows/flows_planktonscope.json deleted file mode 100644 index f7cec23..0000000 --- a/flows/flows_planktonscope.json +++ /dev/null @@ -1,1747 +0,0 @@ -[ - { - "id": "7f885510.6173fc", - "type": "tab", - "label": "Flow 1", - "disabled": false, - "info": "" - }, - { - "id": "955fdac.f54f328", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "c627ea8d.f886e8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_ship", - "x": 170, - "y": 100, - "wires": [ - [ - "3dd9a121.e386de" - ] - ] - }, - { - "id": "dfb29406.d68148", - "type": "ui_dropdown", - "z": "7f885510.6173fc", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "c627ea8d.f886e8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "Plankton net", - "value": "net", - "type": "str" - }, - { - "label": "Niskin bottle 12L", - "value": "niskin_12L", - "type": "str" - }, - { - "label": "Niskin bottle 24L", - "value": "niskin_24L", - "type": "str" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 130, - "y": 220, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "bfce92c6.5f66a", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "c627ea8d.f886e8", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 150, - "y": 180, - "wires": [ - [ - "3dd9a121.e386de" - ] - ] - }, - { - "id": "bae9c122.3612f", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "c627ea8d.f886e8", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_project", - "x": 160, - "y": 40, - "wires": [ - [ - "3dd9a121.e386de", - "a8cb0c6e.7220d" - ] - ] - }, - { - "id": "eb39c21c.a3fec", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "object_lat", - "label": "Lattitude (decimal degrees)", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 7, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "object_lat", - "x": 1020, - "y": 320, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "404b41a5.ae3d5", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "object_lon", - "label": "Longitude (decimal degrees)", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 8, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "object_lon", - "x": 1010, - "y": 360, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "d90c72f2.cf1ca", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "sample_id", - "label": "Name of the station*", - "tooltip": "", - "group": "c627ea8d.f886e8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_id", - "x": 170, - "y": 140, - "wires": [ - [ - "3dd9a121.e386de" - ] - ] - }, - { - "id": "3300f426.cc515c", - "type": "ui_dropdown", - "z": "7f885510.6173fc", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "832434ce.ebe498", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 1030, - "y": 40, - "wires": [ - [ - "de455648.b432f8" - ] - ] - }, - { - "id": "72d57e31.59234", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "Magnification", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n Magnification : X\n \n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1590, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "98a4bc0a.f3304", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "77a6994b.e3efb8", - "name": "Instrument", - "order": 1, - "width": 0, - "height": 0, - "format": "
\n Instrument :\n \n PlanktonScope V2.1\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 170, - "y": 480, - "wires": [ - [] - ] - }, - { - "id": "53b3cb43.2acf04", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "77a6994b.e3efb8", - "name": "Software", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n Software :\n \n Node-RED Dashboard\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 180, - "y": 520, - "wires": [ - [] - ] - }, - { - "id": "1a0a45f1.2cd7da", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "77a6994b.e3efb8", - "name": "Camera", - "order": 3, - "width": 0, - "height": 0, - "format": "
\n Camera :\n \n Pi Camera v2.1\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 180, - "y": 560, - "wires": [ - [] - ] - }, - { - "id": "de455648.b432f8", - "type": "function", - "z": "7f885510.6173fc", - "name": "calculate", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1220, - "y": 40, - "wires": [ - [ - "c83fc403.8ba2d8", - "48d9cc9c.852214", - "44969aec.4e87e4", - "a1201a.dc3f8fe8", - "89b9399b.9389a8" - ] - ] - }, - { - "id": "f3aa18d.65f0de8", - "type": "ui_dropdown", - "z": "7f885510.6173fc", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "a72a9ec6.bb144", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 170, - "y": 280, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "45568fe8.67759", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "a72a9ec6.bb144", - "order": 2, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 140, - "y": 320, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "918b69e2.7e6e88", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "a72a9ec6.bb144", - "order": 3, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 140, - "y": 360, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "86d762dc.47911", - "type": "ui_switch", - "z": "7f885510.6173fc", - "name": "light_state", - "label": "Light", - "tooltip": "", - "group": "c62ffbd3.787ef8", - "order": 1, - "width": 2, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "x": 510, - "y": 160, - "wires": [ - [ - "b5a366b4.cb6918" - ] - ] - }, - { - "id": "b5a366b4.cb6918", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/light.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "light.py", - "x": 820, - "y": 160, - "wires": [ - [], - [], - [] - ], - "icon": "node-red/light.svg" - }, - { - "id": "5ea28a70.42ae14", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "up", - "group": "c62ffbd3.787ef8", - "order": 3, - "width": 1, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_upwards", - "payload": "up", - "payloadType": "str", - "topic": "up", - "x": 530, - "y": 280, - "wires": [ - [ - "523fdeaa.50c6c" - ] - ] - }, - { - "id": "27f16831.dde938", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "down", - "group": "c62ffbd3.787ef8", - "order": 5, - "width": 1, - "height": 1, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_downward", - "payload": "down", - "payloadType": "str", - "topic": "down", - "x": 530, - "y": 360, - "wires": [ - [ - "523fdeaa.50c6c" - ] - ] - }, - { - "id": "b110542b.5de4f8", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "kill_focus", - "group": "c62ffbd3.787ef8", - "order": 6, - "width": 2, - "height": 1, - "passthru": false, - "label": "Cancel focus", - "tooltip": "", - "color": "#AD1625", - "bgcolor": "#333333", - "icon": "pause", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 520, - "y": 400, - "wires": [ - [ - "d9dea2bc.47097" - ] - ] - }, - { - "id": "523fdeaa.50c6c", - "type": "function", - "z": "7f885510.6173fc", - "name": "focus", - "func": "if(msg.topic === \"nb_step\"){\n nb_step = msg.payload;\n global.set(\"nb_step\",nb_step);\n}\nif(msg.topic === \"up\"){\n\n nb_step = global.get(\"nb_step\");\n\n orientation = \"up\";\n\n msg.payload = String(nb_step).concat(' ', orientation);\n return msg;\n}\nif(msg.topic === \"down\"){\n \n nb_step = global.get(\"nb_step\");\n\n orientation = \"down\";\n msg.payload = String(nb_step).concat(' ', orientation);\n\n return msg;\n}\n\n", - "outputs": 1, - "noerr": 0, - "x": 670, - "y": 320, - "wires": [ - [ - "ada728bd.8e7818" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "ada728bd.8e7818", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/focus.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "focus.py", - "x": 820, - "y": 320, - "wires": [ - [], - [], - [] - ], - "icon": "node-red/sort.svg" - }, - { - "id": "d9dea2bc.47097", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash $HOME/PlanktonScope/scripts/killer.sh focus.py && bash $HOME/PlanktonScope/scripts/killer.sh focus.py", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Kill Focus", - "x": 820, - "y": 400, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-stop" - }, - { - "id": "2d0f6720.0f92f8", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "Pi Camera settings", - "order": 7, - "width": 0, - "height": 0, - "format": "\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1010, - "y": 100, - "wires": [ - [] - ] - }, - { - "id": "9599b953.529c28", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "process_pixel", - "order": 3, - "width": 0, - "height": 0, - "format": "
\n Pixel resolution :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1600, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "612e2b9b.ed1684", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "min_size", - "order": 4, - "width": 0, - "height": 0, - "format": "
\n Smallest cells to explore :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1580, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "f84ab57a.556df8", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "max_size", - "order": 5, - "width": 0, - "height": 0, - "format": "
\n Biggest cells to explore :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1580, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "45f53656.d631e8", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "flowrate", - "order": 6, - "width": 0, - "height": 0, - "format": "
\n Suggested flowrate :\n \n ml/min\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1580, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "53ec5f97.7567c", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "3d740a07.4674e6", - "name": "Stream Pi Camera", - "order": 1, - "width": 0, - "height": 0, - "format": "
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 570, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "c84f1718.4af6b8", - "type": "ui_switch", - "z": "7f885510.6173fc", - "name": "fan_state", - "label": "Fan", - "tooltip": "", - "group": "c62ffbd3.787ef8", - "order": 2, - "width": 2, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "x": 520, - "y": 220, - "wires": [ - [ - "dec2b84a.6faa18" - ] - ] - }, - { - "id": "dec2b84a.6faa18", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/fan.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "fan.py", - "x": 810, - "y": 220, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-spinner" - }, - { - "id": "477dc1bd.c3de8", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "a61f7be8.af6418", - "order": 1, - "width": 4, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "acq_id", - "x": 530, - "y": 680, - "wires": [ - [ - "263878b3.e0a478" - ] - ] - }, - { - "id": "3dd9a121.e386de", - "type": "function", - "z": "7f885510.6173fc", - "name": "set global", - "func": "var value = msg.payload.split(' ').join('_');\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 340, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "c83fc403.8ba2d8", - "type": "function", - "z": "7f885510.6173fc", - "name": "get magnification", - "func": "var magnification = global.get(\"magnification\");\nmsg.payload = magnification;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1410, - "y": 40, - "wires": [ - [ - "72d57e31.59234" - ] - ] - }, - { - "id": "48d9cc9c.852214", - "type": "function", - "z": "7f885510.6173fc", - "name": "get process_pixel", - "func": "var process_pixel = global.get(\"process_pixel\");\nmsg.payload = process_pixel;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1410, - "y": 80, - "wires": [ - [ - "9599b953.529c28" - ] - ] - }, - { - "id": "44969aec.4e87e4", - "type": "function", - "z": "7f885510.6173fc", - "name": "get sug_min", - "func": "var sug_min = global.get(\"sug_min\");\nmsg.payload = sug_min;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1390, - "y": 120, - "wires": [ - [ - "612e2b9b.ed1684" - ] - ] - }, - { - "id": "a1201a.dc3f8fe8", - "type": "function", - "z": "7f885510.6173fc", - "name": "get sug_max", - "func": "var sug_max = global.get(\"sug_max\");\nmsg.payload = sug_max;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1390, - "y": 160, - "wires": [ - [ - "f84ab57a.556df8" - ] - ] - }, - { - "id": "89b9399b.9389a8", - "type": "function", - "z": "7f885510.6173fc", - "name": "get flowrate", - "func": "var sug_flowrate = global.get(\"sug_flowrate\");\nmsg.payload = sug_flowrate\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1390, - "y": 200, - "wires": [ - [ - "45f53656.d631e8" - ] - ] - }, - { - "id": "c650b922.6adef8", - "type": "function", - "z": "7f885510.6173fc", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 1180, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "e4c54d5a.19ff3", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_year", - "label": "/", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 3, - "width": 2, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_year", - "format": "{{value}}", - "min": "19", - "max": "50", - "step": 1, - "x": 1010, - "y": 480, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "b45db708.cedec8", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_month", - "label": "/", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 2, - "width": 2, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_month", - "format": "{{value}}", - "min": "1", - "max": "12", - "step": 1, - "x": 1000, - "y": 440, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "6351d257.6d7f1c", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_day", - "label": "Date*", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 1, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_day", - "format": "{{value}}", - "min": "1", - "max": "31", - "step": 1, - "x": 1010, - "y": 400, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "9ee03294.39987", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_hour", - "label": "Time*", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 4, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_hour", - "format": "{{value}}", - "min": "0", - "max": "24", - "step": 1, - "x": 1010, - "y": 520, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "5bd11314.ae6e4c", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_minute", - "label": ":", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 5, - "width": 2, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_minute", - "format": "{{value}}", - "min": "0", - "max": "59", - "step": 1, - "x": 1000, - "y": 560, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "8861710f.55b92", - "type": "function", - "z": "7f885510.6173fc", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 340, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "a8cb0c6e.7220d", - "type": "function", - "z": "7f885510.6173fc", - "name": "store generic", - "func": "global.set(\"acq_instrument\",\"PlanktonScope V2.1\");\nglobal.set(\"acq_software\",\"Node-RED Dashboard\");\nglobal.set(\"acq_camera\",\"Pi Camera V2.1\");\nglobal.set(\"acq_instrument_ID\",\"Odezenne\");", - "outputs": 1, - "noerr": 0, - "x": 350, - "y": 420, - "wires": [ - [] - ] - }, - { - "id": "263878b3.e0a478", - "type": "function", - "z": "7f885510.6173fc", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 680, - "y": 660, - "wires": [ - [] - ] - }, - { - "id": "4b3ea5bd.03248c", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "backward", - "group": "c62ffbd3.787ef8", - "order": 7, - "width": 3, - "height": 1, - "passthru": false, - "label": "Backward", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_back", - "payload": "backward", - "payloadType": "str", - "topic": "backward", - "x": 520, - "y": 460, - "wires": [ - [ - "84fd85fd.426878" - ] - ] - }, - { - "id": "cfe9783a.286438", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "foward", - "group": "c62ffbd3.787ef8", - "order": 9, - "width": 3, - "height": 1, - "passthru": true, - "label": "Forward", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_forward", - "payload": "foward", - "payloadType": "str", - "topic": "foward", - "x": 530, - "y": 540, - "wires": [ - [ - "84fd85fd.426878" - ] - ] - }, - { - "id": "83d75b6b.6afa28", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "kill_pump", - "group": "c62ffbd3.787ef8", - "order": 10, - "width": 2, - "height": 1, - "passthru": false, - "label": "Cancel pump", - "tooltip": "", - "color": "#AD1625", - "bgcolor": "#333333", - "icon": "pause", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 520, - "y": 580, - "wires": [ - [ - "8fc930df.c7ae6" - ] - ] - }, - { - "id": "84fd85fd.426878", - "type": "function", - "z": "7f885510.6173fc", - "name": "pump", - "func": "if(msg.topic === \"volume\"){\n volume = msg.payload;\n global.set(\"volume\",volume);\n}\nif(msg.topic === \"foward\"){\n\n volume = global.get(\"volume\");\n flowrate = global.get(\"flowrate\");\n\n action = \" foward\";\n\n msg.payload = String(volume).concat(' ',flowrate, action);\n return msg;\n}\nif(msg.topic === \"backward\"){\n \n volume = global.get(\"volume\");\n flowrate = global.get(\"flowrate\");\n\n action = \" backward\";\n msg.payload = String(volume).concat(' ',flowrate, action);\n\n return msg;\n}\n\n", - "outputs": 1, - "noerr": 0, - "x": 670, - "y": 500, - "wires": [ - [ - "649f7ec8.06a84" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "649f7ec8.06a84", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/pump.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "pump.py", - "x": 820, - "y": 500, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-rotate-left" - }, - { - "id": "8fc930df.c7ae6", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash $HOME/PlanktonScope/scripts/killer.sh pump.py && bash $HOME/PlanktonScope/scripts/killer.sh pump.py", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Kill Pump", - "x": 820, - "y": 580, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-stop" - }, - { - "id": "6bf10b4c.c83c84", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "start", - "group": "a61f7be8.af6418", - "order": 2, - "width": 4, - "height": 1, - "passthru": false, - "label": "Start Acquisition", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "play_circle_fill", - "payload": "", - "payloadType": "str", - "topic": "start", - "x": 530, - "y": 760, - "wires": [ - [ - "3fe055c2.6ab7da", - "82c90711.145108", - "e1dbc623.8df898", - "5a95f150.76ab3" - ] - ] - }, - { - "id": "2c9498e7.bf0c38", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "cancel", - "group": "a61f7be8.af6418", - "order": 3, - "width": 4, - "height": 1, - "passthru": false, - "label": "Cancel Acquisition", - "tooltip": "", - "color": "#AD1625", - "bgcolor": "#333333", - "icon": "pause_circle_filled", - "payload": "", - "payloadType": "str", - "topic": "cancel", - "x": 530, - "y": 980, - "wires": [ - [ - "f2acb5e0.c2c898", - "2bfa509a.9fc06", - "a2a07a68.274a78", - "4cd6d848.672778" - ] - ] - }, - { - "id": "b0fda998.f0ad48", - "type": "file", - "z": "7f885510.6173fc", - "name": "logs.json", - "filename": "/var/www/logs.json", - "appendNewline": true, - "createDir": false, - "overwriteFile": "false", - "encoding": "none", - "x": 820, - "y": 760, - "wires": [ - [] - ] - }, - { - "id": "3fe055c2.6ab7da", - "type": "function", - "z": "7f885510.6173fc", - "name": "get global", - "func": "msg.payload = {\n \"sample\":{\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \"sample_hour\":global.get(\"sample_hour\"),\n \"sample_minute\":global.get(\"sample_minute\"),\n \"sample_day\":global.get(\"sample_day\"),\n \"sample_month\":global.get(\"sample_month\"),\n \"sample_year\":global.get(\"sample_year\")\n },\n \"object\":{\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\")\n },\n \"acquisition\":{\n \"acq_id\":global.get(\"acq_id\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \"acq_camera\":global.get(\"acq_camera\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_instrument_ID\":global.get(\"acq_instrument_ID\")\n },\n \"process\":{\n \"process_pixel\":global.get(\"process_pixel\")\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 680, - "y": 760, - "wires": [ - [ - "b0fda998.f0ad48" - ] - ] - }, - { - "id": "f2acb5e0.c2c898", - "type": "exec", - "z": "7f885510.6173fc", - "command": "sed -ie '$d' /home/pi/PlanktonScope/logs.json", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Remove last log", - "x": 700, - "y": 1000, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-close" - }, - { - "id": "2bfa509a.9fc06", - "type": "link out", - "z": "7f885510.6173fc", - "name": "cancel_pump", - "links": [ - "eadbf812.3ea798" - ], - "x": 635, - "y": 940, - "wires": [] - }, - { - "id": "eadbf812.3ea798", - "type": "link in", - "z": "7f885510.6173fc", - "name": "", - "links": [ - "2bfa509a.9fc06" - ], - "x": 715, - "y": 600, - "wires": [ - [ - "8fc930df.c7ae6" - ] - ] - }, - { - "id": "217d8bc.8fb7374", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "79767bcc.30bb94", - "name": "Instructions", - "order": 1, - "width": 0, - "height": 0, - "format": "

In case you forget dude but it's important to read this whenever you are not sure before clicking on any buttons.

\n
\n

Focusing :

\n

To focus, you need to specify a value for the number of steps. Then, you can click once but wait while the stage is moving.

\n

To cancel a focusing, click once on CANCEL FOCUS.

\n
\n

Pumping manually :

\n

To focus, you need to specify a value for the volume. Then, you can click once in order to pump manually a defined volume in a certain direction.

\n

To cancel a pumping event, click once on CANCEL PUMP.

\n

Do not run an acquisition if you are using the pump manually.

\n
\n

Start Acquisition :

\n

Taking images will requires few inputs :

\n
    \n
  1. Name of the project
  2. \n
  3. Name of the station
  4. \n
  5. Acquisition ID
  6. \n
  7. Volume
  8. \n
  9. M12 Lens
  10. \n
\n

If any of the previous settings are missing, it's going to be a real mess and delete previous acquisition. So check twice here !!

\n

The other inputs are always welcome ;)

\n
\n

Cancel Acquisition :

\n

I made this button CANCEL ACQUISITION to cancel an acquisition which maybe be fucked.

\n

Image you click it, it's going to delete the folder in which you save this acquisition, meaning execute :

\n

 

\nrm -r  /var/www/Name_of_the_project/Name_of_the_station/Acquisition_ID\n

 

\n

So if you made a great acquisition, then run a new one with the same input for Acquisition ID and finally click on this button, you are going to delete them both.

\n

Don't use it if you don't need it and please never click twice because the pi might burn.

\n
\n

ssh :

\n

To access the inside of the pi, you can use ssh from from terminal once your are connected to the WiFi by typing this command : ssh -Y planktonscope@192.168.4.1

\n

 

\n

The Password is : raspberry

\n
\n

Data :

\n

In order to access your acquisitions, you can either click on this link or get to the directory via ssh : /var/www/

\n
\n

In order to access the script via ssh, you can get to the directory : /home/pi/PlanktonScope/

\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 570, - "y": 1180, - "wires": [ - [] - ] - }, - { - "id": "82c90711.145108", - "type": "function", - "z": "7f885510.6173fc", - "name": "image", - "func": "var sample_project= global.get(\"sample_project\");\nvar sample_id= global.get(\"sample_id\");\nvar acq_id= global.get(\"acq_id\");\nvar volume= global.get(\"volume\");\nvar flowrate= global.get(\"flowrate\");\nmsg.payload = \"/var/www/\"+sample_project+\"/\"+sample_id+\"/\"+acq_id+\" \"+volume+\" \"+flowrate\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 670, - "y": 800, - "wires": [ - [ - "38c8440d.d0139c" - ] - ] - }, - { - "id": "1e9ae141.a0729f", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/image.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "image.py", - "x": 960, - "y": 800, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-file-image-o" - }, - { - "id": "7d2d5235.35f5ec", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash /home/pi/PlanktonScope/scripts/kill_image.sh", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Kill Image", - "x": 840, - "y": 1060, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "a2a07a68.274a78", - "type": "function", - "z": "7f885510.6173fc", - "name": "get global", - "func": "var in_path= global.get(\"in_path\");\nvar sample_project= global.get(\"sample_project\");\nvar sample_id= global.get(\"sample_id\");\nvar acq_id= global.get(\"acq_id\");\nmsg.payload = \"/var/www/\"+sample_project+\"/\"+sample_id+\"/\"+acq_id\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 680, - "y": 1060, - "wires": [ - [ - "7d2d5235.35f5ec" - ] - ] - }, - { - "id": "e1dbc623.8df898", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash /home/pi/RPi_Cam_Web_Interface/stop.sh", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Stop RPi Web Interface", - "x": 730, - "y": 860, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "597635eb.72154c", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash /home/pi/RPi_Cam_Web_Interface/start.sh", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Start RPi Web Interface", - "x": 890, - "y": 1120, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "4cd6d848.672778", - "type": "delay", - "z": "7f885510.6173fc", - "name": "", - "pauseType": "delay", - "timeout": "2", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 680, - "y": 1120, - "wires": [ - [ - "597635eb.72154c" - ] - ] - }, - { - "id": "38c8440d.d0139c", - "type": "delay", - "z": "7f885510.6173fc", - "name": "", - "pauseType": "delay", - "timeout": "2", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 820, - "y": 800, - "wires": [ - [ - "1e9ae141.a0729f" - ] - ] - }, - { - "id": "5a95f150.76ab3", - "type": "link out", - "z": "7f885510.6173fc", - "name": "start_pump", - "links": [ - "5da0773a.700338" - ], - "x": 635, - "y": 720, - "wires": [] - }, - { - "id": "5da0773a.700338", - "type": "link in", - "z": "7f885510.6173fc", - "name": "", - "links": [ - "5a95f150.76ab3" - ], - "x": 715, - "y": 540, - "wires": [ - [ - "649f7ec8.06a84" - ] - ] - }, - { - "id": "4b817fa7.d0d14", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "flowrate", - "label": "Flowrate (ml/min)*", - "tooltip": "", - "group": "a72a9ec6.bb144", - "order": 4, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "flowrate", - "format": "{{value}}", - "min": "0.3", - "max": "20", - "step": "0.1", - "x": 180, - "y": 400, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "42d9d2cb.9d3f84", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "nb_step", - "label": "nb step (30μm/step)", - "tooltip": "", - "group": "c62ffbd3.787ef8", - "order": 4, - "width": 4, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "nb_step", - "format": "{{value}}", - "min": "1", - "max": "5000", - "step": 1, - "x": 520, - "y": 320, - "wires": [ - [ - "523fdeaa.50c6c" - ] - ] - }, - { - "id": "4287fe47.26a63", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "volume", - "label": "Volume (ml)*", - "tooltip": "", - "group": "c62ffbd3.787ef8", - "order": 8, - "width": 4, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "volume", - "format": "{{value}}", - "min": "1", - "max": "5000", - "step": 1, - "x": 520, - "y": 500, - "wires": [ - [ - "84fd85fd.426878" - ] - ] - }, - { - "id": "c627ea8d.f886e8", - "type": "ui_group", - "z": "", - "name": "Sample", - "tab": "6b01f851.598028", - "order": 1, - "disp": true, - "width": 6, - "collapse": false - }, - { - "id": "106f0e1b.6478a2", - "type": "ui_group", - "z": "", - "name": "Spatio Temporal", - "tab": "6b01f851.598028", - "order": 6, - "disp": true, - "width": 7, - "collapse": false - }, - { - "id": "832434ce.ebe498", - "type": "ui_group", - "z": "", - "name": "Optic Settings", - "tab": "6b01f851.598028", - "order": 3, - "disp": true, - "width": "7", - "collapse": false - }, - { - "id": "77a6994b.e3efb8", - "type": "ui_group", - "z": "", - "name": "Generic info", - "tab": "6b01f851.598028", - "order": 7, - "disp": true, - "width": 6, - "collapse": false - }, - { - "id": "a72a9ec6.bb144", - "type": "ui_group", - "z": "", - "name": "Fluidic settings", - "tab": "6b01f851.598028", - "order": 4, - "disp": true, - "width": 6, - "collapse": false - }, - { - "id": "c62ffbd3.787ef8", - "type": "ui_group", - "z": "", - "name": "Controller", - "tab": "6b01f851.598028", - "order": 5, - "disp": true, - "width": "12", - "collapse": false - }, - { - "id": "3d740a07.4674e6", - "type": "ui_group", - "z": "", - "name": "Preview", - "tab": "6b01f851.598028", - "order": 2, - "disp": true, - "width": 12, - "collapse": false - }, - { - "id": "a61f7be8.af6418", - "type": "ui_group", - "z": "", - "name": "Acquisition", - "tab": "6b01f851.598028", - "order": 8, - "disp": true, - "width": 12, - "collapse": false - }, - { - "id": "79767bcc.30bb94", - "type": "ui_group", - "z": "", - "name": "Reminder", - "tab": "6b01f851.598028", - "order": 9, - "disp": true, - "width": 27, - "collapse": false - }, - { - "id": "6b01f851.598028", - "type": "ui_tab", - "z": "", - "name": "PlanktonScope GUI v2.1", - "icon": "date_range", - "order": 1, - "disabled": false, - "hidden": false - } -] diff --git a/flows/flow_chaetoceros.json b/flows/main.json similarity index 55% rename from flows/flow_chaetoceros.json rename to flows/main.json index 17282c3..4106b23 100644 --- a/flows/flow_chaetoceros.json +++ b/flows/main.json @@ -1,475 +1,6 @@ [ { - "id": "259c8713.b50e28", - "type": "tab", - "label": "Main", - "disabled": false, - "info": "" - }, - { - "id": "173a6e6b.e5ca6a", - "type": "subflow", - "name": "sample metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "2582798f.eddcc6" - }, - { - "id": "1d28205b.58a37" - }, - { - "id": "1590a418.9166dc" - }, - { - "id": "d96f9fa3.d4cfc" - }, - { - "id": "784e2f78.9b96f" - } - ] - } - ], - "out": [ - { - "x": 840, - "y": 40, - "wires": [ - { - "id": "a163194f.0b17c8", - "port": 0 - }, - { - "id": "914752eb.af1b", - "port": 0 - }, - { - "id": "6d0d6fc7.d30bb", - "port": 0 - }, - { - "id": "458408d7.2b3b68", - "port": 0 - }, - { - "id": "43b12fe4.c5aa3", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "ae90e3e.7d9fba", - "type": "subflow", - "name": "Focus actuation", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "81a7627c.bac92" - } - ] - } - ], - "out": [ - { - "x": 800, - "y": 200, - "wires": [ - { - "id": "5f4a72d1.9f6adc", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "node-red/sort.svg" - }, - { - "id": "407d8cdb.3cb7cc", - "type": "subflow", - "name": "Pump actuation", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "d9a85435.ced5e" - }, - { - "id": "f859eeef.c59ed" - } - ] - } - ], - "out": [ - { - "x": 700, - "y": 40, - "wires": [ - { - "id": "59b05f7f.9e83f8", - "port": 0 - }, - { - "id": "309468bc.ac83f8", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "font-awesome/fa-recycle" - }, - { - "id": "bdd6e33e.5db3b8", - "type": "subflow", - "name": "acquisition metadata", - "info": "", - "category": "", - "in": [ - { - "x": 50, - "y": 30, - "wires": [ - { - "id": "47459dcd.81b594" - }, - { - "id": "eec199a3.a5a768" - }, - { - "id": "2d278f0a.1a97a" - }, - { - "id": "4074b907.e527e8" - }, - { - "id": "bc37aba3.0d1e78" - }, - { - "id": "d973d64a.8801e8" - }, - { - "id": "277b6764.edb1f8" - }, - { - "id": "75b10c7c.8433a4" - }, - { - "id": "bc39179c.bb3c08" - } - ] - } - ], - "out": [ - { - "x": 740, - "y": 40, - "wires": [ - { - "id": "6ecc9468.0271dc", - "port": 0 - }, - { - "id": "5866c9a4.e1ca88", - "port": 0 - }, - { - "id": "259fd49a.160a3c", - "port": 0 - }, - { - "id": "5aba848a.7a861c", - "port": 0 - }, - { - "id": "7cea16e.c42ace8", - "port": 0 - }, - { - "id": "66a3425c.79aabc", - "port": 0 - }, - { - "id": "fa47061e.34a218", - "port": 0 - }, - { - "id": "6f36bd6d.154d14", - "port": 0 - } - ] - }, - { - "x": 900, - "y": 360, - "wires": [ - { - "id": "f5c1aa13.3cfbf8", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "ad5a5663.ce893", - "type": "subflow", - "name": "object metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "21f41837.bb6c88" - }, - { - "id": "c2f235f2.eee388" - }, - { - "id": "2327c165.8397ae" - } - ] - } - ], - "out": [ - { - "x": 1060, - "y": 159, - "wires": [ - { - "id": "47c7db4d.5eb014", - "port": 0 - }, - { - "id": "20c46fd4.6b984", - "port": 0 - } - ] - }, - { - "x": 1060, - "y": 59, - "wires": [ - { - "id": "9b1b260f.e4b338", - "port": 0 - }, - { - "id": "86aa9817.45a2e8", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "35488f4f.00498", - "type": "subflow", - "name": "Commands", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#FFCC66", - "icon": "node-red-dashboard/ui_button.png" - }, - { - "id": "344146df.e4d5ba", - "type": "subflow", - "name": "Temperature regulation", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#FFCC66", - "icon": "font-awesome/fa-bolt" - }, - { - "id": "91e5fd54.56f58", - "type": "subflow", - "name": "MQTT Receive & Plot", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#F3B567", - "icon": "node-red/bridge.svg" - }, - { - "id": "4475ba6c.45604c", - "type": "subflow", - "name": "process metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 80, - "wires": [ - { - "id": "d899c841.e6c178" - } - ] - } - ], - "out": [ - { - "x": 700, - "y": 80, - "wires": [ - { - "id": "23e45d82.a01f82", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "b73d5eb8.60ef3", - "type": "subflow", - "name": "Valves actuation", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "3808d004.94ea28" - }, - { - "id": "69799a39.13803c" - }, - { - "id": "f7cc1192.5a51e8" - }, - { - "id": "10ce45f6.3036ca" - }, - { - "id": "70dfb6bb.9319" - }, - { - "id": "a0b53585.93216" - } - ] - } - ], - "out": [ - { - "x": 680, - "y": 40, - "wires": [ - { - "id": "c14cf94.1413e88", - "port": 0 - }, - { - "id": "7a0b6294.e887c4", - "port": 0 - }, - { - "id": "8729ec5c.cf4ab8", - "port": 0 - }, - { - "id": "d7b55d02.e41f1", - "port": 0 - }, - { - "id": "27bbe0f0.05b2c", - "port": 0 - }, - { - "id": "b31fd152.a5489", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "node-red-contrib-camerapi/photo.png" - }, - { - "id": "1b486ba8.f8c41c", - "type": "subflow", - "name": "Datetime update", - "info": "", - "category": "", - "in": [ - { - "x": 140, - "y": 80, - "wires": [ - { - "id": "48033b32.2bca94" - } - ] - } - ], - "out": [], - "env": [], - "color": "#DDAA99", - "icon": "font-awesome/fa-clock-o" - }, - { - "id": "66c23d37.f72cdc", - "type": "subflow", - "name": "MQQT Cmds", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 20, - "wires": [ - { - "id": "ca843dd8.d1c62" - } - ] - } - ], - "out": [], - "env": [], - "color": "#DDAA99" - }, - { - "id": "8d959937.18735", + "id": "97600dff.93378", "type": "subflow", "name": "Acquisition actuation", "info": "", @@ -480,1076 +11,1174 @@ "color": "#A6BBCF" }, { - "id": "cc8bc4eb.651868", - "type": "ui_base", - "theme": { - "name": "theme-dark", - "lightTheme": { - "default": "#0094CE", - "baseColor": "#5900ce", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "darkTheme": { - "default": "#097479", - "baseColor": "#059276", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "customTheme": { - "name": "Untitled Theme 1", - "default": "#4B7930", - "baseColor": "#4B7930", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - }, - "themeState": { - "base-color": { - "default": "#097479", - "value": "#059276", - "edited": true - }, - "page-titlebar-backgroundColor": { - "value": "#059276", - "edited": false - }, - "page-backgroundColor": { - "value": "#111111", - "edited": false - }, - "page-sidebar-backgroundColor": { - "value": "#ffffff", - "edited": false - }, - "group-textColor": { - "value": "#08dcb2", - "edited": false - }, - "group-borderColor": { - "value": "#555555", - "edited": false - }, - "group-backgroundColor": { - "value": "#333333", - "edited": false - }, - "widget-textColor": { - "value": "#eeeeee", - "edited": false - }, - "widget-backgroundColor": { - "value": "#059276", - "edited": false - }, - "widget-borderColor": { - "value": "#333333", - "edited": false - }, - "base-font": { - "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - } - }, - "angularTheme": { - "primary": "indigo", - "accents": "blue", - "warn": "red", - "background": "grey" - } - }, - "site": { - "name": "Node-RED Dashboard", - "hideToolbar": "false", - "allowSwipe": "false", - "lockMenu": "true", - "allowTempTheme": "true", - "dateFormat": "DD/MM/YYYY", - "sizes": { - "sx": 56, - "sy": 56, - "gx": 5, - "gy": 5, - "cx": 5, - "cy": 5, - "px": 5, - "py": 5 - } - } - }, - { - "id": "737ec584.2eea2c", - "type": "ui_tab", - "z": "", - "name": "GUI", - "icon": "fa-eyedropper", - "order": 2, - "disabled": false, - "hidden": false - }, - { - "id": "3e1ba03d.f01d8", - "type": "ui_group", - "z": "", - "name": "Sample metadata", - "tab": "737ec584.2eea2c", - "order": 2, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "cef1e703.bcf3c8", - "type": "ui_group", - "z": "", - "name": "Object metadata", - "tab": "737ec584.2eea2c", - "order": 6, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "fbd92986.1028c8", - "type": "ui_group", - "z": "", - "name": "Focus actuation", - "tab": "737ec584.2eea2c", - "order": 4, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "707d9797.c8e798", - "type": "ui_group", - "z": "", - "name": "Pump actuation", - "tab": "737ec584.2eea2c", - "order": 5, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "52159161.72187", - "type": "ui_group", - "z": "", - "name": "Acquisition metadata", - "tab": "737ec584.2eea2c", - "order": 7, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "8cfadfab.327d7", - "type": "ui_group", - "z": "", - "name": "MQTT Plots", - "tab": "737ec584.2eea2c", - "order": 11, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "b77ffa1b.942258", - "type": "mqtt-broker", - "z": "", + "id": "604c996b.1a8428", + "type": "ui_button", + "z": "97600dff.93378", "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "cb2f36fe.1c7038", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "c6a276ac.3eb74", - "type": "ui_group", - "z": "", - "name": "Commands", - "tab": "737ec584.2eea2c", - "order": 12, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "f5194cae.c84688", - "type": "ui_group", - "z": "", - "name": "Streaming camera", - "tab": "737ec584.2eea2c", - "order": 3, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "b1321ea9.cfcf28", - "type": "ui_group", - "z": "", - "name": "Process metadata", - "tab": "737ec584.2eea2c", - "order": 8, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "f41d0ecb.8be06", - "type": "ui_group", - "z": "", - "name": "Valve actuation", - "tab": "737ec584.2eea2c", - "order": 9, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "9214d59d.e7b52", - "type": "ui_group", - "z": "", - "name": "Datetime", - "tab": "737ec584.2eea2c", + "group": "cdb72118.692578", "order": 1, - "disp": true, - "width": "24", - "collapse": false + "width": 0, + "height": 0, + "passthru": false, + "label": "Start Acquisition", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "actuator/image", + "x": 200, + "y": 100, + "wires": [ + [ + "b854ad48.5869e8" + ] + ] }, { - "id": "d170ac9c.3b4828", + "id": "b854ad48.5869e8", + "type": "function", + "z": "97600dff.93378", + "name": "image.js", + "func": "state = global.get(\"state\");\nglobal.set('img_counter',0)\nglobal.set('obj_counter',0)\nif (state == null){state=\"free\"}\n\nvar sleep_before= global.get(\"custom_sleep_before\");\nvar nb_step= global.get(\"custom_nb_step\");\nvar nb_frame= global.get(\"custom_nb_frame\");\nvar segmentation= global.get(\"custom_segmentation\");\n\nif (sleep_before === undefined || sleep_before === \"\" || sleep_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before the acquisition\";\n \n}else if (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of step in between two frames\";\n \n}else if (nb_frame === undefined || nb_frame === \"\" || nb_frame === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of image to save\";\n \n}else if (segmentation === undefined || segmentation === \"\" || segmentation === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Realize or not the segmentation\";\n \n}else {\n nb_frame=nb_frame-1\n \n msg.payload=sleep_before+' '+nb_step+' '+nb_frame+' '+segmentation;\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 360, + "y": 100, + "wires": [ + [ + "84505b75.883a48" + ] + ], + "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" + }, + { + "id": "84505b75.883a48", + "type": "switch", + "z": "97600dff.93378", + "name": "", + "property": "topic", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "actuator/image", + "vt": "str" + }, + { + "t": "eq", + "v": "Missing entry :", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 510, + "y": 100, + "wires": [ + [ + "715a8f15.dc211" + ], + [ + "3173806b.bb0c7" + ] + ] + }, + { + "id": "3173806b.bb0c7", + "type": "ui_toast", + "z": "97600dff.93378", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 690, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "715a8f15.dc211", + "type": "mqtt out", + "z": "97600dff.93378", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 670, + "y": 80, + "wires": [] + }, + { + "id": "ed689faa.3a3e08", + "type": "ui_button", + "z": "97600dff.93378", + "name": "Stop Acquisition", + "group": "cdb72118.692578", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "label": "STOP ACQUISITION", + "tooltip": "", + "color": "", + "bgcolor": "#AD1625", + "icon": "", + "payload": "off", + "payloadType": "str", + "topic": "actuator/wait", + "x": 200, + "y": 140, + "wires": [ + [ + "f6bd3440.60d5a" + ] + ] + }, + { + "id": "f6bd3440.60d5a", + "type": "mqtt out", + "z": "97600dff.93378", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 350, + "y": 140, + "wires": [] + }, + { + "id": "3b827bf5.c7bc64", + "type": "mqtt out", + "z": "97600dff.93378", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 350, + "y": 180, + "wires": [] + }, + { + "id": "cdb72118.692578", "type": "ui_group", "z": "", "name": "Acquisition actuation", - "tab": "737ec584.2eea2c", + "tab": "2b97fe34.a699fa", "order": 10, "disp": true, "width": 24, "collapse": false }, { - "id": "5b1410c.f92017", - "type": "ui_spacer", - "name": "spacer", - "group": "8cfadfab.327d7", - "order": 3, - "width": 1, - "height": 1 - }, - { - "id": "26072b87.02a7a4", - "type": "ui_spacer", - "name": "spacer", - "group": "8cfadfab.327d7", - "order": 4, - "width": 1, - "height": 1 - }, - { - "id": "a8c8abef.b19ea", - "type": "ui_spacer", - "name": "spacer", - "group": "8cfadfab.327d7", - "order": 6, - "width": 1, - "height": 1 - }, - { - "id": "41550c87.dbb054", - "type": "ui_spacer", - "name": "spacer", - "group": "8cfadfab.327d7", - "order": 7, - "width": 1, - "height": 1 - }, - { - "id": "6d0d6fc7.d30bb", - "type": "ui_text_input", - "z": "173a6e6b.e5ca6a", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_ship", - "x": 590, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "43b12fe4.c5aa3", - "type": "ui_dropdown", - "z": "173a6e6b.e5ca6a", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "3e1ba03d.f01d8", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "options": [ + "id": "e8320d42.9a3ad8", + "type": "subflow", + "name": "MQQT Cmds", + "info": "", + "category": "", + "in": [ { - "label": "Plankton net", - "value": "net", - "type": "str" - }, - { - "label": "Niskin bottle 12L", - "value": "niskin_12L", - "type": "str" - }, - { - "label": "Niskin bottle 24L", - "value": "niskin_24L", - "type": "str" - }, - { - "label": "Pass Hull", - "value": "pass_hull", - "type": "str" + "x": 40, + "y": 40, + "wires": [ + { + "id": "cf9e02a2.3feff" + }, + { + "id": "18da28e6.7b000f" + } + ] } ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 550, - "y": 200, - "wires": [ - [] - ] + "out": [], + "env": [], + "color": "#DDAA99" }, { - "id": "458408d7.2b3b68", - "type": "ui_text_input", - "z": "173a6e6b.e5ca6a", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 570, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "a163194f.0b17c8", - "type": "ui_text_input", - "z": "173a6e6b.e5ca6a", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_project", - "x": 580, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "914752eb.af1b", - "type": "ui_text_input", - "z": "173a6e6b.e5ca6a", - "name": "sample_id", - "label": "ID of the station*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "sample_id", - "x": 590, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "e001a28.555566", - "type": "function", - "z": "259c8713.b50e28", - "name": "get global", - "func": "msg.payload={\n \n \"duration_bef_cycle\":global.get(\"duration_bef_cycle\"),\n \"duration_flush\":global.get(\"duration_flush\"),\n \"nb_img\":global.get(\"nb_img\"),\n \"duration_bef_seq\":global.get(\"duration_bef_seq\"),\n \"duration_bef_img\":global.get(\"duration_bef_img\"),\n \"duration_between\":global.get(\"duration_between\"),\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1180, - "y": 100, + "id": "a7301ba5.d56d48", + "type": "exec", + "z": "e8320d42.9a3ad8", + "command": "python3.7 /home/pi/PlanktonScope/script/main.py", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 910, + "y": 140, "wires": [ [ - "76a6e6bb.a08b98" + "87558394.4e589", + "a11158b1.b7649" + ], + [ + "87558394.4e589", + "a11158b1.b7649" + ], + [ + "87558394.4e589", + "a11158b1.b7649" ] ] }, { - "id": "f25890f5.f2549", - "type": "file", - "z": "259c8713.b50e28", + "id": "62b9a3b1.74dbc4", + "type": "exec", + "z": "e8320d42.9a3ad8", + "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, "name": "", - "filename": "/home/pi/PlanktonScope/config.txt", - "appendNewline": true, + "x": 610, + "y": 200, + "wires": [ + [ + "66fb9ed2.8ecd3" + ], + [], + [] + ] + }, + { + "id": "66fb9ed2.8ecd3", + "type": "exec", + "z": "e8320d42.9a3ad8", + "command": "kill", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 1050, + "y": 200, + "wires": [ + [ + "87558394.4e589", + "a11158b1.b7649" + ], + [ + "87558394.4e589", + "a11158b1.b7649" + ], + [ + "87558394.4e589", + "a11158b1.b7649" + ] + ] + }, + { + "id": "5df162d7.08eb34", + "type": "ui_button", + "z": "e8320d42.9a3ad8", + "name": "", + "group": "9c86b3b7.54841", + "order": 9, + "width": 12, + "height": 1, + "passthru": false, + "label": "Kill MQTT", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 80, + "y": 200, + "wires": [ + [ + "62b9a3b1.74dbc4" + ] + ] + }, + { + "id": "d16389e5.3bc67", + "type": "ui_button", + "z": "e8320d42.9a3ad8", + "name": "", + "group": "9c86b3b7.54841", + "order": 10, + "width": 12, + "height": 1, + "passthru": false, + "label": "Restart MQTT", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 100, + "y": 140, + "wires": [ + [ + "a7301ba5.d56d48" + ] + ] + }, + { + "id": "87558394.4e589", + "type": "ui_toast", + "z": "e8320d42.9a3ad8", + "position": "top right", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 1260, + "y": 140, + "wires": [] + }, + { + "id": "500abffa.c7a788", + "type": "file", + "z": "e8320d42.9a3ad8", + "name": "", + "filename": "/home/pi/PlanktonScope/script/main.py", + "appendNewline": false, "createDir": true, "overwriteFile": "true", "encoding": "none", - "x": 1520, + "x": 530, "y": 100, - "wires": [ - [] - ] - }, - { - "id": "f5c1aa13.3cfbf8", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "set optical config", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 750, - "y": 360, - "wires": [ - [] - ] - }, - { - "id": "eb9181d8.25e01", - "type": "ui_dropdown", - "z": "bdd6e33e.5db3b8", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "52159161.72187", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 526, - "y": 360, "wires": [ [ - "f5c1aa13.3cfbf8" + "a7301ba5.d56d48" ] ] }, { - "id": "5aba848a.7a861c", - "type": "ui_numeric", - "z": "bdd6e33e.5db3b8", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 8, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 536, - "y": 160, + "id": "985c65de.0801b", + "type": "template", + "z": "e8320d42.9a3ad8", + "name": "main.py", + "field": "payload", + "fieldType": "msg", + "format": "python", + "syntax": "plain", + "template": "################################################################################\n#Actuator Libraries\n################################################################################\n\n#Library for exchaning messages with Node-RED\nimport paho.mqtt.client as mqtt\n\n#Library to control the PiCamera\nfrom picamera import PiCamera\n\n#Libraries to control the steppers for focusing and pumping\nfrom adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\n\n#Library to send command over I2C for the light module on the fan\nimport smbus\n\n################################################################################\n#Practical Libraries\n################################################################################\n\n#Library to get date and time for folder name and filename\nfrom datetime import datetime, timedelta\n\n#Library to be able to sleep for a duration\nfrom time import sleep\n\n#Libraries manipulate json format, execute bash commands\nimport json, shutil, os, subprocess\n\n################################################################################\n#Morphocut Libraries\n################################################################################\n\nfrom skimage.util import img_as_ubyte\nfrom morphocut import Call\nfrom morphocut.contrib.ecotaxa import EcotaxaWriter\nfrom morphocut.contrib.zooprocess import CalculateZooProcessFeatures\nfrom morphocut.core import Pipeline\nfrom morphocut.file import Find\nfrom morphocut.image import (ExtractROI,\n FindRegions,\n ImageReader,\n ImageWriter,\n RescaleIntensity,\n RGB2Gray\n)\nfrom morphocut.stat import RunningMedian\nfrom morphocut.str import Format\nfrom morphocut.stream import TQDM, Enumerate, FilterVariables\n\n################################################################################\n#Other image processing Libraries\n################################################################################\n\nfrom skimage.feature import canny\nfrom skimage.color import rgb2gray, label2rgb\nfrom skimage.morphology import disk\nfrom skimage.morphology import erosion, dilation, closing\nfrom skimage.measure import label, regionprops\nimport cv2\n\n################################################################################\n#Streaming PiCamera over server\n################################################################################\nimport io\nimport picamera\nimport logging\nimport socketserver\nfrom threading import Condition\nfrom http import server\nimport threading\n\n################################################################################\n#Creation of the webpage containing the PiCamera Streaming\n################################################################################\n\nPAGE=\"\"\"\\\n\n\nPlanktonScope v2 | PiCamera Streaming\n\n\n\n\n\n\"\"\"\n\n################################################################################\n#Classes for the PiCamera Streaming\n################################################################################\n\nclass StreamingOutput(object):\n def __init__(self):\n self.frame = None\n self.buffer = io.BytesIO()\n self.condition = Condition()\n\n def write(self, buf):\n if buf.startswith(b'\\xff\\xd8'):\n # New frame, copy the existing buffer's content and notify all\n # clients it's available\n self.buffer.truncate()\n with self.condition:\n self.frame = self.buffer.getvalue()\n self.condition.notify_all()\n self.buffer.seek(0)\n return self.buffer.write(buf)\n\nclass StreamingHandler(server.BaseHTTPRequestHandler):\n def do_GET(self):\n if self.path == '/':\n self.send_response(301)\n self.send_header('Location', '/index.html')\n self.end_headers()\n elif self.path == '/index.html':\n content = PAGE.encode('utf-8')\n self.send_response(200)\n self.send_header('Content-Type', 'text/html')\n self.send_header('Content-Length', len(content))\n self.end_headers()\n self.wfile.write(content)\n elif self.path == '/stream.mjpg':\n self.send_response(200)\n self.send_header('Age', 0)\n self.send_header('Cache-Control', 'no-cache, private')\n self.send_header('Pragma', 'no-cache')\n self.send_header('Content-Type', 'multipart/x-mixed-replace; boundary=FRAME')\n self.end_headers()\n try:\n while True:\n with output.condition:\n output.condition.wait()\n frame = output.frame\n self.wfile.write(b'--FRAME\\r\\n')\n self.send_header('Content-Type', 'image/jpeg')\n self.send_header('Content-Length', len(frame))\n self.end_headers()\n self.wfile.write(frame)\n self.wfile.write(b'\\r\\n')\n except Exception as e:\n logging.warning(\n 'Removed streaming client %s: %s',\n self.client_address, str(e))\n else:\n self.send_error(404)\n self.end_headers()\n\nclass StreamingServer(socketserver.ThreadingMixIn, server.HTTPServer):\n allow_reuse_address = True\n daemon_threads = True\n\n################################################################################\n#MQTT core functions\n################################################################################\n\n#Run this function in order to connect to the client (Node-RED)\ndef on_connect(client, userdata, flags, rc):\n #Print when connected\n print(\"Connected! - \" + str(rc))\n #When connected, run subscribe()\n client.subscribe(\"actuator/#\")\n #Turn green the light module\n rgb(0,255,0)\n\n#Run this function in order to subscribe to all the topics begining by actuator\ndef on_subscribe(client, obj, mid, granted_qos):\n #Print when subscribed\n print(\"Subscribed! - \"+str(mid)+\" \"+str(granted_qos))\n\n#Run this command when Node-RED is sending a message on the subscribed topic\ndef on_message(client, userdata, msg):\n #Print the topic and the message\n print(msg.topic+\" \"+str(msg.qos)+\" \"+str(msg.payload))\n #Update the global variables command, args and counter\n global command\n global args\n global counter\n #Parse the topic to find the command. ex : actuator/pump -> pump\n command=msg.topic.split(\"/\")[1]\n #Decode the message to find the arguments\n args=str(msg.payload.decode())\n #Reset the counter to 0\n counter=0\n\n################################################################################\n#LEDs Actuation\n################################################################################\ndef rgb(R,G,B):\n #Update LED n1\n bus.write_byte_data(0x0d, 0x00, 0)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update LED n2\n bus.write_byte_data(0x0d, 0x00, 1)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update LED n3\n bus.write_byte_data(0x0d, 0x00, 2)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update the I2C Bus in order to really update the LEDs new values\n cmd=\"i2cdetect -y 1\"\n subprocess.Popen(cmd.split(),stdout=subprocess.PIPE)\n\n################################################################################\n#Init function - executed only once\n################################################################################\n\n#define the bus used to actuate the light module on the fan\nbus = smbus.SMBus(1)\n\n#define the names for the 2 exsting steppers\nkit = MotorKit()\npump_stepper = kit.stepper1\nfocus_stepper = kit.stepper2\n#Make sure the steppers are release and do not use any power\npump_stepper.release()\nfocus_stepper.release()\n\n#Precise the settings of the PiCamera\ncamera = PiCamera()\ncamera.resolution = (3280, 2464)\ncamera.iso = 60\ncamera.shutter_speed = 500\ncamera.exposure_mode = 'fixedfps'\n\n#Declare the global variables command, args and counter\ncommand = ''\nargs = ''\ncounter=''\n\n#MQTT Client functions definition\nclient = mqtt.Client()\nclient.connect(\"192.168.4.1\",1883,60)\nclient.on_connect = on_connect\nclient.on_subscribe = on_subscribe\nclient.on_message = on_message\nclient.loop_start()\n\n################################################################################\n#Definition of the few important metadata\n################################################################################\n\nlocal_metadata = {\n \"process_datetime\": datetime.now(),\n \"acq_camera_resolution\" : camera.resolution,\n \"acq_camera_iso\" : camera.iso,\n \"acq_camera_shutter_speed\" : camera.shutter_speed\n}\n\n#Read the content of config.json containing the metadata defined on Node-RED\nconfig_json = open('/home/pi/PlanktonScope/config.json','r')\nnode_red_metadata = json.loads(config_json.read())\n\n#Concat the local metadata and the metadata from Node-RED\nglobal_metadata = {**local_metadata, **node_red_metadata}\n\n#Define the name of the .zip file that will contain the images and the .tsv table for EcoTaxa\narchive_fn = os.path.join(\"/home/pi/PlanktonScope/\",\"export\", \"ecotaxa_export.zip\")\n\n################################################################################\n#MorphoCut Script\n################################################################################\n\n#Define processing pipeline\nwith Pipeline() as p:\n\n #Recursively find .jpg files in import_path.\n #Sort to get consective frames.\n abs_path = Find(\"/home/pi/PlanktonScope/tmp\", [\".jpg\"], sort=True, verbose=True)\n\n #Extract name from abs_path\n name = Call(lambda p: os.path.splitext(os.path.basename(p))[0], abs_path)\n\n #Set the LEDs as Green\n Call(rgb, 0,255,0)\n\n #Read image\n img = ImageReader(abs_path)\n\n #Show progress bar for frames\n TQDM(Format(\"Frame {name}\", name=name))\n\n #Apply running median to approximate the background image\n flat_field = RunningMedian(img, 5)\n\n #Correct image\n img = img / flat_field\n\n #Rescale intensities and convert to uint8 to speed up calculations\n img = RescaleIntensity(img, in_range=(0, 1.1), dtype=\"uint8\")\n\n #Filter variable to reduce memory load\n FilterVariables(name,img)\n\n #Save cleaned images\n #frame_fn = Format(os.path.join(\"/home/pi/PlanktonScope/tmp\",\"CLEAN\", \"{name}.jpg\"), name=name)\n #ImageWriter(frame_fn, img)\n\n #Convert image to uint8 gray\n img_gray = RGB2Gray(img)\n\n #?\n img_gray = Call(img_as_ubyte, img_gray)\n\n #Canny edge detection using OpenCV\n img_canny = Call(cv2.Canny, img_gray, 50,100)\n\n #Dilate using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15))\n img_dilate = Call(cv2.dilate, img_canny, kernel, iterations=2)\n\n #Close using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (5, 5))\n img_close = Call(cv2.morphologyEx, img_dilate, cv2.MORPH_CLOSE, kernel, iterations=1)\n\n #Erode using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15))\n mask = Call(cv2.erode, img_close, kernel, iterations=2)\n\n #Find objects\n regionprops = FindRegions(\n mask, img_gray, min_area=1000, padding=10, warn_empty=name\n )\n\n #Set the LEDs as Purple\n Call(rgb, 255,0,255)\n\n # For an object, extract a vignette/ROI from the image\n roi_orig = ExtractROI(img, regionprops, bg_color=255)\n\n # Generate an object identifier\n i = Enumerate()\n\n #Call(print,i)\n\n #Define the ID of each object\n object_id = Format(\"{name}_{i:d}\", name=name, i=i)\n\n #Call(print,object_id)\n\n #Define the name of each object\n object_fn = Format(os.path.join(\"/home/pi/PlanktonScope/\",\"OBJECTS\", \"{name}.jpg\"), name=object_id)\n\n #Save the image of the object with its name\n ImageWriter(object_fn, roi_orig)\n\n #Calculate features. The calculated features are added to the global_metadata.\n #Returns a Variable representing a dict for every object in the stream.\n meta = CalculateZooProcessFeatures(\n regionprops, prefix=\"object_\", meta=global_metadata\n )\n\n #Get all the metadata\n json_meta = Call(json.dumps,meta, sort_keys=True, default=str)\n\n #Publish the json containing all the metadata to via MQTT to Node-RED\n Call(client.publish, \"receiver/segmentation/metric\", json_meta)\n\n #Add object_id to the metadata dictionary\n meta[\"object_id\"] = object_id\n\n #Generate object filenames\n orig_fn = Format(\"{object_id}.jpg\", object_id=object_id)\n\n #Write objects to an EcoTaxa archive:\n #roi image in original color, roi image in grayscale, metadata associated with each object\n EcotaxaWriter(archive_fn, (orig_fn, roi_orig), meta)\n\n #Progress bar for objects\n TQDM(Format(\"Object {object_id}\", object_id=object_id))\n\n #Publish the object_id to via MQTT to Node-RED\n Call(client.publish, \"receiver/segmentation/object_id\", object_id)\n\n #Set the LEDs as Green\n Call(rgb, 0,255,0)\n\n################################################################################\n#While loop for capting commands from Node-RED\n################################################################################\n\noutput = StreamingOutput()\naddress = ('192.168.4.1', 8000)\nserver = StreamingServer(address, StreamingHandler)\nthreading.Thread(target=server.serve_forever).start()\ncamera.start_recording(output, format='mjpeg', resize=(640, 480))\n\nwhile True:\n\n ############################################################################\n #Pump Event\n ############################################################################\n\n #If the command is \"pump\"\n if (command==\"pump\"):\n\n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Get direction from the different received arguments\n direction=args.split(\" \")[0]\n\n #Get delay (in between steps) from the different received arguments\n delay=float(args.split(\" \")[1])\n\n #Get number of steps from the different received arguments\n nb_step=int(args.split(\" \")[2])\n\n #Print status\n print(\"The pump has been started.\")\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Start\");\n\n ########################################################################\n while True:\n\n #Depending on direction, select the right direction for the pump\n if direction == \"BACKWARD\":\n direction=stepper.BACKWARD\n\n if direction == \"FORWARD\":\n direction=stepper.FORWARD\n\n #Actuate the pump for one step in the right direction\n pump_stepper.onestep(direction=direction, style=stepper.DOUBLE)\n\n #Increment the counter\n counter+=1\n\n #Wait during the delay to pump at the right flowrate\n sleep(delay)\n\n ####################################################################\n #If counter reach the number of step, break\n if counter>nb_step:\n\n #Release the pump stepper to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The pumping is done.\")\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Done\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"pump\", break this while loop\n if command!=\"pump\":\n\n #Release the pump stepper to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The pump has been interrompted.\")\n\n #Publish the status \"Interrompted\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ############################################################################\n #Focus Event\n ############################################################################\n\n #If the command is \"focus\"\n elif (command==\"focus\"):\n\n #Set the LEDs as Yellow\n rgb(255,255,0)\n\n #Get direction from the different received arguments\n direction=args.split(\" \")[0]\n\n #Get number of steps from the different received arguments\n nb_step=int(args.split(\" \")[1])\n\n #Print status\n print(\"The focus has been started.\")\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Start\");\n\n ########################################################################\n while True:\n\n #Depending on direction, select the right direction for the focus\n if direction == \"FORWARD\":\n direction=stepper.FORWARD\n\n if direction == \"BACKWARD\":\n direction=stepper.BACKWARD\n\n #Actuate the focus for one microstep in the right direction\n focus_stepper.onestep(direction=direction, style=stepper.MICROSTEP)\n\n #Increment the counter\n counter+=1\n\n ####################################################################\n #If counter reach the number of step, break\n if counter>nb_step:\n\n #Release the focus steppers to stop power draw\n focus_stepper.release()\n\n #Print status\n print(\"The focusing is done.\")\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Done\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"pump\", break this while loop\n if command!=\"focus\":\n\n #Release the focus steppers to stop power draw\n focus_stepper.release()\n\n #Print status\n print(\"The stage has been interrompted.\")\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ############################################################################\n #Image Event\n ############################################################################\n\n elif (command==\"image\"):\n \n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Will do my best dude\");\n\n #Get duration to wait before an image from the different received arguments\n sleep_before=int(args.split(\" \")[0])\n\n #Get number of step in between two images from the different received arguments\n nb_step=int(args.split(\" \")[1])\n\n #Get the number of frames to image from the different received arguments\n nb_frame=int(args.split(\" \")[2])\n\n #Get the segmentation status (true/false) from the different received arguments\n segmentation=str(args.split(\" \")[3])\n\n #Sleep a duration before to start acquisition\n sleep(sleep_before)\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Start\");\n\n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Pump duing a given number of steps (in between each image)\n for i in range(nb_step):\n\n #If the command is still image - pump a defined nb of steps\n if (command==\"image\"):\n\n #Actuate the pump for one step in the FORWARD direction\n pump_stepper.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)\n\n #The flowrate is fixed for now.\n sleep(0.01)\n\n #If the command isn't image anymore - break\n else:\n\n break\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n while True:\n\n #Set the LEDs as Cyan\n rgb(0,255,255)\n\n #Increment the counter\n counter+=1\n\n #Get datetime\n datetime_tmp=datetime.now().strftime(\"%H_%M_%S_%f\")\n\n #Print datetime\n print(datetime_tmp)\n\n #Define the filename of the image\n filename = os.path.join(\"/home/pi/PlanktonScope/tmp\",datetime_tmp+\".jpg\")\n\n #Capture an image with the proper filename\n camera.capture(filename)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Publish the name of the image to via MQTT to Node-RED\n\n client.publish(\"receiver/image\", datetime_tmp+\".jpg has been imaged.\");\n \n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Pump during a given nb of steps\n for i in range(nb_step):\n\n #Actuate the pump for one step in the FORWARD direction\n pump_stepper.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)\n\n #The flowrate is fixed for now.\n sleep(0.01)\n\n #Wait a fixed delay which set the framerate as < than 2 imag/sec\n sleep(0.5)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n ####################################################################\n #If counter reach the number of frame, break\n if(counter>nb_frame):\n\n #Publish the status \"Completed\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Completed\");\n\n #Release the pump steppers to stop power draw\n pump_stepper.release()\n\n if(segmentation == \"True\"):\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/segmentation\", \"Start\");\n\n #Start the MorphoCut Pipeline\n p.run()\n\n #remove directory\n #shutil.rmtree(import_path)\n\n #Publish the status \"Completed\" to via MQTT to Node-RED\n client.publish(\"receiver/segmentation\", \"Completed\");\n\n #Set the LEDs as White\n rgb(255,255,255)\n\n #cmd = os.popen(\"rm -rf /home/pi/PlanktonScope/tmp/*.jpg\")\n\n #Let it happen\n sleep(1)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #End if(segmentation == \"True\"):\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n \n #Set the LEDs as Green\n rgb(0,255,255)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"image\", break this while loop\n if command!=\"image\":\n\n #Release the pump steppers to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The imaging has been interrompted.\")\n\n #Publish the status \"Interrompted\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n else:\n #Set the LEDs as Black\n rgb(0,0,0)\n #Its just waiting to receive command from Node-RED\n sleep(1)\n #Set the LEDs as White\n rgb(255,255,255)\n #Its just waiting to receive command from Node-RED\n sleep(1)\n", + "output": "str", + "x": 300, + "y": 100, "wires": [ - [] + [ + "500abffa.c7a788" + ] ] }, { - "id": "7cea16e.c42ace8", - "type": "ui_numeric", - "z": "bdd6e33e.5db3b8", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 4, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 536, + "id": "a11158b1.b7649", + "type": "debug", + "z": "e8320d42.9a3ad8", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "x": 1230, "y": 200, + "wires": [] + }, + { + "id": "cf9e02a2.3feff", + "type": "exec", + "z": "e8320d42.9a3ad8", + "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 430, + "y": 40, "wires": [ + [ + "945415c5.01217" + ], + [], [] ] }, { - "id": "6ecc9468.0271dc", - "type": "ui_text_input", - "z": "bdd6e33e.5db3b8", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "52159161.72187", + "id": "945415c5.01217", + "type": "exec", + "z": "e8320d42.9a3ad8", + "command": "kill", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 910, + "y": 40, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "18da28e6.7b000f", + "type": "delay", + "z": "e8320d42.9a3ad8", + "name": "", + "pauseType": "delay", + "timeout": "1", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "x": 160, + "y": 100, + "wires": [ + [ + "985c65de.0801b" + ] + ] + }, + { + "id": "6384a5e.e34465c", + "type": "subflow", + "name": "Datetime update", + "info": "", + "category": "", + "in": [ + { + "x": 140, + "y": 80, + "wires": [ + { + "id": "42ffcda3.49c30c" + } + ] + } + ], + "out": [], + "env": [], + "color": "#DDAA99", + "icon": "font-awesome/fa-clock-o" + }, + { + "id": "e3824a97.8f2c3", + "type": "exec", + "z": "6384a5e.e34465c", + "command": "sudo date -s", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 1010, + "y": 240, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "a5a13db6.4c6958", + "type": "function", + "z": "6384a5e.e34465c", + "name": "", + "func": "d = new Date();\n//get weekday\nvar weekday = new Array(7);\nweekday[0] = \"Sun\";\nweekday[1] = \"Mon\";\nweekday[2] = \"Tue\";\nweekday[3] = \"Wed\";\nweekday[4] = \"Thu\";\nweekday[5] = \"Fri\";\nweekday[6] = \"Sat\";\nvar w = weekday[d.getUTCDay()];\n//get Month\nvar month = new Array(12);\nmonth[0] = \"Jan\";\nmonth[1] = \"Feb\";\nmonth[2] = \"Mar\";\nmonth[3] = \"Apr\";\nmonth[4] = \"May\";\nmonth[5] = \"Jun\";\nmonth[6] = \"Jul\";\nmonth[7] = \"Aug\";\nmonth[8] = \"Sep\";\nmonth[9] = \"Oct\";\nmonth[10] = \"Nov\";\nmonth[11] = \"Dec\";\nvar n = month[d.getUTCMonth()];\n \n//get day\nvar day = d.getUTCDay()\n\n//get Hours\nvar Hours = d.getUTCHours();\n//get Minutes\nvar Minutes = d.getUTCMinutes();\n//get Seconds\nvar Seconds = d.getUTCSeconds();\n//get FullYear\nvar FullYear = d.getUTCFullYear();\n\n//Thu Aug 09 2012 23:34:04 GMT+0200 (GMT+02:00)\n\n//Thu Aug 9 21:31:26 UTC 2012\n\n//msg.payload = \"Thu Aug 9 21:31:26 UTC 2012\"\n\nmsg.payload = '\"'+w+\" \"+n+\" \"+day+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+\" UTC \"+FullYear+'\"';\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 40, + "wires": [ + [ + "bafb69f.a42ea18" + ] + ] + }, + { + "id": "bafb69f.a42ea18", + "type": "ui_template", + "z": "6384a5e.e34465c", + "group": "9c86b3b7.54841", + "name": "", "order": 1, "width": 0, "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_id", - "x": 586, + "format": "
", + "storeOutMessages": true, + "fwdInMessages": true, + "templateScope": "local", + "x": 640, "y": 40, "wires": [ [] ] }, { - "id": "259fd49a.160a3c", - "type": "ui_dropdown", - "z": "bdd6e33e.5db3b8", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "52159161.72187", - "order": 7, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 566, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "66a3425c.79aabc", - "type": "ui_text_input", - "z": "bdd6e33e.5db3b8", - "name": "acq_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "52159161.72187", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_volume", - "x": 566, - "y": 240, - "wires": [ - [] - ] - }, - { - "id": "5866c9a4.e1ca88", - "type": "ui_text_input", - "z": "bdd6e33e.5db3b8", - "name": "acq_instrument", - "label": "Acquisition instrument", - "tooltip": "PlanktonScope V2.1", - "group": "52159161.72187", - "order": 6, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "acq_instrument", - "x": 556, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "76a6e6bb.a08b98", - "type": "json", - "z": "259c8713.b50e28", - "name": "", - "property": "payload", - "action": "str", - "pretty": true, - "x": 1310, - "y": 100, - "wires": [ - [ - "f25890f5.f2549" - ] - ] - }, - { - "id": "594ec843.9d4458", - "type": "file in", - "z": "259c8713.b50e28", - "name": "", - "filename": "/home/pi/PlanktonScope/config.txt", - "format": "utf8", - "chunk": false, - "sendError": false, - "encoding": "none", - "x": 340, - "y": 60, - "wires": [ - [ - "3bc1a977.4e9c76" - ] - ] - }, - { - "id": "d9ca0e54.f8b58", - "type": "inject", - "z": "259c8713.b50e28", - "name": "on_load", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": 0.1, - "x": 100, - "y": 60, - "wires": [ - [ - "594ec843.9d4458", - "ca38a11d.0ee54", - "807d5cce.2bb1e", - "fda01242.9576a8" - ] - ] - }, - { - "id": "3bc1a977.4e9c76", - "type": "json", - "z": "259c8713.b50e28", - "name": "", - "property": "payload", - "action": "", - "pretty": false, - "x": 550, - "y": 60, - "wires": [ - [ - "7f101b25.0da4a4", - "99b5a67.080f258", - "a71ba4a6.c44c4", - "fe5585e.a1ab078", - "da9f1367.3a17a8", - "d8dbecd.f7b3b9", - "c986ae96.860ec8" - ] - ] - }, - { - "id": "2582798f.eddcc6", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_projet", - "func": "msg.payload = msg.payload.sample_project;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 250, - "y": 40, - "wires": [ - [ - "a163194f.0b17c8" - ] - ] - }, - { - "id": "1590a418.9166dc", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_ship", - "func": "msg.payload = msg.payload.sample_ship;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 240, - "y": 120, - "wires": [ - [ - "6d0d6fc7.d30bb" - ] - ] - }, - { - "id": "1d28205b.58a37", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_id", - "func": "msg.payload = msg.payload.sample_id+1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 240, - "y": 80, - "wires": [ - [ - "914752eb.af1b" - ] - ] - }, - { - "id": "d96f9fa3.d4cfc", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_operator", - "func": "msg.payload = msg.payload.sample_operator;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 260, - "y": 160, - "wires": [ - [ - "458408d7.2b3b68" - ] - ] - }, - { - "id": "784e2f78.9b96f", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_sampling_gear", - "func": "msg.payload = msg.payload.sample_sampling_gear;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 280, - "y": 200, - "wires": [ - [ - "43b12fe4.c5aa3" - ] - ] - }, - { - "id": "47459dcd.81b594", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_id", - "func": "msg.payload = msg.payload.acq_id+1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 210, - "y": 40, - "wires": [ - [ - "6ecc9468.0271dc" - ] - ] - }, - { - "id": "eec199a3.a5a768", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_instrument", - "func": "msg.payload = msg.payload.acq_instrument;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 230, - "y": 80, - "wires": [ - [ - "5866c9a4.e1ca88" - ] - ] - }, - { - "id": "2d278f0a.1a97a", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_celltype", - "func": "msg.payload = msg.payload.acq_celltype;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 120, - "wires": [ - [ - "259fd49a.160a3c" - ] - ] - }, - { - "id": "4074b907.e527e8", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_minimum_mesh", - "func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 250, - "y": 160, - "wires": [ - [ - "5aba848a.7a861c" - ] - ] - }, - { - "id": "bc37aba3.0d1e78", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_maximum_mesh", - "func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 250, - "y": 200, - "wires": [ - [ - "7cea16e.c42ace8" - ] - ] - }, - { - "id": "d973d64a.8801e8", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_volume", - "func": "msg.payload = msg.payload.acq_volume;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 240, - "wires": [ - [ - "66a3425c.79aabc" - ] - ] - }, - { - "id": "bc39179c.bb3c08", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_fnumber_objective", - "func": "msg.payload = msg.payload.acq_fnumber_objective;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 260, - "y": 360, - "wires": [ - [ - "eb9181d8.25e01" - ] - ] - }, - { - "id": "47c7db4d.5eb014", + "id": "81f9cd4c.8540b", "type": "ui_numeric", - "z": "ad5a5663.ce893", - "name": "object_depth_min", - "label": "Minimum depth (m)", + "z": "6384a5e.e34465c", + "name": "tmp_year", + "label": "Year", "tooltip": "", - "group": "cef1e703.bcf3c8", + "group": "9c86b3b7.54841", + "order": 2, + "width": 5, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_year", + "format": "{{value}}", + "min": "2020", + "max": "2030", + "step": 1, + "x": 640, + "y": 80, + "wires": [ + [ + "8f5a74df.0663f" + ] + ] + }, + { + "id": "274f25fc.9e61ba", + "type": "ui_numeric", + "z": "6384a5e.e34465c", + "name": "tmp_month", + "label": "Month", + "tooltip": "", + "group": "9c86b3b7.54841", "order": 3, - "width": 0, - "height": 0, + "width": 3, + "height": 1, "wrap": false, "passthru": true, - "topic": "object_depth_min", + "topic": "tmp_month", "format": "{{value}}", - "min": "0", - "max": "2000", - "step": "1", - "x": 610, + "min": "1", + "max": "12", + "step": 1, + "x": 650, "y": 120, "wires": [ - [] + [ + "8f5a74df.0663f" + ] ] }, { - "id": "20c46fd4.6b984", + "id": "4ddcb673.905a", "type": "ui_numeric", - "z": "ad5a5663.ce893", - "name": "object_depth_max", - "label": "Maximum depth (m)", + "z": "6384a5e.e34465c", + "name": "tmp_day", + "label": "Day", "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 2, - "width": 0, - "height": 0, + "group": "9c86b3b7.54841", + "order": 4, + "width": 3, + "height": 1, "wrap": false, "passthru": true, - "topic": "object_depth_max", + "topic": "tmp_day", "format": "{{value}}", - "min": "0", - "max": "2000", - "step": "1", - "x": 610, + "min": "1", + "max": "31", + "step": 1, + "x": 640, "y": 160, "wires": [ - [] + [ + "8f5a74df.0663f" + ] ] }, { - "id": "1a5edafb.a05cf5", + "id": "248eee4c.238282", + "type": "ui_numeric", + "z": "6384a5e.e34465c", + "name": "tmp_hour", + "label": "Hour", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 5, + "width": 3, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_hour", + "format": "{{value}}", + "min": "0", + "max": "23", + "step": 1, + "x": 640, + "y": 200, + "wires": [ + [ + "8f5a74df.0663f" + ] + ] + }, + { + "id": "a368c4b7.2dc4b8", + "type": "ui_numeric", + "z": "6384a5e.e34465c", + "name": "tmp_minute", + "label": "Minute", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 6, + "width": 3, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_minute", + "format": "{{value}}", + "min": "0", + "max": "59", + "step": 1, + "x": 650, + "y": 240, + "wires": [ + [ + "8f5a74df.0663f" + ] + ] + }, + { + "id": "96cc9953.9496c8", + "type": "ui_numeric", + "z": "6384a5e.e34465c", + "name": "tmp_second", + "label": "Second", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 7, + "width": 3, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_second", + "format": "{{value}}", + "min": "0", + "max": "59", + "step": 1, + "x": 650, + "y": 280, + "wires": [ + [ + "8f5a74df.0663f" + ] + ] + }, + { + "id": "d6240495.8429c", + "type": "interval", + "z": "6384a5e.e34465c", + "name": "interval", + "interval": "1", + "onstart": false, + "msg": "ping", + "showstatus": true, + "unit": "seconds", + "statusformat": "YYYY-MM-D HH:mm:ss", + "x": 310, + "y": 40, + "wires": [ + [ + "a5a13db6.4c6958" + ] + ] + }, + { + "id": "e8d38dc0.c7e84", + "type": "ui_button", + "z": "6384a5e.e34465c", + "name": "", + "group": "9c86b3b7.54841", + "order": 8, + "width": 4, + "height": 1, + "passthru": false, + "label": "Update", + "tooltip": "", + "color": "black", + "bgcolor": "white", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 640, + "y": 320, + "wires": [ + [ + "581f71d3.bde458" + ] + ] + }, + { + "id": "581f71d3.bde458", "type": "function", - "z": "259c8713.b50e28", + "z": "6384a5e.e34465c", + "name": "update datetime", + "func": "var FullYear= global.get(\"year\");\nvar Month= global.get(\"month\");\nvar day= global.get(\"day\");\nvar Hours= global.get(\"hour\");\nvar Minutes= global.get(\"minute\");\nvar Seconds= global.get(\"second\");\n\nmsg.payload = new Date();\n//get Month\nvar month = new Array(12);\nmonth[1] = \"Jan\";\nmonth[2] = \"Feb\";\nmonth[3] = \"Mar\";\nmonth[4] = \"Apr\";\nmonth[5] = \"May\";\nmonth[6] = \"Jun\";\nmonth[7] = \"Jul\";\nmonth[8] = \"Aug\";\nmonth[9] = \"Sep\";\nmonth[10] = \"Oct\";\nmonth[11] = \"Nov\";\nmonth[12] = \"Dec\";\nvar n = month[Month];\n \nmsg.payload = '\"'+day+\" \"+n+\" \"+FullYear+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+'\"';\n\n\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 800, + "y": 320, + "wires": [ + [ + "6b023a67.faa104", + "e3824a97.8f2c3" + ] + ] + }, + { + "id": "8f5a74df.0663f", + "type": "function", + "z": "6384a5e.e34465c", "name": "set global", "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 1020, + "x": 840, "y": 60, + "wires": [ + [] + ] + }, + { + "id": "6b023a67.faa104", + "type": "debug", + "z": "6384a5e.e34465c", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 1010, + "y": 300, + "wires": [] + }, + { + "id": "4ab089b9.1098", + "type": "function", + "z": "6384a5e.e34465c", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCFullYear();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 80, "wires": [ [ - "e001a28.555566" + "81f9cd4c.8540b" ] ] }, { - "id": "21f41837.bb6c88", + "id": "42ffcda3.49c30c", "type": "function", - "z": "ad5a5663.ce893", - "name": "get object_depth_min", - "func": "msg.payload = msg.payload.object_depth_min;\nreturn msg;", + "z": "6384a5e.e34465c", + "name": "", + "func": "d = new Date();\nmsg.payload = d\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 304, + "x": 310, + "y": 80, + "wires": [ + [ + "4ab089b9.1098", + "13529b2c.cb9d9d", + "c09bb768.0e7518", + "967b4488.670f08", + "3e3732d.273a04e", + "327729f0.afe466" + ] + ] + }, + { + "id": "13529b2c.cb9d9d", + "type": "function", + "z": "6384a5e.e34465c", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCMonth();\n\nmsg.payload = val+1;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, "y": 120, "wires": [ [ - "47c7db4d.5eb014" + "274f25fc.9e61ba" ] ] }, { - "id": "c2f235f2.eee388", + "id": "c09bb768.0e7518", "type": "function", - "z": "ad5a5663.ce893", - "name": "get object_depth_max", - "func": "msg.payload = msg.payload.object_depth_max;\nreturn msg;", + "z": "6384a5e.e34465c", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCDay();\n\nmsg.payload = val;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 304, + "x": 490, "y": 160, "wires": [ [ - "20c46fd4.6b984" + "4ddcb673.905a" ] ] }, { - "id": "23e45d82.a01f82", + "id": "967b4488.670f08", + "type": "function", + "z": "6384a5e.e34465c", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCHours();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 200, + "wires": [ + [ + "248eee4c.238282" + ] + ] + }, + { + "id": "3e3732d.273a04e", + "type": "function", + "z": "6384a5e.e34465c", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCMinutes();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 240, + "wires": [ + [ + "a368c4b7.2dc4b8" + ] + ] + }, + { + "id": "327729f0.afe466", + "type": "function", + "z": "6384a5e.e34465c", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCSeconds();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 280, + "wires": [ + [ + "96cc9953.9496c8" + ] + ] + }, + { + "id": "9c86b3b7.54841", + "type": "ui_group", + "z": "", + "name": "Datetime", + "tab": "2b97fe34.a699fa", + "order": 1, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "a156df1e.d37178", + "type": "subflow", + "name": "Acquisition inputs", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "2dd27be1.476eac" + }, + { + "id": "3883d084.feb708" + }, + { + "id": "4bf1038f.d36f9c" + }, + { + "id": "ae15c276.ec8c68" + } + ] + } + ], + "out": [ + { + "x": 740, + "y": 40, + "wires": [ + { + "id": "b996437b.1a45b8", + "port": 0 + }, + { + "id": "d56a51c1.60023", + "port": 0 + }, + { + "id": "229ade87.b1656a", + "port": 0 + }, + { + "id": "5e093b67.a32f9c", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "node-red-contrib-camerapi/photo.png" + }, + { + "id": "b996437b.1a45b8", "type": "ui_text_input", - "z": "4475ba6c.45604c", + "z": "a156df1e.d37178", + "name": "custom_nb_step", + "label": "Number of steps in between two images", + "tooltip": "", + "group": "48649115.fcd01", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "custom_nb_step", + "x": 540, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "229ade87.b1656a", + "type": "ui_text_input", + "z": "a156df1e.d37178", + "name": "custom_nb_frame", + "label": "Number of images per acquisition", + "tooltip": "", + "group": "48649115.fcd01", + "order": 3, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "custom_nb_frame", + "x": 530, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "2dd27be1.476eac", + "type": "function", + "z": "a156df1e.d37178", + "name": "get custom_nb_step", + "func": "msg.payload = msg.payload.custom_nb_step;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 80, + "wires": [ + [ + "b996437b.1a45b8" + ] + ] + }, + { + "id": "4bf1038f.d36f9c", + "type": "function", + "z": "a156df1e.d37178", + "name": "get custom_nb_frame", + "func": "msg.payload = msg.payload.custom_nb_frame;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 120, + "wires": [ + [ + "229ade87.b1656a" + ] + ] + }, + { + "id": "ae15c276.ec8c68", + "type": "function", + "z": "a156df1e.d37178", + "name": "get custom_segmentation", + "func": "msg.payload = msg.payload.custom_segmentation;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 160, + "wires": [ + [ + "5e093b67.a32f9c" + ] + ] + }, + { + "id": "3883d084.feb708", + "type": "function", + "z": "a156df1e.d37178", + "name": "get custom_sleep_before", + "func": "msg.payload = msg.payload.custom_sleep_before;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 40, + "wires": [ + [ + "d56a51c1.60023" + ] + ] + }, + { + "id": "d56a51c1.60023", + "type": "ui_text_input", + "z": "a156df1e.d37178", + "name": "custom_sleep_before", + "label": "Duration before the acquisition (s)", + "tooltip": "", + "group": "48649115.fcd01", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "custom_sleep_before", + "x": 520, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "5e093b67.a32f9c", + "type": "ui_switch", + "z": "a156df1e.d37178", + "name": "custom_segmentation", + "label": "Realize the segmentation", + "tooltip": "", + "group": "48649115.fcd01", + "order": 6, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "custom_segmentation", + "style": "", + "onvalue": "True", + "onvalueType": "str", + "onicon": "", + "oncolor": "", + "offvalue": "False", + "offvalueType": "str", + "officon": "", + "offcolor": "", + "x": 520, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "48649115.fcd01", + "type": "ui_group", + "z": "", + "name": "Acquisition inputs", + "tab": "2b97fe34.a699fa", + "order": 9, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "99798a85.e62408", + "type": "subflow", + "name": "Process metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 80, + "wires": [ + { + "id": "20414296.54837e" + } + ] + } + ], + "out": [ + { + "x": 700, + "y": 80, + "wires": [ + { + "id": "d5ab9061.b06a9", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "d5ab9061.b06a9", + "type": "ui_text_input", + "z": "99798a85.e62408", "name": "process_id", "label": "Id of the process", "tooltip": "", - "group": "b1321ea9.cfcf28", + "group": "beeb994e.b67688", "order": 1, "width": 0, "height": 0, @@ -1564,9 +1193,9 @@ ] }, { - "id": "d899c841.e6c178", + "id": "20414296.54837e", "type": "function", - "z": "4475ba6c.45604c", + "z": "99798a85.e62408", "name": "get process_id", "func": "msg.payload = msg.payload.process_id+1;\nreturn msg;", "outputs": 1, @@ -1575,666 +1204,55 @@ "y": 80, "wires": [ [ - "23e45d82.a01f82" + "d5ab9061.b06a9" ] ] }, { - "id": "4fa9647b.8a2ebc", - "type": "gpsd", - "z": "ad5a5663.ce893", - "name": "", - "hostname": "localhost", - "port": "2947", - "tpv": true, - "sky": false, - "info": false, - "device": false, - "gst": false, - "att": false, - "x": 90, - "y": 220, - "wires": [ - [ - "2327c165.8397ae", - "bbb7cb31.15121" - ] - ] - }, - { - "id": "767b43a1.de21dc", - "type": "ui_worldmap", - "z": "ad5a5663.ce893", - "d": true, - "group": "cef1e703.bcf3c8", - "order": 1, - "width": 0, - "height": 0, - "name": "", - "lat": "1.5", - "lon": "1.5", - "zoom": "4", - "layer": "OSM grey", - "cluster": "1", - "maxage": "", - "usermenu": "hide", - "layers": "hide", - "panit": "false", - "panlock": "false", - "zoomlock": "false", - "hiderightclick": "true", - "coords": "deg", - "showgrid": "false", - "path": "/worldmap", - "x": 640, - "y": 200, - "wires": [] - }, - { - "id": "2327c165.8397ae", - "type": "function", - "z": "ad5a5663.ce893", - "name": "get object_lat & object_lon", - "func": "\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 320, - "y": 200, - "wires": [ - [ - "767b43a1.de21dc" - ] - ] - }, - { - "id": "fa47061e.34a218", - "type": "ui_numeric", - "z": "bdd6e33e.5db3b8", - "name": "acq_min_esd", - "label": "Minimum size to segment (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 9, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_min_esd", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "5", - "x": 566, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "6f36bd6d.154d14", - "type": "ui_numeric", - "z": "bdd6e33e.5db3b8", - "name": "acq_max_esd", - "label": "Maximum size to segment (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 5, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_max_esd", - "format": "{{value}}", - "min": "100", - "max": "2000", - "step": "5", - "x": 556, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "277b6764.edb1f8", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_min_esd", - "func": "msg.payload = msg.payload.acq_min_esd;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 230, - "y": 280, - "wires": [ - [ - "fa47061e.34a218" - ] - ] - }, - { - "id": "75b10c7c.8433a4", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_max_esd", - "func": "msg.payload = msg.payload.acq_max_esd;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 230, - "y": 320, - "wires": [ - [ - "6f36bd6d.154d14" - ] - ] - }, - { - "id": "5f4a72d1.9f6adc", - "type": "ui_text_input", - "z": "ae90e3e.7d9fba", - "name": "nb_step", - "label": "Number of step(s)", - "tooltip": "", - "group": "fbd92986.1028c8", - "order": 2, - "width": 8, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "nb_step", - "x": 520, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "81a7627c.bac92", - "type": "function", - "z": "ae90e3e.7d9fba", - "name": "get generic_nb_step", - "func": "msg.payload = msg.payload.generic_nb_step;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 240, - "y": 40, - "wires": [ - [ - "5f4a72d1.9f6adc" - ] - ] - }, - { - "id": "705dddc5.567bc4", - "type": "ui_button", - "z": "ae90e3e.7d9fba", - "name": "DOWN", - "group": "fbd92986.1028c8", - "order": 3, - "width": 6, - "height": 1, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_downward", - "payload": "DOWN", - "payloadType": "str", - "topic": "actuator/focus", - "x": 520, - "y": 120, - "wires": [ - [ - "4f74f017.00a58" - ] - ] - }, - { - "id": "b0aacff7.56651", - "type": "ui_button", - "z": "ae90e3e.7d9fba", - "name": "UP", - "group": "fbd92986.1028c8", - "order": 1, - "width": 6, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_upwards", - "payload": "UP", - "payloadType": "str", - "topic": "actuator/focus", - "x": 530, - "y": 81, - "wires": [ - [ - "4f74f017.00a58" - ] - ] - }, - { - "id": "3e9c4e74.aee022", - "type": "function", - "z": "407d8cdb.3cb7cc", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"manual_volume\");\nvar flowrate= global.get(\"flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n volume = global.get(\"manual_volume\");\n nb_step=volume*507\n msg.volume = volume;\n flowrate = global.get(\"flowrate\");\n duration=(volume*60)/flowrate\n delay=(duration/nb_step)-0.005\n msg.topic = \"actuator/pump\";\n \n if(msg.payload === \"FORWARD\" & state===\"free\"){\n msg.payload='FORWARD '+delay+' '+nb_step;\n }\n if(msg.payload === \"BACKWARD\" & state===\"free\"){\n msg.payload='BACKWARD '+delay+' '+nb_step;\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 620, - "y": 140, - "wires": [ - [ - "98e2e9e0.fb7418" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "3f0df968.b0d286", - "type": "ui_button", - "z": "407d8cdb.3cb7cc", - "name": "BACKWARD", - "group": "707d9797.c8e798", - "order": 2, - "width": 6, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_back", - "payload": "BACKWARD", - "payloadType": "str", - "topic": "actuator/pump", - "x": 470, - "y": 120, - "wires": [ - [ - "3e9c4e74.aee022" - ] - ] - }, - { - "id": "214fb242.9abb6e", - "type": "ui_button", - "z": "407d8cdb.3cb7cc", - "name": "FORWARD", - "group": "707d9797.c8e798", - "order": 4, - "width": 6, - "height": 1, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_forward", - "payload": "FORWARD", - "payloadType": "str", - "topic": "actuator/pump", - "x": 470, - "y": 160, - "wires": [ - [ - "3e9c4e74.aee022" - ] - ] - }, - { - "id": "1d58e86f.a3a9e8", - "type": "rpi-gpio out", - "z": "259c8713.b50e28", - "name": "", - "pin": "40", - "set": "", - "level": "0", - "freq": "", - "out": "out", - "x": 400, - "y": 100, - "wires": [] - }, - { - "id": "3e58f066.366b5", - "type": "ui_template", - "z": "259c8713.b50e28", - "group": "f5194cae.c84688", - "name": "Stream Pi Camera", - "order": 1, + "id": "beeb994e.b67688", + "type": "ui_group", + "z": "", + "name": "Process metadata", + "tab": "2b97fe34.a699fa", + "order": 8, + "disp": true, "width": 24, - "height": 11, - "format": "
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 750, - "y": 340, - "wires": [ - [] - ] + "collapse": false }, { - "id": "b7d9455c.026588", - "type": "switch", - "z": "ae90e3e.7d9fba", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/focus", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 810, - "y": 100, - "wires": [ - [ - "fdb3b132.8b341" - ], - [ - "b9d996d6.37c2f8" - ] - ] + "id": "246abd43.838a5a", + "type": "subflow", + "name": "MQTT Receive & Plot", + "info": "", + "category": "", + "in": [], + "out": [], + "env": [], + "color": "#F3B567", + "icon": "node-red/bridge.svg" }, { - "id": "b9d996d6.37c2f8", - "type": "ui_toast", - "z": "ae90e3e.7d9fba", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 970, - "y": 140, - "wires": [ - [] - ] - }, - { - "id": "ca38a11d.0ee54", - "type": "function", - "z": "259c8713.b50e28", - "name": "init LED", - "func": "msg.payload=1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 260, - "y": 100, - "wires": [ - [ - "1d58e86f.a3a9e8" - ] - ] - }, - { - "id": "98e2e9e0.fb7418", - "type": "switch", - "z": "407d8cdb.3cb7cc", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/pump", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 770, - "y": 140, - "wires": [ - [ - "61fb057d.3c251c" - ], - [ - "46a536f0.c83138" - ] - ] - }, - { - "id": "46a536f0.c83138", - "type": "ui_toast", - "z": "407d8cdb.3cb7cc", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 930, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "24ffcf03.2a51b", - "type": "ui_button", - "z": "407d8cdb.3cb7cc", - "name": "stop pump", - "group": "707d9797.c8e798", - "order": 5, - "width": 4, - "height": 1, - "passthru": true, - "label": "STOP PUMP", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 470, - "y": 200, - "wires": [ - [ - "e2a7220a.09d43" - ] - ] - }, - { - "id": "4f74f017.00a58", - "type": "function", - "z": "ae90e3e.7d9fba", - "name": "focus.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 660, - "y": 100, - "wires": [ - [ - "b7d9455c.026588" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "52cc1de5.b78e84", - "type": "ui_button", - "z": "ae90e3e.7d9fba", - "name": "stop focus", - "group": "fbd92986.1028c8", - "order": 4, - "width": 4, - "height": 1, - "passthru": true, - "label": "STOP FOCUS", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 510, - "y": 160, - "wires": [ - [ - "e46763fe.7fc83" - ] - ] - }, - { - "id": "39cad6fb.1503ca", - "type": "ui_button", - "z": "35488f4f.00498", - "name": "", - "group": "c6a276ac.3eb74", - "order": 1, - "width": 0, - "height": 0, - "passthru": false, - "label": "Reboot", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "reboot", - "x": 220, - "y": 80, - "wires": [ - [ - "95b876d4.07c708" - ] - ] - }, - { - "id": "1f53f29b.feee4d", - "type": "exec", - "z": "35488f4f.00498", - "command": "sudo", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "2", - "oldrc": false, - "name": "cmd", - "x": 530, - "y": 80, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "e325458b.95bff8", - "type": "ui_button", - "z": "35488f4f.00498", - "name": "", - "group": "c6a276ac.3eb74", - "order": 2, - "width": 0, - "height": 0, - "passthru": false, - "label": "Shutdown", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "shutdown", - "x": 220, - "y": 140, - "wires": [ - [ - "95b876d4.07c708" - ] - ] - }, - { - "id": "95b876d4.07c708", - "type": "python3-function", - "z": "35488f4f.00498", - "name": "action", - "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", - "outputs": 1, - "x": 390, - "y": 100, - "wires": [ - [ - "d348474b.d756a8", - "1f53f29b.feee4d" - ] - ] - }, - { - "id": "d348474b.d756a8", - "type": "exec", - "z": "35488f4f.00498", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 550, - "y": 140, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "cdd1b550.da18e8", + "id": "1aeca49c.10b893", "type": "mqtt in", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "topic": "receiver/#", "qos": "0", "datatype": "auto", - "broker": "b77ffa1b.942258", + "broker": "84801dc0.193d88", "x": 80, "y": 40, "wires": [ [ - "6920281d.dc9b48" + "be5de01e.45d56", + "613bee5b.042fe" ] ] }, { - "id": "6920281d.dc9b48", + "id": "be5de01e.45d56", "type": "switch", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "property": "topic", "propertyType": "msg", @@ -2267,23 +1285,23 @@ "y": 40, "wires": [ [ - "2f66e917.fee586" + "d39289fb.9f759" ], [ - "363ee47e.ed522c" + "e2ab3af3.e61a8" ], [ - "45a52868.fe37c8" + "e43e94c.c297968" ], [ - "469cc189.903d" + "b06c80f3.f1642" ] ] }, { - "id": "2f66e917.fee586", + "id": "d39289fb.9f759", "type": "switch", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "property": "payload", "propertyType": "msg", @@ -2311,20 +1329,20 @@ "y": 40, "wires": [ [ - "5c0d0c35.3bcf14" + "267bd959.17b856" ], [ - "cd01157d.0892d8" + "265e58c6.06de38" ], [ - "68e02bf4.7013e4" + "a433c901.2abd48" ] ] }, { - "id": "5c0d0c35.3bcf14", + "id": "267bd959.17b856", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The pump has started", "rules": [ { @@ -2343,13 +1361,15 @@ "x": 920, "y": 40, "wires": [ - [] + [ + "3b6b4fd4.8c3368" + ] ] }, { - "id": "cd01157d.0892d8", + "id": "265e58c6.06de38", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The pump has finished.", "rules": [ { @@ -2368,13 +1388,15 @@ "x": 910, "y": 80, "wires": [ - [] + [ + "3b6b4fd4.8c3368" + ] ] }, { - "id": "68e02bf4.7013e4", + "id": "a433c901.2abd48", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The pump has been stopped.", "rules": [ { @@ -2393,13 +1415,15 @@ "x": 900, "y": 120, "wires": [ - [] + [ + "3b6b4fd4.8c3368" + ] ] }, { - "id": "363ee47e.ed522c", + "id": "e2ab3af3.e61a8", "type": "switch", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "property": "payload", "propertyType": "msg", @@ -2427,20 +1451,20 @@ "y": 200, "wires": [ [ - "c088b72f.326d98" + "bd89c468.5a4f4" ], [ - "36934381.14442c" + "762ab12c.cc7e88" ], [ - "89329cfe.c8f4" + "ecb1efe6.7cb968" ] ] }, { - "id": "c088b72f.326d98", + "id": "bd89c468.5a4f4", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The focus has started", "rules": [ { @@ -2459,13 +1483,15 @@ "x": 920, "y": 200, "wires": [ - [] + [ + "3b6b4fd4.8c3368" + ] ] }, { - "id": "36934381.14442c", + "id": "762ab12c.cc7e88", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The focus has finished.", "rules": [ { @@ -2484,13 +1510,15 @@ "x": 910, "y": 240, "wires": [ - [] + [ + "3b6b4fd4.8c3368" + ] ] }, { - "id": "89329cfe.c8f4", + "id": "ecb1efe6.7cb968", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The focus has been stopped.", "rules": [ { @@ -2509,65 +1537,15 @@ "x": 900, "y": 280, "wires": [ - [] + [ + "3b6b4fd4.8c3368" + ] ] }, { - "id": "fdb3b132.8b341", - "type": "mqtt out", - "z": "ae90e3e.7d9fba", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 950, - "y": 80, - "wires": [] - }, - { - "id": "e46763fe.7fc83", - "type": "mqtt out", - "z": "ae90e3e.7d9fba", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 650, - "y": 160, - "wires": [] - }, - { - "id": "61fb057d.3c251c", - "type": "mqtt out", - "z": "407d8cdb.3cb7cc", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 910, - "y": 120, - "wires": [] - }, - { - "id": "e2a7220a.09d43", - "type": "mqtt out", - "z": "407d8cdb.3cb7cc", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 610, - "y": 200, - "wires": [] - }, - { - "id": "45a52868.fe37c8", + "id": "e43e94c.c297968", "type": "switch", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "property": "payload", "propertyType": "msg", @@ -2600,24 +1578,24 @@ "y": 360, "wires": [ [ - "113c9b93.455814" + "87a2aa4d.3590c8" ], [ - "29a7c6de.6ac2ea" + "da9f9e9b.7c9f5" ], [ - "f1b07b24.b85718" + "1143b916.5047b7" ], [ - "446a811b.25e4b", - "a57fea5b.59eb5" + "fa7f2eaf.0e6f1", + "3b6b4fd4.8c3368" ] ] }, { - "id": "177a91d4.f1016e", + "id": "30c9c4c9.d46e3c", "type": "switch", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "property": "payload", "propertyType": "msg", @@ -2640,17 +1618,17 @@ "y": 560, "wires": [ [ - "5d717a25.3437e4" + "23e5c77c.4f63f" ], [ - "7d713b16.235164" + "5491334a.93cbfc" ] ] }, { - "id": "29a7c6de.6ac2ea", + "id": "da9f9e9b.7c9f5", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The acquisition has finished.", "rules": [ { @@ -2670,14 +1648,14 @@ "y": 400, "wires": [ [ - "a57fea5b.59eb5" + "3b6b4fd4.8c3368" ] ] }, { - "id": "f1b07b24.b85718", + "id": "1143b916.5047b7", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The acquisition has been stopped.", "rules": [ { @@ -2697,14 +1675,14 @@ "y": 440, "wires": [ [ - "a57fea5b.59eb5" + "3b6b4fd4.8c3368" ] ] }, { - "id": "113c9b93.455814", + "id": "87a2aa4d.3590c8", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The acquisition has started", "rules": [ { @@ -2724,14 +1702,14 @@ "y": 360, "wires": [ [ - "a57fea5b.59eb5" + "3b6b4fd4.8c3368" ] ] }, { - "id": "446a811b.25e4b", + "id": "fa7f2eaf.0e6f1", "type": "function", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "img_counter.js", "func": "img_counter=global.get('img_counter')\nimg_counter=img_counter+1\nglobal.set('img_counter',img_counter)\nmsg.payload = img_counter\nreturn msg;", "outputs": 1, @@ -2740,14 +1718,14 @@ "y": 480, "wires": [ [ - "57014db.1bbe0b4" + "582d7204.ec89fc" ] ] }, { - "id": "803b507f.9e38c", + "id": "498b3d58.58b1a4", "type": "function", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "obj_counter.js", "func": "obj_counter=global.get('obj_counter')\nobj_counter=obj_counter+1\nglobal.set('obj_counter',obj_counter)\nmsg.payload = obj_counter\nreturn msg;", "outputs": 1, @@ -2756,16 +1734,16 @@ "y": 640, "wires": [ [ - "6ad4ae5e.62f4a" + "67618ae5.b74864" ] ] }, { - "id": "57014db.1bbe0b4", + "id": "582d7204.ec89fc", "type": "ui_chart", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "img_counter", - "group": "8cfadfab.327d7", + "group": "eb610eb9.84fae8", "order": 2, "width": 23, "height": 2, @@ -2803,9 +1781,9 @@ ] }, { - "id": "469cc189.903d", + "id": "b06c80f3.f1642", "type": "switch", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "property": "topic", "propertyType": "msg", @@ -2833,20 +1811,20 @@ "y": 560, "wires": [ [ - "177a91d4.f1016e" + "30c9c4c9.d46e3c" ], [ - "803b507f.9e38c" + "498b3d58.58b1a4" ], [ - "73f0f4b.8dd430c" + "33094026.f6e8c" ] ] }, { - "id": "7d713b16.235164", + "id": "5491334a.93cbfc", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The segmentation has finished.", "rules": [ { @@ -2866,14 +1844,14 @@ "y": 600, "wires": [ [ - "a57fea5b.59eb5" + "3b6b4fd4.8c3368" ] ] }, { - "id": "5d717a25.3437e4", + "id": "23e5c77c.4f63f", "type": "change", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "The segmentation has started", "rules": [ { @@ -2893,16 +1871,16 @@ "y": 560, "wires": [ [ - "a57fea5b.59eb5" + "3b6b4fd4.8c3368" ] ] }, { - "id": "6ad4ae5e.62f4a", + "id": "67618ae5.b74864", "type": "ui_chart", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "obj_counter", - "group": "8cfadfab.327d7", + "group": "eb610eb9.84fae8", "order": 5, "width": 23, "height": 2, @@ -2940,9 +1918,9 @@ ] }, { - "id": "32b535dc.2d85ea", + "id": "3c29eb4.e570414", "type": "function", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "func": "msg.payload=msg.payload.object_area\nmsg.topic=\"area\"\n\nreturn msg;", "outputs": 1, @@ -2951,14 +1929,14 @@ "y": 700, "wires": [ [ - "1624f1bf.604bfe" + "84dfe51a.0e9fd" ] ] }, { - "id": "73f0f4b.8dd430c", + "id": "33094026.f6e8c", "type": "json", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "property": "payload", "action": "", @@ -2967,14 +1945,14 @@ "y": 700, "wires": [ [ - "32b535dc.2d85ea" + "3c29eb4.e570414" ] ] }, { - "id": "6fc7332f.89431c", + "id": "9b672325.568a18", "type": "exec", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "command": "free -m | grep \"Mem\" | awk -F ' ' '{print $3}'", "addpay": false, "append": "", @@ -2985,16 +1963,16 @@ "y": 780, "wires": [ [ - "42781732.a6ab58" + "76a7ddb6.fbde64" ], [], [] ] }, { - "id": "7cdef10d.cb2f2", + "id": "7c9eaef6.142a4", "type": "inject", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", "topic": "", "payload": "", @@ -3007,16 +1985,16 @@ "y": 780, "wires": [ [ - "6fc7332f.89431c" + "9b672325.568a18" ] ] }, { - "id": "42781732.a6ab58", + "id": "76a7ddb6.fbde64", "type": "ui_chart", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", - "group": "8cfadfab.327d7", + "group": "eb610eb9.84fae8", "order": 1, "width": 0, "height": 0, @@ -3026,11 +2004,11 @@ "xformat": "auto", "interpolate": "linear", "nodata": "", - "dot": false, + "dot": true, "ymin": "", "ymax": "", "removeOlder": 1, - "removeOlderPoints": "", + "removeOlderPoints": "200", "removeOlderUnit": "3600", "cutout": 0, "useOneColor": false, @@ -3054,11 +2032,11 @@ ] }, { - "id": "1624f1bf.604bfe", + "id": "84dfe51a.0e9fd", "type": "ui_chart", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "name": "", - "group": "8cfadfab.327d7", + "group": "eb610eb9.84fae8", "order": 8, "width": 0, "height": 0, @@ -3096,496 +2074,9 @@ ] }, { - "id": "7f101b25.0da4a4", - "type": "subflow:173a6e6b.e5ca6a", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 750, - "y": 60, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ] - }, - { - "id": "d8dbecd.f7b3b9", - "type": "subflow:ae90e3e.7d9fba", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 740, - "y": 260, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ] - }, - { - "id": "309468bc.ac83f8", - "type": "ui_text_input", - "z": "407d8cdb.3cb7cc", - "name": "manual_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 3, - "width": 8, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "manual_volume", - "x": 460, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "f859eeef.c59ed", - "type": "function", - "z": "407d8cdb.3cb7cc", - "name": "get generic_manual_volume", - "func": "msg.payload = msg.payload.generic_manual_volume;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 80, - "wires": [ - [ - "309468bc.ac83f8" - ] - ] - }, - { - "id": "59b05f7f.9e83f8", - "type": "ui_slider", - "z": "407d8cdb.3cb7cc", - "name": "flowrate", - "label": "Flowrate (ml/min)*", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "outs": "end", - "topic": "flowrate", - "min": 0, - "max": "20", - "step": "0.1", - "x": 480, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "d9a85435.ced5e", - "type": "function", - "z": "407d8cdb.3cb7cc", - "name": "get generic.flowrate", - "func": "msg.payload = msg.payload.generic_flowrate;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 190, - "y": 40, - "wires": [ - [ - "59b05f7f.9e83f8" - ] - ] - }, - { - "id": "c986ae96.860ec8", - "type": "subflow:407d8cdb.3cb7cc", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 740, - "y": 300, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ] - }, - { - "id": "99b5a67.080f258", - "type": "subflow:bdd6e33e.5db3b8", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 760, - "y": 100, - "wires": [ - [ - "1a5edafb.a05cf5" - ], - [ - "e001a28.555566" - ] - ] - }, - { - "id": "a71ba4a6.c44c4", - "type": "subflow:ad5a5663.ce893", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 740, - "y": 140, - "wires": [ - [ - "1a5edafb.a05cf5" - ], - [ - "e001a28.555566" - ] - ] - }, - { - "id": "9c301fc6.9a9318", - "type": "subflow:35488f4f.00498", - "z": "259c8713.b50e28", - "name": "System commands", - "env": [], - "x": 750, - "y": 460, - "wires": [] - }, - { - "id": "4d5b9f01.270e88", - "type": "exec", - "z": "344146df.e4d5ba", - "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "RPi Temp.", - "x": 350, - "y": 80, - "wires": [ - [ - "4f3fb60b.912848" - ], - [], - [] - ] - }, - { - "id": "1c4bc7ff.94aa8", - "type": "inject", - "z": "344146df.e4d5ba", - "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "10", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 190, - "y": 80, - "wires": [ - [ - "4d5b9f01.270e88" - ] - ] - }, - { - "id": "4f3fb60b.912848", - "type": "python3-function", - "z": "344146df.e4d5ba", - "name": "fan.py", - "func": "#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)", - "outputs": 1, - "x": 530, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "ee70d541.87713", - "type": "subflow:344146df.e4d5ba", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 300, - "y": 140, - "wires": [] - }, - { - "id": "c14cf94.1413e88", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_flush", - "label": "Duration of the flushing (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_flush", - "x": 520, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "d7b55d02.e41f1", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_bef_seq", - "label": "Duration before sequence (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_bef_seq", - "x": 510, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "8729ec5c.cf4ab8", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "nb_img", - "label": "Number of images per acquisition", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "nb_img", - "x": 540, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "3808d004.94ea28", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_flush", - "func": "msg.payload = msg.payload.duration_flush;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 210, - "y": 80, - "wires": [ - [ - "c14cf94.1413e88" - ] - ] - }, - { - "id": "f7cc1192.5a51e8", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get nb_img", - "func": "msg.payload = msg.payload.nb_img;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 190, - "y": 120, - "wires": [ - [ - "8729ec5c.cf4ab8" - ] - ] - }, - { - "id": "10ce45f6.3036ca", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_bef_seq", - "func": "msg.payload = msg.payload.duration_bef_seq;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 160, - "wires": [ - [ - "d7b55d02.e41f1" - ] - ] - }, - { - "id": "27bbe0f0.05b2c", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_bef_img", - "label": "Duration before image (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_bef_img", - "x": 510, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "70dfb6bb.9319", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_bef_img", - "func": "msg.payload = msg.payload.duration_bef_img;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 200, - "wires": [ - [ - "27bbe0f0.05b2c" - ] - ] - }, - { - "id": "b31fd152.a5489", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_between", - "label": "Duration between acquisition (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 6, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_between", - "x": 510, - "y": 240, - "wires": [ - [] - ] - }, - { - "id": "a0b53585.93216", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_between", - "func": "msg.payload = msg.payload.duration_between;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 240, - "wires": [ - [ - "b31fd152.a5489" - ] - ] - }, - { - "id": "fee8c0fa.108778", - "type": "subflow:91e5fd54.56f58", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 760, - "y": 380, - "wires": [] - }, - { - "id": "fe5585e.a1ab078", - "type": "subflow:4475ba6c.45604c", - "z": "259c8713.b50e28", - "name": "process metadata", - "env": [], - "x": 750, - "y": 180, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ] - }, - { - "id": "da9f1367.3a17a8", - "type": "subflow:b73d5eb8.60ef3", - "z": "259c8713.b50e28", - "d": true, - "name": "Valve actuation", - "env": [], - "x": 740, - "y": 220, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ], - "icon": "node-red-dashboard/ui_switch.png" - }, - { - "id": "69799a39.13803c", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_bef_cycle", - "func": "msg.payload = msg.payload.duration_bef_cycle;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "7a0b6294.e887c4" - ] - ] - }, - { - "id": "7a0b6294.e887c4", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_bef_cycle", - "label": "Duration before the cycles (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_bef_cycle", - "x": 510, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "a57fea5b.59eb5", + "id": "3b6b4fd4.8c3368", "type": "ui_toast", - "z": "91e5fd54.56f58", + "z": "246abd43.838a5a", "position": "top right", "displayTime": "3", "highlight": "", @@ -3601,73 +2092,389 @@ "wires": [] }, { - "id": "f7d3d0c4.0203", - "type": "exec", - "z": "1b486ba8.f8c41c", - "command": "sudo date -s", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, + "id": "613bee5b.042fe", + "type": "debug", + "z": "246abd43.838a5a", "name": "", - "x": 1010, - "y": 240, - "wires": [ - [], - [], - [] - ] + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "x": 240, + "y": 140, + "wires": [] }, { - "id": "c5fcaba5.184e88", - "type": "function", - "z": "1b486ba8.f8c41c", + "id": "84801dc0.193d88", + "type": "mqtt-broker", + "z": "", "name": "", - "func": "d = new Date();\n//get weekday\nvar weekday = new Array(7);\nweekday[0] = \"Sun\";\nweekday[1] = \"Mon\";\nweekday[2] = \"Tue\";\nweekday[3] = \"Wed\";\nweekday[4] = \"Thu\";\nweekday[5] = \"Fri\";\nweekday[6] = \"Sat\";\nvar w = weekday[d.getUTCDay()];\n//get Month\nvar month = new Array(12);\nmonth[0] = \"Jan\";\nmonth[1] = \"Feb\";\nmonth[2] = \"Mar\";\nmonth[3] = \"Apr\";\nmonth[4] = \"May\";\nmonth[5] = \"Jun\";\nmonth[6] = \"Jul\";\nmonth[7] = \"Aug\";\nmonth[8] = \"Sep\";\nmonth[9] = \"Oct\";\nmonth[10] = \"Nov\";\nmonth[11] = \"Dec\";\nvar n = month[d.getUTCMonth()];\n \n//get day\nvar day = d.getUTCDay()\n\n//get Hours\nvar Hours = d.getUTCHours();\n//get Minutes\nvar Minutes = d.getUTCMinutes();\n//get Seconds\nvar Seconds = d.getUTCSeconds();\n//get FullYear\nvar FullYear = d.getUTCFullYear();\n\n//Thu Aug 09 2012 23:34:04 GMT+0200 (GMT+02:00)\n\n//Thu Aug 9 21:31:26 UTC 2012\n\n//msg.payload = \"Thu Aug 9 21:31:26 UTC 2012\"\n\nmsg.payload = '\"'+w+\" \"+n+\" \"+day+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+\" UTC \"+FullYear+'\"';\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 40, + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "eb610eb9.84fae8", + "type": "ui_group", + "z": "", + "name": "MQTT Plots", + "tab": "2b97fe34.a699fa", + "order": 11, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "1273b673.4a35ea", + "type": "subflow", + "name": "System Commands", + "info": "", + "category": "", + "in": [], + "out": [], + "env": [], + "color": "#FFCC66", + "icon": "node-red-dashboard/ui_button.png" + }, + { + "id": "44a78834.e8f8b8", + "type": "ui_button", + "z": "1273b673.4a35ea", + "name": "", + "group": "82b3caaa.0518", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "Reboot", + "tooltip": "", + "color": "", + "bgcolor": "#AD1625", + "icon": "", + "payload": "off", + "payloadType": "str", + "topic": "reboot", + "x": 220, + "y": 80, "wires": [ [ - "a1c2a5e3.4aea58" + "aba9aac1.c2d198" ] ] }, { - "id": "807d5cce.2bb1e", - "type": "subflow:1b486ba8.f8c41c", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 280, - "y": 180, - "wires": [] + "id": "a32bfa65.bc6b9", + "type": "exec", + "z": "1273b673.4a35ea", + "command": "sudo", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "2", + "oldrc": false, + "name": "cmd", + "x": 530, + "y": 80, + "wires": [ + [], + [], + [] + ] }, { - "id": "a1c2a5e3.4aea58", - "type": "ui_template", - "z": "1b486ba8.f8c41c", - "group": "9214d59d.e7b52", + "id": "825c8791.c0bfb", + "type": "ui_button", + "z": "1273b673.4a35ea", "name": "", - "order": 1, + "group": "82b3caaa.0518", + "order": 2, "width": 0, "height": 0, - "format": "
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 640, - "y": 40, + "passthru": false, + "label": "Shutdown", + "tooltip": "", + "color": "", + "bgcolor": "#AD1625", + "icon": "", + "payload": "off", + "payloadType": "str", + "topic": "shutdown", + "x": 220, + "y": 140, + "wires": [ + [ + "aba9aac1.c2d198" + ] + ] + }, + { + "id": "aba9aac1.c2d198", + "type": "python3-function", + "z": "1273b673.4a35ea", + "name": "action", + "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", + "outputs": 1, + "x": 390, + "y": 100, + "wires": [ + [ + "72b7368a.abad3", + "a32bfa65.bc6b9" + ] + ] + }, + { + "id": "72b7368a.abad3", + "type": "exec", + "z": "1273b673.4a35ea", + "command": "i2cdetect -y 1", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "1", + "oldrc": false, + "name": "i2c update", + "x": 550, + "y": 140, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "82b3caaa.0518", + "type": "ui_group", + "z": "", + "name": "Commands", + "tab": "2b97fe34.a699fa", + "order": 12, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "506e9090.6e905", + "type": "subflow", + "name": "Object metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "4ab4976c.eee488" + }, + { + "id": "581c8a23.83fa8c" + }, + { + "id": "52052007.b3d0e" + } + ] + } + ], + "out": [ + { + "x": 1060, + "y": 159, + "wires": [ + { + "id": "26b33a5c.0ef82e", + "port": 0 + }, + { + "id": "9ee0935a.415808", + "port": 0 + } + ] + }, + { + "x": 1060, + "y": 59, + "wires": [ + { + "id": "d3875217.e3b668", + "port": 0 + }, + { + "id": "82fef572.49b5f", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "26b33a5c.0ef82e", + "type": "ui_numeric", + "z": "506e9090.6e905", + "name": "object_depth_min", + "label": "Minimum depth (m)", + "tooltip": "", + "group": "f377d75b.32d27", + "order": 3, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "object_depth_min", + "format": "{{value}}", + "min": "0", + "max": "2000", + "step": "1", + "x": 610, + "y": 120, "wires": [ [] ] }, { - "id": "9b1b260f.e4b338", + "id": "9ee0935a.415808", + "type": "ui_numeric", + "z": "506e9090.6e905", + "name": "object_depth_max", + "label": "Maximum depth (m)", + "tooltip": "", + "group": "f377d75b.32d27", + "order": 2, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "object_depth_max", + "format": "{{value}}", + "min": "0", + "max": "2000", + "step": "1", + "x": 610, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "4ab4976c.eee488", "type": "function", - "z": "ad5a5663.ce893", + "z": "506e9090.6e905", + "name": "get object_depth_min", + "func": "msg.payload = msg.payload.object_depth_min;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 304, + "y": 120, + "wires": [ + [ + "26b33a5c.0ef82e" + ] + ] + }, + { + "id": "581c8a23.83fa8c", + "type": "function", + "z": "506e9090.6e905", + "name": "get object_depth_max", + "func": "msg.payload = msg.payload.object_depth_max;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 304, + "y": 160, + "wires": [ + [ + "9ee0935a.415808" + ] + ] + }, + { + "id": "472998cd.45f588", + "type": "gpsd", + "z": "506e9090.6e905", + "name": "", + "hostname": "localhost", + "port": "2947", + "tpv": true, + "sky": false, + "info": false, + "device": false, + "gst": false, + "att": false, + "x": 90, + "y": 220, + "wires": [ + [ + "52052007.b3d0e", + "ab40705d.43a5d" + ] + ] + }, + { + "id": "7d5701.1e1981", + "type": "ui_worldmap", + "z": "506e9090.6e905", + "d": true, + "group": "f377d75b.32d27", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "lat": "1.5", + "lon": "1.5", + "zoom": "4", + "layer": "OSM grey", + "cluster": "1", + "maxage": "", + "usermenu": "hide", + "layers": "hide", + "panit": "false", + "panlock": "false", + "zoomlock": "false", + "hiderightclick": "true", + "coords": "deg", + "showgrid": "false", + "path": "/worldmap", + "x": 640, + "y": 200, + "wires": [] + }, + { + "id": "52052007.b3d0e", + "type": "function", + "z": "506e9090.6e905", + "name": "get object_lat & object_lon", + "func": "\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 320, + "y": 200, + "wires": [ + [ + "7d5701.1e1981" + ] + ] + }, + { + "id": "d3875217.e3b668", + "type": "function", + "z": "506e9090.6e905", "name": "set object_time", "func": "var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute;\nglobal.set('object_time',time_UTC);\nreturn msg;", "outputs": 1, @@ -3679,9 +2486,9 @@ ] }, { - "id": "86aa9817.45a2e8", + "id": "82fef572.49b5f", "type": "function", - "z": "ad5a5663.ce893", + "z": "506e9090.6e905", "name": "set object_date", "func": "var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;", "outputs": 1, @@ -3693,519 +2500,9 @@ ] }, { - "id": "546376f8.9d25d8", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "year", - "label": "Year", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 2, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "year", - "format": "{{value}}", - "min": "2020", - "max": "2030", - "step": 1, - "x": 630, - "y": 80, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "8a701d46.962ed8", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "month", - "label": "Month", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 3, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "month", - "format": "{{value}}", - "min": "1", - "max": "12", - "step": 1, - "x": 630, - "y": 120, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "3e39bc34.b3042c", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "day", - "label": "Day", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 4, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "day", - "format": "{{value}}", - "min": "1", - "max": "31", - "step": 1, - "x": 630, - "y": 160, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "6edc1533.cd3ab4", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "hour", - "label": "Hour", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 5, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "hour", - "format": "{{value}}", - "min": "0", - "max": "23", - "step": 1, - "x": 630, - "y": 200, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "1ba0f9e6.1be54e", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "minute", - "label": "Minute", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 6, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "minute", - "format": "{{value}}", - "min": "0", - "max": "59", - "step": 1, - "x": 630, - "y": 240, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "fd050fce.2ffe28", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "second", - "label": "Second", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 7, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "second", - "format": "{{value}}", - "min": "0", - "max": "59", - "step": 1, - "x": 640, - "y": 280, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "e1cc68bb.7b045", - "type": "interval", - "z": "1b486ba8.f8c41c", - "name": "interval", - "interval": "1", - "onstart": false, - "msg": "ping", - "showstatus": true, - "unit": "seconds", - "statusformat": "YYYY-MM-D HH:mm:ss", - "x": 310, - "y": 40, - "wires": [ - [ - "c5fcaba5.184e88" - ] - ] - }, - { - "id": "23f1828c.afae3e", - "type": "ui_button", - "z": "1b486ba8.f8c41c", - "name": "", - "group": "9214d59d.e7b52", - "order": 8, - "width": 4, - "height": 1, - "passthru": false, - "label": "Update", - "tooltip": "", - "color": "black", - "bgcolor": "white", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 640, - "y": 320, - "wires": [ - [ - "cb4c9210.01c958" - ] - ] - }, - { - "id": "cb4c9210.01c958", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "update datetime", - "func": "var FullYear= global.get(\"year\");\nvar Month= global.get(\"month\");\nvar day= global.get(\"day\");\nvar Hours= global.get(\"hour\");\nvar Minutes= global.get(\"minute\");\nvar Seconds= global.get(\"second\");\n\nmsg.payload = new Date();\n//get Month\nvar month = new Array(12);\nmonth[1] = \"Jan\";\nmonth[2] = \"Feb\";\nmonth[3] = \"Mar\";\nmonth[4] = \"Apr\";\nmonth[5] = \"May\";\nmonth[6] = \"Jun\";\nmonth[7] = \"Jul\";\nmonth[8] = \"Aug\";\nmonth[9] = \"Sep\";\nmonth[10] = \"Oct\";\nmonth[11] = \"Nov\";\nmonth[12] = \"Dec\";\nvar n = month[Month];\n \nmsg.payload = '\"'+day+\" \"+n+\" \"+FullYear+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+'\"';\n\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 800, - "y": 320, - "wires": [ - [ - "7c1c8abf.4b984c", - "f7d3d0c4.0203" - ] - ] - }, - { - "id": "dc685555.af057", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 840, - "y": 60, - "wires": [ - [] - ] - }, - { - "id": "7c1c8abf.4b984c", + "id": "ab40705d.43a5d", "type": "debug", - "z": "1b486ba8.f8c41c", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 1010, - "y": 300, - "wires": [] - }, - { - "id": "92842b63.e0d7b8", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCFullYear();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 80, - "wires": [ - [ - "546376f8.9d25d8" - ] - ] - }, - { - "id": "48033b32.2bca94", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = new Date();\nmsg.payload = d\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 310, - "y": 80, - "wires": [ - [ - "92842b63.e0d7b8", - "94057891.b1a658", - "aab6990b.1cf718", - "42b00a98.b36bb4", - "e2370ad.c8e7ff8", - "9c43dfe1.eb6178" - ] - ] - }, - { - "id": "94057891.b1a658", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCMonth();\n\nmsg.payload = val+1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 120, - "wires": [ - [ - "8a701d46.962ed8" - ] - ] - }, - { - "id": "aab6990b.1cf718", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCDay();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 160, - "wires": [ - [ - "3e39bc34.b3042c" - ] - ] - }, - { - "id": "42b00a98.b36bb4", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCHours();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 200, - "wires": [ - [ - "6edc1533.cd3ab4" - ] - ] - }, - { - "id": "e2370ad.c8e7ff8", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCMinutes();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 240, - "wires": [ - [ - "1ba0f9e6.1be54e" - ] - ] - }, - { - "id": "9c43dfe1.eb6178", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCSeconds();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 280, - "wires": [ - [ - "fd050fce.2ffe28" - ] - ] - }, - { - "id": "ca843dd8.d1c62", - "type": "exec", - "z": "66c23d37.f72cdc", - "command": "python3.7 /home/pi/PlanktonScope/script/mqtt_pump_focus_image_segment_strem.py", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 520, - "y": 100, - "wires": [ - [], - [ - "a49ed5a6.5b73b8" - ], - [] - ] - }, - { - "id": "1af32c3e.856864", - "type": "exec", - "z": "66c23d37.f72cdc", - "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/mqtt_pump_focus_image_segment_strem.py\"| head -1 | awk -F \" \" '{print$1}' ", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 660, - "y": 160, - "wires": [ - [ - "ddabe48c.369c68" - ], - [], - [] - ] - }, - { - "id": "ddabe48c.369c68", - "type": "exec", - "z": "66c23d37.f72cdc", - "command": "kill", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 1210, - "y": 120, - "wires": [ - [ - "6382060e.460ab8" - ], - [ - "6382060e.460ab8" - ], - [ - "6382060e.460ab8" - ] - ] - }, - { - "id": "fcaca139.5ed04", - "type": "ui_button", - "z": "66c23d37.f72cdc", - "name": "", - "group": "9214d59d.e7b52", - "order": 9, - "width": 12, - "height": 1, - "passthru": false, - "label": "Kill MQTT", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 80, - "y": 160, - "wires": [ - [ - "1af32c3e.856864" - ] - ] - }, - { - "id": "9d663990.fd2908", - "type": "ui_button", - "z": "66c23d37.f72cdc", - "name": "", - "group": "9214d59d.e7b52", - "order": 10, - "width": 12, - "height": 1, - "passthru": false, - "label": "Restart MQTT", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 100, - "y": 100, - "wires": [ - [ - "ca843dd8.d1c62" - ] - ] - }, - { - "id": "a49ed5a6.5b73b8", - "type": "ui_toast", - "z": "66c23d37.f72cdc", - "position": "top right", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 0, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 920, - "y": 100, - "wires": [] - }, - { - "id": "fda01242.9576a8", - "type": "subflow:66c23d37.f72cdc", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 270, - "y": 220, - "wires": [] - }, - { - "id": "bbb7cb31.15121", - "type": "debug", - "z": "ad5a5663.ce893", + "z": "506e9090.6e905", "name": "", "active": true, "tosidebar": true, @@ -4218,73 +2515,651 @@ "wires": [] }, { - "id": "6382060e.460ab8", - "type": "debug", - "z": "66c23d37.f72cdc", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 1380, - "y": 120, - "wires": [] + "id": "f377d75b.32d27", + "type": "ui_group", + "z": "", + "name": "Object metadata", + "tab": "2b97fe34.a699fa", + "order": 6, + "disp": true, + "width": "24", + "collapse": false }, { - "id": "b23ae409.085ad8", - "type": "ui_button", - "z": "8d959937.18735", - "name": "", - "group": "d170ac9c.3b4828", - "order": 1, + "id": "97d77aeb.75afd8", + "type": "subflow", + "name": "Acquisition metadata", + "info": "", + "category": "", + "in": [ + { + "x": 50, + "y": 30, + "wires": [ + { + "id": "282cae65.749e9a" + }, + { + "id": "cc899daf.a8d5d8" + }, + { + "id": "9873f1c8.6cb608" + }, + { + "id": "e53df171.eed68" + }, + { + "id": "5f728563.cf6214" + }, + { + "id": "c1a5eaf5.8691c" + }, + { + "id": "86c63d98.eb21" + }, + { + "id": "3707a612.b8619a" + }, + { + "id": "b2d20d5d.fd9e38" + } + ] + } + ], + "out": [ + { + "x": 740, + "y": 40, + "wires": [ + { + "id": "3b267291.1eee26", + "port": 0 + }, + { + "id": "435a2dcf.a1a60c", + "port": 0 + }, + { + "id": "cc6cb58d.b2dbe8", + "port": 0 + }, + { + "id": "8b306bbc.914", + "port": 0 + }, + { + "id": "2a5a2b7a.f218d4", + "port": 0 + }, + { + "id": "28df07d8.d71ba8", + "port": 0 + }, + { + "id": "6cf2c1ac.a0fea8", + "port": 0 + }, + { + "id": "e7c4132f.f4417", + "port": 0 + } + ] + }, + { + "x": 900, + "y": 360, + "wires": [ + { + "id": "1e688c91.1b805b", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "1e688c91.1b805b", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "set optical config", + "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"acq_magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"acq_magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"acq_magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"acq_magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"acq_magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 750, + "y": 360, + "wires": [ + [] + ] + }, + { + "id": "2877f2f.211cc8e", + "type": "ui_dropdown", + "z": "97d77aeb.75afd8", + "name": "acq_fnumber_objective", + "label": "M12 Lens*", + "tooltip": "", + "place": "Select option", + "group": "60b93a5.a032344", + "order": 3, "width": 0, "height": 0, - "passthru": false, - "label": "Start Acquisition", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", + "passthru": true, + "options": [ + { + "label": "f 25mm 1/2\" 5MP IR", + "value": 25, + "type": "num" + }, + { + "label": "f 16mm 1/2.5\" 5MP IR", + "value": 16, + "type": "num" + }, + { + "label": "f 12mm 1/2.5\" 5MP IR", + "value": 12, + "type": "num" + }, + { + "label": "f 8mm 1/2.5\" 5MP IR", + "value": 8, + "type": "num" + }, + { + "label": "f 6mm 1/2.5\" 5MP IR", + "value": 6, + "type": "num" + } + ], "payload": "", - "payloadType": "str", - "topic": "actuator/image", - "x": 200, - "y": 100, + "topic": "acq_fnumber_objective", + "x": 526, + "y": 360, "wires": [ [ - "715c6be9.55822c" + "1e688c91.1b805b" ] ] }, { - "id": "715c6be9.55822c", + "id": "8b306bbc.914", + "type": "ui_numeric", + "z": "97d77aeb.75afd8", + "name": "acq_minimum_mesh", + "label": "Min fraction size (μm)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 8, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "acq_minimum_mesh", + "format": "{{value}}", + "min": 0, + "max": "300", + "step": "10", + "x": 536, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "2a5a2b7a.f218d4", + "type": "ui_numeric", + "z": "97d77aeb.75afd8", + "name": "acq_maximum_mesh", + "label": "Max fraction size (μm)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 4, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "acq_maximum_mesh", + "format": "{{value}}", + "min": "200", + "max": "2000", + "step": "100", + "x": 536, + "y": 200, + "wires": [ + [] + ] + }, + { + "id": "3b267291.1eee26", + "type": "ui_text_input", + "z": "97d77aeb.75afd8", + "name": "acq_id", + "label": "Acquisition unique ID*", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "acq_id", + "x": 586, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "cc6cb58d.b2dbe8", + "type": "ui_dropdown", + "z": "97d77aeb.75afd8", + "name": "acq_celltype", + "label": "Thickness flowcell*", + "tooltip": "", + "place": "Select option", + "group": "60b93a5.a032344", + "order": 7, + "width": 0, + "height": 0, + "passthru": true, + "options": [ + { + "label": "200 μm µ-Slide I Luer", + "value": 200, + "type": "num" + }, + { + "label": "400 μm µ-Slide I Luer", + "value": 400, + "type": "num" + }, + { + "label": "600 μm µ-Slide I Luer", + "value": 600, + "type": "num" + }, + { + "label": "800 μm µ-Slide I Luer", + "value": 800, + "type": "num" + } + ], + "payload": "", + "topic": "acq_celltype", + "x": 566, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "28df07d8.d71ba8", + "type": "ui_text_input", + "z": "97d77aeb.75afd8", + "name": "acq_volume", + "label": "Volume to pass (ml)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "acq_volume", + "x": 566, + "y": 240, + "wires": [ + [] + ] + }, + { + "id": "435a2dcf.a1a60c", + "type": "ui_text_input", + "z": "97d77aeb.75afd8", + "name": "acq_instrument", + "label": "Acquisition instrument", + "tooltip": "PlanktonScope V2.1", + "group": "60b93a5.a032344", + "order": 6, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "acq_instrument", + "x": 556, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "282cae65.749e9a", "type": "function", - "z": "8d959937.18735", - "name": "image.js", - "func": "state = global.get(\"state\");\nglobal.set('img_counter',0)\nglobal.set('obj_counter',0)\nif (state == null){state=\"free\"}\n\nvar duration_bef_cycle= global.get(\"duration_bef_cycle\");\nvar duration_flush= global.get(\"duration_flush\");\nvar nb_img= global.get(\"nb_img\");\nvar duration_bef_seq= global.get(\"duration_bef_seq\");\nvar duration_bef_img= global.get(\"duration_bef_img\");\nvar duration_between= global.get(\"duration_between\");\n\nif (duration_bef_cycle === undefined || duration_bef_cycle === \"\" || duration_bef_cycle === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before the cycles\";\n \n}else if (duration_flush === undefined || duration_flush === \"\" || duration_flush === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration of the flushing\";\n \n}else if (nb_img === undefined || nb_img === \"\" || nb_img === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Directory to store the images\";\n \n}else if (duration_bef_seq === undefined || duration_bef_seq === \"\" || duration_bef_seq === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before the sequence\";\n \n}else if (duration_bef_img === undefined || duration_bef_img === \"\" || duration_bef_img === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before an image\";\n \n}else if (duration_between === undefined || duration_between === \"\" || duration_between === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration between sequence\";\n \n}else {\n nb_img=nb_img-1\n msg.payload=duration_bef_cycle+' '+duration_flush+' '+nb_img+' '+duration_bef_seq+' '+duration_bef_img+' '+duration_between;\n}\nreturn msg;", + "z": "97d77aeb.75afd8", + "name": "get acq_id", + "func": "msg.payload = msg.payload.acq_id+1;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 360, - "y": 100, + "x": 210, + "y": 40, "wires": [ [ - "bda62ebe.dd2e4" + "3b267291.1eee26" + ] + ] + }, + { + "id": "cc899daf.a8d5d8", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "get acq_instrument", + "func": "msg.payload = msg.payload.acq_instrument;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 80, + "wires": [ + [ + "435a2dcf.a1a60c" + ] + ] + }, + { + "id": "9873f1c8.6cb608", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "get acq_celltype", + "func": "msg.payload = msg.payload.acq_celltype;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 120, + "wires": [ + [ + "cc6cb58d.b2dbe8" + ] + ] + }, + { + "id": "e53df171.eed68", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "get acq_minimum_mesh", + "func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 250, + "y": 160, + "wires": [ + [ + "8b306bbc.914" + ] + ] + }, + { + "id": "5f728563.cf6214", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "get acq_maximum_mesh", + "func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 250, + "y": 200, + "wires": [ + [ + "2a5a2b7a.f218d4" + ] + ] + }, + { + "id": "c1a5eaf5.8691c", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "get acq_volume", + "func": "msg.payload = msg.payload.acq_volume;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 240, + "wires": [ + [ + "28df07d8.d71ba8" + ] + ] + }, + { + "id": "b2d20d5d.fd9e38", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "get acq_fnumber_objective", + "func": "msg.payload = msg.payload.acq_fnumber_objective;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 260, + "y": 360, + "wires": [ + [ + "2877f2f.211cc8e" + ] + ] + }, + { + "id": "6cf2c1ac.a0fea8", + "type": "ui_numeric", + "z": "97d77aeb.75afd8", + "name": "acq_min_esd", + "label": "Minimum size to segment (μm)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 9, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "acq_min_esd", + "format": "{{value}}", + "min": 0, + "max": "300", + "step": "5", + "x": 566, + "y": 280, + "wires": [ + [] + ] + }, + { + "id": "e7c4132f.f4417", + "type": "ui_numeric", + "z": "97d77aeb.75afd8", + "name": "acq_max_esd", + "label": "Maximum size to segment (μm)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 5, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "acq_max_esd", + "format": "{{value}}", + "min": "100", + "max": "2000", + "step": "5", + "x": 556, + "y": 320, + "wires": [ + [] + ] + }, + { + "id": "86c63d98.eb21", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "get acq_min_esd", + "func": "msg.payload = msg.payload.acq_min_esd;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 280, + "wires": [ + [ + "6cf2c1ac.a0fea8" + ] + ] + }, + { + "id": "3707a612.b8619a", + "type": "function", + "z": "97d77aeb.75afd8", + "name": "get acq_max_esd", + "func": "msg.payload = msg.payload.acq_max_esd;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 320, + "wires": [ + [ + "e7c4132f.f4417" + ] + ] + }, + { + "id": "60b93a5.a032344", + "type": "ui_group", + "z": "", + "name": "Acquisition metadata", + "tab": "2b97fe34.a699fa", + "order": 7, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "9a45991b.365bc8", + "type": "subflow", + "name": "Pump actuation", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "eb7c01ae.d00358" + }, + { + "id": "642ae1f3.cf7d28" + } + ] + } + ], + "out": [ + { + "x": 700, + "y": 40, + "wires": [ + { + "id": "4485759b.52ee74", + "port": 0 + }, + { + "id": "3283f063.31c548", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "font-awesome/fa-recycle" + }, + { + "id": "6246d9ef.156bd", + "type": "function", + "z": "9a45991b.365bc8", + "name": "pump.js", + "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"pump_manual_volume\");\nvar flowrate= global.get(\"pump_flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n volume = global.get(\"pump_manual_volume\");\n nb_step=volume*507\n msg.volume = volume;\n flowrate = global.get(\"pump_flowrate\");\n duration=(volume*60)/flowrate\n delay=(duration/nb_step)-0.005\n msg.topic = \"actuator/pump\";\n \n if(msg.payload === \"FORWARD\" & state===\"free\"){\n msg.payload='FORWARD '+delay+' '+nb_step;\n }\n if(msg.payload === \"BACKWARD\" & state===\"free\"){\n msg.payload='BACKWARD '+delay+' '+nb_step;\n }\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 640, + "y": 140, + "wires": [ + [ + "53bef09a.8102e" ] ], "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" }, { - "id": "bda62ebe.dd2e4", + "id": "2374d55d.a3e3a2", + "type": "ui_button", + "z": "9a45991b.365bc8", + "name": "BACKWARD", + "group": "4153382f.45437", + "order": 2, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "arrow_back", + "payload": "BACKWARD", + "payloadType": "str", + "topic": "actuator/pump", + "x": 470, + "y": 120, + "wires": [ + [ + "6246d9ef.156bd" + ] + ] + }, + { + "id": "c8aa9753.f51c08", + "type": "ui_button", + "z": "9a45991b.365bc8", + "name": "FORWARD", + "group": "4153382f.45437", + "order": 4, + "width": 6, + "height": 1, + "passthru": true, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "arrow_forward", + "payload": "FORWARD", + "payloadType": "str", + "topic": "actuator/pump", + "x": 470, + "y": 160, + "wires": [ + [ + "6246d9ef.156bd" + ] + ] + }, + { + "id": "53bef09a.8102e", "type": "switch", - "z": "8d959937.18735", + "z": "9a45991b.365bc8", "name": "", "property": "topic", "propertyType": "msg", "rules": [ { "t": "eq", - "v": "actuator/image", + "v": "actuator/pump", "vt": "str" }, { @@ -4296,21 +3171,21 @@ "checkall": "true", "repair": false, "outputs": 2, - "x": 510, - "y": 100, + "x": 770, + "y": 140, "wires": [ [ - "366697a.e8f6068" + "4d3bf3c2.6a380c" ], [ - "e2049db5.46682" + "d943e58a.e85fc" ] ] }, { - "id": "e2049db5.46682", + "id": "d943e58a.e85fc", "type": "ui_toast", - "z": "8d959937.18735", + "z": "9a45991b.365bc8", "position": "dialog", "displayTime": "3", "highlight": "", @@ -4321,36 +3196,23 @@ "raw": false, "topic": "", "name": "", - "x": 690, - "y": 120, + "x": 930, + "y": 160, "wires": [ [] ] }, { - "id": "366697a.e8f6068", - "type": "mqtt out", - "z": "8d959937.18735", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 670, - "y": 80, - "wires": [] - }, - { - "id": "3a85a060.ad2aa", + "id": "eaa22490.6843d", "type": "ui_button", - "z": "8d959937.18735", - "name": "Stop Acquisition", - "group": "d170ac9c.3b4828", - "order": 2, - "width": 0, - "height": 0, + "z": "9a45991b.365bc8", + "name": "stop pump", + "group": "4153382f.45437", + "order": 5, + "width": 4, + "height": 1, "passthru": true, - "label": "STOP ACQUISITION", + "label": "STOP PUMP", "tooltip": "", "color": "", "bgcolor": "#AD1625", @@ -4358,79 +3220,1077 @@ "payload": "off", "payloadType": "str", "topic": "actuator/wait", - "x": 200, - "y": 140, + "x": 470, + "y": 200, "wires": [ [ - "f59d51da.c3b078" + "9e71b7a5.28dff8" ] ] }, { - "id": "f59d51da.c3b078", + "id": "4d3bf3c2.6a380c", "type": "mqtt out", - "z": "8d959937.18735", + "z": "9a45991b.365bc8", "name": "", "topic": "", "qos": "", "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 350, - "y": 140, + "broker": "e8ab36cc.74d77", + "x": 910, + "y": 120, "wires": [] }, { - "id": "8ade1ac1.5c3408", - "type": "ui_switch", - "z": "8d959937.18735", - "name": "Segmentation", - "label": "Segmentation", + "id": "9e71b7a5.28dff8", + "type": "mqtt out", + "z": "9a45991b.365bc8", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 610, + "y": 200, + "wires": [] + }, + { + "id": "3283f063.31c548", + "type": "ui_text_input", + "z": "9a45991b.365bc8", + "name": "pump_manual_volume", + "label": "Volume to pass (ml)", "tooltip": "", - "group": "d170ac9c.3b4828", + "group": "4153382f.45437", + "order": 3, + "width": 8, + "height": 1, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "pump_manual_volume", + "x": 480, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "642ae1f3.cf7d28", + "type": "function", + "z": "9a45991b.365bc8", + "name": "get pump_manual_volume", + "func": "msg.payload = msg.payload.pump_manual_volume;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 80, + "wires": [ + [ + "3283f063.31c548" + ] + ] + }, + { + "id": "4485759b.52ee74", + "type": "ui_slider", + "z": "9a45991b.365bc8", + "name": "pump_flowrate", + "label": "Flowrate (ml/min)*", + "tooltip": "", + "group": "4153382f.45437", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "outs": "end", + "topic": "pump_flowrate", + "min": 0, + "max": "20", + "step": "0.1", + "x": 500, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "eb7c01ae.d00358", + "type": "function", + "z": "9a45991b.365bc8", + "name": "get pump_flowrate", + "func": "msg.payload = msg.payload.pump_flowrate;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 190, + "y": 40, + "wires": [ + [ + "4485759b.52ee74" + ] + ] + }, + { + "id": "4153382f.45437", + "type": "ui_group", + "z": "", + "name": "Pump actuation", + "tab": "2b97fe34.a699fa", + "order": 5, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "ac806d39.1682a8", + "type": "subflow", + "name": "Focus actuation", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "c631467a.569ba" + } + ] + } + ], + "out": [ + { + "x": 800, + "y": 200, + "wires": [ + { + "id": "97bf666e.4d3ad", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "node-red/sort.svg" + }, + { + "id": "97bf666e.4d3ad", + "type": "ui_text_input", + "z": "ac806d39.1682a8", + "name": "focus_nb_step", + "label": "Number of step(s)", + "tooltip": "", + "group": "69433259.f306fc", + "order": 2, + "width": 8, + "height": 1, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "focus_nb_step", + "x": 540, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "c631467a.569ba", + "type": "function", + "z": "ac806d39.1682a8", + "name": "get focus_nb_step", + "func": "msg.payload = msg.payload.focus_nb_step;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 40, + "wires": [ + [ + "97bf666e.4d3ad" + ] + ] + }, + { + "id": "8346f4af.5c0978", + "type": "ui_button", + "z": "ac806d39.1682a8", + "name": "DOWN", + "group": "69433259.f306fc", + "order": 3, + "width": 6, + "height": 1, + "passthru": true, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "arrow_downward", + "payload": "DOWN", + "payloadType": "str", + "topic": "actuator/focus", + "x": 520, + "y": 120, + "wires": [ + [ + "350c388d.12cd28" + ] + ] + }, + { + "id": "7ee30e1c.691bd", + "type": "ui_button", + "z": "ac806d39.1682a8", + "name": "UP", + "group": "69433259.f306fc", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "arrow_upwards", + "payload": "UP", + "payloadType": "str", + "topic": "actuator/focus", + "x": 530, + "y": 81, + "wires": [ + [ + "350c388d.12cd28" + ] + ] + }, + { + "id": "a2f04fac.5a338", + "type": "switch", + "z": "ac806d39.1682a8", + "name": "", + "property": "topic", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "actuator/focus", + "vt": "str" + }, + { + "t": "eq", + "v": "Missing entry :", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 810, + "y": 100, + "wires": [ + [ + "9fd904e.d1cbcf8" + ], + [ + "ccd4fa1e.152" + ] + ] + }, + { + "id": "ccd4fa1e.152", + "type": "ui_toast", + "z": "ac806d39.1682a8", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 970, + "y": 140, + "wires": [ + [] + ] + }, + { + "id": "350c388d.12cd28", + "type": "function", + "z": "ac806d39.1682a8", + "name": "focus.js", + "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"focus_nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"focus_nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 660, + "y": 100, + "wires": [ + [ + "a2f04fac.5a338" + ] + ], + "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" + }, + { + "id": "da904b2b.4a1d68", + "type": "ui_button", + "z": "ac806d39.1682a8", + "name": "stop focus", + "group": "69433259.f306fc", + "order": 4, + "width": 4, + "height": 1, + "passthru": true, + "label": "STOP FOCUS", + "tooltip": "", + "color": "", + "bgcolor": "#AD1625", + "icon": "", + "payload": "off", + "payloadType": "str", + "topic": "actuator/wait", + "x": 510, + "y": 160, + "wires": [ + [ + "8bb9c09d.bc8178" + ] + ] + }, + { + "id": "9fd904e.d1cbcf8", + "type": "mqtt out", + "z": "ac806d39.1682a8", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 950, + "y": 80, + "wires": [] + }, + { + "id": "8bb9c09d.bc8178", + "type": "mqtt out", + "z": "ac806d39.1682a8", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 650, + "y": 160, + "wires": [] + }, + { + "id": "69433259.f306fc", + "type": "ui_group", + "z": "", + "name": "Focus actuation", + "tab": "2b97fe34.a699fa", + "order": 4, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "e8ab36cc.74d77", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "5c6dd7ee.546fa8", + "type": "subflow", + "name": "Sample metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "730e3aa0.75f6dc" + }, + { + "id": "b49441ee.07b358" + }, + { + "id": "77454044.f47e88" + }, + { + "id": "203e3416.6c480c" + }, + { + "id": "3555467a.6ba1ea" + } + ] + } + ], + "out": [ + { + "x": 840, + "y": 40, + "wires": [ + { + "id": "419967b7.b9b5f", + "port": 0 + }, + { + "id": "9b3f7b46.107718", + "port": 0 + }, + { + "id": "6f24740b.fbae5c", + "port": 0 + }, + { + "id": "bf7a47c8.a960b8", + "port": 0 + }, + { + "id": "327afe96.262122", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "6f24740b.fbae5c", + "type": "ui_text_input", + "z": "5c6dd7ee.546fa8", + "name": "sample_ship", + "label": "Name of the ship", + "tooltip": "", + "group": "417f91c9.193ab", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "sample_ship", + "x": 590, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "327afe96.262122", + "type": "ui_dropdown", + "z": "5c6dd7ee.546fa8", + "name": "sample_sampling_gear", + "label": "Sampling gear", + "tooltip": "", + "place": "Select", + "group": "417f91c9.193ab", + "order": 4, + "width": 0, + "height": 0, + "passthru": true, + "options": [ + { + "label": "Plankton net", + "value": "net", + "type": "str" + }, + { + "label": "Niskin bottle 12L", + "value": "niskin_12L", + "type": "str" + }, + { + "label": "Niskin bottle 24L", + "value": "niskin_24L", + "type": "str" + }, + { + "label": "Pass Hull", + "value": "pass_hull", + "type": "str" + }, + { + "label": "Flask", + "value": "flask", + "type": "str" + } + ], + "payload": "", + "topic": "sample_sampling_gear", + "x": 550, + "y": 200, + "wires": [ + [] + ] + }, + { + "id": "bf7a47c8.a960b8", + "type": "ui_text_input", + "z": "5c6dd7ee.546fa8", + "name": "sample_operator", + "label": "Name of the operator", + "tooltip": "", + "group": "417f91c9.193ab", "order": 3, "width": 0, "height": 0, - "passthru": false, - "decouple": "false", - "topic": "actuator/segmentation_state", - "style": "", - "onvalue": "true", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "str", - "officon": "", - "offcolor": "", - "x": 200, - "y": 180, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "sample_operator", + "x": 570, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "419967b7.b9b5f", + "type": "ui_text_input", + "z": "5c6dd7ee.546fa8", + "name": "sample_project", + "label": "Name of the project*", + "tooltip": "", + "group": "417f91c9.193ab", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "sample_project", + "x": 580, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "9b3f7b46.107718", + "type": "ui_text_input", + "z": "5c6dd7ee.546fa8", + "name": "sample_id", + "label": "ID of the station*", + "tooltip": "", + "group": "417f91c9.193ab", + "order": 5, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "sample_id", + "x": 590, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "730e3aa0.75f6dc", + "type": "function", + "z": "5c6dd7ee.546fa8", + "name": "get sample_projet", + "func": "msg.payload = msg.payload.sample_project;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 250, + "y": 40, "wires": [ [ - "7751b219.9a3e1c" + "419967b7.b9b5f" ] ] }, { - "id": "7751b219.9a3e1c", - "type": "mqtt out", - "z": "8d959937.18735", + "id": "77454044.f47e88", + "type": "function", + "z": "5c6dd7ee.546fa8", + "name": "get sample_ship", + "func": "msg.payload = msg.payload.sample_ship;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 240, + "y": 120, + "wires": [ + [ + "6f24740b.fbae5c" + ] + ] + }, + { + "id": "b49441ee.07b358", + "type": "function", + "z": "5c6dd7ee.546fa8", + "name": "get sample_id", + "func": "msg.payload = msg.payload.sample_id+1;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 240, + "y": 80, + "wires": [ + [ + "9b3f7b46.107718" + ] + ] + }, + { + "id": "203e3416.6c480c", + "type": "function", + "z": "5c6dd7ee.546fa8", + "name": "get sample_operator", + "func": "msg.payload = msg.payload.sample_operator;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 260, + "y": 160, + "wires": [ + [ + "bf7a47c8.a960b8" + ] + ] + }, + { + "id": "3555467a.6ba1ea", + "type": "function", + "z": "5c6dd7ee.546fa8", + "name": "get sample_sampling_gear", + "func": "msg.payload = msg.payload.sample_sampling_gear;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 200, + "wires": [ + [ + "327afe96.262122" + ] + ] + }, + { + "id": "417f91c9.193ab", + "type": "ui_group", + "z": "", + "name": "Sample metadata", + "tab": "2b97fe34.a699fa", + "order": 2, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "2b97fe34.a699fa", + "type": "ui_tab", + "z": "", + "name": "GUI", + "icon": "fa-eyedropper", + "order": 2, + "disabled": false, + "hidden": false + }, + { + "id": "bb8dbe68.7e20a", + "type": "tab", + "label": "Main", + "disabled": false, + "info": "" + }, + { + "id": "20340bb6.5f923c", + "type": "function", + "z": "bb8dbe68.7e20a", + "name": "get global", + "func": "msg.payload={\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"custom_nb_frame\":global.get(\"custom_nb_frame\"),\n \"custom_nb_step\":global.get(\"custom_nb_step\"),\n \"custom_segmentation\":global.get(\"custom_segmentation\"),\n \"custom_sleep_before\":global.get(\"custom_sleep_before\"),\n \"focus_nb_step\":global.get(\"focus_nb_step\"),\n \"pump_flowrate\":global.get(\"pump_flowrate\"),\n \"pump_manual_volume\":global.get(\"pump_manual_volume\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n \n};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 1260, + "y": 160, + "wires": [ + [ + "d69f0eb1.d514d" + ] + ] + }, + { + "id": "aed82ae1.3a7558", + "type": "file", + "z": "bb8dbe68.7e20a", "name": "", + "filename": "/home/pi/PlanktonScope/config.json", + "appendNewline": true, + "createDir": true, + "overwriteFile": "true", + "encoding": "none", + "x": 1640, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "d69f0eb1.d514d", + "type": "json", + "z": "bb8dbe68.7e20a", + "name": "config.json", + "property": "payload", + "action": "str", + "pretty": true, + "x": 1410, + "y": 160, + "wires": [ + [ + "aed82ae1.3a7558" + ] + ] + }, + { + "id": "b57ab8b0.7bfc4", + "type": "file in", + "z": "bb8dbe68.7e20a", + "name": "", + "filename": "/home/pi/PlanktonScope/config.json", + "format": "utf8", + "chunk": false, + "sendError": false, + "encoding": "none", + "x": 360, + "y": 80, + "wires": [ + [ + "5b6059c3.8d4fa8" + ] + ], + "info": "# PlanktonScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" + }, + { + "id": "7880a269.4817ac", + "type": "inject", + "z": "bb8dbe68.7e20a", + "name": "on_load", "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 350, - "y": 180, + "payload": "", + "payloadType": "date", + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "x": 120, + "y": 80, + "wires": [ + [ + "b57ab8b0.7bfc4", + "10d8393.60498c7", + "dba45961.85d67", + "8231cfcc.0c5dd8" + ] + ], + "info": "# PlanktonScope Help\nWhen the **Pi** is booting, **Node-RED** will be initiated and this node will be activated once and execute the following nodes." + }, + { + "id": "5b6059c3.8d4fa8", + "type": "json", + "z": "bb8dbe68.7e20a", + "name": "config.json", + "property": "payload", + "action": "", + "pretty": false, + "x": 610, + "y": 80, + "wires": [ + [ + "9b872b59.667ee", + "67bab5e1.2c7dcc", + "8e5a1fb0.dc878", + "bfc59fc4.be21a8", + "80434aac.22226", + "a3453d30.ca9a28", + "e25e094c.60fb1" + ] + ] + }, + { + "id": "1b45a311.c993ed", + "type": "function", + "z": "bb8dbe68.7e20a", + "name": "set global", + "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 1080, + "y": 80, + "wires": [ + [ + "20340bb6.5f923c" + ] + ] + }, + { + "id": "1d54c0bf.fbcf07", + "type": "rpi-gpio out", + "z": "bb8dbe68.7e20a", + "name": "", + "pin": "40", + "set": "", + "level": "0", + "freq": "", + "out": "out", + "x": 440, + "y": 120, "wires": [] }, { - "id": "2a677ff0.62e0f", - "type": "subflow:8d959937.18735", - "z": "259c8713.b50e28", + "id": "7da863d0.f7d41c", + "type": "ui_template", + "z": "bb8dbe68.7e20a", + "group": "dc721eb.9ef51e", + "name": "Stream Pi Camera", + "order": 1, + "width": 24, + "height": 11, + "format": "
", + "storeOutMessages": true, + "fwdInMessages": true, + "templateScope": "local", + "x": 830, + "y": 320, + "wires": [ + [] + ] + }, + { + "id": "10d8393.60498c7", + "type": "function", + "z": "bb8dbe68.7e20a", + "name": "init LED", + "func": "msg.payload=1;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 120, + "wires": [ + [ + "1d54c0bf.fbcf07" + ] + ] + }, + { + "id": "9b872b59.667ee", + "type": "subflow:5c6dd7ee.546fa8", + "z": "bb8dbe68.7e20a", "name": "", "env": [], - "x": 750, - "y": 420, + "x": 830, + "y": 80, + "wires": [ + [ + "1b45a311.c993ed" + ] + ] + }, + { + "id": "a3453d30.ca9a28", + "type": "subflow:ac806d39.1682a8", + "z": "bb8dbe68.7e20a", + "name": "", + "env": [], + "x": 820, + "y": 240, + "wires": [ + [ + "1b45a311.c993ed" + ] + ] + }, + { + "id": "e25e094c.60fb1", + "type": "subflow:9a45991b.365bc8", + "z": "bb8dbe68.7e20a", + "name": "", + "env": [], + "x": 820, + "y": 280, + "wires": [ + [ + "1b45a311.c993ed" + ] + ] + }, + { + "id": "67bab5e1.2c7dcc", + "type": "subflow:97d77aeb.75afd8", + "z": "bb8dbe68.7e20a", + "name": "", + "env": [], + "x": 840, + "y": 120, + "wires": [ + [ + "1b45a311.c993ed" + ], + [ + "20340bb6.5f923c" + ] + ] + }, + { + "id": "8e5a1fb0.dc878", + "type": "subflow:506e9090.6e905", + "z": "bb8dbe68.7e20a", + "name": "", + "env": [], + "x": 820, + "y": 160, + "wires": [ + [ + "1b45a311.c993ed" + ], + [ + "20340bb6.5f923c" + ] + ] + }, + { + "id": "14b78383.7457bc", + "type": "subflow:1273b673.4a35ea", + "z": "bb8dbe68.7e20a", + "name": "System commands", + "env": [], + "x": 830, + "y": 480, "wires": [] + }, + { + "id": "e6403eaf.54f7e", + "type": "subflow:246abd43.838a5a", + "z": "bb8dbe68.7e20a", + "name": "", + "env": [], + "x": 840, + "y": 400, + "wires": [] + }, + { + "id": "bfc59fc4.be21a8", + "type": "subflow:99798a85.e62408", + "z": "bb8dbe68.7e20a", + "name": "process metadata", + "env": [], + "x": 830, + "y": 200, + "wires": [ + [ + "1b45a311.c993ed" + ] + ] + }, + { + "id": "80434aac.22226", + "type": "subflow:a156df1e.d37178", + "z": "bb8dbe68.7e20a", + "name": "Acquisition inputs", + "env": [], + "x": 830, + "y": 360, + "wires": [ + [ + "1b45a311.c993ed" + ] + ], + "icon": "node-red-dashboard/ui_switch.png" + }, + { + "id": "dba45961.85d67", + "type": "subflow:6384a5e.e34465c", + "z": "bb8dbe68.7e20a", + "name": "", + "env": [], + "x": 300, + "y": 200, + "wires": [] + }, + { + "id": "8231cfcc.0c5dd8", + "type": "subflow:e8320d42.9a3ad8", + "z": "bb8dbe68.7e20a", + "name": "", + "env": [], + "x": 290, + "y": 240, + "wires": [] + }, + { + "id": "557afe0d.33d97", + "type": "subflow:97600dff.93378", + "z": "bb8dbe68.7e20a", + "name": "", + "env": [], + "x": 830, + "y": 440, + "wires": [] + }, + { + "id": "af4f780b.068368", + "type": "ui_switch", + "z": "bb8dbe68.7e20a", + "name": "", + "label": "LED", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 10, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "x": 270, + "y": 160, + "wires": [ + [ + "1d54c0bf.fbcf07" + ] + ] + }, + { + "id": "dc721eb.9ef51e", + "type": "ui_group", + "z": "", + "name": "Streaming camera", + "tab": "2b97fe34.a699fa", + "order": 3, + "disp": true, + "width": 24, + "collapse": false } ] diff --git a/flows/mqtt_nodered.json b/flows/mqtt_nodered.json deleted file mode 100644 index abeb85e..0000000 --- a/flows/mqtt_nodered.json +++ /dev/null @@ -1 +0,0 @@ -[{"id":"259c8713.b50e28","type":"tab","label":"Main","disabled":false,"info":""},{"id":"6d0d6fc7.d30bb","type":"ui_text_input","z":"259c8713.b50e28","name":"sample_ship","label":"Name of the ship","tooltip":"","group":"3e1ba03d.f01d8","order":3,"width":12,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"sample_ship","x":1370,"y":140,"wires":[["de9708c2.d00068"]]},{"id":"43b12fe4.c5aa3","type":"ui_dropdown","z":"259c8713.b50e28","name":"sample_sampling_gear","label":"Sampling gear","tooltip":"","place":"Select","group":"3e1ba03d.f01d8","order":5,"width":0,"height":0,"passthru":true,"options":[{"label":"Plankton net","value":"net","type":"str"},{"label":"Niskin bottle 12L","value":"niskin_12L","type":"str"},{"label":"Niskin bottle 24L","value":"niskin_24L","type":"str"},{"label":"Pass Hull","value":"pass_hull","type":"str"}],"payload":"","topic":"sample_sampling_gear","x":1330,"y":220,"wires":[["3c6a723.145778e"]]},{"id":"458408d7.2b3b68","type":"ui_text_input","z":"259c8713.b50e28","name":"sample_operator","label":"Name of the operator","tooltip":"","group":"3e1ba03d.f01d8","order":4,"width":12,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"sample_operator","x":1350,"y":180,"wires":[["a2ae6c99.188f2"]]},{"id":"a163194f.0b17c8","type":"ui_text_input","z":"259c8713.b50e28","name":"sample_project","label":"Name of the project*","tooltip":"","group":"3e1ba03d.f01d8","order":1,"width":12,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"sample_project","x":1360,"y":60,"wires":[["1c2c7439.47115c"]]},{"id":"914752eb.af1b","type":"ui_text_input","z":"259c8713.b50e28","name":"sample_id","label":"ID of the station*","tooltip":"","group":"3e1ba03d.f01d8","order":2,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"sample_id","x":1370,"y":100,"wires":[["30648de6.8ebc52"]]},{"id":"8a735175.23927","type":"ui_date_picker","z":"259c8713.b50e28","name":"acq_date","label":"Date :","group":"52159161.72187","order":2,"width":12,"height":1,"passthru":true,"topic":"","x":1380,"y":1141,"wires":[["86aa9817.45a2e8"]]},{"id":"16d7de1c.b0c892","type":"ui_text_input","z":"259c8713.b50e28","name":"acq_time","label":"Time :","tooltip":"","group":"52159161.72187","order":3,"width":12,"height":1,"passthru":true,"mode":"time","delay":300,"topic":"","x":1380,"y":1181,"wires":[["9b1b260f.e4b338"]]},{"id":"9b1b260f.e4b338","type":"function","z":"259c8713.b50e28","name":"set object_time","func":"var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute+\"00\";\nglobal.set('object_time',time_UTC);\nreturn msg;","outputs":1,"noerr":0,"x":1544,"y":1181,"wires":[["829cc940.327648"]]},{"id":"86aa9817.45a2e8","type":"function","z":"259c8713.b50e28","name":"set object_date","func":"var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;","outputs":1,"noerr":0,"x":1544,"y":1141,"wires":[["c93577b9.a1e438"]]},{"id":"e001a28.555566","type":"function","z":"259c8713.b50e28","name":"get global","func":"msg.payload={\n \n \"generic_nb_step\":global.get(\"generic_nb_step\"),\n \"generic_flowrate\":global.get(\"generic_flowrate\"),\n \"generic_manual_volume\":global.get(\"generic_manual_volume\"),\n \"generic_sleep_before\":global.get(\"generic_sleep_before\"),\n \"generic_volume_before\":global.get(\"generic_volume_before\"),\n \"generic_path\":global.get(\"generic_path\"),\n \"generic_nb_frame\":global.get(\"generic_nb_frame\"),\n \"generic_sleep_during\":global.get(\"generic_sleep_during\"),\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n};\nreturn msg;","outputs":1,"noerr":0,"x":1880,"y":60,"wires":[["76a6e6bb.a08b98"]]},{"id":"f25890f5.f2549","type":"file","z":"259c8713.b50e28","name":"","filename":"/home/pi/PlanktonScope/config.txt","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":2233,"y":60,"wires":[[]]},{"id":"f5c1aa13.3cfbf8","type":"function","z":"259c8713.b50e28","name":"set optical config","func":"global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;","outputs":1,"noerr":0,"x":1550,"y":1041,"wires":[["72e1e23b.a8a67c"]]},{"id":"eb9181d8.25e01","type":"ui_dropdown","z":"259c8713.b50e28","name":"acq_fnumber_objective","label":"M12 Lens*","tooltip":"","place":"Select option","group":"52159161.72187","order":7,"width":12,"height":1,"passthru":true,"options":[{"label":"f 25mm 1/2\" 5MP IR","value":25,"type":"num"},{"label":"f 16mm 1/2.5\" 5MP IR","value":16,"type":"num"},{"label":"f 12mm 1/2.5\" 5MP IR","value":12,"type":"num"},{"label":"f 8mm 1/2.5\" 5MP IR","value":8,"type":"num"},{"label":"f 6mm 1/2.5\" 5MP IR","value":6,"type":"num"}],"payload":"","topic":"acq_fnumber_objective","x":1326,"y":1041,"wires":[["f5c1aa13.3cfbf8"]]},{"id":"5aba848a.7a861c","type":"ui_numeric","z":"259c8713.b50e28","name":"acq_minimum_mesh","label":"Min fraction size (μm)","tooltip":"","group":"52159161.72187","order":8,"width":12,"height":1,"wrap":false,"passthru":true,"topic":"acq_minimum_mesh","format":"{{value}}","min":0,"max":"300","step":"10","x":1336,"y":841,"wires":[["510bd72a.b42ea8"]]},{"id":"7cea16e.c42ace8","type":"ui_numeric","z":"259c8713.b50e28","name":"acq_maximum_mesh","label":"Max fraction size (μm)","tooltip":"","group":"52159161.72187","order":9,"width":12,"height":1,"wrap":false,"passthru":true,"topic":"acq_maximum_mesh","format":"{{value}}","min":"200","max":"2000","step":"100","x":1336,"y":881,"wires":[["a3f18257.8a55e"]]},{"id":"6ecc9468.0271dc","type":"ui_text_input","z":"259c8713.b50e28","name":"acq_id","label":"Acquisition unique ID*","tooltip":"","group":"52159161.72187","order":1,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"acq_id","x":1386,"y":721,"wires":[["b26183bf.aa217"]]},{"id":"259fd49a.160a3c","type":"ui_dropdown","z":"259c8713.b50e28","name":"acq_celltype","label":"Thickness flowcell*","tooltip":"","place":"Select option","group":"52159161.72187","order":6,"width":12,"height":1,"passthru":true,"options":[{"label":"200 μm µ-Slide I Luer","value":200,"type":"num"},{"label":"400 μm µ-Slide I Luer","value":400,"type":"num"},{"label":"600 μm µ-Slide I Luer","value":600,"type":"num"},{"label":"800 μm µ-Slide I Luer","value":800,"type":"num"}],"payload":"","topic":"acq_celltype","x":1366,"y":801,"wires":[["d96d32ec.f88b9"]]},{"id":"66a3425c.79aabc","type":"ui_text_input","z":"259c8713.b50e28","name":"acq_volume","label":"Volume to pass (ml)","tooltip":"","group":"52159161.72187","order":5,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"acq_volume","x":1366,"y":921,"wires":[["a3ec68a2.889ca8"]]},{"id":"6722bc48.d4f354","type":"comment","z":"259c8713.b50e28","name":"sample","info":"SAMPLE: a collection event\n\n sample_id [t] : unique identifier\n sample_*** [f] or [t] : other fields relative to the sample\n","x":810,"y":60,"wires":[]},{"id":"f93037f1.6a6238","type":"comment","z":"259c8713.b50e28","name":"acquisition","info":"ACQUISITION: metadata relative to the image acquisition\n\n acq_id [t] : unique identifier. If your acquisition differ for each sample you must have different identifier.\n acq_instrument [t] : name of the instrument (UVP, ZOOSCAN, FLOWCAM, etc.)\n acq_*** [f] or [t] : other fields relative to the acquisition\n","x":800,"y":720,"wires":[]},{"id":"734ba3db.3f82fc","type":"comment","z":"259c8713.b50e28","name":"object","info":"OBJECT: one object to be classified, usually one organism. One object can be represented by several images. In this tsv file, there is one line per image which means the object data gets repeated on several lines.\n\n object_id [t] : unique object name (will be displayed in Ecotaxa object page)\n object_link [f] : URL of an associated website\n object_lat [f] : latitude, decimal degrees\n object_lon [f] : longitude, decimal degrees\n object_date [f] : ISO8601 YYYYMMJJ UTC\n object_time [f] : ISO8601 HHMMSS UTC\n object_depth_min [f] : minimum depth of object, meters\n object_depth_max [f] : maximum depth of object, meters\n\nAnd, for already classified objects\n\n object_annotation_date [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_time [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_category [t] : class of the object with optionnaly its direct parent following separated by left angle bracket without whitespace \"Cnidaria","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1210,"y":300,"wires":[[]]},{"id":"b7d9455c.026588","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"actuator/focus","vt":"str"},{"t":"eq","v":"Missing entry :","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1670,"y":400,"wires":[["fdb3b132.8b341"],["b9d996d6.37c2f8"]]},{"id":"b9d996d6.37c2f8","type":"ui_toast","z":"259c8713.b50e28","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1830,"y":420,"wires":[[]]},{"id":"ca38a11d.0ee54","type":"function","z":"259c8713.b50e28","name":"init LED","func":"msg.payload=1;\nreturn msg;","outputs":1,"noerr":0,"x":240,"y":161,"wires":[["1d58e86f.a3a9e8"]]},{"id":"75701b99.c6e974","type":"exec","z":"259c8713.b50e28","command":"vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"","addpay":false,"append":"","useSpawn":"","timer":"","name":"RPi Temp.","x":2750,"y":180,"wires":[["aac61390.c13c6"],[],[]]},{"id":"1780384d.718198","type":"inject","z":"259c8713.b50e28","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":"","x":2590,"y":180,"wires":[["75701b99.c6e974"]]},{"id":"aac61390.c13c6","type":"python3-function","z":"259c8713.b50e28","name":"fan.py","func":"#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)","outputs":1,"x":2930,"y":180,"wires":[[]]},{"id":"603d5fab.08f56","type":"comment","z":"259c8713.b50e28","name":"save config.txt","info":"","x":1690,"y":20,"wires":[]},{"id":"72e1e23b.a8a67c","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04","d473399b.081ae8"],"x":1675,"y":1040,"wires":[]},{"id":"d473399b.081ae8","type":"link in","z":"259c8713.b50e28","name":"","links":["72e1e23b.a8a67c","c93577b9.a1e438","829cc940.327648"],"x":1635,"y":100,"wires":[["e001a28.555566"]]},{"id":"c93577b9.a1e438","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04","d473399b.081ae8"],"x":1675,"y":1140,"wires":[]},{"id":"829cc940.327648","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04","d473399b.081ae8"],"x":1675,"y":1180,"wires":[]},{"id":"98e2e9e0.fb7418","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"actuator/pump","vt":"str"},{"t":"eq","v":"Missing entry :","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1670,"y":600,"wires":[["61fb057d.3c251c"],["46a536f0.c83138"]]},{"id":"46a536f0.c83138","type":"ui_toast","z":"259c8713.b50e28","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1830,"y":620,"wires":[[]]},{"id":"24ffcf03.2a51b","type":"ui_button","z":"259c8713.b50e28","name":"stop pump","group":"707d9797.c8e798","order":5,"width":4,"height":1,"passthru":true,"label":"STOP PUMP","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"actuator/wait","x":1370,"y":660,"wires":[["e2a7220a.09d43"]]},{"id":"7eb16c3b.294e54","type":"comment","z":"259c8713.b50e28","name":"turn ON the LED","info":"","x":260,"y":121,"wires":[]},{"id":"4f74f017.00a58","type":"function","z":"259c8713.b50e28","name":"focus.js","func":"state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":1520,"y":400,"wires":[["b7d9455c.026588"]],"info":"### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"},{"id":"52cc1de5.b78e84","type":"ui_button","z":"259c8713.b50e28","name":"stop focus","group":"fbd92986.1028c8","order":5,"width":4,"height":1,"passthru":true,"label":"STOP FOCUS","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"actuator/wait","x":1370,"y":460,"wires":[["e46763fe.7fc83"]]},{"id":"39cad6fb.1503ca","type":"ui_button","z":"259c8713.b50e28","name":"","group":"c6a276ac.3eb74","order":1,"width":12,"height":1,"passthru":false,"label":"Reboot","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"reboot","x":2620,"y":60,"wires":[["95b876d4.07c708","99d61fbe.b244b"]]},{"id":"1f53f29b.feee4d","type":"exec","z":"259c8713.b50e28","command":"sudo","addpay":true,"append":"","useSpawn":"false","timer":"2","oldrc":false,"name":"cmd","x":2930,"y":60,"wires":[[],[],[]]},{"id":"e325458b.95bff8","type":"ui_button","z":"259c8713.b50e28","name":"","group":"c6a276ac.3eb74","order":2,"width":12,"height":1,"passthru":false,"label":"Shutdown","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"shutdown","x":2620,"y":120,"wires":[["95b876d4.07c708","99d61fbe.b244b"]]},{"id":"95b876d4.07c708","type":"python3-function","z":"259c8713.b50e28","name":"action","func":"#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg","outputs":1,"x":2790,"y":80,"wires":[["d348474b.d756a8","1f53f29b.feee4d"]]},{"id":"d348474b.d756a8","type":"exec","z":"259c8713.b50e28","command":"i2cdetect -y 1","addpay":false,"append":"","useSpawn":"false","timer":"1","oldrc":false,"name":"i2c update","x":2950,"y":120,"wires":[[],[],[]]},{"id":"99d61fbe.b244b","type":"link out","z":"259c8713.b50e28","name":"","links":["3517d063.27073"],"x":2735,"y":20,"wires":[]},{"id":"cdd1b550.da18e8","type":"mqtt in","z":"259c8713.b50e28","name":"","topic":"receiver/#","qos":"0","datatype":"auto","broker":"b77ffa1b.942258","x":720,"y":2000,"wires":[["6920281d.dc9b48"]]},{"id":"6920281d.dc9b48","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"receiver/pump","vt":"str"},{"t":"eq","v":"receiver/focus","vt":"str"},{"t":"eq","v":"receiver/image","vt":"str"},{"t":"cont","v":"receiver/segmentation","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":870,"y":2000,"wires":[["2f66e917.fee586"],["363ee47e.ed522c"],["45a52868.fe37c8"],["469cc189.903d"]]},{"id":"2f66e917.fee586","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Start","vt":"str"},{"t":"eq","v":"Done","vt":"str"},{"t":"eq","v":"Interrompted","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1050,"y":1800,"wires":[["5c0d0c35.3bcf14"],["cd01157d.0892d8"],["68e02bf4.7013e4"]]},{"id":"5c0d0c35.3bcf14","type":"change","z":"259c8713.b50e28","name":"The pump has started","rules":[{"t":"set","p":"payload","pt":"msg","to":"The pump has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":1760,"wires":[[]]},{"id":"cd01157d.0892d8","type":"change","z":"259c8713.b50e28","name":"The pump has finished.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The pump has finished.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1800,"wires":[[]]},{"id":"68e02bf4.7013e4","type":"change","z":"259c8713.b50e28","name":"The pump has been stopped.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The pump has been stopped.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":1840,"wires":[[]]},{"id":"363ee47e.ed522c","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Start","vt":"str"},{"t":"eq","v":"Done","vt":"str"},{"t":"eq","v":"Interrompted","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1050,"y":1920,"wires":[["c088b72f.326d98"],["36934381.14442c"],["89329cfe.c8f4"]]},{"id":"c088b72f.326d98","type":"change","z":"259c8713.b50e28","name":"The focus has started","rules":[{"t":"set","p":"payload","pt":"msg","to":"The focus has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":1880,"wires":[[]]},{"id":"36934381.14442c","type":"change","z":"259c8713.b50e28","name":"The focus has finished.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The focus has finished.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1920,"wires":[[]]},{"id":"89329cfe.c8f4","type":"change","z":"259c8713.b50e28","name":"The focus has been stopped.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The focus has been stopped.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":1960,"wires":[[]]},{"id":"fdb3b132.8b341","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1810,"y":380,"wires":[]},{"id":"e46763fe.7fc83","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1510,"y":460,"wires":[]},{"id":"61fb057d.3c251c","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1810,"y":580,"wires":[]},{"id":"e2a7220a.09d43","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1510,"y":660,"wires":[]},{"id":"577f7f72.6b68b","type":"ui_button","z":"259c8713.b50e28","name":"","group":"8cfadfab.327d7","order":7,"width":19,"height":1,"passthru":false,"label":"Start Acquisition","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"actuator/image","x":1360,"y":1660,"wires":[["5218ba30.bbe844"]]},{"id":"d5111b87.2a64a8","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_sleep_before","label":"Sleep duration before acquisition (s)","tooltip":"","group":"8cfadfab.327d7","order":1,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"generic_sleep_before","x":1340,"y":1360,"wires":[["3d141631.d548ba"]]},{"id":"3d141631.d548ba","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1360,"wires":[]},{"id":"74c89905.79d968","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_sleep_during","label":"Sleep duration between acquisition (s)","tooltip":"","group":"8cfadfab.327d7","order":2,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"generic_sleep_during","x":1340,"y":1520,"wires":[["644e95b9.04b7ac"]]},{"id":"644e95b9.04b7ac","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1520,"wires":[]},{"id":"b50cf2f4.bfb84","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":501,"wires":[]},{"id":"1e75fd6c.234753","type":"ui_slider","z":"259c8713.b50e28","name":"flowrate","label":"Flowrate (ml/min)*","tooltip":"","group":"707d9797.c8e798","order":1,"width":0,"height":0,"passthru":true,"outs":"end","topic":"flowrate","min":0,"max":"20","step":"0.1","x":1380,"y":501,"wires":[["b50cf2f4.bfb84"]]},{"id":"3345fc41.8341b4","type":"function","z":"259c8713.b50e28","name":"get generic.flowrate","func":"msg.payload = msg.payload.generic_flowrate;\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":501,"wires":[["1e75fd6c.234753"]]},{"id":"32510458.f42f9c","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":501,"wires":[["3345fc41.8341b4"]]},{"id":"3cd0a17b.0cc42e","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1440,"wires":[]},{"id":"62fea790.2840a8","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_path","label":"DIrectory to store the images","tooltip":"","group":"8cfadfab.327d7","order":3,"width":12,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"generic_path","x":1370,"y":1440,"wires":[["3cd0a17b.0cc42e"]]},{"id":"73e051a8.5875e","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_volume_before","label":"Volume to pass before to begin","tooltip":"","group":"8cfadfab.327d7","order":5,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"generic_volume_before","x":1330,"y":1400,"wires":[["5ea01613.8cc9d8"]]},{"id":"5ea01613.8cc9d8","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1400,"wires":[]},{"id":"26549e4b.5dbf72","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_nb_frame","label":"Number of frame per acquisition","tooltip":"","group":"8cfadfab.327d7","order":4,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"generic_nb_frame","x":1350,"y":1480,"wires":[["61382d0b.60c534"]]},{"id":"61382d0b.60c534","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1480,"wires":[]},{"id":"d5df5489.6523e8","type":"function","z":"259c8713.b50e28","name":"get generic_sleep_before","func":"msg.payload = msg.payload.generic_sleep_before;\nreturn msg;","outputs":1,"noerr":0,"x":1050,"y":1360,"wires":[["d5111b87.2a64a8"]]},{"id":"835c262e.00b468","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1360,"wires":[["d5df5489.6523e8"]]},{"id":"9b2fe59b.be48c8","type":"function","z":"259c8713.b50e28","name":"get generic_volume_before","func":"msg.payload = msg.payload.generic_volume_before;\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":1400,"wires":[["73e051a8.5875e"]]},{"id":"a07dad70.7c48","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1400,"wires":[["9b2fe59b.be48c8"]]},{"id":"54dfe4df.c6837c","type":"function","z":"259c8713.b50e28","name":"get generic_path","func":"msg.payload = msg.payload.generic_path;\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":1440,"wires":[["62fea790.2840a8"]]},{"id":"9fb166d6.86f908","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1440,"wires":[["54dfe4df.c6837c"]]},{"id":"1aa409a4.7b3866","type":"function","z":"259c8713.b50e28","name":"get generic_nb_frame","func":"msg.payload = msg.payload.generic_nb_frame;\nreturn msg;","outputs":1,"noerr":0,"x":1040,"y":1480,"wires":[["26549e4b.5dbf72"]]},{"id":"51e769aa.92a138","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1480,"wires":[["1aa409a4.7b3866"]]},{"id":"ce6ded0a.8ee37","type":"function","z":"259c8713.b50e28","name":"get generic_sleep_during","func":"msg.payload = msg.payload.generic_sleep_during;\nreturn msg;","outputs":1,"noerr":0,"x":1050,"y":1520,"wires":[["74c89905.79d968"]]},{"id":"3fa20f41.11e61","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1520,"wires":[["ce6ded0a.8ee37"]]},{"id":"5218ba30.bbe844","type":"function","z":"259c8713.b50e28","name":"image.js","func":"state = global.get(\"state\");\nglobal.set('img_counter',0)\nglobal.set('obj_counter',0)\nif (state == null){state=\"free\"}\n\nvar generic_sleep_before= global.get(\"generic_sleep_before\");\nvar generic_volume_before= global.get(\"generic_volume_before\");\nvar generic_path= global.get(\"generic_path\");\nvar generic_nb_frame= global.get(\"generic_nb_frame\");\nvar generic_sleep_during= global.get(\"generic_sleep_during\");\n\nif (generic_sleep_before === undefined || generic_sleep_before === \"\" || generic_sleep_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before start the acquisition\";\n \n}else if (generic_volume_before === undefined || generic_volume_before === \"\" || generic_volume_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume before acquisition\";\n \n}else if (generic_path === undefined || generic_path === \"\" || generic_path === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Directory to store the images\";\n \n}else if (generic_nb_frame === undefined || generic_nb_frame === \"\" || generic_nb_frame === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of frames per acquisition\";\n \n}else if (generic_sleep_during === undefined || generic_sleep_during === \"\" || generic_sleep_during === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration in between each acquisition\";\n \n}else {\n generic_nb_step = 507*generic_volume_before\n generic_nb_frame=generic_nb_frame-1\n msg.payload=generic_sleep_before+' '+generic_nb_step+' '+generic_path+' '+generic_nb_frame+' '+generic_sleep_during;\n}\nreturn msg;","outputs":1,"noerr":0,"x":1520,"y":1660,"wires":[["8142bee4.882c2"]],"info":"### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"},{"id":"8142bee4.882c2","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"actuator/image","vt":"str"},{"t":"eq","v":"Missing entry :","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1670,"y":1660,"wires":[["a4b8aae3.cc3ad8"],["54420752.4a4ab8"]]},{"id":"54420752.4a4ab8","type":"ui_toast","z":"259c8713.b50e28","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1830,"y":1680,"wires":[[]]},{"id":"a4b8aae3.cc3ad8","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1810,"y":1640,"wires":[]},{"id":"ca843dd8.d1c62","type":"exec","z":"259c8713.b50e28","command":"python3.7 /home/pi/PlanktonScope/script/mqtt_pump_focus_image.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":430,"y":420,"wires":[[],[],[]]},{"id":"45a52868.fe37c8","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Start","vt":"str"},{"t":"eq","v":"Done","vt":"str"},{"t":"eq","v":"Interrompted","vt":"str"},{"t":"cont","v":"jpg","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":2080,"wires":[["113c9b93.455814"],["29a7c6de.6ac2ea"],["f1b07b24.b85718"],["446a811b.25e4b"]]},{"id":"177a91d4.f1016e","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Start","vt":"str"},{"t":"eq","v":"Done","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1190,"y":2200,"wires":[["5d717a25.3437e4"],["7d713b16.235164"]]},{"id":"29a7c6de.6ac2ea","type":"change","z":"259c8713.b50e28","name":"The acquisition has finished.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The acquisition has finished.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":2080,"wires":[[]]},{"id":"f1b07b24.b85718","type":"change","z":"259c8713.b50e28","name":"The acquisition has been stopped.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The acquisition has been stopped.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1400,"y":2120,"wires":[[]]},{"id":"113c9b93.455814","type":"change","z":"259c8713.b50e28","name":"The acquisition has started","rules":[{"t":"set","p":"payload","pt":"msg","to":"The acquisition has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":2040,"wires":[[]]},{"id":"446a811b.25e4b","type":"function","z":"259c8713.b50e28","name":"img_counter.js","func":"img_counter=global.get('img_counter')\nimg_counter=img_counter+1\nglobal.set('img_counter',img_counter)\nmsg.payload = img_counter\nreturn msg;","outputs":1,"noerr":0,"x":1300,"y":2160,"wires":[["57014db.1bbe0b4","95f4a476.261718"]]},{"id":"803b507f.9e38c","type":"function","z":"259c8713.b50e28","name":"obj_counter.js","func":"obj_counter=global.get('obj_counter')\nobj_counter=obj_counter+1\nglobal.set('obj_counter',obj_counter)\nmsg.payload = obj_counter\nreturn msg;","outputs":1,"noerr":0,"x":1300,"y":2280,"wires":[["6ad4ae5e.62f4a","95f4a476.261718"]]},{"id":"57014db.1bbe0b4","type":"ui_chart","z":"259c8713.b50e28","name":"img_counter","group":"8cfadfab.327d7","order":12,"width":24,"height":2,"label":"img_counter","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1470,"y":2160,"wires":[[]]},{"id":"469cc189.903d","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"receiver/segmentation","vt":"str"},{"t":"eq","v":"receiver/segmentation/object_id","vt":"str"},{"t":"eq","v":"receiver/segmentation/metric","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1050,"y":2240,"wires":[["177a91d4.f1016e"],["803b507f.9e38c"],["73f0f4b.8dd430c"]]},{"id":"7d713b16.235164","type":"change","z":"259c8713.b50e28","name":"The segmentation has finished.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The segmentation has finished.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":2240,"wires":[[]]},{"id":"5d717a25.3437e4","type":"change","z":"259c8713.b50e28","name":"The segmentation has started","rules":[{"t":"set","p":"payload","pt":"msg","to":"The segmentation has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":2200,"wires":[[]]},{"id":"6ad4ae5e.62f4a","type":"ui_chart","z":"259c8713.b50e28","name":"obj_counter","group":"8cfadfab.327d7","order":13,"width":24,"height":2,"label":"obj_counter","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1470,"y":2280,"wires":[[]]},{"id":"95f4a476.261718","type":"ui_chart","z":"259c8713.b50e28","name":"","group":"8cfadfab.327d7","order":10,"width":24,"height":5,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"500","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1670,"y":2220,"wires":[[]]},{"id":"32b535dc.2d85ea","type":"function","z":"259c8713.b50e28","name":"","func":"msg.payload=msg.payload.object_area\nmsg.topic=\"area\"\n\nreturn msg;","outputs":1,"noerr":0,"x":1290,"y":2380,"wires":[["1624f1bf.604bfe"]]},{"id":"73f0f4b.8dd430c","type":"json","z":"259c8713.b50e28","name":"","property":"payload","action":"","pretty":false,"x":1120,"y":2380,"wires":[["32b535dc.2d85ea"]]},{"id":"6fc7332f.89431c","type":"exec","z":"259c8713.b50e28","command":"free -m | grep \"Mem\" | awk -F ' ' '{print $3}'","addpay":false,"append":"","useSpawn":"","timer":"","name":"Get memory used","x":1350,"y":2560,"wires":[["42781732.a6ab58"],[],[]]},{"id":"7cdef10d.cb2f2","type":"inject","z":"259c8713.b50e28","name":"","topic":"","payload":"","payloadType":"num","repeat":"1","crontab":"","once":false,"onceDelay":"","x":1150,"y":2560,"wires":[["6fc7332f.89431c"]]},{"id":"42781732.a6ab58","type":"ui_chart","z":"259c8713.b50e28","name":"","group":"8cfadfab.327d7","order":11,"width":24,"height":5,"label":"Memory load","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1690,"y":2260,"wires":[[]]},{"id":"957a161c.f76038","type":"mqtt in","z":"259c8713.b50e28","name":"","topic":"receiver/#","qos":"0","datatype":"auto","broker":"b77ffa1b.942258","x":500,"y":1700,"wires":[["676a23fa.d442ac"]]},{"id":"676a23fa.d442ac","type":"debug","z":"259c8713.b50e28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":1700,"wires":[]},{"id":"1624f1bf.604bfe","type":"ui_chart","z":"259c8713.b50e28","name":"","group":"8cfadfab.327d7","order":14,"width":24,"height":10,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"1000","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1470,"y":2380,"wires":[[]]},{"id":"4e90749b.fd1804","type":"ui_button","z":"259c8713.b50e28","name":"Stop Acquisition","group":"8cfadfab.327d7","order":8,"width":5,"height":1,"passthru":true,"label":"STOP ACQUISITION","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"actuator/wait","x":1360,"y":1700,"wires":[["6b21f65f.d65e18"]]},{"id":"6b21f65f.d65e18","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1510,"y":1700,"wires":[]},{"id":"e5de63c5.dfaab8","type":"ui_switch","z":"259c8713.b50e28","name":"","label":"switch","tooltip":"","group":"fbd92986.1028c8","order":5,"width":"7","height":"2","passthru":true,"decouple":"false","topic":"","style":"","onvalue":true,"onvalueType":"str","onicon":"","oncolor":"","offvalue":false,"offvalueType":"str","officon":"","offcolor":"","x":240,"y":280,"wires":[["1d58e86f.a3a9e8"]]},{"id":"376a1510.c92cc2","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1950,"y":260,"wires":[]},{"id":"f91fffca.82e778","type":"ui_switch","z":"259c8713.b50e28","name":"","label":"switch","tooltip":"","group":"fbd92986.1028c8","order":5,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"actuator/stream","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":1250,"y":260,"wires":[["3e58f066.366b5","f4d8a599.1c9888"]]},{"id":"f4d8a599.1c9888","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1510,"y":260,"wires":[["e34fe7f8.18f85"],["631dc7be.14d66"]]},{"id":"e34fe7f8.18f85","type":"change","z":"259c8713.b50e28","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"actuator/on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1710,"y":220,"wires":[["376a1510.c92cc2"]]},{"id":"631dc7be.14d66","type":"change","z":"259c8713.b50e28","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"actuator/off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1710,"y":300,"wires":[["376a1510.c92cc2"]]},{"id":"3e1ba03d.f01d8","type":"ui_group","z":"","name":"Sample Identification","tab":"737ec584.2eea2c","order":1,"disp":true,"width":24,"collapse":false},{"id":"52159161.72187","type":"ui_group","name":"Group 1","tab":"737ec584.2eea2c","order":5,"disp":true,"width":24},{"id":"8cfadfab.327d7","type":"ui_group","z":"","name":"Charts","tab":"737ec584.2eea2c","order":6,"disp":true,"width":"24","collapse":false},{"id":"cef1e703.bcf3c8","type":"ui_group","z":"","name":"Spatio Temporal","tab":"737ec584.2eea2c","order":4,"disp":true,"width":24,"collapse":false},{"id":"fbd92986.1028c8","type":"ui_group","z":"","name":"Focus Adjustment","tab":"737ec584.2eea2c","order":2,"disp":true,"width":24,"collapse":false},{"id":"707d9797.c8e798","type":"ui_group","z":"","name":"Fluidic Manual Manipulation","tab":"737ec584.2eea2c","order":3,"disp":true,"width":24,"collapse":false},{"id":"c6a276ac.3eb74","type":"ui_group","z":"","name":"Commands","tab":"737ec584.2eea2c","order":7,"disp":true,"width":24,"collapse":false},{"id":"b77ffa1b.942258","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"test","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"cb2f36fe.1c7038","type":"mqtt-broker","z":"","name":"","broker":"0.0.0.0","port":"1883","clientid":"Client_node","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"737ec584.2eea2c","type":"ui_tab","z":"","name":"Sample","icon":"fa-eyedropper","order":2,"disabled":false,"hidden":false}] diff --git a/flows/store_retrieve.json b/flows/store_retrieve.json deleted file mode 100644 index 02147cb..0000000 --- a/flows/store_retrieve.json +++ /dev/null @@ -1,1170 +0,0 @@ -[ - { - "id": "103f6179.d5012f", - "type": "tab", - "label": "Sample", - "disabled": false, - "info": "" - }, - { - "id": "f6f450aa.8ed73", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_ship", - "x": 1170, - "y": 100, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "8f3a0dab.4d614", - "type": "ui_dropdown", - "z": "103f6179.d5012f", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "aac2eaf7.0cdab8", - "order": 7, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "Plankton net", - "value": "net", - "type": "str" - }, - { - "label": "Niskin bottle 12L", - "value": "niskin_12L", - "type": "str" - }, - { - "label": "Niskin bottle 24L", - "value": "niskin_24L", - "type": "str" - }, - { - "label": "Pass Hull", - "value": "pass_hull", - "type": "str" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 1130, - "y": 220, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "e046b933.316b28", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 6, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 1150, - "y": 180, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "2ff04681.e99aea", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_project", - "x": 1160, - "y": 60, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "75615576.3a38cc", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "sample_id", - "label": "ID of the station*", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "sample_id", - "x": 1170, - "y": 140, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "b77eb8b0.a222a8", - "type": "ui_date_picker", - "z": "103f6179.d5012f", - "name": "acq_date", - "label": "Date :", - "group": "aac2eaf7.0cdab8", - "order": 10, - "width": 0, - "height": 0, - "passthru": true, - "topic": "", - "x": 1176, - "y": 640, - "wires": [ - [ - "4fa687df.1aa1d8" - ] - ] - }, - { - "id": "86d5ed81.6dc99", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "acq_time", - "label": "Time :", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 11, - "width": 0, - "height": 0, - "passthru": true, - "mode": "time", - "delay": 300, - "topic": "", - "x": 1176, - "y": 680, - "wires": [ - [ - "26461e30.b461b2" - ] - ] - }, - { - "id": "26461e30.b461b2", - "type": "function", - "z": "103f6179.d5012f", - "name": "set time global", - "func": "var time = new Date(msg.payload);\nglobal.set('generic_acq_time',time);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute+\"00\";\nglobal.set('object_time',time_UTC);\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1396, - "y": 680, - "wires": [ - [ - "da16d746.4b12e8" - ] - ] - }, - { - "id": "4fa687df.1aa1d8", - "type": "function", - "z": "103f6179.d5012f", - "name": "set date global", - "func": "var date = new Date(msg.payload);\nglobal.set('generic_acq_date',date);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1396, - "y": 640, - "wires": [ - [ - "da16d746.4b12e8" - ] - ] - }, - { - "id": "da16d746.4b12e8", - "type": "function", - "z": "103f6179.d5012f", - "name": "get global", - "func": "msg.payload={\n generic:{\n \"generic_sample_date\":global.get(\"generic_sample_date\"),\n \"generic_sample_time\":global.get(\"generic_sample_time\"),\n \"generic_acq_date\":global.get(\"generic_acq_date\"),\n \"generic_acq_time\":global.get(\"generic_acq_time\")\n },\n sample:{\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_date\":global.get(\"sample_date\"),\n \"sample_time\":global.get(\"sample_time\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\")\n },\n acquisition:{\n \"acq_id\":global.get(\"acq_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\")\n },\n object:{\n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\")\n \n },\n process:{\n //PROCESS\n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n }\n};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1693, - "y": 60, - "wires": [ - [ - "28df8fd6.06fb7" - ] - ] - }, - { - "id": "6dd1657e.c52e4c", - "type": "file", - "z": "103f6179.d5012f", - "name": "", - "filename": "/home/pi/PlanktonScope/log/config.txt", - "appendNewline": true, - "createDir": true, - "overwriteFile": "true", - "encoding": "none", - "x": 2043, - "y": 60, - "wires": [ - [] - ] - }, - { - "id": "3a43748d.52464c", - "type": "function", - "z": "103f6179.d5012f", - "name": "set optical config", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1386, - "y": 720, - "wires": [ - [ - "da16d746.4b12e8" - ] - ] - }, - { - "id": "ff1b2069.b8273", - "type": "ui_dropdown", - "z": "103f6179.d5012f", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "aac2eaf7.0cdab8", - "order": 15, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 1126, - "y": 720, - "wires": [ - [ - "3a43748d.52464c" - ] - ] - }, - { - "id": "4d38113f.08c6d", - "type": "ui_numeric", - "z": "103f6179.d5012f", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 16, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 1136, - "y": 520, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "220c7464.306a8c", - "type": "ui_numeric", - "z": "103f6179.d5012f", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 17, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 1136, - "y": 560, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "c3b1ab59.484178", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 9, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_id", - "x": 1186, - "y": 400, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "3bb0adb4.de5412", - "type": "ui_dropdown", - "z": "103f6179.d5012f", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "aac2eaf7.0cdab8", - "order": 13, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 1166, - "y": 480, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "c19a2c73.7512f", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "acq_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 14, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_volume", - "x": 1166, - "y": 600, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "c9b2c48c.40d068", - "type": "comment", - "z": "103f6179.d5012f", - "name": "sample", - "info": "SAMPLE: a collection event\n\n sample_id [t] : unique identifier\n sample_*** [f] or [t] : other fields relative to the sample\n", - "x": 990, - "y": 20, - "wires": [] - }, - { - "id": "8abc2578.2ebcf8", - "type": "comment", - "z": "103f6179.d5012f", - "name": "acquisition", - "info": "ACQUISITION: metadata relative to the image acquisition\n\n acq_id [t] : unique identifier. If your acquisition differ for each sample you must have different identifier.\n acq_instrument [t] : name of the instrument (UVP, ZOOSCAN, FLOWCAM, etc.)\n acq_*** [f] or [t] : other fields relative to the acquisition\n", - "x": 996, - "y": 360, - "wires": [] - }, - { - "id": "91ab2c80.0f453", - "type": "comment", - "z": "103f6179.d5012f", - "name": "object", - "info": "OBJECT: one object to be classified, usually one organism. One object can be represented by several images. In this tsv file, there is one line per image which means the object data gets repeated on several lines.\n\n object_id [t] : unique object name (will be displayed in Ecotaxa object page)\n object_link [f] : URL of an associated website\n object_lat [f] : latitude, decimal degrees\n object_lon [f] : longitude, decimal degrees\n object_date [f] : ISO8601 YYYYMMJJ UTC\n object_time [f] : ISO8601 HHMMSS UTC\n object_depth_min [f] : minimum depth of object, meters\n object_depth_max [f] : maximum depth of object, meters\n\nAnd, for already classified objects\n\n object_annotation_date [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_time [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_category [t] : class of the object with optionnaly its direct parent following separated by left angle bracket without whitespace \"Cnidaria