[ { "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": "1371dec5.76e671", "type": "tab", "label": "Settings", "disabled": false, "info": "" }, { "id": "c1660bc.e7ff7f8", "type": "tab", "label": "Gallery", "disabled": false, "info": "" }, { "id": "9a22e67a.378818", "type": "tab", "label": "MQTT Receive", "disabled": false, "info": "" }, { "id": "1c24ad9c.bebec2", "type": "subflow", "name": "Config", "info": "An input to this subflow will get the configuration to be saved to disk.\n\nOn startup, this node outputs the loaded configuration", "category": "", "in": [ { "x": 440, "y": 860, "wires": [ { "id": "cdc75496.45f748" } ] } ], "out": [ { "x": 1240, "y": 300, "wires": [ { "id": "ad541674.4791c8", "port": 0 } ] } ], "env": [], "color": "#DDAA99" }, { "id": "4ed15f63.9d1468", "type": "subflow", "name": "MQTT Receive", "info": "", "category": "", "in": [], "out": [], "env": [], "color": "#DDAA99" }, { "id": "20ae9e26.17d73a", "type": "subflow", "name": "Get global for config.json", "info": "", "category": "", "in": [ { "x": 60, "y": 80, "wires": [ { "id": "b584292a.24b08" } ] } ], "out": [ { "x": 340, "y": 80, "wires": [ { "id": "b584292a.24b08", "port": 0 } ] } ], "env": [], "color": "#DDAA99" }, { "id": "833bc5bb.217ba8", "type": "ui_group", "z": "", "name": "Preview", "tab": "181bb236.1e94be", "order": 1, "disp": true, "width": 18, "collapse": false }, { "id": "3a6bb13f.c9703e", "type": "ui_tab", "name": "Home", "icon": "home", "order": 1, "disabled": false, "hidden": false }, { "id": "181bb236.1e94be", "type": "ui_tab", "name": "Optic Configuration", "icon": "fa-eye", "order": 3, "disabled": false, "hidden": false }, { "id": "c9194f02.9d5e9", "type": "ui_tab", "name": "Fluidic Acquisition", "icon": "fa-flask", "order": 4, "disabled": false, "hidden": false }, { "id": "8d16beb8.9b3fb", "type": "ui_tab", "name": "Segmentation", "icon": "fa-crop", "order": 5, "disabled": false, "hidden": false }, { "id": "d9cd733b.ab73d", "type": "ui_tab", "name": "Settings", "icon": "fa-cogs", "order": 7, "disabled": false, "hidden": false }, { "id": "4248342d.e55fac", "type": "ui_group", "name": "Optic Characterization", "tab": "181bb236.1e94be", "order": 2, "disp": true, "width": 10, "collapse": false }, { "id": "858a0e3c.987fe", "type": "ui_group", "name": "Preview", "tab": "c9194f02.9d5e9", "order": 1, "disp": true, "width": "14", "collapse": false }, { "id": "64903b47.4034e4", "type": "ui_group", "z": "", "name": "Navigation", "tab": "8d16beb8.9b3fb", "order": 2, "disp": false, "width": "6", "collapse": false }, { "id": "3da7da8f.179606", "type": "ui_group", "name": "Processor", "tab": "d9cd733b.ab73d", "order": 1, "disp": true, "width": "6", "collapse": false }, { "id": "cc8bc4eb.651868", "type": "ui_base", "z": "", "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": "#333333", "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": 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": true, "hidden": true }, { "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", "name": "Group 1", "tab": "3a6bb13f.c9703e", "order": 1, "disp": false, "width": "4", "collapse": false }, { "id": "3e1ba03d.f01d8", "type": "ui_group", "name": "Sample Identification", "tab": "737ec584.2eea2c", "order": 1, "disp": true, "width": 11, "collapse": false }, { "id": "4e0cd5ea.17e59c", "type": "ui_group", "name": "Group 2", "tab": "3a6bb13f.c9703e", "order": 2, "disp": false, "width": "4", "collapse": false }, { "id": "ef590206.24f6", "type": "ui_group", "name": "Group 3", "tab": "3a6bb13f.c9703e", "order": 3, "disp": false, "width": "4", "collapse": false }, { "id": "ae8f6620.073358", "type": "ui_group", "name": "Group 4", "tab": "3a6bb13f.c9703e", "order": 4, "disp": false, "width": "4", "collapse": false }, { "id": "196518b2.4d53b7", "type": "ui_group", "name": "Group 5", "tab": "3a6bb13f.c9703e", "order": 5, "disp": false, "width": "4", "collapse": false }, { "id": "777a7c33.fcd804", "type": "ui_group", "name": "Group 6", "tab": "3a6bb13f.c9703e", "order": 6, "disp": false, "width": "4", "collapse": false }, { "id": "cef1e703.bcf3c8", "type": "ui_group", "name": "Net throw", "tab": "737ec584.2eea2c", "order": 2, "disp": true, "width": 10, "collapse": false }, { "id": "5517c651.b2f668", "type": "ui_group", "name": "Validation", "tab": "737ec584.2eea2c", "order": 4, "disp": false, "width": 10, "collapse": false }, { "id": "fbd92986.1028c8", "type": "ui_group", "name": "Focus Adjustment", "tab": "181bb236.1e94be", "order": 4, "disp": true, "width": 10, "collapse": false }, { "id": "707d9797.c8e798", "type": "ui_group", "name": "Fluidic Manual Manipulation", "tab": "181bb236.1e94be", "order": 5, "disp": true, "width": 10, "collapse": false }, { "id": "7a0b4877.a5d268", "type": "ui_group", "name": "Validation", "tab": "181bb236.1e94be", "order": 6, "disp": false, "width": "10", "collapse": false }, { "id": "404c301a.19c4e", "type": "ui_group", "name": "Fraction size", "tab": "c9194f02.9d5e9", "order": 2, "disp": true, "width": "10", "collapse": false }, { "id": "4322c187.e73e5", "type": "ui_group", "name": "Acquisition", "tab": "c9194f02.9d5e9", "order": 4, "disp": true, "width": 10, "collapse": false }, { "id": "b7919ae2.c01788", "type": "ui_group", "name": "Navigation", "tab": "c9194f02.9d5e9", "order": 6, "disp": false, "width": 10, "collapse": false }, { "id": "b5d61bc7.54fe48", "type": "ui_group", "z": "", "name": "Statistics", "tab": "c9194f02.9d5e9", "order": 5, "disp": true, "width": "10", "collapse": false }, { "id": "1be83144.4fe4bf", "type": "ui_group", "name": "Danger Zone (DO NOT TOUCH HERE UNLESS YOU KNOW WHAT YOU ARE DOING)", "tab": "d9cd733b.ab73d", "order": 5, "disp": true, "width": 24, "collapse": false }, { "id": "3ca00bf9.e5cac4", "type": "ui_group", "z": "", "name": "Navigation", "tab": "d9cd733b.ab73d", "order": 7, "disp": false, "width": "24", "collapse": false }, { "id": "b5ba3f26.2e722", "type": "ui_group", "name": "CPU Temperature", "tab": "d9cd733b.ab73d", "order": 2, "disp": true, "width": "6", "collapse": false }, { "id": "806d69c8.67fc58", "type": "ui_group", "name": "Memory", "tab": "d9cd733b.ab73d", "order": 3, "disp": true, "width": "6", "collapse": false }, { "id": "405183bc.d8991c", "type": "ui_group", "name": "Disk Usage", "tab": "d9cd733b.ab73d", "order": 4, "disp": true, "width": "6", "collapse": false }, { "id": "8dc3722c.06efa8", "type": "mqtt-broker", "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": "abeb6dad.635a2", "type": "ui_group", "z": "", "name": "Control", "tab": "8d16beb8.9b3fb", "order": 1, "disp": true, "width": 12, "collapse": false }, { "id": "cf5d9f0e.d57e7", "type": "ui_group", "name": "Net retrieval", "tab": "737ec584.2eea2c", "order": 3, "disp": true, "width": 10, "collapse": false }, { "id": "5a0e69ac.725268", "type": "ui_spacer", "name": "spacer", "group": "3ca00bf9.e5cac4", "order": 2, "width": 1, "height": 1 }, { "id": "ca7a56b3.89805", "type": "ui_spacer", "name": "spacer", "group": "3ca00bf9.e5cac4", "order": 5, "width": 1, "height": 1 }, { "id": "aab3b337.985c98", "type": "ui_spacer", "name": "spacer", "group": "1be83144.4fe4bf", "order": 2, "width": 9, "height": 1 }, { "id": "5324b3d4.72d6d4", "type": "ui_spacer", "name": "spacer", "group": "1be83144.4fe4bf", "order": 4, "width": 9, "height": 1 }, { "id": "8780f7f3.52ee5", "type": "ui_spacer", "name": "spacer", "group": "1be83144.4fe4bf", "order": 5, "width": 9, "height": 1 }, { "id": "5e847442.3e340c", "type": "ui_spacer", "name": "spacer", "group": "1be83144.4fe4bf", "order": 7, "width": 9, "height": 1 }, { "id": "cc4fe53d.f4dc4", "type": "ui_spacer", "name": "spacer", "group": "1be83144.4fe4bf", "order": 9, "width": 10, "height": 1 }, { "id": "ce9e278.781eed8", "type": "ui_group", "name": "Information", "tab": "d9cd733b.ab73d", "order": 6, "disp": true, "width": "6", "collapse": false }, { "id": "70de8209.68416c", "type": "ui_group", "z": "", "name": "Status", "tab": "c9194f02.9d5e9", "order": 7, "disp": true, "width": 10, "collapse": false }, { "id": "46be9c86.dea684", "type": "ui_group", "z": "", "name": "Status", "tab": "8d16beb8.9b3fb", "order": 3, "disp": true, "width": "12", "collapse": false }, { "id": "8c38a81e.9897a8", "type": "ui_group", "z": "", "name": "Camera Settings", "tab": "181bb236.1e94be", "order": 3, "disp": true, "width": "10", "collapse": false }, { "id": "ed19fd14.ba2bc8", "type": "ui_spacer", "name": "spacer", "group": "3e1ba03d.f01d8", "order": 7, "width": 1, "height": 1 }, { "id": "971ec4f0.ca9718", "type": "ui_spacer", "name": "spacer", "group": "cf5d9f0e.d57e7", "order": 6, "width": 4, "height": 1 }, { "id": "f4e2e0a1.33948", "type": "ui_spacer", "name": "spacer", "group": "46be9c86.dea684", "order": 2, "width": 8, "height": 1 }, { "id": "1e82bb3b.7f0b1d", "type": "ui_spacer", "name": "spacer", "group": "46be9c86.dea684", "order": 3, "width": 12, "height": 1 }, { "id": "da2ef6ba.6c77", "type": "ui_spacer", "name": "spacer", "group": "46be9c86.dea684", "order": 4, "width": 4, "height": 1 }, { "id": "3116094c.81972e", "type": "ui_spacer", "name": "spacer", "group": "46be9c86.dea684", "order": 6, "width": 4, "height": 1 }, { "id": "9ca7cb9c.a296f8", "type": "ui_spacer", "name": "spacer", "group": "46be9c86.dea684", "order": 8, "width": 12, "height": 1 }, { "id": "dff95db9.441a9", "type": "ui_spacer", "name": "spacer", "group": "4322c187.e73e5", "order": 6, "width": 10, "height": 1 }, { "id": "af26bc88.ba0548", "type": "ui_spacer", "name": "spacer", "group": "4322c187.e73e5", "order": 9, "width": 10, "height": 1 }, { "id": "3432fc1c.79719c", "type": "ui_spacer", "name": "spacer", "group": "b5d61bc7.54fe48", "order": 2, "width": 6, "height": 1 }, { "id": "58e49f6e.36a43", "type": "ui_spacer", "name": "spacer", "group": "b5d61bc7.54fe48", "order": 3, "width": 1, "height": 1 }, { "id": "34d24744.cd3f3", "type": "ui_spacer", "name": "spacer", "group": "b5d61bc7.54fe48", "order": 5, "width": 1, "height": 1 }, { "id": "93f4db6d.d6c5a8", "type": "ui_spacer", "name": "spacer", "group": "b7919ae2.c01788", "order": 2, "width": 5, "height": 1 }, { "id": "8789db4f.9528a8", "type": "ui_spacer", "name": "spacer", "group": "707d9797.c8e798", "order": 5, "width": 1, "height": 1 }, { "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": 1, "width": 0, "height": 0, "passthru": false, "label": "Home", "tooltip": "", "color": "", "bgcolor": "", "icon": "home", "payload": "{\"tab\":\"Home\"}", "payloadType": "json", "topic": "", "x": 410, "y": 460, "wires": [ [ "f0fb77cf.8f1c28" ] ] }, { "id": "f0fb77cf.8f1c28", "type": "ui_ui_control", "z": "cb95299c.2817c8", "name": "", "events": "change", "x": 720, "y": 460, "wires": [ [] ] }, { "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": "{\"tab\":\"Home\"}", "payloadType": "json", "topic": "", "x": 130, "y": 1140, "wires": [ [ "60fd157b.8a5aac" ] ] }, { "id": "60fd157b.8a5aac", "type": "ui_ui_control", "z": "1371dec5.76e671", "name": "", "events": "change", "x": 280, "y": 1140, "wires": [ [] ] }, { "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": "30", "max": "55", "colors": [ "#00b500", "#e6e600", "#ca3838" ], "seg1": "", "seg2": "", "x": 610, "y": 100, "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": 120, "wires": [ [ "bc503fa5.f46dd", "2c8c45ab.610c0a", "cef370c7.1f7a" ], [], [] ] }, { "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": "30", "ymax": "60", "removeOlder": "20", "removeOlderPoints": "200", "removeOlderUnit": "60", "cutout": 0, "useOneColor": false, "useUTC": false, "colors": [ "#1f77b4", "#aec7e8", "#ff7f0e", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "useOldStyle": true, "outputs": 1, "x": 570, "y": 140, "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": 310, "y": 200, "wires": [ [ "e046247c.c466e8", "4b2b9a70.6a9af4" ], [], [] ] }, { "id": "c2b8d8b.0d90328", "type": "exec", "z": "1371dec5.76e671", "command": "free | grep Mem | awk '{print 100*($2-$7)/$2}' | awk '{print int($1+0.5)}' | tr -d \"\\n\"", "addpay": false, "append": "", "useSpawn": "", "timer": "", "name": "Free Memory", "x": 310, "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": "%", "format": "{{value}}", "min": 0, "max": "100", "colors": [ "#00b500", "#e6e600", "#ca3838" ], "seg1": "", "seg2": "", "x": 580, "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": "%", "format": "{{value}}", "min": 0, "max": "100", "colors": [ "#00b500", "#e6e600", "#ca3838" ], "seg1": "", "seg2": "", "x": 580, "y": 280, "wires": [] }, { "id": "3910d662.fa1f7a", "type": "exec", "z": "1371dec5.76e671", "command": "df -h | grep /dev/root | awk -F ' ' '{print $5}' | tr -d % | tr \"\\n$\" \"\\ \" | sed 's/,/./' | tr -d \" \"", "addpay": false, "append": "", "useSpawn": "", "timer": "", "name": "Disk Usage", "x": 310, "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": "%", "format": "{{value}}", "min": 0, "max": "100", "colors": [ "#00b500", "#e6e600", "#ca3838" ], "seg1": "", "seg2": "", "x": 570, "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": 570, "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": "0", "ymax": "100", "removeOlder": "20", "removeOlderPoints": "", "removeOlderUnit": "60", "cutout": 0, "useOneColor": false, "useUTC": false, "colors": [ "#1f77b4", "#aec7e8", "#ff7f0e", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "useOldStyle": true, "outputs": 1, "x": 570, "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": "0", "ymax": "100", "removeOlder": "4", "removeOlderPoints": "200", "removeOlderUnit": "3600", "cutout": 0, "useOneColor": false, "useUTC": false, "colors": [ "#1f77b4", "#aec7e8", "#ff7f0e", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "useOldStyle": true, "outputs": 1, "x": 570, "y": 420, "wires": [ [] ] }, { "id": "1cd5b4c0.46af9b", "type": "inject", "z": "1371dec5.76e671", "name": "update: 15s", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "5", "crontab": "", "once": false, "onceDelay": "", "topic": "", "payload": "", "payloadType": "date", "x": 90, "y": 260, "wires": [ [ "3910d662.fa1f7a", "c2b8d8b.0d90328", "55749fd8.3aca5", "ddcbbfa5.cd158" ] ] }, { "id": "8485d05.444903", "type": "ui_switch", "z": "1371dec5.76e671", "name": "fan_state", "label": "Fan", "tooltip": "", "group": "3ca00bf9.e5cac4", "order": 6, "width": 3, "height": 1, "passthru": true, "decouple": "false", "topic": "", "style": "", "onvalue": "on", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "off", "offvalueType": "str", "officon": "", "offcolor": "", "x": 940, "y": 40, "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": 1090, "y": 40, "wires": [ [] ] }, { "id": "a113b518.830008", "type": "ui_button", "z": "1371dec5.76e671", "name": "", "group": "1be83144.4fe4bf", "order": 10, "width": 7, "height": 1, "passthru": false, "label": "Reboot", "tooltip": "", "color": "", "bgcolor": "#AD1625", "icon": "refresh", "payload": "reboot", "payloadType": "str", "topic": "reboot", "x": 120, "y": 1000, "wires": [ [ "ee57d11c.ed1dd" ] ] }, { "id": "d9a924bc.0ca078", "type": "exec", "z": "1371dec5.76e671", "command": "sudo", "addpay": true, "append": "now", "useSpawn": "false", "timer": "2", "oldrc": false, "name": "cmd", "x": 510, "y": 1000, "wires": [ [], [], [] ] }, { "id": "552d8bbb.cc4ca4", "type": "ui_button", "z": "1371dec5.76e671", "name": "", "group": "1be83144.4fe4bf", "order": 8, "width": 7, "height": 1, "passthru": false, "label": "Shutdown", "tooltip": "", "color": "", "bgcolor": "#AD1625", "icon": "standby", "payload": "shutdown", "payloadType": "str", "topic": "shutdown", "x": 120, "y": 1080, "wires": [ [ "ee57d11c.ed1dd" ] ] }, { "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\n#msg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", "outputs": 1, "x": 330, "y": 1040, "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": 530, "y": 1080, "wires": [ [], [], [] ] }, { "id": "bc503fa5.f46dd", "type": "switch", "z": "1371dec5.76e671", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "gt", "v": "50", "vt": "num" }, { "t": "lte", "v": "35", "vt": "num" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 570, "y": 40, "wires": [ [ "a25d6486.e1ce28" ], [ "5d4f3e71.1bad4" ] ] }, { "id": "5d4f3e71.1bad4", "type": "change", "z": "1371dec5.76e671", "name": "Set OFF", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "off", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 720, "y": 60, "wires": [ [ "8485d05.444903" ] ] }, { "id": "a25d6486.e1ce28", "type": "change", "z": "1371dec5.76e671", "name": "Set ON", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "on", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 720, "y": 20, "wires": [ [ "8485d05.444903" ] ] }, { "id": "6a84252a.d52a0c", "type": "ui_template", "z": "bccd1f23.87219", "group": "833bc5bb.217ba8", "name": "Stream Pi Camera", "order": 1, "width": 18, "height": 14, "format": "
\n \n
", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", "x": 110, "y": 100, "wires": [ [] ] }, { "id": "dc48dc42.98d18", "type": "function", "z": "bccd1f23.87219", "name": "set global", "func": "global.set(msg.topic,msg.payload);", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 880, "y": 340, "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": 600, "y": 120, "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": 600, "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": 1, "width": 5, "height": 1, "passthru": true, "mode": "text", "delay": 300, "topic": "acq_id", "x": 650, "y": 240, "wires": [ [ "fb887036.12429", "67091ac0.8f9f6c" ] ] }, { "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": "811cd88c.daf528", "type": "ui_button", "z": "bccd1f23.87219", "name": "down", "group": "fbd92986.1028c8", "order": 5, "width": 0, "height": 0, "passthru": true, "label": "", "tooltip": "", "color": "", "bgcolor": "", "icon": "arrow_downward", "payload": "DOWN", "payloadType": "str", "topic": "actuator/focus", "x": 190, "y": 640, "wires": [ [ "65ad39d.b6d4d48" ] ] }, { "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": "actuator/focus", "x": 190, "y": 600, "wires": [ [ "65ad39d.b6d4d48" ] ] }, { "id": "68962547.34a67c", "type": "ui_text_input", "z": "bccd1f23.87219", "name": "pump_manual_volume", "label": "Volume to pass (ml)", "tooltip": "", "group": "707d9797.c8e798", "order": 3, "width": 3, "height": 1, "passthru": true, "mode": "number", "delay": 300, "topic": "pump_manual_volume", "x": 320, "y": 340, "wires": [ [ "dc48dc42.98d18" ] ] }, { "id": "34c81624.df1cea", "type": "ui_slider", "z": "bccd1f23.87219", "name": "pump_flowrate", "label": "Flowrate (ml/min)*", "tooltip": "", "group": "707d9797.c8e798", "order": 1, "width": 0, "height": 0, "passthru": true, "outs": "end", "topic": "pump_flowrate", "min": 0, "max": "20", "step": "0.1", "x": 340, "y": 300, "wires": [ [ "dc48dc42.98d18" ] ] }, { "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
\n In doubt? Start Here!\n
", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": false, "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": 670, "y": 340, "wires": [ [ "9f501f49.45645" ] ] }, { "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, "multiple": false, "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": 630, "y": 460, "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": 650, "y": 420, "wires": [ [ "9f501f49.45645", "52af9ac0.60eb24" ] ] }, { "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": 660, "y": 300, "wires": [ [ "9f501f49.45645" ] ] }, { "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": 670, "y": 380, "wires": [ [ "9f501f49.45645" ] ] }, { "id": "9f501f49.45645", "type": "function", "z": "b771c342.49603", "name": "set global", "func": "global.set(msg.topic,msg.payload);", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 1240, "y": 540, "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, "multiple": false, "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": 630, "y": 80, "wires": [ [ "fb887036.12429", "99b11fe4.2795d" ] ] }, { "id": "fb887036.12429", "type": "function", "z": "baa1e3d9.cb29d", "name": "set global", "func": "global.set(msg.topic, msg.payload);", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 1100, "y": 180, "wires": [ [] ] }, { "id": "222c851d.5d0a3a", "type": "ui_ui_control", "z": "b771c342.49603", "name": "", "events": "change", "x": 420, "y": 1000, "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": 850, "y": 1120, "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 object_date= global.get(\"object_date\");\nvar object_time= global.get(\"object_time\");\nvar object_lat_end= global.get(\"object_lat_end\");\nvar object_lon_end= global.get(\"object_lon_end\");\nvar object_date_end= global.get(\"object_date_end\");\nvar object_time_end= global.get(\"object_time_end\");\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 = \"Latitude of throw\"\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Longitude of throw\"\n}\n\nelse if (object_date === undefined || object_date === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date of throw\"\n}\n\nelse if (object_time === undefined || object_time === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time of throw\"\n}\n\nelse if (object_lat_end === undefined || object_lat_end === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Latitude of retrieval\"\n}\n\nelse if (object_lon_end === undefined || object_lon_end === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Longitude of retrieval\"\n}\n\nelse if (object_date_end === undefined || object_date_end === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date of retrieval\"\n}\n\nelse if (object_time_end === undefined || object_time_end === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time of retrieval\"\n}\n\nelse {\n msg.topic = \"Change Tab\"\n msg.payload={\"tab\":\"Optic Configuration\"};\n}\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 430, "y": 1060, "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": 290, "y": 1240, "wires": [ [] ] }, { "id": "726a7822.cd6298", "type": "ui_ui_control", "z": "b771c342.49603", "name": "", "events": "change", "x": 840, "y": 1040, "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": 610, "y": 1060, "wires": [ [ "726a7822.cd6298", "e2b277c1.07283" ], [ "52f6b103.1efb6" ] ] }, { "id": "2d128018.6a809", "type": "ui_text_input", "z": "b771c342.49603", "name": "object_lat", "label": "Latitude of throw", "tooltip": "36°57'9\" N", "group": "cef1e703.bcf3c8", "order": 1, "width": 5, "height": 1, "passthru": true, "mode": "text", "delay": 300, "topic": "object_lat", "x": 680, "y": 580, "wires": [ [ "42795da1.0ee104" ] ] }, { "id": "4626c0da.e0dd5", "type": "ui_text_input", "z": "b771c342.49603", "name": "object_lon", "label": "Longitude of throw", "tooltip": "110°4'21\" W", "group": "cef1e703.bcf3c8", "order": 2, "width": 5, "height": 1, "passthru": true, "mode": "text", "delay": 300, "topic": "object_lon", "x": 670, "y": 620, "wires": [ [ "42795da1.0ee104" ] ] }, { "id": "f00f321f.77d76", "type": "ui_date_picker", "z": "b771c342.49603", "name": "object_date", "label": "Date", "group": "cef1e703.bcf3c8", "order": 3, "width": 5, "height": 1, "passthru": true, "topic": "object_date", "x": 670, "y": 660, "wires": [ [ "29f2b365.4327ec" ] ] }, { "id": "207fbdbb.2fe2a2", "type": "ui_text_input", "z": "b771c342.49603", "name": "object_time", "label": "Time :", "tooltip": "UTC time, 03:23:00 or 15:45", "group": "cef1e703.bcf3c8", "order": 4, "width": 5, "height": 1, "passthru": true, "mode": "text", "delay": 300, "topic": "object_time", "x": 670, "y": 700, "wires": [ [ "1a945afa.d60aad" ] ] }, { "id": "6c792043.b6ff9", "type": "ui_ui_control", "z": "bccd1f23.87219", "name": "", "events": "change", "x": 1060, "y": 1120, "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": 1070, "y": 1220, "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, "initialize": "", "finalize": "", "x": 670, "y": 1180, "wires": [ [ "652d812a.7d808" ] ] }, { "id": "f58a0c4.e207df", "type": "ui_ui_control", "z": "bccd1f23.87219", "name": "", "events": "change", "x": 1060, "y": 1160, "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": 830, "y": 1180, "wires": [ [ "f58a0c4.e207df" ], [ "902429eb.ceacb8" ] ] }, { "id": "5846b1d4.7971b", "type": "ui_button", "z": "bccd1f23.87219", "name": "Backward", "group": "707d9797.c8e798", "order": 2, "width": 2, "height": 1, "passthru": false, "label": "", "tooltip": "", "color": "", "bgcolor": "", "icon": "arrow_back", "payload": "BACKWARD", "payloadType": "str", "topic": "actuator/pump", "x": 180, "y": 220, "wires": [ [ "3cb96380.e575ec" ] ] }, { "id": "2cab680b.baf888", "type": "ui_button", "z": "bccd1f23.87219", "name": "Forward", "group": "707d9797.c8e798", "order": 4, "width": 2, "height": 1, "passthru": true, "label": "", "tooltip": "", "color": "", "bgcolor": "", "icon": "arrow_forward", "payload": "FORWARD", "payloadType": "str", "topic": "actuator/pump", "x": 180, "y": 260, "wires": [ [ "3cb96380.e575ec" ] ] }, { "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": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "x": 280, "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": 1080, "y": 100, "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, "resendOnRefresh": false, "templateScope": "local", "x": 1670, "y": 100, "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(\"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, "initialize": "", "finalize": "", "x": 1280, "y": 100, "wires": [ [ "ad87820f.b1d1e", "d68a52ee.82e8e", "238f26b1.e2089a", "6e0f6d36.a6b854" ] ] }, { "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, "resendOnRefresh": false, "templateScope": "local", "x": 1680, "y": 140, "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": 1660, "y": 180, "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": 1660, "y": 220, "wires": [ [] ] }, { "id": "ad87820f.b1d1e", "type": "function", "z": "bccd1f23.87219", "name": "get magnification", "func": "var magnification = global.get(\"acq_magnification\");\nmsg.payload = magnification;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 1490, "y": 100, "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, "initialize": "", "finalize": "", "x": 1490, "y": 140, "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": 1470, "y": 180, "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": 1470, "y": 220, "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": "
\n \n
", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", "x": 910, "y": 40, "wires": [ [] ] }, { "id": "d0c5b57d.590818", "type": "ui_ui_control", "z": "baa1e3d9.cb29d", "name": "", "events": "change", "x": 1020, "y": 80, "wires": [ [] ] }, { "id": "16de754c.cc969b", "type": "ui_button", "z": "b771c342.49603", "name": "", "group": "5517c651.b2f668", "order": 1, "width": 5, "height": 1, "passthru": false, "label": "Previous", "tooltip": "", "color": "#097479", "bgcolor": "white", "icon": "keyboard_return", "payload": "{\"tab\":\"Home\"}", "payloadType": "json", "topic": "", "x": 280, "y": 1000, "wires": [ [ "222c851d.5d0a3a" ] ] }, { "id": "84f3d040.5f7ea", "type": "ui_button", "z": "b771c342.49603", "name": "", "group": "5517c651.b2f668", "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": 280, "y": 1060, "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": 500, "y": 1120, "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": 500, "y": 1180, "wires": [ [ "fe840e05.b46f3" ] ] }, { "id": "c72f8fae.23bd4", "type": "ui_button", "z": "baa1e3d9.cb29d", "name": "", "group": "b7919ae2.c01788", "order": 1, "width": 5, "height": 1, "passthru": false, "label": "Previous", "tooltip": "", "color": "#097479", "bgcolor": "white", "icon": "keyboard_return", "payload": "{\"tab\":\"Optic Configuration\"}", "payloadType": "json", "topic": "", "x": 880, "y": 80, "wires": [ [ "d0c5b57d.590818" ] ] }, { "id": "389bef3.d94c61", "type": "ui_text_input", "z": "baa1e3d9.cb29d", "name": "acq_volume", "label": "Volume to pass (ml)", "tooltip": "", "group": "4322c187.e73e5", "order": 2, "width": 5, "height": 1, "passthru": true, "mode": "number", "delay": 300, "topic": "acq_volume", "x": 630, "y": 200, "wires": [ [ "fb887036.12429" ] ] }, { "id": "29be525e.0c87fe", "type": "ui_template", "z": "baa1e3d9.cb29d", "group": "b5d61bc7.54fe48", "name": "show global", "order": 6, "width": 0, "height": 0, "format": "
\n Sample Project:
\n Sample Ship:
\n sample operator:
\n sample id:
\n sample sampling_gear:
\n\n acq id:
\n acq instrument:
\n acq instrument_id:
\n acq camera:
\n acq celltype:
\n acq minimum_mesh:
\n acq maximum_mesh:
\n acq min_esd:
\n acq max_esd:
\n acq volume:
\n acq magnification:
\n acq fnumber_objective:
\n acq software:
\n acq flowrate:
\n\n object lat:
\n object lon:
\n object lat end:
\n object lon end:
\n object date:
\n object time:
\n object date end:
\n object time end:
\n object depth min:
\n object depth max:
\n\n process pixel:
\n process id: \n
\n", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", "x": 950, "y": 500, "wires": [ [] ] }, { "id": "e2919164.70927", "type": "function", "z": "baa1e3d9.cb29d", "name": "get global", "func": "msg.payload = {\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 \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_camera\":global.get(\"acq_camera\"),\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(\"acq_magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_flowrate\":global.get(\"sug_flowrate\"),\n \n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_lat_end\":global.get(\"object_lat_end\"),\n \"object_lon_end\":global.get(\"object_lon_end\"),\n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_date_end\":global.get(\"object_date_end\"),\n \"object_time_end\":global.get(\"object_time_end\"),\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}\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 740, "y": 500, "wires": [ [ "29be525e.0c87fe" ] ] }, { "id": "7ca7754c.0f731c", "type": "inject", "z": "eaae323a.31b3", "name": "", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 120, "y": 420, "wires": [ [ "4c6d21e3.0173c" ] ] }, { "id": "cbb8afed.0a026", "type": "rpi-gpio out", "z": "bccd1f23.87219", "name": "LED Output", "pin": "40", "set": true, "level": "0", "freq": "", "out": "out", "x": 450, "y": 40, "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": 280, "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": 640, "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": 870, "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": 430, "y": 420, "wires": [ [ "a256071b.25a008" ] ] }, { "id": "3cb96380.e575ec", "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(\"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 msg.volume = volume;\n flowrate = global.get(\"pump_flowrate\");\n msg.topic = \"actuator/pump\";\n \n if(state===\"free\"){\n // msg.payload is FORWARD or BACKWARD here\n msg.payload={\"action\":\"move\", \n \"direction\":msg.payload,\n \"volume\":volume,\n \"flowrate\":flowrate};\n }\n}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 360, "y": 240, "wires": [ [ "43fa762d.35bcb" ] ], "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": "43fa762d.35bcb", "type": "switch", "z": "bccd1f23.87219", "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": 490, "y": 240, "wires": [ [ "bdc8ce57.de1f08" ], [ "8bcce348.efc1a" ] ] }, { "id": "8bcce348.efc1a", "type": "ui_toast", "z": "bccd1f23.87219", "position": "dialog", "displayTime": "3", "highlight": "", "sendall": true, "outputs": 1, "ok": "OK", "cancel": "", "raw": false, "topic": "", "name": "", "x": 650, "y": 260, "wires": [ [] ] }, { "id": "bdc8ce57.de1f08", "type": "mqtt out", "z": "bccd1f23.87219", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 630, "y": 220, "wires": [] }, { "id": "3d31ee98.a7d6fa", "type": "ui_text_input", "z": "bccd1f23.87219", "name": "focus_distance", "label": "Distance in µm", "tooltip": "This will be rounded to the nearest 25µm", "group": "fbd92986.1028c8", "order": 4, "width": 0, "height": 0, "passthru": true, "mode": "number", "delay": 300, "topic": "focus_distance", "x": 400, "y": 440, "wires": [ [ "dbd6bde.99db64" ] ] }, { "id": "1f7cea1d.fbe61e", "type": "switch", "z": "bccd1f23.87219", "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": 470, "y": 620, "wires": [ [ "62030521.88317c" ], [ "d71d224f.0585d8" ] ] }, { "id": "d71d224f.0585d8", "type": "ui_toast", "z": "bccd1f23.87219", "position": "dialog", "displayTime": "3", "highlight": "", "sendall": true, "outputs": 1, "ok": "OK", "cancel": "", "raw": false, "topic": "", "name": "", "x": 650, "y": 640, "wires": [ [] ] }, { "id": "65ad39d.b6d4d48", "type": "function", "z": "bccd1f23.87219", "name": "focus.js", "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar distance = global.get(\"focus_distance\");\n\nif (distance === undefined || distance === \"\" || distance === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Distance\";\n}else {\n distance = global.get(\"focus_distance\");\n if(state===\"free\"){\n // msg.payload is UP or DOWN here\n msg.payload={\"action\":\"move\", \n \"direction\":msg.payload,\n \"distance\":(distance/1000)};\n }\n}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 320, "y": 620, "wires": [ [ "1f7cea1d.fbe61e" ] ] }, { "id": "1962d999.4a97e6", "type": "ui_button", "z": "bccd1f23.87219", "name": "stop focus", "group": "fbd92986.1028c8", "order": 7, "width": 0, "height": 0, "passthru": true, "label": "STOP FOCUS", "tooltip": "", "color": "", "bgcolor": "#AD1625", "icon": "", "payload": "{\"action\":\"stop\"}", "payloadType": "json", "topic": "actuator/focus", "x": 180, "y": 680, "wires": [ [ "fd05f252.5a90c" ] ] }, { "id": "62030521.88317c", "type": "mqtt out", "z": "bccd1f23.87219", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 630, "y": 560, "wires": [] }, { "id": "fd05f252.5a90c", "type": "mqtt out", "z": "bccd1f23.87219", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 630, "y": 680, "wires": [] }, { "id": "dbd6bde.99db64", "type": "function", "z": "bccd1f23.87219", "name": "round distance", "func": "// Here we change the focus_distance to 25 µm increment\nif (msg.payload%25 <= 12.5){\n msg.payload = msg.payload - msg.payload%25\n}\nelse {\n msg.payload = msg.payload + msg.payload%25\n}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 620, "y": 440, "wires": [ [ "3d31ee98.a7d6fa", "69d4ea6c.4c1e2c", "dc48dc42.98d18" ] ] }, { "id": "3bd43039.bc5fb8", "type": "ui_button", "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", "order": 2, "width": 0, "height": 0, "passthru": false, "label": "UP 1mm", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "{\"action\":\"move\",\"direction\":\"UP\",\"distance\":1}", "payloadType": "json", "topic": "actuator/focus", "x": 180, "y": 520, "wires": [ [ "62030521.88317c" ] ] }, { "id": "c0663029.2d03b", "type": "ui_button", "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", "order": 6, "width": 0, "height": 0, "passthru": false, "label": "DOWN 1mm", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "{\"action\":\"move\",\"direction\":\"DOWN\",\"distance\":1}", "payloadType": "json", "topic": "actuator/focus", "x": 170, "y": 560, "wires": [ [ "62030521.88317c" ] ] }, { "id": "69d4ea6c.4c1e2c", "type": "ui_slider", "z": "bccd1f23.87219", "name": "focus_distance", "label": "", "tooltip": "in µm", "group": "fbd92986.1028c8", "order": 3, "width": 0, "height": 0, "passthru": true, "outs": "end", "topic": "focus_distance", "min": "25", "max": "2000", "step": "25", "x": 400, "y": 500, "wires": [ [ "3d31ee98.a7d6fa" ] ] }, { "id": "71f55a58.d7eaf4", "type": "inject", "z": "bccd1f23.87219", "name": "Default: 500µm", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "500", "payloadType": "num", "x": 120, "y": 440, "wires": [ [ "3d31ee98.a7d6fa", "69d4ea6c.4c1e2c" ] ] }, { "id": "9a1d0e7c.2d5a1", "type": "inject", "z": "bccd1f23.87219", "name": "Default: OFF", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "false", "payloadType": "bool", "x": 110, "y": 40, "wires": [ [ "961d27e7.da65c8" ] ] }, { "id": "16aa0238.209276", "type": "ui_slider", "z": "bccd1f23.87219", "name": "Iso slider", "label": "ISO", "tooltip": "Possible values are 100, 200, 320, 400, 500, 640, 800. 500 by default.", "group": "8c38a81e.9897a8", "order": 2, "width": 0, "height": 0, "passthru": true, "outs": "end", "topic": "imager/image", "min": "100", "max": "800", "step": "20", "x": 360, "y": 820, "wires": [ [ "bb090334.1e21a8" ] ] }, { "id": "bb090334.1e21a8", "type": "function", "z": "bccd1f23.87219", "name": "round iso", "func": "// Iso should be one of 60, 100, 200, 320, 400, 500, 640, 800\n\nif (msg.payload <= 80){\n msg.payload = 60;\n return msg;\n}\n\nif (msg.payload <= 150){\n msg.payload = 100;\n return msg;\n}\n\nif (msg.payload <= 260){\n msg.payload = 200;\n return msg;\n}\n\nif (msg.payload <= 360){\n msg.payload = 320;\n return msg;\n}\n\nif (msg.payload <= 450){\n msg.payload = 400;\n return msg;\n}\n\nif (msg.payload <= 565){\n msg.payload = 500;\n return msg;\n}\n\nif (msg.payload <= 700){\n msg.payload = 640;\n return msg;\n}\n\n\nif (700 < msg.payload){\n msg.payload = 800;\n return msg;\n}\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 520, "y": 820, "wires": [ [ "16aa0238.209276", "8ea9dc9a.c7d87" ] ] }, { "id": "8ea9dc9a.c7d87", "type": "function", "z": "bccd1f23.87219", "name": "Encapsulate settings", "func": "msg.payload = {\n \"action\":\"settings\", \n \"settings\":{\"iso\":msg.payload}\n}\nmsg.topic = \"imager/image\"\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 720, "y": 820, "wires": [ [ "845e06e1.0d812" ] ] }, { "id": "5765a825.a595c8", "type": "ui_slider", "z": "bccd1f23.87219", "name": "Shutter speed slider", "label": "Shutter Speed", "tooltip": "In microseconds, up to 1000µs, 1µs by default", "group": "8c38a81e.9897a8", "order": 1, "width": 0, "height": 0, "passthru": true, "outs": "end", "topic": "imager/image", "min": "1", "max": "1000", "step": "1", "x": 390, "y": 880, "wires": [ [ "c38509b.fb08af8" ] ] }, { "id": "c38509b.fb08af8", "type": "function", "z": "bccd1f23.87219", "name": "Encapsulate settings", "func": "msg.payload = {\n \"action\":\"settings\", \n \"settings\":{\"shutter_speed\":msg.payload}\n}\nmsg.topic = \"imager/image\"\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 720, "y": 880, "wires": [ [ "845e06e1.0d812" ] ] }, { "id": "845e06e1.0d812", "type": "mqtt out", "z": "bccd1f23.87219", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 930, "y": 840, "wires": [] }, { "id": "2350e507.d4e302", "type": "inject", "z": "bccd1f23.87219", "name": "Default: 1µs", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "1", "topic": "", "payload": "1", "payloadType": "num", "x": 110, "y": 880, "wires": [ [ "5765a825.a595c8" ] ] }, { "id": "2edd922b.a471a6", "type": "inject", "z": "bccd1f23.87219", "name": "Default: ISO 100", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "1", "topic": "", "payload": "100", "payloadType": "num", "x": 110, "y": 820, "wires": [ [ "16aa0238.209276" ] ] }, { "id": "f782a471.447748", "type": "inject", "z": "bccd1f23.87219", "name": "Default: 5mL/min", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "5", "payloadType": "num", "x": 130, "y": 300, "wires": [ [ "34c81624.df1cea" ] ] }, { "id": "73b8252a.5ca754", "type": "inject", "z": "bccd1f23.87219", "name": "Default: 2mL", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "2", "payloadType": "num", "x": 110, "y": 340, "wires": [ [ "68962547.34a67c" ] ] }, { "id": "8ec68b82.17e3d8", "type": "ui_button", "z": "cb95299c.2817c8", "name": "Start segmentation", "group": "abeb6dad.635a2", "order": 1, "width": 6, "height": 1, "passthru": false, "label": "Start segmentation", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "{\"action\":\"segment\"}", "payloadType": "json", "topic": "segmenter/segment", "x": 370, "y": 260, "wires": [ [ "16f3cef4.0acac9" ] ] }, { "id": "27be7971.b3fbce", "type": "ui_button", "z": "cb95299c.2817c8", "name": "Stop segmentation", "group": "abeb6dad.635a2", "order": 2, "width": 6, "height": 1, "passthru": true, "label": "Stop segmentation", "tooltip": "", "color": "", "bgcolor": "#AD1625", "icon": "", "payload": "{\"action\":\"stop\"}", "payloadType": "json", "topic": "segmenter/segment", "x": 370, "y": 380, "wires": [ [ "16f3cef4.0acac9" ] ] }, { "id": "16f3cef4.0acac9", "type": "mqtt out", "z": "cb95299c.2817c8", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 710, "y": 320, "wires": [] }, { "id": "6b61b50c.7456d4", "type": "ui_button", "z": "1371dec5.76e671", "name": "Update", "group": "1be83144.4fe4bf", "order": 3, "width": 6, "height": 1, "passthru": false, "label": "Update", "tooltip": "", "color": "", "bgcolor": "", "icon": "system_update", "payload": "", "payloadType": "str", "topic": "update", "x": 100, "y": 520, "wires": [ [ "386ce65d.a15d52" ] ] }, { "id": "386ce65d.a15d52", "type": "exec", "z": "1371dec5.76e671", "command": "bash /home/pi/PlanktonScope/scripts/bash/update.sh", "addpay": false, "append": "", "useSpawn": "true", "timer": "", "oldrc": false, "name": "Update", "x": 300, "y": 520, "wires": [ [ "1fa7fddf.18161a" ], [ "8c3e4a1c.1ebbb" ], [ "8c3e4a1c.1ebbb" ] ] }, { "id": "9998aa86.74bb", "type": "exec", "z": "1371dec5.76e671", "command": "python3 /home/pi/PlanktonScope/scripts/main.py", "addpay": false, "append": "", "useSpawn": "true", "timer": "", "oldrc": false, "name": "", "x": 860, "y": 940, "wires": [ [], [], [ "de4ba211.e1d3f" ] ] }, { "id": "672d89a8.4e6968", "type": "exec", "z": "1371dec5.76e671", "d": true, "command": "sudo killall -9 python3", "addpay": true, "append": "", "useSpawn": "false", "timer": "", "oldrc": false, "name": "Hard kill", "x": 980, "y": 880, "wires": [ [], [], [] ] }, { "id": "afa9f4b.2e77988", "type": "delay", "z": "1371dec5.76e671", "name": "", "pauseType": "delay", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 460, "y": 940, "wires": [ [ "9998aa86.74bb" ] ] }, { "id": "1df370a8.6c70ff", "type": "ui_button", "z": "1371dec5.76e671", "name": "Restart Python", "group": "1be83144.4fe4bf", "order": 6, "width": 6, "height": 1, "passthru": false, "label": "Restart Python", "tooltip": "", "color": "", "bgcolor": "#AD1625", "icon": "refresh", "payload": "", "payloadType": "str", "topic": "", "x": 100, "y": 940, "wires": [ [ "afa9f4b.2e77988", "3829adc.ccc87d2", "35ea3cf0.a398ac" ] ] }, { "id": "de4ba211.e1d3f", "type": "debug", "z": "1371dec5.76e671", "name": "output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 960, "wires": [] }, { "id": "7aa2e737.e16d98", "type": "status", "z": "1371dec5.76e671", "name": "", "scope": [ "9998aa86.74bb" ], "x": 1220, "y": 900, "wires": [ [ "439b952c.3e9cf4" ] ] }, { "id": "439b952c.3e9cf4", "type": "debug", "z": "1371dec5.76e671", "name": "status", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "status", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1450, "y": 900, "wires": [] }, { "id": "35ea3cf0.a398ac", "type": "exec", "z": "1371dec5.76e671", "command": "sudo killall -15 python3", "addpay": true, "append": "", "useSpawn": "false", "timer": "", "oldrc": false, "name": "Python soft kill", "x": 480, "y": 880, "wires": [ [], [], [] ] }, { "id": "a776b9fc.d542e8", "type": "delay", "z": "1371dec5.76e671", "d": true, "name": "", "pauseType": "delay", "timeout": "4", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 740, "y": 880, "wires": [ [ "672d89a8.4e6968" ] ] }, { "id": "569154a.b53182c", "type": "inject", "z": "1371dec5.76e671", "name": "once", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "", "topic": "", "x": 130, "y": 820, "wires": [ [ "afa9f4b.2e77988", "3829adc.ccc87d2", "452af41c.43940c", "b3c21aa9.8c06c" ] ] }, { "id": "3829adc.ccc87d2", "type": "exec", "z": "1371dec5.76e671", "command": "sudo killall -15 raspimjpeg", "addpay": true, "append": "", "useSpawn": "false", "timer": "", "oldrc": false, "name": "Raspimjpeg soft kill", "x": 490, "y": 820, "wires": [ [], [], [] ] }, { "id": "b55ed048.2418c8", "type": "ui_template", "z": "1371dec5.76e671", "group": "1be83144.4fe4bf", "name": "", "order": 1, "width": 0, "height": 0, "format": "
If you want to update to the latest code version of Node-Red and Python, please click here.\nWe are trying to save your configuration changes with git stash and restore them afterwards, but clearly, things may break!\nIf you have made changes to the flow, you will lose them. Please commit those changes from Node-Red interface, from the Project History tab.
", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", "x": 100, "y": 460, "wires": [ [] ] }, { "id": "4b489713.ccde5", "type": "ui_button", "z": "baa1e3d9.cb29d", "name": "", "group": "4322c187.e73e5", "order": 11, "width": 5, "height": 1, "passthru": false, "label": "Start Acquisition", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "imager/image", "x": 520, "y": 580, "wires": [ [ "c9f510c0.7d1328" ] ] }, { "id": "c9f510c0.7d1328", "type": "function", "z": "baa1e3d9.cb29d", "name": "Image control", "func": "state = global.get(\"state\");\nglobal.set('img_counter',0);\nglobal.set('obj_counter',0);\nif (state === null){state=\"free\"}\n\nvar nb_frame= global.get(\"nb_frame\");\nvar 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_id= global.get(\"acq_id\");\nvar pump_direction= global.get(\"pump_direction\");\nvar imaging_pump_volume= global.get(\"imaging_pump_volume\");\n\nif (acq_celltype === undefined || acq_celltype === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Type of the flowcell\"\n}else if (acq_minimum_mesh === undefined || acq_minimum_mesh === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Lower fraction size\"\n}else if (acq_maximum_mesh === undefined || acq_maximum_mesh === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Upper fraction size\"\n}else if (imaging_pump_volume === undefined || imaging_pump_volume === \"\" || imaging_pump_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume inbetween images\"\n}else if (acq_id === undefined || acq_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Acquisition ID\"\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 (pump_direction === undefined || pump_direction === \"\" || pump_direction === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Pump direction\";\n \n}else {\n msg.payload={\"action\":\"image\", \n \"sleep\":1,\n \"pump_direction\": pump_direction,\n \"volume\":imaging_pump_volume,\n \"nb_frame\":nb_frame,\n }\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 720, "y": 580, "wires": [ [ "52ea7d01.711034", "40c12463.a1f84c", "f62d9622.621318" ] ], "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": "d6ebaa2.ea21d58", "type": "switch", "z": "baa1e3d9.cb29d", "name": "", "property": "topic", "propertyType": "msg", "rules": [ { "t": "eq", "v": "imager/image", "vt": "str" }, { "t": "eq", "v": "Missing entry :", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1070, "y": 580, "wires": [ [ "c3e50240.82aa58" ], [ "20e0a8c8.edbeb" ] ] }, { "id": "20e0a8c8.edbeb", "type": "ui_toast", "z": "baa1e3d9.cb29d", "position": "dialog", "displayTime": "3", "highlight": "", "sendall": true, "outputs": 1, "ok": "OK", "cancel": "", "raw": false, "topic": "", "name": "", "x": 1230, "y": 620, "wires": [ [] ] }, { "id": "c3e50240.82aa58", "type": "mqtt out", "z": "baa1e3d9.cb29d", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 1210, "y": 540, "wires": [] }, { "id": "3a4450b1.4459a8", "type": "ui_button", "z": "baa1e3d9.cb29d", "name": "Stop Acquisition", "group": "4322c187.e73e5", "order": 10, "width": 5, "height": 1, "passthru": true, "label": "STOP ACQUISITION", "tooltip": "", "color": "", "bgcolor": "#AD1625", "icon": "cancel", "payload": "{\"action\":\"stop\"}", "payloadType": "json", "topic": "imager/image", "x": 520, "y": 620, "wires": [ [ "d74210ef.edc15" ] ] }, { "id": "d74210ef.edc15", "type": "mqtt out", "z": "baa1e3d9.cb29d", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 690, "y": 620, "wires": [] }, { "id": "bb62da8a.ebc328", "type": "ui_switch", "z": "baa1e3d9.cb29d", "name": "Pump direction", "label": "Pump direction", "tooltip": "BACKWARD / FORWARD", "group": "4322c187.e73e5", "order": 7, "width": 5, "height": 1, "passthru": true, "decouple": "false", "topic": "pump_direction", "style": "", "onvalue": "FORWARD", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "BACKWARD", "offvalueType": "str", "officon": "", "offcolor": "", "x": 520, "y": 660, "wires": [ [ "6b2239f3.41fa3" ] ] }, { "id": "52ea7d01.711034", "type": "function", "z": "baa1e3d9.cb29d", "name": "Encapsulate config", "func": "msg.payload = {\n \"action\":\"update_config\", \n \"config\":{\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 \"acq_camera_name\":global.get(\"acq_camera_name\"),\n \"acq_nb_frame\":global.get(\"nb_frame\"),\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, "initialize": "", "finalize": "", "x": 950, "y": 540, "wires": [ [ "c3e50240.82aa58" ] ] }, { "id": "40c12463.a1f84c", "type": "delay", "z": "baa1e3d9.cb29d", "name": "", "pauseType": "delay", "timeout": "1", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 920, "y": 580, "wires": [ [ "d6ebaa2.ea21d58" ] ] }, { "id": "4d1b02cb.83b51c", "type": "ui_button", "z": "baa1e3d9.cb29d", "name": "", "group": "4322c187.e73e5", "order": 8, "width": 5, "height": 1, "passthru": false, "label": "Update config", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "imager/image", "x": 520, "y": 540, "wires": [ [ "52ea7d01.711034", "e2919164.70927", "a4abb1ae.2ae418" ] ] }, { "id": "452af41c.43940c", "type": "python3-function", "z": "1371dec5.76e671", "name": "Get MachineName", "func": "import sys\nsys.path.append('/home/pi/PlanktonScope/scripts')\nimport planktoscope.uuidName\n\nmsg['payload'] = planktoscope.uuidName.machineName(machine=planktoscope.uuidName.getSerial())\nmsg['topic'] = \"acq_instrument_id\";\nreturn msg", "outputs": 1, "x": 490, "y": 760, "wires": [ [ "4828d2f4.7c712c", "e2f39a35.f57298", "a400a97e.e333a8" ] ] }, { "id": "4828d2f4.7c712c", "type": "function", "z": "1371dec5.76e671", "name": "set global", "func": "global.set(msg.topic,msg.payload);\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 780, "y": 800, "wires": [ [] ] }, { "id": "2200e2ae.0d183e", "type": "rpi-gpio out", "z": "1371dec5.76e671", "name": "Pump Enable", "pin": "7", "set": true, "level": "1", "freq": "", "out": "out", "x": 470, "y": 600, "wires": [] }, { "id": "592c4dac.b8a9dc", "type": "rpi-gpio out", "z": "1371dec5.76e671", "name": "Focus Enable", "pin": "32", "set": true, "level": "1", "freq": "", "out": "out", "x": 480, "y": 640, "wires": [] }, { "id": "d027a6bf.7049e8", "type": "function", "z": "b771c342.49603", "name": "get sample_projet", "func": "msg.payload = msg.payload.sample_project;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 350, "y": 300, "wires": [ [ "9c882b37.fde668" ] ] }, { "id": "5a811caf.0f3144", "type": "function", "z": "b771c342.49603", "name": "get sample_ship", "func": "msg.payload = msg.payload.sample_ship;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 340, "y": 340, "wires": [ [ "4557d689.a4fa88" ] ] }, { "id": "45911c98.2bd83c", "type": "function", "z": "b771c342.49603", "name": "get sample_id", "func": "msg.payload = msg.payload.sample_id;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 340, "y": 380, "wires": [ [ "94eb4221.9b92c" ] ] }, { "id": "1e09a4ab.72996b", "type": "function", "z": "b771c342.49603", "name": "get sample_operator", "func": "msg.payload = msg.payload.sample_operator;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 360, "y": 420, "wires": [ [ "82c5fc77.59c97" ] ] }, { "id": "a3272681.f271c8", "type": "function", "z": "b771c342.49603", "name": "get sample_sampling_gear", "func": "msg.payload = msg.payload.sample_sampling_gear;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 380, "y": 460, "wires": [ [ "fcfc31ae.af3af" ] ] }, { "id": "6465bdd5.15eb8c", "type": "file in", "z": "1c24ad9c.bebec2", "name": "", "filename": "/home/pi/PlanktonScope/config.json", "format": "utf8", "chunk": false, "sendError": false, "encoding": "none", "x": 660, "y": 300, "wires": [ [ "15ceb135.6628bf" ] ], "info": "# PlanktonScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" }, { "id": "15ceb135.6628bf", "type": "json", "z": "1c24ad9c.bebec2", "name": "config.json", "property": "payload", "action": "", "pretty": false, "x": 910, "y": 300, "wires": [ [ "ad541674.4791c8" ] ] }, { "id": "b584292a.24b08", "type": "function", "z": "20ae9e26.17d73a", "name": "get global", "func": "msg.payload={\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 \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_instrument_id\":global.get(\"machine_name\"),\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 \"acq_camera\":global.get(\"camera\"),\n \n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n};\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 200, "y": 80, "wires": [ [] ] }, { "id": "7205d267.36adcc", "type": "file", "z": "1c24ad9c.bebec2", "name": "", "filename": "/home/pi/PlanktonScope/config.json", "appendNewline": true, "createDir": true, "overwriteFile": "true", "encoding": "none", "x": 1040, "y": 860, "wires": [ [] ] }, { "id": "2e6ddf51.c0dba", "type": "json", "z": "1c24ad9c.bebec2", "name": "config.json", "property": "payload", "action": "str", "pretty": true, "x": 810, "y": 860, "wires": [ [ "7205d267.36adcc" ] ] }, { "id": "ad541674.4791c8", "type": "function", "z": "1c24ad9c.bebec2", "name": "Global Set", "func": "for (const key in msg.payload) {\n global.set(key, msg.payload[key]);\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 1090, "y": 300, "wires": [ [] ] }, { "id": "3e9a33c.141384c", "type": "inject", "z": "1c24ad9c.bebec2", "name": "Load config", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "x": 410, "y": 300, "wires": [ [ "6465bdd5.15eb8c" ] ] }, { "id": "e2f39a35.f57298", "type": "subflow:1c24ad9c.bebec2", "z": "1371dec5.76e671", "name": "", "env": [], "x": 770, "y": 720, "wires": [ [ "bdc6718a.dd5d48", "f783aefd.c3bfd8" ] ] }, { "id": "a6907a38.f6611", "type": "subflow:1c24ad9c.bebec2", "z": "b771c342.49603", "name": "", "env": [], "x": 90, "y": 380, "wires": [ [ "d027a6bf.7049e8", "5a811caf.0f3144", "45911c98.2bd83c", "1e09a4ab.72996b", "a3272681.f271c8" ] ] }, { "id": "e2b277c1.07283", "type": "subflow:1c24ad9c.bebec2", "z": "b771c342.49603", "name": "", "env": [], "x": 830, "y": 1080, "wires": [ [] ] }, { "id": "3cea1f2.20525e", "type": "ui_text_input", "z": "b771c342.49603", "name": "object_lat_end", "label": "Latitude of retrieval", "tooltip": "36°57'9\" N", "group": "cf5d9f0e.d57e7", "order": 1, "width": 5, "height": 1, "passthru": true, "mode": "text", "delay": 300, "topic": "object_lat_end", "x": 660, "y": 760, "wires": [ [ "42795da1.0ee104" ] ] }, { "id": "661818e.5a31368", "type": "ui_text_input", "z": "b771c342.49603", "name": "object_lon_end", "label": "Longitude of retrieval", "tooltip": "110°4'21\" W", "group": "cf5d9f0e.d57e7", "order": 2, "width": 5, "height": 1, "passthru": true, "mode": "text", "delay": 300, "topic": "object_lon_end", "x": 660, "y": 800, "wires": [ [ "42795da1.0ee104" ] ] }, { "id": "f9d71e4b.2940a", "type": "ui_date_picker", "z": "b771c342.49603", "name": "object_date_end", "label": "Date", "group": "cf5d9f0e.d57e7", "order": 3, "width": 5, "height": 1, "passthru": true, "topic": "object_date_end", "x": 660, "y": 840, "wires": [ [ "29f2b365.4327ec" ] ] }, { "id": "2a514f3b.97a6b", "type": "ui_text_input", "z": "b771c342.49603", "name": "object_time_end", "label": "Time :", "tooltip": "UTC time, 03:23:00 or 15:45", "group": "cf5d9f0e.d57e7", "order": 4, "width": 5, "height": 1, "passthru": true, "mode": "text", "delay": 300, "topic": "object_time_end", "x": 660, "y": 880, "wires": [ [ "1a945afa.d60aad" ] ] }, { "id": "1a945afa.d60aad", "type": "function", "z": "b771c342.49603", "name": "set time global", "func": "msg.payload = msg.payload.replace(/\\D/g, \"\"); // remove non-digit characters\nif (msg.payload.length<5) msg.payload += \"00\";\n\nglobal.set(msg.topic,msg.payload);", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 980, "y": 740, "wires": [ [] ] }, { "id": "29f2b365.4327ec", "type": "function", "z": "b771c342.49603", "name": "set date global", "func": "var date = new Date(msg.payload);\n\nglobal.set(msg.topic,date.toISOString().split('T')[0].replace(/-/gi, ''));", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 980, "y": 700, "wires": [ [] ] }, { "id": "b3c21aa9.8c06c", "type": "exec", "z": "1371dec5.76e671", "command": "git --git-dir /home/pi/PlanktonScope/.git/ rev-parse --short master", "addpay": false, "append": "", "useSpawn": "false", "timer": "", "oldrc": false, "name": "git rev", "x": 450, "y": 700, "wires": [ [ "3e64877a.9684b" ], [], [] ] }, { "id": "3e64877a.9684b", "type": "function", "z": "1371dec5.76e671", "name": "store version", "func": "msg.payload = \"PlanktoScope v2.2-\"+msg.payload.trim()\n\nglobal.set(\"acq_software\",msg.payload);\n\nreturn msg\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 790, "y": 660, "wires": [ [ "8343fa69.49339" ] ] }, { "id": "68fa1227.dbdd5c", "type": "function", "z": "bccd1f23.87219", "name": "get acq_fnumber_objective", "func": "msg.payload = msg.payload.acq_fnumber_objective;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 820, "y": 100, "wires": [ [ "cc966678.da8d08" ] ] }, { "id": "1c45ea1c.80234e", "type": "subflow:1c24ad9c.bebec2", "z": "bccd1f23.87219", "name": "", "x": 600, "y": 100, "wires": [ [ "68fa1227.dbdd5c" ] ] }, { "id": "5921d0d0.a3d568", "type": "subflow:1c24ad9c.bebec2", "z": "baa1e3d9.cb29d", "name": "", "x": 90, "y": 160, "wires": [ [ "f3658d30.b8448", "1f133196.96564e", "d3ca8847.4d1ae", "5e3dec55.881074", "de2c90cf.b73b08" ] ] }, { "id": "f3658d30.b8448", "type": "function", "z": "baa1e3d9.cb29d", "name": "get acq_id", "func": "msg.payload = msg.payload.acq_id;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 310, "y": 240, "wires": [ [ "6b34c456.83178c" ] ] }, { "id": "de2c90cf.b73b08", "type": "function", "z": "baa1e3d9.cb29d", "name": "get acq_celltype", "func": "msg.payload = msg.payload.acq_celltype;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 320, "y": 80, "wires": [ [ "cc0ca68b.4263a8" ] ] }, { "id": "5e3dec55.881074", "type": "function", "z": "baa1e3d9.cb29d", "name": "get acq_minimum_mesh", "func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 350, "y": 120, "wires": [ [ "f59a2f0d.5e9af" ] ] }, { "id": "d3ca8847.4d1ae", "type": "function", "z": "baa1e3d9.cb29d", "name": "get acq_maximum_mesh", "func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 350, "y": 160, "wires": [ [ "6008a8bb.259f08" ] ] }, { "id": "1f133196.96564e", "type": "function", "z": "baa1e3d9.cb29d", "name": "get acq_volume", "func": "msg.payload = msg.payload.acq_volume;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 320, "y": 200, "wires": [ [ "389bef3.d94c61" ] ] }, { "id": "bdc6718a.dd5d48", "type": "ui_text", "z": "1371dec5.76e671", "group": "ce9e278.781eed8", "order": 3, "width": 0, "height": 0, "name": "", "label": "Instrument Type", "format": "{{msg.payload.acq_instrument}}", "layout": "row-spread", "x": 1040, "y": 700, "wires": [] }, { "id": "a400a97e.e333a8", "type": "ui_text", "z": "1371dec5.76e671", "group": "ce9e278.781eed8", "order": 0, "width": 0, "height": 0, "name": "", "label": "Instrument Name", "format": "{{msg.payload}}", "layout": "row-spread", "x": 810, "y": 760, "wires": [] }, { "id": "8343fa69.49339", "type": "ui_text", "z": "1371dec5.76e671", "group": "ce9e278.781eed8", "order": 1, "width": 0, "height": 0, "name": "", "label": "Software version", "format": "{{msg.payload}}", "layout": "row-spread", "x": 1040, "y": 660, "wires": [] }, { "id": "f783aefd.c3bfd8", "type": "ui_text", "z": "1371dec5.76e671", "group": "ce9e278.781eed8", "order": 0, "width": 0, "height": 0, "name": "", "label": "Camera Name", "format": "{{msg.payload.acq_camera}}", "layout": "row-spread", "x": 1040, "y": 740, "wires": [] }, { "id": "a0e2d78c.a587e", "type": "inject", "z": "1371dec5.76e671", "name": "Default: ON", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "", "topic": "", "payload": "true", "payloadType": "bool", "x": 110, "y": 620, "wires": [ [ "2200e2ae.0d183e", "592c4dac.b8a9dc" ] ] }, { "id": "906d9fea.4bab48", "type": "status", "z": "b771c342.49603", "d": true, "name": "GPS Status", "scope": [], "x": 310, "y": 1320, "wires": [ [ "7116e906.9f50f" ] ] }, { "id": "7116e906.9f50f", "type": "ui_text", "z": "b771c342.49603", "d": true, "group": "cf5d9f0e.d57e7", "order": 5, "width": 6, "height": 1, "name": "GPS Status Display", "label": "GPS Status:", "format": "{{msg.status.text}}", "layout": "row-left", "x": 810, "y": 1320, "wires": [] }, { "id": "3269f55f.05d0d2", "type": "function", "z": "b771c342.49603", "name": "DD to DMS", "func": "function ConvertDDToDMS(D, lng){\n // from https://stackoverflow.com/a/5786281/2108279\n return {\n dir : D<0?lng?'W':'S':lng?'E':'N',\n deg : 0|(D<0?D=-D:D),\n min : 0|D%1*60,\n sec :(0|D*60%1*6000)/100\n };\n}\n\nmsg.payload = {\n \"lat\":ConvertDDToDMS(msg.payload.lat, false),\n \"lon\":ConvertDDToDMS(msg.payload.lon, true)\n};\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 450, "y": 680, "wires": [ [] ] }, { "id": "48879182.6fd718", "type": "inject", "z": "baa1e3d9.cb29d", "name": "Default: 10", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "10", "payloadType": "num", "x": 310, "y": 280, "wires": [ [ "51b4d0df.d70a88" ] ] }, { "id": "1fa7fddf.18161a", "type": "ui_toast", "z": "1371dec5.76e671", "position": "dialog", "displayTime": "10", "highlight": "", "sendall": true, "outputs": 1, "ok": "OK", "cancel": "", "raw": false, "topic": "", "name": "Update notif", "x": 570, "y": 500, "wires": [ [] ] }, { "id": "8c3e4a1c.1ebbb", "type": "debug", "z": "1371dec5.76e671", "name": "Update", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 560, "y": 540, "wires": [] }, { "id": "6451f991.aaac1", "type": "ui_button", "z": "bccd1f23.87219", "name": "stop pump", "group": "707d9797.c8e798", "order": 6, "width": 2, "height": 1, "passthru": true, "label": "STOP PUMP", "tooltip": "", "color": "", "bgcolor": "#AD1625", "icon": "", "payload": "{\"action\":\"stop\"}", "payloadType": "json", "topic": "actuator/pump", "x": 170, "y": 180, "wires": [ [ "e2af9066.9c0178" ] ] }, { "id": "e2af9066.9c0178", "type": "mqtt out", "z": "bccd1f23.87219", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 310, "y": 180, "wires": [] }, { "id": "b402f719.55bc98", "type": "inject", "z": "baa1e3d9.cb29d", "name": "Default: FORWARD", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "pump_direction", "payload": "FORWARD", "payloadType": "str", "x": 290, "y": 660, "wires": [ [ "bb62da8a.ebc328" ] ] }, { "id": "42795da1.0ee104", "type": "function", "z": "b771c342.49603", "name": "DDMM.MMMM to DD", "func": "// Format 36°57.4439' N, 110°4.2100' W\n// From https://stackoverflow.com/questions/1140189/converting-latitude-and-longitude-to-decimal-values\nfunction ConvertDDMMToDD(input) {\n var parts = input.split(/[^\\d\\w]+/);\n var dd = Number(parts[0]) + (Number(parts[1]) + Number(parts[2])/10000)/60;\n\n if (parts[3] == \"S\" || parts[3] == \"W\") {\n dd = dd * -1;\n } // Don't do anything for N or E\n return dd.toFixed(6);\n}\n\nmsg.payload = ConvertDDMMToDD(msg.payload)\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 1000, "y": 660, "wires": [ [ "9f501f49.45645" ] ] }, { "id": "cdc75496.45f748", "type": "subflow:20ae9e26.17d73a", "z": "1c24ad9c.bebec2", "x": 610, "y": 860, "wires": [ [ "2e6ddf51.c0dba" ] ] }, { "id": "6b2239f3.41fa3", "type": "function", "z": "baa1e3d9.cb29d", "name": "set global", "func": "global.set(msg.topic, msg.payload);", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 700, "y": 660, "wires": [ [] ] }, { "id": "a4abb1ae.2ae418", "type": "subflow:1c24ad9c.bebec2", "z": "baa1e3d9.cb29d", "name": "", "env": [], "x": 730, "y": 460, "wires": [ [] ] }, { "id": "51b4d0df.d70a88", "type": "ui_text_input", "z": "baa1e3d9.cb29d", "name": "nb_frame", "label": "Number of images to acquire", "tooltip": "", "group": "4322c187.e73e5", "order": 3, "width": 0, "height": 0, "passthru": true, "mode": "number", "delay": 300, "topic": "nb_frame", "x": 640, "y": 280, "wires": [ [ "fb887036.12429", "67091ac0.8f9f6c" ] ] }, { "id": "9c7f7fc9.c8d3a", "type": "ui_text_input", "z": "b771c342.49603", "name": "object_depth_max", "label": "Object depth Max", "tooltip": "", "group": "3e1ba03d.f01d8", "order": 8, "width": 5, "height": 1, "passthru": true, "mode": "number", "delay": 300, "topic": "object_depth_max", "x": 650, "y": 500, "wires": [ [ "9f501f49.45645" ] ] }, { "id": "317eeeb7.8d3042", "type": "ui_text_input", "z": "b771c342.49603", "name": "object_depth_min", "label": "Object Depth Min", "tooltip": "", "group": "3e1ba03d.f01d8", "order": 6, "width": 5, "height": 1, "passthru": true, "mode": "number", "delay": 300, "topic": "object_depth_min", "x": 650, "y": 540, "wires": [ [ "9f501f49.45645" ] ] }, { "id": "999065ca.27edb8", "type": "switch", "z": "baa1e3d9.cb29d", "name": "topic filter", "property": "topic", "propertyType": "msg", "rules": [ { "t": "eq", "v": "status/pump", "vt": "str" }, { "t": "eq", "v": "status/focus", "vt": "str" }, { "t": "eq", "v": "status/imager", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 680, "y": 940, "wires": [ [ "a46a1e7f.88a92", "6742014e.1bb238" ], [ "c516d9ea.f7f6e", "6742014e.1bb238" ], [ "2b009bd7.c07004", "307c851e.fb0f7a" ] ] }, { "id": "2b009bd7.c07004", "type": "ui_text", "z": "baa1e3d9.cb29d", "group": "70de8209.68416c", "order": 3, "width": 10, "height": 2, "name": "imager", "label": "Imager status:", "format": "{{msg.payload.status}}", "layout": "col-center", "x": 1110, "y": 900, "wires": [] }, { "id": "c516d9ea.f7f6e", "type": "ui_text", "z": "baa1e3d9.cb29d", "group": "70de8209.68416c", "order": 1, "width": 5, "height": 1, "name": "focus", "label": "Focus status:", "format": "{{msg.payload.status}}", "layout": "col-center", "x": 1110, "y": 860, "wires": [] }, { "id": "a46a1e7f.88a92", "type": "ui_text", "z": "baa1e3d9.cb29d", "group": "70de8209.68416c", "order": 2, "width": 5, "height": 1, "name": "pump", "label": "Pump status:", "format": "{{msg.payload.status}}", "layout": "col-center", "x": 1110, "y": 820, "wires": [] }, { "id": "bb628f8d.98f108", "type": "link in", "z": "baa1e3d9.cb29d", "name": "Status for fluidic module", "links": [ "58f2e0f.4e8b12" ], "x": 515, "y": 940, "wires": [ [ "999065ca.27edb8" ] ] }, { "id": "1fdf77b5.24e4e", "type": "mqtt in", "z": "9a22e67a.378818", "name": "", "topic": "status/#", "qos": "0", "datatype": "json", "broker": "8dc3722c.06efa8", "x": 290, "y": 340, "wires": [ [ "fa73983d.318188" ] ] }, { "id": "4a1e9e3e.27506", "type": "switch", "z": "9a22e67a.378818", "name": "Filter segmenter out", "property": "topic", "propertyType": "msg", "rules": [ { "t": "else" }, { "t": "cont", "v": "status/segmenter", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 620, "y": 340, "wires": [ [ "58f2e0f.4e8b12" ], [ "dcf5bd45.16a8d" ] ] }, { "id": "fa73983d.318188", "type": "json", "z": "9a22e67a.378818", "name": "", "property": "payload", "action": "obj", "pretty": true, "x": 430, "y": 340, "wires": [ [ "4a1e9e3e.27506" ] ] }, { "id": "58f2e0f.4e8b12", "type": "link out", "z": "9a22e67a.378818", "name": "Fluidic module status", "links": [ "bb628f8d.98f108" ], "x": 795, "y": 320, "wires": [] }, { "id": "307c851e.fb0f7a", "type": "switch", "z": "baa1e3d9.cb29d", "name": "Imaging state", "property": "payload", "propertyType": "msg", "rules": [ { "t": "jsonata_exp", "v": "$contains(msg.payload.status, \"jpg\")\t", "vt": "jsonata" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 910, "y": 1040, "wires": [ [ "db8e3dde.44efb8" ], [ "6742014e.1bb238" ] ] }, { "id": "db8e3dde.44efb8", "type": "function", "z": "baa1e3d9.cb29d", "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, "initialize": "", "finalize": "", "x": 1140, "y": 1100, "wires": [ [ "b7c3a3ad.9bf32", "39812a27.6cb10e" ] ] }, { "id": "59164d65.e7993c", "type": "ui_toast", "z": "baa1e3d9.cb29d", "position": "top right", "displayTime": "5", "highlight": "", "sendall": true, "outputs": 0, "ok": "OK", "cancel": "", "raw": false, "topic": "", "name": "", "x": 1600, "y": 980, "wires": [] }, { "id": "8c7348aa.1962e8", "type": "template", "z": "baa1e3d9.cb29d", "name": "Create sentence", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "The {{topic}} is {{payload.status}}", "output": "str", "x": 1400, "y": 980, "wires": [ [ "59164d65.e7993c" ] ] }, { "id": "6742014e.1bb238", "type": "change", "z": "baa1e3d9.cb29d", "name": "Remove high-level topic", "rules": [ { "t": "change", "p": "topic", "pt": "msg", "from": "status/", "fromt": "str", "to": "", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1170, "y": 980, "wires": [ [ "8c7348aa.1962e8" ] ] }, { "id": "b7c3a3ad.9bf32", "type": "ui_text", "z": "baa1e3d9.cb29d", "group": "b5d61bc7.54fe48", "order": 4, "width": 5, "height": 2, "name": "Image Count", "label": "Images count", "format": "{{msg.payload}}", "layout": "col-center", "x": 1590, "y": 1120, "wires": [] }, { "id": "1a2e721a.f5e876", "type": "ui_gauge", "z": "baa1e3d9.cb29d", "name": "Image Donut", "group": "b5d61bc7.54fe48", "order": 1, "width": 4, "height": 3, "gtype": "donut", "title": "progress", "label": "%", "format": "{{value}}", "min": 0, "max": "100", "colors": [ "#ffa83f", "#e6ff02", "#00dfe9" ], "seg1": "50", "seg2": "75", "x": 1590, "y": 1080, "wires": [] }, { "id": "39812a27.6cb10e", "type": "function", "z": "baa1e3d9.cb29d", "name": "percent image", "func": "msg.payload = (100 * msg.payload/global.get('nb_frame')).toFixed(2)\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 1400, "y": 1080, "wires": [ [ "1a2e721a.f5e876" ] ] }, { "id": "1585d7e9.ea2d28", "type": "function", "z": "baa1e3d9.cb29d", "name": "img_counter init", "func": "img_counter=0\nglobal.set('img_counter',img_counter)\nmsg.payload = img_counter\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 1340, "y": 1160, "wires": [ [ "b7c3a3ad.9bf32" ] ] }, { "id": "e1a2f1b3.fe1758", "type": "inject", "z": "baa1e3d9.cb29d", "name": "Init graphs", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "0", "payloadType": "num", "x": 1130, "y": 1160, "wires": [ [ "1585d7e9.ea2d28" ] ] }, { "id": "8f3788f6.ddcf98", "type": "function", "z": "cb95299c.2817c8", "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, "initialize": "", "finalize": "", "x": 820, "y": 840, "wires": [ [ "9d53dbe2.dbffe8", "fa3b7929.ac7da8" ] ] }, { "id": "aa38dbbc.cf0a9", "type": "switch", "z": "cb95299c.2817c8", "name": "Segmenter", "property": "topic", "propertyType": "msg", "rules": [ { "t": "eq", "v": "status/segmenter", "vt": "str" }, { "t": "eq", "v": "status/segmenter/name", "vt": "str" }, { "t": "eq", "v": "status/segmenter/object_id", "vt": "str" }, { "t": "eq", "v": "status/segmenter/metric", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 4, "x": 490, "y": 740, "wires": [ [ "b9a23b91.93638", "6919465f.332e5" ], [ "49af3d24.1799e4" ], [ "8f3788f6.ddcf98" ], [ "50ce901f.b5034" ] ] }, { "id": "9d53dbe2.dbffe8", "type": "ui_chart", "z": "cb95299c.2817c8", "name": "obj_counter", "group": "46be9c86.dea684", "order": 7, "width": 12, "height": 2, "label": "Objects", "chartType": "horizontalBar", "legend": "false", "xformat": "HH:mm:ss", "interpolate": "linear", "nodata": "Objects count will be shown here once the segmentation is started", "dot": false, "ymin": "", "ymax": "", "removeOlder": 1, "removeOlderPoints": "", "removeOlderUnit": "3600", "cutout": 0, "useOneColor": true, "useUTC": false, "colors": [ "#1f77b4", "#aec7e8", "#ff7f0e", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "useOldStyle": false, "outputs": 1, "x": 1330, "y": 840, "wires": [ [] ] }, { "id": "50ce901f.b5034", "type": "function", "z": "cb95299c.2817c8", "name": "ex : area", "func": "msg.payload=msg.payload.object_area\nmsg.topic=\"area\"\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 800, "y": 880, "wires": [ [ "458cd82e.03d258" ] ] }, { "id": "a4f0f0d1.3aca88", "type": "ui_toast", "z": "cb95299c.2817c8", "position": "top right", "displayTime": "5", "highlight": "", "sendall": true, "outputs": 0, "ok": "OK", "cancel": "", "raw": false, "topic": "", "name": "", "x": 1340, "y": 680, "wires": [] }, { "id": "458cd82e.03d258", "type": "ui_chart", "z": "cb95299c.2817c8", "name": "Area chart", "group": "46be9c86.dea684", "order": 9, "width": 12, "height": 7, "label": "Objects Area", "chartType": "line", "legend": "false", "xformat": "HH:mm:ss", "interpolate": "linear", "nodata": "Objects area will be shown here once the segmentation is started", "dot": true, "ymin": "", "ymax": "", "removeOlder": 1, "removeOlderPoints": "1000", "removeOlderUnit": "3600", "cutout": 0, "useOneColor": false, "useUTC": true, "colors": [ "#1f77b4", "#aec7e8", "#ff7f0e", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "useOldStyle": false, "outputs": 1, "x": 1330, "y": 880, "wires": [ [] ] }, { "id": "49af3d24.1799e4", "type": "debug", "z": "cb95299c.2817c8", "name": "segmentation name", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 830, "y": 760, "wires": [] }, { "id": "7088a5be.0c79a4", "type": "template", "z": "cb95299c.2817c8", "name": "Create sentence", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "The {{topic}} is {{payload.status}}", "output": "str", "x": 1100, "y": 680, "wires": [ [ "a4f0f0d1.3aca88" ] ] }, { "id": "b9a23b91.93638", "type": "change", "z": "cb95299c.2817c8", "name": "Remove high-level topic", "rules": [ { "t": "change", "p": "topic", "pt": "msg", "from": "status/", "fromt": "str", "to": "", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 850, "y": 680, "wires": [ [ "7088a5be.0c79a4" ] ] }, { "id": "6919465f.332e5", "type": "ui_text", "z": "cb95299c.2817c8", "group": "46be9c86.dea684", "order": 1, "width": 4, "height": 1, "name": "segmenter", "label": "Segmenter status:", "format": "{{msg.payload.status}}", "layout": "col-center", "x": 810, "y": 720, "wires": [] }, { "id": "fa3b7929.ac7da8", "type": "ui_text", "z": "cb95299c.2817c8", "group": "46be9c86.dea684", "order": 5, "width": 4, "height": 1, "name": "obj_count", "label": "Objects count", "format": "{{msg.payload}}", "layout": "col-center", "x": 1320, "y": 800, "wires": [] }, { "id": "640ece83.88cab", "type": "inject", "z": "cb95299c.2817c8", "name": "Init graphs", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "0", "payloadType": "num", "x": 810, "y": 800, "wires": [ [ "cd10a556.6a9a08" ] ] }, { "id": "cd10a556.6a9a08", "type": "function", "z": "cb95299c.2817c8", "name": "obj_counter init", "func": "obj_counter=0\nglobal.set('obj_counter',obj_counter)\nmsg.payload = obj_counter\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 1000, "y": 800, "wires": [ [ "fa3b7929.ac7da8" ] ] }, { "id": "25867454.a8e334", "type": "link in", "z": "cb95299c.2817c8", "name": "Segmenter module status", "links": [ "dcf5bd45.16a8d" ], "x": 295, "y": 740, "wires": [ [ "aa38dbbc.cf0a9" ] ] }, { "id": "dcf5bd45.16a8d", "type": "link out", "z": "9a22e67a.378818", "name": "Segmenter module status", "links": [ "25867454.a8e334" ], "x": 795, "y": 360, "wires": [] }, { "id": "52af9ac0.60eb24", "type": "link out", "z": "b771c342.49603", "name": "Sample Operator", "links": [ "c1d4934c.9bb628" ], "x": 815, "y": 420, "wires": [] }, { "id": "105e3033.152848", "type": "exec", "z": "1371dec5.76e671", "command": "", "addpay": true, "append": "", "useSpawn": "false", "timer": "1", "oldrc": false, "name": "git user.name", "x": 1160, "y": 420, "wires": [ [], [], [] ] }, { "id": "cc205a38.f86ea", "type": "template", "z": "1371dec5.76e671", "name": "git config", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "git config --global --replace-all user.name \"{{payload}}\"", "output": "str", "x": 980, "y": 420, "wires": [ [ "105e3033.152848" ] ] }, { "id": "c1d4934c.9bb628", "type": "link in", "z": "1371dec5.76e671", "name": "Git config", "links": [ "52af9ac0.60eb24" ], "x": 875, "y": 420, "wires": [ [ "cc205a38.f86ea" ] ] }, { "id": "892fcd9b.d34a1", "type": "switch", "z": "baa1e3d9.cb29d", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 1440, "y": 840, "wires": [ [] ] }, { "id": "9bd72495.a8a098", "type": "ui_text", "z": "baa1e3d9.cb29d", "group": "4322c187.e73e5", "order": 4, "width": 5, "height": 1, "name": "Imaged volume", "label": "Imaged volume", "format": "{{msg.payload}}", "layout": "row-spread", "x": 1120, "y": 260, "wires": [] }, { "id": "99b11fe4.2795d", "type": "function", "z": "baa1e3d9.cb29d", "name": "Volume calc", "func": "msg.payload = ((4.15*3.14*msg.payload/1000) / 1000).toFixed(4) + \" mL\"\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 930, "y": 260, "wires": [ [ "9bd72495.a8a098" ] ], "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": "8e16aa2f.e40398", "type": "ui_text", "z": "baa1e3d9.cb29d", "group": "4322c187.e73e5", "order": 5, "width": 5, "height": 1, "name": "Pump volume", "label": "Pump volume", "format": "{{msg.payload}}", "layout": "row-spread", "x": 1180, "y": 300, "wires": [] }, { "id": "67091ac0.8f9f6c", "type": "function", "z": "baa1e3d9.cb29d", "name": "pump volume calc", "func": "var acq_volume = global.get(\"acq_volume\");\nvar nb_frame = global.get(\"nb_frame\");\n\nvar pump_volume = Math.max((Number(acq_volume) / Number(nb_frame)), 0.01).toFixed(4)\n\nglobal.set(\"imaging_pump_volume\", pump_volume)\n\nmsg.payload = pump_volume + \" mL per frame\"\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 950, "y": 300, "wires": [ [ "8e16aa2f.e40398", "f62d9622.621318" ] ], "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": "f62d9622.621318", "type": "debug", "z": "baa1e3d9.cb29d", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1210, "y": 360, "wires": [] }, { "id": "43737d43.eb0e9c", "type": "ui_slider", "z": "bccd1f23.87219", "name": "WB Red slider", "label": "WB: Red", "tooltip": "from 1.0 to 3.0", "group": "8c38a81e.9897a8", "order": 3, "width": 5, "height": 1, "passthru": true, "outs": "end", "topic": "imager/image", "min": "1.0", "max": "3.0", "step": "0.01", "x": 380, "y": 940, "wires": [ [ "5e147425.7666ec" ] ] }, { "id": "5e147425.7666ec", "type": "function", "z": "bccd1f23.87219", "name": "Encapsulate settings", "func": "msg.payload = {\n \"action\":\"settings\", \n \"settings\":{\"white_balance_gain\":{\n \"red\":Math.round(msg.payload*100)\n }\n }\n}\nmsg.topic = \"imager/image\"\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 720, "y": 940, "wires": [ [ "45c83cd2.15aee4" ] ] }, { "id": "4b708426.adeeb4", "type": "function", "z": "bccd1f23.87219", "name": "Encapsulate settings", "func": "msg.payload = {\n \"action\":\"settings\", \n \"settings\":{\"white_balance_gain\":{\n \"blue\":Math.round(msg.payload*100)\n }\n }\n}\nmsg.topic = \"imager/image\"\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 720, "y": 1000, "wires": [ [ "45c83cd2.15aee4" ] ] }, { "id": "45c83cd2.15aee4", "type": "mqtt out", "z": "bccd1f23.87219", "name": "", "topic": "", "qos": "", "retain": "", "broker": "8dc3722c.06efa8", "x": 930, "y": 960, "wires": [] }, { "id": "5ca6cdb6.3a6684", "type": "inject", "z": "bccd1f23.87219", "name": "Default: WB 2.0", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "1", "topic": "", "payload": "2.0", "payloadType": "num", "x": 120, "y": 940, "wires": [ [ "43737d43.eb0e9c" ] ] }, { "id": "7b699798.3d568", "type": "ui_slider", "z": "bccd1f23.87219", "name": "WB Blue slider", "label": "WB: Blue", "tooltip": "from 1.0 to 3.0", "group": "8c38a81e.9897a8", "order": 4, "width": 5, "height": 1, "passthru": true, "outs": "end", "topic": "imager/image", "min": "1.0", "max": "3.0", "step": "0.01", "x": 380, "y": 1000, "wires": [ [ "4b708426.adeeb4" ] ] }, { "id": "7db56b9d.37f52c", "type": "inject", "z": "bccd1f23.87219", "name": "Default: WB 1.4", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "1", "topic": "", "payload": "1.4", "payloadType": "num", "x": 120, "y": 1000, "wires": [ [ "7b699798.3d568" ] ] } ]