planktoscope/flows/flows.json

4864 lines
146 KiB
JSON
Raw Normal View History

2020-01-08 14:32:46 +01:00
[
{
2020-07-14 18:22:31 +02:00
"id": "ff9251a5.9c5e18",
2020-01-08 14:32:46 +01:00
"type": "tab",
2020-07-14 18:22:31 +02:00
"label": "Main",
2020-01-08 14:32:46 +01:00
"disabled": false,
"info": ""
},
{
2020-07-14 18:22:31 +02:00
"id": "bba19d97.b32b1",
"type": "subflow",
"name": "Acquisition actuation",
"info": "",
"category": "",
"in": [],
"out": [],
"env": [],
"color": "#A6BBCF"
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "c1d3ff7c.4384f",
"type": "subflow",
"name": "MQQT Cmds",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 40,
"wires": [
{
"id": "5079cccb.298d14"
},
{
"id": "197215b2.165f22"
}
]
}
],
"out": [],
"env": [],
"color": "#DDAA99"
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "c10e968b.87e488",
"type": "subflow",
"name": "Datetime update",
"info": "",
"category": "",
"in": [
{
"x": 140,
"y": 80,
"wires": [
{
"id": "93b9f3cd.759688"
}
]
}
],
"out": [],
"env": [],
"color": "#DDAA99",
"icon": "font-awesome/fa-clock-o"
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "863e8384.56889",
"type": "subflow",
"name": "Acquisition inputs",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 40,
"wires": [
{
"id": "3eaf4c98.d94b54"
},
{
"id": "e50aa637.59ac68"
},
{
"id": "8eeb9e9e.a50d7"
},
{
"id": "e4e16eb9.5296c"
}
]
}
],
"out": [
{
"x": 740,
"y": 40,
"wires": [
{
"id": "c4527705.33a84",
"port": 0
},
{
"id": "f648e44.94e3998",
"port": 0
},
{
"id": "582e21b2.ad67a8",
"port": 0
},
{
"id": "f9705bc.3d322a8",
"port": 0
}
]
}
],
"env": [],
"color": "#A6BBCF",
"icon": "node-red-contrib-camerapi/photo.png"
},
{
"id": "5a287804.a10e2",
"type": "subflow",
"name": "Process metadata",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 80,
"wires": [
{
"id": "dfb4b682.601e1"
}
]
}
],
"out": [
{
"x": 700,
"y": 80,
"wires": [
{
"id": "11b31baf.95996c",
"port": 0
}
]
}
],
"env": [],
"color": "#DDAA99"
},
{
"id": "a8ad6dec.1a393",
"type": "subflow",
"name": "MQTT Receive & Plot",
"info": "",
"category": "",
"in": [],
"out": [],
"env": [],
"color": "#F3B567",
"icon": "node-red/bridge.svg"
},
{
"id": "9882c53a.0ccc8",
"type": "subflow",
"name": "Temperature regulation",
"info": "",
"category": "",
"in": [],
"out": [],
"env": [],
"color": "#FFCC66",
"icon": "font-awesome/fa-bolt"
},
{
"id": "fbe9590f.bd63b8",
"type": "subflow",
"name": "System Commands",
"info": "",
"category": "",
"in": [],
"out": [],
"env": [],
"color": "#FFCC66",
"icon": "node-red-dashboard/ui_button.png"
},
{
"id": "b45c6fb6.f6dfa8",
"type": "subflow",
"name": "Object metadata",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 40,
"wires": [
{
"id": "8a61177.8eaa1e8"
},
{
"id": "3893c81e.a9b9e"
},
{
"id": "bd643763.2a7768"
}
]
}
],
"out": [
{
"x": 1060,
"y": 159,
"wires": [
{
"id": "cf0b247b.e3e7c",
"port": 0
},
{
"id": "1675637a.1d762d",
"port": 0
}
]
},
{
"x": 1060,
"y": 59,
"wires": [
{
"id": "d485fec3.802e",
"port": 0
},
{
"id": "5196107b.a5eae8",
"port": 0
}
]
}
],
"env": [],
"color": "#DDAA99"
},
{
"id": "6ca1a253.126bb4",
"type": "subflow",
"name": "Acquisition metadata",
"info": "",
"category": "",
"in": [
{
"x": 50,
"y": 30,
"wires": [
{
"id": "93a3fd29.c55938"
},
{
"id": "9e9e7f8a.b66d4"
},
{
"id": "b1105180.b4b78"
},
{
"id": "ec403304.e34c58"
},
{
"id": "7aac5c46.0669ec"
},
{
"id": "c491cf7.36957b"
},
{
"id": "e0644195.305068"
},
{
"id": "e3fe6242.bfaf18"
},
{
"id": "31d58fcd.ede758"
}
]
}
],
"out": [
{
"x": 740,
"y": 40,
"wires": [
{
"id": "21b35429.fe43a4",
"port": 0
},
{
"id": "f0595ff1.c4d568",
"port": 0
},
{
"id": "c4e69883.a0f3d",
"port": 0
},
{
"id": "12e818fa.b7301f",
"port": 0
},
{
"id": "b577dcd2.8d2c88",
"port": 0
},
{
"id": "f7f5ccc1.29a41",
"port": 0
},
{
"id": "bd733bef.7efd08",
"port": 0
},
{
"id": "a6057924.bc14",
"port": 0
}
]
},
{
"x": 900,
"y": 360,
"wires": [
{
"id": "5a5fcc9a.9ede14",
"port": 0
}
]
}
],
"env": [],
"color": "#DDAA99"
},
{
"id": "626459d2.f9c98",
"type": "subflow",
"name": "Pump actuation",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 40,
"wires": [
{
"id": "f7b6f5e7.7b7ca"
},
{
"id": "50093f5.8e35ec"
}
]
}
],
"out": [
{
"x": 700,
"y": 40,
"wires": [
{
"id": "fa485315.928ae",
"port": 0
},
{
"id": "2f9ec1a6.d5fb66",
"port": 0
}
]
}
],
"env": [],
"color": "#A6BBCF",
"icon": "font-awesome/fa-recycle"
},
{
"id": "5c516299.73e054",
"type": "subflow",
"name": "Focus actuation",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 40,
"wires": [
{
"id": "60dc5851.6962b"
}
]
}
],
"out": [
{
"x": 800,
"y": 200,
"wires": [
{
"id": "7297e2f7.dce564",
"port": 0
}
]
}
],
"env": [],
"color": "#A6BBCF",
"icon": "node-red/sort.svg"
},
{
"id": "efeebffd.34c7e",
"type": "subflow",
"name": "Sample metadata",
"info": "",
"category": "",
"in": [
{
"x": 40,
"y": 40,
"wires": [
{
"id": "78f5791d.946bd8"
},
{
"id": "346d141f.ebab3c"
},
{
"id": "2a09d440.119154"
},
{
"id": "2d438355.ed942c"
},
{
"id": "ac4a71a.c35309"
}
]
}
],
"out": [
{
"x": 840,
"y": 40,
"wires": [
{
"id": "1cb896c7.6dfc11",
"port": 0
},
{
"id": "288ba4b3.a9a2cc",
"port": 0
},
{
"id": "10f1e5c1.3cb69a",
"port": 0
},
{
"id": "aa90b06d.ca78e",
"port": 0
},
{
"id": "da0c5a96.74c0e",
"port": 0
}
]
}
],
"env": [],
"color": "#DDAA99"
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "68d72e45.e7d58",
2020-01-08 14:32:46 +01:00
"type": "ui_base",
"theme": {
"name": "theme-dark",
"lightTheme": {
"default": "#0094CE",
2020-07-14 18:22:31 +02:00
"baseColor": "#5900ce",
2020-01-08 14:32:46 +01:00
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
2020-07-14 18:22:31 +02:00
"edited": true,
2020-01-08 14:32:46 +01:00
"reset": false
},
"darkTheme": {
"default": "#097479",
2020-07-14 18:22:31 +02:00
"baseColor": "#059276",
2020-01-08 14:32:46 +01:00
"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",
2020-07-14 18:22:31 +02:00
"value": "#059276",
"edited": true
2020-01-08 14:32:46 +01:00
},
"page-titlebar-backgroundColor": {
2020-07-14 18:22:31 +02:00
"value": "#059276",
2020-01-08 14:32:46 +01:00
"edited": false
},
"page-backgroundColor": {
"value": "#111111",
"edited": false
},
"page-sidebar-backgroundColor": {
2020-07-14 18:22:31 +02:00
"value": "#ffffff",
2020-01-08 14:32:46 +01:00
"edited": false
},
"group-textColor": {
2020-07-14 18:22:31 +02:00
"value": "#08dcb2",
2020-01-08 14:32:46 +01:00
"edited": false
},
"group-borderColor": {
"value": "#555555",
"edited": false
},
"group-backgroundColor": {
"value": "#333333",
"edited": false
},
"widget-textColor": {
"value": "#eeeeee",
"edited": false
},
"widget-backgroundColor": {
2020-07-14 18:22:31 +02:00
"value": "#059276",
2020-01-08 14:32:46 +01:00
"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",
2020-07-14 18:22:31 +02:00
"lockMenu": "true",
2020-01-08 14:32:46 +01:00
"allowTempTheme": "true",
"dateFormat": "DD/MM/YYYY",
"sizes": {
2020-07-14 18:22:31 +02:00
"sx": 56,
"sy": 56,
"gx": 5,
"gy": 5,
"cx": 5,
"cy": 5,
"px": 5,
"py": 5
2020-01-08 14:32:46 +01:00
}
}
},
{
2020-07-14 18:22:31 +02:00
"id": "44986592.b84004",
"type": "mqtt-broker",
2020-01-08 14:32:46 +01:00
"z": "",
2020-07-14 18:22:31 +02:00
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "test",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "8eac3de.7c8234",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "0.0.0.0",
"port": "1883",
"clientid": "Client_node",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "888cbaa1.5d9318",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "test",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "f98c50f4.4bed48",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "0.0.0.0",
"port": "1883",
"clientid": "Client_node",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "3ee94635.002c9a",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "test",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "b0b1b2bb.385fe",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "0.0.0.0",
"port": "1883",
"clientid": "Client_node",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "659e81f6.f85fb8",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "test",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "52b67b31.c63a04",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "0.0.0.0",
"port": "1883",
"clientid": "Client_node",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "494e9f19.80f8e8",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "test",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "5ad5df6e.1d1e6",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "0.0.0.0",
"port": "1883",
"clientid": "Client_node",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "3ab46cf0.f57dbc",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "test",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "40f247ee.202528",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "0.0.0.0",
"port": "1883",
"clientid": "Client_node",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "84801dc0.193d88",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "test",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "e8ab36cc.74d77",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "0.0.0.0",
"port": "1883",
"clientid": "Client_node",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "55588d59.326124",
"type": "ui_group",
"z": "",
"name": "Acquisition actuation",
"tab": "",
"order": 10,
"disp": true,
"width": 24,
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "d4efe27d.5af0e",
2020-01-08 14:32:46 +01:00
"type": "ui_group",
"z": "",
2020-07-14 18:22:31 +02:00
"name": "Datetime",
"tab": "",
2020-01-08 14:32:46 +01:00
"order": 1,
2020-07-14 18:22:31 +02:00
"disp": true,
"width": "24",
2020-01-08 14:32:46 +01:00
"collapse": false
},
{
2020-07-14 18:22:31 +02:00
"id": "4a3b889c.c4c0a",
2020-01-08 14:32:46 +01:00
"type": "ui_group",
"z": "",
2020-07-14 18:22:31 +02:00
"name": "Valve actuation",
"tab": "",
"order": 9,
"disp": true,
"width": "24",
2020-01-08 14:32:46 +01:00
"collapse": false
},
{
2020-07-14 18:22:31 +02:00
"id": "b2080aa8.7b048",
2020-01-08 14:32:46 +01:00
"type": "ui_group",
"z": "",
2020-07-14 18:22:31 +02:00
"name": "Process metadata",
"tab": "",
"order": 8,
"disp": true,
"width": 24,
"collapse": false
},
{
"id": "b2ce0fd5.641a8",
"type": "ui_group",
"z": "",
"name": "MQTT Plots",
"tab": "",
"order": 11,
"disp": true,
"width": "24",
"collapse": false
},
{
"id": "516113d5.b6b5d4",
"type": "ui_group",
"z": "",
"name": "Commands",
"tab": "",
"order": 12,
"disp": true,
"width": 24,
"collapse": false
},
{
"id": "488da474.92ee5c",
"type": "ui_group",
"z": "",
"name": "Object metadata",
"tab": "",
"order": 6,
"disp": true,
"width": "24",
"collapse": false
},
{
"id": "a302c12b.834e8",
"type": "ui_group",
"z": "",
"name": "Acquisition metadata",
"tab": "",
"order": 7,
"disp": true,
"width": "24",
"collapse": false
},
{
"id": "95792df3.55e6e",
"type": "ui_group",
"z": "",
"name": "Pump actuation",
"tab": "",
"order": 5,
"disp": true,
"width": "24",
2020-01-08 14:32:46 +01:00
"collapse": false
},
{
2020-07-14 18:22:31 +02:00
"id": "8a415d41.11df38",
2020-01-08 14:32:46 +01:00
"type": "ui_group",
"z": "",
2020-07-14 18:22:31 +02:00
"name": "Focus actuation",
"tab": "",
2020-01-08 14:32:46 +01:00
"order": 4,
2020-07-14 18:22:31 +02:00
"disp": true,
"width": "24",
2020-01-08 14:32:46 +01:00
"collapse": false
},
{
2020-07-14 18:22:31 +02:00
"id": "ead03bfe.db2268",
"type": "ui_group",
2020-01-08 14:32:46 +01:00
"z": "",
2020-07-14 18:22:31 +02:00
"name": "Sample metadata",
"tab": "",
2020-01-08 14:32:46 +01:00
"order": 2,
2020-07-14 18:22:31 +02:00
"disp": true,
"width": "24",
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "d4c113ac.dade38",
"type": "ui_group",
2020-01-08 14:32:46 +01:00
"z": "",
2020-07-14 18:22:31 +02:00
"name": "Streaming camera",
"tab": "",
2020-01-08 14:32:46 +01:00
"order": 3,
2020-07-14 18:22:31 +02:00
"disp": true,
"width": 24,
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "cdb72118.692578",
"type": "ui_group",
2020-01-08 14:32:46 +01:00
"z": "",
2020-07-14 18:22:31 +02:00
"name": "Acquisition actuation",
"tab": "2b97fe34.a699fa",
"order": 10,
"disp": true,
"width": 24,
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "9c86b3b7.54841",
"type": "ui_group",
2020-01-08 14:32:46 +01:00
"z": "",
2020-07-14 18:22:31 +02:00
"name": "Datetime",
"tab": "2b97fe34.a699fa",
"order": 1,
"disp": true,
"width": "24",
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "48649115.fcd01",
2020-01-08 14:32:46 +01:00
"type": "ui_group",
2020-07-14 18:22:31 +02:00
"z": "",
"name": "Acquisition inputs",
"tab": "2b97fe34.a699fa",
"order": 9,
2020-01-08 14:32:46 +01:00
"disp": true,
2020-07-14 18:22:31 +02:00
"width": "24",
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "beeb994e.b67688",
2020-01-08 14:32:46 +01:00
"type": "ui_group",
2020-07-14 18:22:31 +02:00
"z": "",
"name": "Process metadata",
"tab": "2b97fe34.a699fa",
"order": 8,
2020-01-08 14:32:46 +01:00
"disp": true,
2020-07-14 18:22:31 +02:00
"width": 24,
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "eb610eb9.84fae8",
2020-01-08 14:32:46 +01:00
"type": "ui_group",
2020-07-14 18:22:31 +02:00
"z": "",
"name": "MQTT Plots",
"tab": "2b97fe34.a699fa",
"order": 11,
2020-01-08 14:32:46 +01:00
"disp": true,
2020-07-14 18:22:31 +02:00
"width": "24",
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "82b3caaa.0518",
2020-01-08 14:32:46 +01:00
"type": "ui_group",
2020-07-14 18:22:31 +02:00
"z": "",
"name": "Commands",
"tab": "2b97fe34.a699fa",
"order": 12,
2020-01-08 14:32:46 +01:00
"disp": true,
2020-07-14 18:22:31 +02:00
"width": 24,
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "f377d75b.32d27",
"type": "ui_group",
"z": "",
"name": "Object metadata",
"tab": "2b97fe34.a699fa",
"order": 6,
"disp": true,
"width": "24",
"collapse": false
},
{
"id": "60b93a5.a032344",
"type": "ui_group",
"z": "",
"name": "Acquisition metadata",
"tab": "2b97fe34.a699fa",
"order": 7,
"disp": true,
"width": "24",
"collapse": false
},
{
"id": "4153382f.45437",
"type": "ui_group",
"z": "",
"name": "Pump actuation",
"tab": "2b97fe34.a699fa",
"order": 5,
"disp": true,
"width": "24",
"collapse": false
},
{
"id": "69433259.f306fc",
"type": "ui_group",
"z": "",
"name": "Focus actuation",
"tab": "2b97fe34.a699fa",
"order": 4,
"disp": true,
"width": "24",
"collapse": false
},
{
"id": "417f91c9.193ab",
"type": "ui_group",
"z": "",
"name": "Sample metadata",
"tab": "2b97fe34.a699fa",
"order": 2,
"disp": true,
"width": "24",
"collapse": false
},
{
"id": "2b97fe34.a699fa",
"type": "ui_tab",
"z": "",
"name": "GUI",
"icon": "fa-eyedropper",
"order": 2,
"disabled": false,
"hidden": false
},
{
"id": "dc721eb.9ef51e",
"type": "ui_group",
"z": "",
"name": "Streaming camera",
"tab": "2b97fe34.a699fa",
"order": 3,
"disp": true,
"width": 24,
"collapse": false
2020-01-08 14:32:46 +01:00
},
{
2020-07-14 18:22:31 +02:00
"id": "853e90d6.4afd1",
2020-01-08 14:32:46 +01:00
"type": "ui_button",
2020-07-14 18:22:31 +02:00
"z": "bba19d97.b32b1",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"group": "cdb72118.692578",
2020-01-08 14:32:46 +01:00
"order": 1,
2020-07-14 18:22:31 +02:00
"width": 0,
"height": 0,
2020-01-08 14:32:46 +01:00
"passthru": false,
2020-07-14 18:22:31 +02:00
"label": "Start Acquisition",
2020-01-08 14:32:46 +01:00
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
2020-07-14 18:22:31 +02:00
"topic": "actuator/image",
"x": 200,
"y": 100,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"6e46e66c.654ff8"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "6e46e66c.654ff8",
"type": "function",
"z": "bba19d97.b32b1",
"name": "image.js",
"func": "state = global.get(\"state\");\nglobal.set('img_counter',0)\nglobal.set('obj_counter',0)\nif (state == null){state=\"free\"}\n\nvar sleep_before= global.get(\"custom_sleep_before\");\nvar nb_step= global.get(\"custom_nb_step\");\nvar nb_frame= global.get(\"custom_nb_frame\");\nvar segmentation= global.get(\"custom_segmentation\");\n\nif (sleep_before === undefined || sleep_before === \"\" || sleep_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before the acquisition\";\n \n}else if (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of step in between two frames\";\n \n}else if (nb_frame === undefined || nb_frame === \"\" || nb_frame === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of image to save\";\n \n}else if (segmentation === undefined || segmentation === \"\" || segmentation === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Realize or not the segmentation\";\n \n}else {\n nb_frame=nb_frame-1\n \n msg.payload=sleep_before+' '+nb_step+' '+nb_frame+' '+segmentation;\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 360,
"y": 100,
"wires": [
[
"5a37b9e6.6e3e58"
]
],
"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": "5a37b9e6.6e3e58",
"type": "switch",
"z": "bba19d97.b32b1",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "actuator/image",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 510,
"y": 100,
"wires": [
[
"75233be8.98e6f4"
],
[
"bee35f80.112d"
]
]
},
{
"id": "bee35f80.112d",
"type": "ui_toast",
"z": "bba19d97.b32b1",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 690,
"y": 120,
"wires": [
[]
]
},
{
"id": "75233be8.98e6f4",
"type": "mqtt out",
"z": "bba19d97.b32b1",
"name": "",
"topic": "",
"qos": "",
"retain": "",
"broker": "e8ab36cc.74d77",
"x": 670,
"y": 80,
"wires": []
},
{
"id": "75d00421.d31e1c",
2020-01-08 14:32:46 +01:00
"type": "ui_button",
2020-07-14 18:22:31 +02:00
"z": "bba19d97.b32b1",
"name": "Stop Acquisition",
"group": "cdb72118.692578",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"label": "STOP ACQUISITION",
"tooltip": "",
"color": "",
"bgcolor": "#AD1625",
"icon": "",
"payload": "off",
"payloadType": "str",
"topic": "actuator/wait",
"x": 200,
"y": 140,
"wires": [
[
"f2ce7a07.d3eff8"
]
]
},
{
"id": "f2ce7a07.d3eff8",
"type": "mqtt out",
"z": "bba19d97.b32b1",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"topic": "",
"qos": "",
"retain": "",
"broker": "e8ab36cc.74d77",
"x": 350,
"y": 140,
"wires": []
},
{
"id": "977270e2.b70738",
"type": "mqtt out",
"z": "bba19d97.b32b1",
"name": "",
"topic": "",
"qos": "",
"retain": "",
"broker": "e8ab36cc.74d77",
"x": 350,
"y": 180,
"wires": []
},
{
"id": "23f3e613.20ad82",
"type": "exec",
"z": "c1d3ff7c.4384f",
"command": "python3.7 /home/pi/PlanktonScope/script/main.py",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 910,
"y": 140,
"wires": [
[
"87b835dc.107c6",
"2de12b49.050f44"
],
[
"87b835dc.107c6",
"2de12b49.050f44"
],
[
"87b835dc.107c6",
"2de12b49.050f44"
]
]
},
{
"id": "1ef92011.66439",
"type": "exec",
"z": "c1d3ff7c.4384f",
"command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 610,
"y": 200,
"wires": [
[
"c1fd2bf6.fa7198"
],
[],
[]
]
},
{
"id": "c1fd2bf6.fa7198",
"type": "exec",
"z": "c1d3ff7c.4384f",
"command": "kill",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 1050,
"y": 200,
"wires": [
[
"87b835dc.107c6",
"2de12b49.050f44"
],
[
"87b835dc.107c6",
"2de12b49.050f44"
],
[
"87b835dc.107c6",
"2de12b49.050f44"
]
]
},
{
"id": "9a6e378b.5ea938",
"type": "ui_button",
"z": "c1d3ff7c.4384f",
"name": "",
"group": "9c86b3b7.54841",
"order": 9,
2020-01-08 14:32:46 +01:00
"width": 12,
2020-07-14 18:22:31 +02:00
"height": 1,
2020-01-08 14:32:46 +01:00
"passthru": false,
2020-07-14 18:22:31 +02:00
"label": "Kill MQTT",
2020-01-08 14:32:46 +01:00
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
2020-07-14 18:22:31 +02:00
"topic": "",
"x": 80,
"y": 200,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"1ef92011.66439"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "e74e7b3d.2ba678",
2020-01-08 14:32:46 +01:00
"type": "ui_button",
2020-07-14 18:22:31 +02:00
"z": "c1d3ff7c.4384f",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"group": "9c86b3b7.54841",
"order": 10,
2020-01-08 14:32:46 +01:00
"width": 12,
2020-07-14 18:22:31 +02:00
"height": 1,
2020-01-08 14:32:46 +01:00
"passthru": false,
2020-07-14 18:22:31 +02:00
"label": "Restart MQTT",
2020-01-08 14:32:46 +01:00
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
2020-07-14 18:22:31 +02:00
"topic": "",
"x": 100,
"y": 140,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"23f3e613.20ad82"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "87b835dc.107c6",
"type": "ui_toast",
"z": "c1d3ff7c.4384f",
"position": "top right",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 0,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"x": 1260,
"y": 140,
"wires": []
},
{
"id": "b60669a0.b480d8",
"type": "exec",
"z": "c10e968b.87e488",
"command": "sudo date -s",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 1010,
"y": 240,
2020-01-08 14:32:46 +01:00
"wires": [
2020-07-14 18:22:31 +02:00
[],
[],
2020-01-08 14:32:46 +01:00
[]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "68aace8d.6bf5",
"type": "function",
"z": "c10e968b.87e488",
"name": "",
"func": "d = new Date();\n//get weekday\nvar weekday = new Array(7);\nweekday[0] = \"Sun\";\nweekday[1] = \"Mon\";\nweekday[2] = \"Tue\";\nweekday[3] = \"Wed\";\nweekday[4] = \"Thu\";\nweekday[5] = \"Fri\";\nweekday[6] = \"Sat\";\nvar w = weekday[d.getUTCDay()];\n//get Month\nvar month = new Array(12);\nmonth[0] = \"Jan\";\nmonth[1] = \"Feb\";\nmonth[2] = \"Mar\";\nmonth[3] = \"Apr\";\nmonth[4] = \"May\";\nmonth[5] = \"Jun\";\nmonth[6] = \"Jul\";\nmonth[7] = \"Aug\";\nmonth[8] = \"Sep\";\nmonth[9] = \"Oct\";\nmonth[10] = \"Nov\";\nmonth[11] = \"Dec\";\nvar n = month[d.getUTCMonth()];\n \n//get day\nvar day = d.getUTCDay()\n\n//get Hours\nvar Hours = d.getUTCHours();\n//get Minutes\nvar Minutes = d.getUTCMinutes();\n//get Seconds\nvar Seconds = d.getUTCSeconds();\n//get FullYear\nvar FullYear = d.getUTCFullYear();\n\n//Thu Aug 09 2012 23:34:04 GMT+0200 (GMT+02:00)\n\n//Thu Aug 9 21:31:26 UTC 2012\n\n//msg.payload = \"Thu Aug 9 21:31:26 UTC 2012\"\n\nmsg.payload = '\"'+w+\" \"+n+\" \"+day+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+\" UTC \"+FullYear+'\"';\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 490,
"y": 40,
"wires": [
[
"a1db5dbb.32c998"
]
]
},
{
"id": "a1db5dbb.32c998",
"type": "ui_template",
"z": "c10e968b.87e488",
"group": "9c86b3b7.54841",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"order": 1,
2020-01-08 14:32:46 +01:00
"width": 0,
"height": 0,
2020-07-14 18:22:31 +02:00
"format": "<div ng-bind-html=\"msg.payload\"></div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 640,
"y": 40,
"wires": [
[]
]
},
{
"id": "b3b03af9.8edae8",
"type": "ui_numeric",
"z": "c10e968b.87e488",
"name": "tmp_year",
"label": "Year",
"tooltip": "",
"group": "9c86b3b7.54841",
"order": 2,
"width": 5,
"height": 1,
"wrap": false,
"passthru": true,
"topic": "tmp_year",
"format": "{{value}}",
"min": "2020",
"max": "2030",
"step": 1,
"x": 640,
"y": 80,
"wires": [
[
"8de4b398.3c755"
]
]
},
{
"id": "ed1f72c4.e136e",
"type": "ui_numeric",
"z": "c10e968b.87e488",
"name": "tmp_month",
"label": "Month",
"tooltip": "",
"group": "9c86b3b7.54841",
"order": 3,
"width": 3,
"height": 1,
"wrap": false,
"passthru": true,
"topic": "tmp_month",
"format": "{{value}}",
"min": "1",
"max": "12",
"step": 1,
"x": 650,
"y": 120,
"wires": [
[
"8de4b398.3c755"
]
]
},
{
"id": "be55a4d1.4d5fa8",
"type": "ui_numeric",
"z": "c10e968b.87e488",
"name": "tmp_day",
"label": "Day",
"tooltip": "",
"group": "9c86b3b7.54841",
"order": 4,
"width": 3,
"height": 1,
"wrap": false,
"passthru": true,
"topic": "tmp_day",
"format": "{{value}}",
"min": "1",
"max": "31",
"step": 1,
"x": 640,
"y": 160,
"wires": [
[
"8de4b398.3c755"
]
]
},
{
"id": "ee1e92f8.a01bb8",
"type": "ui_numeric",
"z": "c10e968b.87e488",
"name": "tmp_hour",
"label": "Hour",
"tooltip": "",
"group": "9c86b3b7.54841",
"order": 5,
"width": 3,
"height": 1,
"wrap": false,
"passthru": true,
"topic": "tmp_hour",
"format": "{{value}}",
"min": "0",
"max": "23",
"step": 1,
"x": 640,
"y": 200,
"wires": [
[
"8de4b398.3c755"
]
]
},
{
"id": "c532a0cd.b0a47",
"type": "ui_numeric",
"z": "c10e968b.87e488",
"name": "tmp_minute",
"label": "Minute",
"tooltip": "",
"group": "9c86b3b7.54841",
"order": 6,
"width": 3,
"height": 1,
"wrap": false,
"passthru": true,
"topic": "tmp_minute",
"format": "{{value}}",
"min": "0",
"max": "59",
"step": 1,
"x": 650,
"y": 240,
"wires": [
[
"8de4b398.3c755"
]
]
},
{
"id": "5b200123.04ec98",
"type": "ui_numeric",
"z": "c10e968b.87e488",
"name": "tmp_second",
"label": "Second",
"tooltip": "",
"group": "9c86b3b7.54841",
"order": 7,
"width": 3,
"height": 1,
"wrap": false,
"passthru": true,
"topic": "tmp_second",
"format": "{{value}}",
"min": "0",
"max": "59",
"step": 1,
"x": 650,
"y": 280,
"wires": [
[
"8de4b398.3c755"
]
]
},
{
"id": "d8f0f8d1.0550d",
"type": "interval",
"z": "c10e968b.87e488",
"name": "interval",
"interval": "1",
"onstart": false,
"msg": "ping",
"showstatus": true,
"unit": "seconds",
"statusformat": "YYYY-MM-D HH:mm:ss",
"x": 310,
"y": 40,
"wires": [
[
"68aace8d.6bf5"
]
]
},
{
"id": "eb163e1c.a7b97",
"type": "ui_button",
"z": "c10e968b.87e488",
"name": "",
"group": "9c86b3b7.54841",
"order": 8,
"width": 4,
"height": 1,
2020-01-08 14:32:46 +01:00
"passthru": false,
2020-07-14 18:22:31 +02:00
"label": "Update",
2020-01-08 14:32:46 +01:00
"tooltip": "",
2020-07-14 18:22:31 +02:00
"color": "black",
"bgcolor": "white",
2020-01-08 14:32:46 +01:00
"icon": "",
"payload": "",
"payloadType": "str",
2020-07-14 18:22:31 +02:00
"topic": "",
"x": 640,
"y": 320,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"aa948c91.3895a"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "aa948c91.3895a",
2020-01-08 14:32:46 +01:00
"type": "function",
2020-07-14 18:22:31 +02:00
"z": "c10e968b.87e488",
"name": "update datetime",
"func": "var FullYear= global.get(\"year\");\nvar Month= global.get(\"month\");\nvar day= global.get(\"day\");\nvar Hours= global.get(\"hour\");\nvar Minutes= global.get(\"minute\");\nvar Seconds= global.get(\"second\");\n\nmsg.payload = new Date();\n//get Month\nvar month = new Array(12);\nmonth[1] = \"Jan\";\nmonth[2] = \"Feb\";\nmonth[3] = \"Mar\";\nmonth[4] = \"Apr\";\nmonth[5] = \"May\";\nmonth[6] = \"Jun\";\nmonth[7] = \"Jul\";\nmonth[8] = \"Aug\";\nmonth[9] = \"Sep\";\nmonth[10] = \"Oct\";\nmonth[11] = \"Nov\";\nmonth[12] = \"Dec\";\nvar n = month[Month];\n \nmsg.payload = '\"'+day+\" \"+n+\" \"+FullYear+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+'\"';\n\n\nreturn msg;",
2020-01-08 14:32:46 +01:00
"outputs": 1,
"noerr": 0,
2020-07-14 18:22:31 +02:00
"x": 800,
"y": 320,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"3b7403cb.d33394",
"b60669a0.b480d8"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "8de4b398.3c755",
"type": "function",
"z": "c10e968b.87e488",
"name": "set global",
"func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 840,
"y": 60,
2020-01-08 14:32:46 +01:00
"wires": [
[]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "3b7403cb.d33394",
"type": "debug",
"z": "c10e968b.87e488",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 1010,
"y": 300,
"wires": []
},
{
"id": "315c5aa3.fdf5d6",
2020-01-08 14:32:46 +01:00
"type": "function",
2020-07-14 18:22:31 +02:00
"z": "c10e968b.87e488",
"name": "",
"func": "d = msg.payload;\n\nvar val = d.getUTCFullYear();\n\nmsg.payload = val;\nreturn msg;",
2020-01-08 14:32:46 +01:00
"outputs": 1,
"noerr": 0,
2020-07-14 18:22:31 +02:00
"x": 490,
"y": 80,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"b3b03af9.8edae8"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "93b9f3cd.759688",
"type": "function",
"z": "c10e968b.87e488",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"func": "d = new Date();\nmsg.payload = d\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 310,
"y": 80,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"315c5aa3.fdf5d6",
"922cecc2.dc7f68",
"c2aa11f2.0fdee8",
"915b7162.7a73e",
"b57fe145.320d28",
"d3f45b98.f05a58"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "922cecc2.dc7f68",
"type": "function",
"z": "c10e968b.87e488",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"func": "d = msg.payload;\n\nvar val = d.getUTCMonth();\n\nmsg.payload = val+1;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 490,
"y": 120,
2020-01-08 14:32:46 +01:00
"wires": [
2020-07-14 18:22:31 +02:00
[
"ed1f72c4.e136e"
]
2020-01-08 14:32:46 +01:00
]
},
{
2020-07-14 18:22:31 +02:00
"id": "c2aa11f2.0fdee8",
2020-01-08 14:32:46 +01:00
"type": "function",
2020-07-14 18:22:31 +02:00
"z": "c10e968b.87e488",
"name": "",
"func": "d = msg.payload;\n\nvar val = d.getUTCDay();\n\nmsg.payload = val;\nreturn msg;",
2020-01-08 14:32:46 +01:00
"outputs": 1,
"noerr": 0,
2020-07-14 18:22:31 +02:00
"x": 490,
"y": 160,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"be55a4d1.4d5fa8"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "915b7162.7a73e",
"type": "function",
"z": "c10e968b.87e488",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"func": "d = msg.payload;\n\nvar val = d.getUTCHours();\n\nmsg.payload = val;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 490,
"y": 200,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"ee1e92f8.a01bb8"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "b57fe145.320d28",
"type": "function",
"z": "c10e968b.87e488",
2020-01-08 14:32:46 +01:00
"name": "",
2020-07-14 18:22:31 +02:00
"func": "d = msg.payload;\n\nvar val = d.getUTCMinutes();\n\nmsg.payload = val;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 490,
"y": 240,
2020-01-08 14:32:46 +01:00
"wires": [
2020-07-14 18:22:31 +02:00
[
"c532a0cd.b0a47"
]
2020-01-08 14:32:46 +01:00
]
},
{
2020-07-14 18:22:31 +02:00
"id": "d3f45b98.f05a58",
2020-01-08 14:32:46 +01:00
"type": "function",
2020-07-14 18:22:31 +02:00
"z": "c10e968b.87e488",
"name": "",
"func": "d = msg.payload;\n\nvar val = d.getUTCSeconds();\n\nmsg.payload = val;\nreturn msg;",
2020-01-08 14:32:46 +01:00
"outputs": 1,
"noerr": 0,
2020-07-14 18:22:31 +02:00
"x": 490,
"y": 280,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"5b200123.04ec98"
2020-01-08 14:32:46 +01:00
]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "c4527705.33a84",
"type": "ui_text_input",
"z": "863e8384.56889",
"name": "custom_nb_step",
"label": "Number of steps in between two images",
"tooltip": "",
"group": "48649115.fcd01",
"order": 2,
2020-01-08 14:32:46 +01:00
"width": 0,
"height": 0,
2020-07-14 18:22:31 +02:00
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "custom_nb_step",
"x": 540,
"y": 80,
2020-01-08 14:32:46 +01:00
"wires": [
2020-07-14 18:22:31 +02:00
[]
2020-01-08 14:32:46 +01:00
]
},
{
2020-07-14 18:22:31 +02:00
"id": "582e21b2.ad67a8",
"type": "ui_text_input",
"z": "863e8384.56889",
"name": "custom_nb_frame",
"label": "Number of images per acquisition",
"tooltip": "",
"group": "48649115.fcd01",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "custom_nb_frame",
"x": 530,
"y": 120,
2020-01-08 14:32:46 +01:00
"wires": [
[]
]
},
{
2020-07-14 18:22:31 +02:00
"id": "3eaf4c98.d94b54",
2020-01-08 14:32:46 +01:00
"type": "function",
2020-07-14 18:22:31 +02:00
"z": "863e8384.56889",
"name": "get custom_nb_step",
"func": "msg.payload = msg.payload.custom_nb_step;\nreturn msg;",
2020-01-08 14:32:46 +01:00
"outputs": 1,
"noerr": 0,
"x": 220,
2020-07-14 18:22:31 +02:00
"y": 80,
"wires": [
[
"c4527705.33a84"
]
]
},
{
"id": "8eeb9e9e.a50d7",
"type": "function",
"z": "863e8384.56889",
"name": "get custom_nb_frame",
"func": "msg.payload = msg.payload.custom_nb_frame;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 220,
"y": 120,
2020-01-08 14:32:46 +01:00
"wires": [
[
2020-07-14 18:22:31 +02:00
"582e21b2.ad67a8"
2020-01-08 14:32:46 +01:00
]
]
2020-07-14 18:22:31 +02:00
},
{
"id": "e4e16eb9.5296c",
"type": "function",
"z": "863e8384.56889",
"name": "get custom_segmentation",
"func": "msg.payload = msg.payload.custom_segmentation;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 230,
"y": 160,
"wires": [
[
"f9705bc.3d322a8"
]
]
},
{
"id": "e50aa637.59ac68",
"type": "function",
"z": "863e8384.56889",
"name": "get custom_sleep_before",
"func": "msg.payload = msg.payload.custom_sleep_before;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 230,
"y": 40,
"wires": [
[
"f648e44.94e3998"
]
]
},
{
"id": "f648e44.94e3998",
"type": "ui_text_input",
"z": "863e8384.56889",
"name": "custom_sleep_before",
"label": "Duration before the acquisition (s)",
"tooltip": "",
"group": "48649115.fcd01",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "custom_sleep_before",
"x": 520,
"y": 40,
"wires": [
[]
]
},
{
"id": "11b31baf.95996c",
"type": "ui_text_input",
"z": "5a287804.a10e2",
"name": "process_id",
"label": "Id of the process",
"tooltip": "",
"group": "beeb994e.b67688",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "process_id",
"x": 550,
"y": 80,
"wires": [
[]
]
},
{
"id": "dfb4b682.601e1",
"type": "function",
"z": "5a287804.a10e2",
"name": "get process_id",
"func": "msg.payload = msg.payload.process_id+1;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 200,
"y": 80,
"wires": [
[
"11b31baf.95996c"
]
]
},
{
"id": "3777e513.35c3fa",
"type": "mqtt in",
"z": "a8ad6dec.1a393",
"name": "",
"topic": "receiver/#",
"qos": "0",
"datatype": "auto",
"broker": "84801dc0.193d88",
"x": 80,
"y": 40,
"wires": [
[
"9886f960.4b6268",
"589fbae2.8ff914"
]
]
},
{
"id": "9886f960.4b6268",
"type": "switch",
"z": "a8ad6dec.1a393",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "receiver/pump",
"vt": "str"
},
{
"t": "eq",
"v": "receiver/focus",
"vt": "str"
},
{
"t": "eq",
"v": "receiver/image",
"vt": "str"
},
{
"t": "cont",
"v": "receiver/segmentation",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 230,
"y": 40,
"wires": [
[
"c90e948f.2f7348"
],
[
"1d54f7b3.db7ac8"
],
[
"d02a7968.b8874"
],
[
"11e60fef.079d38"
]
]
},
{
"id": "c90e948f.2f7348",
"type": "switch",
"z": "a8ad6dec.1a393",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Start",
"vt": "str"
},
{
"t": "eq",
"v": "Done",
"vt": "str"
},
{
"t": "eq",
"v": "Interrompted",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 470,
"y": 40,
"wires": [
[
"e16b8120.403e8"
],
[
"4ea155a3.d8531c"
],
[
"3d35b841.e6596"
]
]
},
{
"id": "e16b8120.403e8",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The pump has started",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The pump has started",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 920,
"y": 40,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "4ea155a3.d8531c",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The pump has finished.",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The pump has finished.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 910,
"y": 80,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "3d35b841.e6596",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The pump has been stopped.",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The pump has been stopped.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 900,
"y": 120,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "1d54f7b3.db7ac8",
"type": "switch",
"z": "a8ad6dec.1a393",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Start",
"vt": "str"
},
{
"t": "eq",
"v": "Done",
"vt": "str"
},
{
"t": "eq",
"v": "Interrompted",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 470,
"y": 200,
"wires": [
[
"7ce7cf66.df449"
],
[
"8846b607.310e9"
],
[
"5a8f4613.c9989"
]
]
},
{
"id": "7ce7cf66.df449",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The focus has started",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The focus has started",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 920,
"y": 200,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "8846b607.310e9",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The focus has finished.",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The focus has finished.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 910,
"y": 240,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "5a8f4613.c9989",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The focus has been stopped.",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The focus has been stopped.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 900,
"y": 280,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "d02a7968.b8874",
"type": "switch",
"z": "a8ad6dec.1a393",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Start",
"vt": "str"
},
{
"t": "eq",
"v": "Done",
"vt": "str"
},
{
"t": "eq",
"v": "Interrompted",
"vt": "str"
},
{
"t": "cont",
"v": "jpg",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 470,
"y": 360,
"wires": [
[
"d7f9086b.728df8"
],
[
"c104db3.a287628"
],
[
"e99cb81d.b79df"
],
[
"3de45d76.06ab6a",
"1597b08f.5bce8f"
]
]
},
{
"id": "90e10524.6709f",
"type": "switch",
"z": "a8ad6dec.1a393",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Start",
"vt": "str"
},
{
"t": "eq",
"v": "Done",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 650,
"y": 560,
"wires": [
[
"6c8a5e5c.bf0f5"
],
[
"90433a26.6fc278"
]
]
},
{
"id": "c104db3.a287628",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The acquisition has finished.",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The acquisition has finished.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 900,
"y": 400,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "e99cb81d.b79df",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The acquisition has been stopped.",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The acquisition has been stopped.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 880,
"y": 440,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "d7f9086b.728df8",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The acquisition has started",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The acquisition has started",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 900,
"y": 360,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "3de45d76.06ab6a",
"type": "function",
"z": "a8ad6dec.1a393",
"name": "img_counter.js",
"func": "img_counter=global.get('img_counter')\nimg_counter=img_counter+1\nglobal.set('img_counter',img_counter)\nmsg.payload = img_counter\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 780,
"y": 480,
"wires": [
[
"2f2c466d.88c6ba"
]
]
},
{
"id": "aebfa8a2.b4a928",
"type": "function",
"z": "a8ad6dec.1a393",
"name": "obj_counter.js",
"func": "obj_counter=global.get('obj_counter')\nobj_counter=obj_counter+1\nglobal.set('obj_counter',obj_counter)\nmsg.payload = obj_counter\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 780,
"y": 640,
"wires": [
[
"add1bf6d.b7a668"
]
]
},
{
"id": "2f2c466d.88c6ba",
"type": "ui_chart",
"z": "a8ad6dec.1a393",
"name": "img_counter",
"group": "eb610eb9.84fae8",
"order": 2,
"width": 23,
"height": 2,
"label": "img_counter",
"chartType": "horizontalBar",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 950,
"y": 480,
"wires": [
[]
]
},
{
"id": "11e60fef.079d38",
"type": "switch",
"z": "a8ad6dec.1a393",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "receiver/segmentation",
"vt": "str"
},
{
"t": "eq",
"v": "receiver/segmentation/object_id",
"vt": "str"
},
{
"t": "eq",
"v": "receiver/segmentation/metric",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 470,
"y": 560,
"wires": [
[
"90e10524.6709f"
],
[
"aebfa8a2.b4a928"
],
[
"7dd159b.6c105a8"
]
]
},
{
"id": "90433a26.6fc278",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The segmentation has finished.",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The segmentation has finished.",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 890,
"y": 600,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "6c8a5e5c.bf0f5",
"type": "change",
"z": "a8ad6dec.1a393",
"name": "The segmentation has started",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "The segmentation has started",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 890,
"y": 560,
"wires": [
[
"1597b08f.5bce8f"
]
]
},
{
"id": "add1bf6d.b7a668",
"type": "ui_chart",
"z": "a8ad6dec.1a393",
"name": "obj_counter",
"group": "eb610eb9.84fae8",
"order": 5,
"width": 23,
"height": 2,
"label": "obj_counter",
"chartType": "horizontalBar",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": true,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 950,
"y": 640,
"wires": [
[]
]
},
{
"id": "6f3399be.761c68",
"type": "function",
"z": "a8ad6dec.1a393",
"name": "",
"func": "msg.payload=msg.payload.object_area\nmsg.topic=\"area\"\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 810,
"y": 700,
"wires": [
[
"e50c9bb6.397a08"
]
]
},
{
"id": "7dd159b.6c105a8",
"type": "json",
"z": "a8ad6dec.1a393",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 650,
"y": 700,
"wires": [
[
"6f3399be.761c68"
]
]
},
{
"id": "b56d820b.9f7b",
"type": "exec",
"z": "a8ad6dec.1a393",
"command": "free -m | grep \"Mem\" | awk -F ' ' '{print $3}'",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "Get memory used",
"x": 750,
"y": 780,
"wires": [
[
"bb46922a.0aa378"
],
[],
[]
]
},
{
"id": "7c27a4b2.6fe8e4",
"type": "inject",
"z": "a8ad6dec.1a393",
"name": "",
"topic": "",
"payload": "",
"payloadType": "num",
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 570,
"y": 780,
"wires": [
[
"b56d820b.9f7b"
]
]
},
{
"id": "bb46922a.0aa378",
"type": "ui_chart",
"z": "a8ad6dec.1a393",
"name": "",
"group": "eb610eb9.84fae8",
"order": 1,
"width": 0,
"height": 0,
"label": "Memory load",
"chartType": "line",
"legend": "false",
"xformat": "auto",
"interpolate": "linear",
"nodata": "",
"dot": true,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "200",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 950,
"y": 760,
"wires": [
[]
]
},
{
"id": "e50c9bb6.397a08",
"type": "ui_chart",
"z": "a8ad6dec.1a393",
"name": "",
"group": "eb610eb9.84fae8",
"order": 8,
"width": 0,
"height": 0,
"label": "chart",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": true,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "1000",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"outputs": 1,
"x": 970,
"y": 700,
"wires": [
[]
]
},
{
"id": "1597b08f.5bce8f",
"type": "ui_toast",
"z": "a8ad6dec.1a393",
"position": "top right",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 0,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 1220,
"y": 360,
"wires": []
},
{
"id": "85ced3a9.8bc898",
"type": "exec",
"z": "9882c53a.0ccc8",
"command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "RPi Temp.",
"x": 350,
"y": 80,
"wires": [
[
"8715b9fb.194438"
],
[],
[]
]
},
{
"id": "3bb0ef9d.258af8",
"type": "inject",
"z": "9882c53a.0ccc8",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "10",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 190,
"y": 80,
"wires": [
[
"85ced3a9.8bc898"
]
]
},
{
"id": "8715b9fb.194438",
"type": "python3-function",
"z": "9882c53a.0ccc8",
"name": "fan.py",
"func": "#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)",
"outputs": 1,
"x": 530,
"y": 80,
"wires": [
[]
]
},
{
"id": "7bdf69d9.8f98e",
"type": "ui_button",
"z": "fbe9590f.bd63b8",
"name": "",
"group": "82b3caaa.0518",
"order": 1,
"width": 0,
"height": 0,
"passthru": false,
"label": "Reboot",
"tooltip": "",
"color": "",
"bgcolor": "#AD1625",
"icon": "",
"payload": "off",
"payloadType": "str",
"topic": "reboot",
"x": 220,
"y": 80,
"wires": [
[
"c55ff479.c166a8"
]
]
},
{
"id": "f400fb5a.9bc108",
"type": "exec",
"z": "fbe9590f.bd63b8",
"command": "sudo",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "2",
"oldrc": false,
"name": "cmd",
"x": 530,
"y": 80,
"wires": [
[],
[],
[]
]
},
{
"id": "867e9bed.e2a298",
"type": "ui_button",
"z": "fbe9590f.bd63b8",
"name": "",
"group": "82b3caaa.0518",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Shutdown",
"tooltip": "",
"color": "",
"bgcolor": "#AD1625",
"icon": "",
"payload": "off",
"payloadType": "str",
"topic": "shutdown",
"x": 220,
"y": 140,
"wires": [
[
"c55ff479.c166a8"
]
]
},
{
"id": "c55ff479.c166a8",
"type": "python3-function",
"z": "fbe9590f.bd63b8",
"name": "action",
"func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg",
"outputs": 1,
"x": 390,
"y": 100,
"wires": [
[
"46f85d17.08fa54",
"f400fb5a.9bc108"
]
]
},
{
"id": "46f85d17.08fa54",
"type": "exec",
"z": "fbe9590f.bd63b8",
"command": "i2cdetect -y 1",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "1",
"oldrc": false,
"name": "i2c update",
"x": 550,
"y": 140,
"wires": [
[],
[],
[]
]
},
{
"id": "cf0b247b.e3e7c",
"type": "ui_numeric",
"z": "b45c6fb6.f6dfa8",
"name": "object_depth_min",
"label": "Minimum depth (m)",
"tooltip": "",
"group": "f377d75b.32d27",
"order": 3,
"width": 0,
"height": 0,
"wrap": false,
"passthru": true,
"topic": "object_depth_min",
"format": "{{value}}",
"min": "0",
"max": "2000",
"step": "1",
"x": 610,
"y": 120,
"wires": [
[]
]
},
{
"id": "1675637a.1d762d",
"type": "ui_numeric",
"z": "b45c6fb6.f6dfa8",
"name": "object_depth_max",
"label": "Maximum depth (m)",
"tooltip": "",
"group": "f377d75b.32d27",
"order": 2,
"width": 0,
"height": 0,
"wrap": false,
"passthru": true,
"topic": "object_depth_max",
"format": "{{value}}",
"min": "0",
"max": "2000",
"step": "1",
"x": 610,
"y": 160,
"wires": [
[]
]
},
{
"id": "8a61177.8eaa1e8",
"type": "function",
"z": "b45c6fb6.f6dfa8",
"name": "get object_depth_min",
"func": "msg.payload = msg.payload.object_depth_min;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 304,
"y": 120,
"wires": [
[
"cf0b247b.e3e7c"
]
]
},
{
"id": "3893c81e.a9b9e",
"type": "function",
"z": "b45c6fb6.f6dfa8",
"name": "get object_depth_max",
"func": "msg.payload = msg.payload.object_depth_max;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 304,
"y": 160,
"wires": [
[
"1675637a.1d762d"
]
]
},
{
"id": "f478b054.024158",
"type": "gpsd",
"z": "b45c6fb6.f6dfa8",
"name": "",
"hostname": "localhost",
"port": "2947",
"tpv": true,
"sky": false,
"info": false,
"device": false,
"gst": false,
"att": false,
"x": 90,
"y": 220,
"wires": [
[
"bd643763.2a7768",
"edee5fda.673ae"
]
]
},
{
"id": "ca169437.bb25e8",
"type": "ui_worldmap",
"z": "b45c6fb6.f6dfa8",
"d": true,
"group": "f377d75b.32d27",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"lat": "1.5",
"lon": "1.5",
"zoom": "4",
"layer": "OSM grey",
"cluster": "1",
"maxage": "",
"usermenu": "hide",
"layers": "hide",
"panit": "false",
"panlock": "false",
"zoomlock": "false",
"hiderightclick": "true",
"coords": "deg",
"showgrid": "false",
"path": "/worldmap",
"x": 640,
"y": 200,
"wires": []
},
{
"id": "bd643763.2a7768",
"type": "function",
"z": "b45c6fb6.f6dfa8",
"name": "get object_lat & object_lon",
"func": "\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 320,
"y": 200,
"wires": [
[
"ca169437.bb25e8"
]
]
},
{
"id": "d485fec3.802e",
"type": "function",
"z": "b45c6fb6.f6dfa8",
"name": "set object_time",
"func": "var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute;\nglobal.set('object_time',time_UTC);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 804,
"y": 80,
"wires": [
[]
]
},
{
"id": "5196107b.a5eae8",
"type": "function",
"z": "b45c6fb6.f6dfa8",
"name": "set object_date",
"func": "var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 804,
"y": 40,
"wires": [
[]
]
},
{
"id": "edee5fda.673ae",
"type": "debug",
"z": "b45c6fb6.f6dfa8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 280,
"y": 360,
"wires": []
},
{
"id": "5a5fcc9a.9ede14",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "set optical config",
"func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"acq_magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"acq_magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"acq_magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"acq_magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"acq_magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 750,
"y": 360,
"wires": [
[]
]
},
{
"id": "3d3aafbf.e907a8",
"type": "ui_dropdown",
"z": "6ca1a253.126bb4",
"name": "acq_fnumber_objective",
"label": "M12 Lens*",
"tooltip": "",
"place": "Select option",
"group": "60b93a5.a032344",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"options": [
{
"label": "f 25mm 1/2\" 5MP IR",
"value": 25,
"type": "num"
},
{
"label": "f 16mm 1/2.5\" 5MP IR",
"value": 16,
"type": "num"
},
{
"label": "f 12mm 1/2.5\" 5MP IR",
"value": 12,
"type": "num"
},
{
"label": "f 8mm 1/2.5\" 5MP IR",
"value": 8,
"type": "num"
},
{
"label": "f 6mm 1/2.5\" 5MP IR",
"value": 6,
"type": "num"
}
],
"payload": "",
"topic": "acq_fnumber_objective",
"x": 526,
"y": 360,
"wires": [
[
"5a5fcc9a.9ede14"
]
]
},
{
"id": "12e818fa.b7301f",
"type": "ui_numeric",
"z": "6ca1a253.126bb4",
"name": "acq_minimum_mesh",
"label": "Min fraction size (μm)",
"tooltip": "",
"group": "60b93a5.a032344",
"order": 8,
"width": 0,
"height": 0,
"wrap": false,
"passthru": true,
"topic": "acq_minimum_mesh",
"format": "{{value}}",
"min": 0,
"max": "300",
"step": "10",
"x": 536,
"y": 160,
"wires": [
[]
]
},
{
"id": "b577dcd2.8d2c88",
"type": "ui_numeric",
"z": "6ca1a253.126bb4",
"name": "acq_maximum_mesh",
"label": "Max fraction size (μm)",
"tooltip": "",
"group": "60b93a5.a032344",
"order": 4,
"width": 0,
"height": 0,
"wrap": false,
"passthru": true,
"topic": "acq_maximum_mesh",
"format": "{{value}}",
"min": "200",
"max": "2000",
"step": "100",
"x": 536,
"y": 200,
"wires": [
[]
]
},
{
"id": "21b35429.fe43a4",
"type": "ui_text_input",
"z": "6ca1a253.126bb4",
"name": "acq_id",
"label": "Acquisition unique ID*",
"tooltip": "",
"group": "60b93a5.a032344",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "acq_id",
"x": 586,
"y": 40,
"wires": [
[]
]
},
{
"id": "c4e69883.a0f3d",
"type": "ui_dropdown",
"z": "6ca1a253.126bb4",
"name": "acq_celltype",
"label": "Thickness flowcell*",
"tooltip": "",
"place": "Select option",
"group": "60b93a5.a032344",
"order": 7,
"width": 0,
"height": 0,
"passthru": true,
"options": [
{
"label": "200 μm µ-Slide I Luer",
"value": 200,
"type": "num"
},
{
"label": "400 μm µ-Slide I Luer",
"value": 400,
"type": "num"
},
{
"label": "600 μm µ-Slide I Luer",
"value": 600,
"type": "num"
},
{
"label": "800 μm µ-Slide I Luer",
"value": 800,
"type": "num"
}
],
"payload": "",
"topic": "acq_celltype",
"x": 566,
"y": 120,
"wires": [
[]
]
},
{
"id": "f7f5ccc1.29a41",
"type": "ui_text_input",
"z": "6ca1a253.126bb4",
"name": "acq_volume",
"label": "Volume to pass (ml)",
"tooltip": "",
"group": "60b93a5.a032344",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "acq_volume",
"x": 566,
"y": 240,
"wires": [
[]
]
},
{
"id": "f0595ff1.c4d568",
"type": "ui_text_input",
"z": "6ca1a253.126bb4",
"name": "acq_instrument",
"label": "Acquisition instrument",
"tooltip": "PlanktonScope V2.1",
"group": "60b93a5.a032344",
"order": 6,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "acq_instrument",
"x": 556,
"y": 80,
"wires": [
[]
]
},
{
"id": "93a3fd29.c55938",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_id",
"func": "msg.payload = msg.payload.acq_id+1;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 210,
"y": 40,
"wires": [
[
"21b35429.fe43a4"
]
]
},
{
"id": "9e9e7f8a.b66d4",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_instrument",
"func": "msg.payload = msg.payload.acq_instrument;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 230,
"y": 80,
"wires": [
[
"f0595ff1.c4d568"
]
]
},
{
"id": "b1105180.b4b78",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_celltype",
"func": "msg.payload = msg.payload.acq_celltype;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 220,
"y": 120,
"wires": [
[
"c4e69883.a0f3d"
]
]
},
{
"id": "ec403304.e34c58",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_minimum_mesh",
"func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 250,
"y": 160,
"wires": [
[
"12e818fa.b7301f"
]
]
},
{
"id": "7aac5c46.0669ec",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_maximum_mesh",
"func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 250,
"y": 200,
"wires": [
[
"b577dcd2.8d2c88"
]
]
},
{
"id": "c491cf7.36957b",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_volume",
"func": "msg.payload = msg.payload.acq_volume;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 220,
"y": 240,
"wires": [
[
"f7f5ccc1.29a41"
]
]
},
{
"id": "31d58fcd.ede758",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_fnumber_objective",
"func": "msg.payload = msg.payload.acq_fnumber_objective;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 260,
"y": 360,
"wires": [
[
"3d3aafbf.e907a8"
]
]
},
{
"id": "bd733bef.7efd08",
"type": "ui_numeric",
"z": "6ca1a253.126bb4",
"name": "acq_min_esd",
"label": "Minimum size to segment (μm)",
"tooltip": "",
"group": "60b93a5.a032344",
"order": 9,
"width": 0,
"height": 0,
"wrap": false,
"passthru": true,
"topic": "acq_min_esd",
"format": "{{value}}",
"min": 0,
"max": "300",
"step": "5",
"x": 566,
"y": 280,
"wires": [
[]
]
},
{
"id": "a6057924.bc14",
"type": "ui_numeric",
"z": "6ca1a253.126bb4",
"name": "acq_max_esd",
"label": "Maximum size to segment (μm)",
"tooltip": "",
"group": "60b93a5.a032344",
"order": 5,
"width": 0,
"height": 0,
"wrap": false,
"passthru": true,
"topic": "acq_max_esd",
"format": "{{value}}",
"min": "100",
"max": "2000",
"step": "5",
"x": 556,
"y": 320,
"wires": [
[]
]
},
{
"id": "e0644195.305068",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_min_esd",
"func": "msg.payload = msg.payload.acq_min_esd;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 230,
"y": 280,
"wires": [
[
"bd733bef.7efd08"
]
]
},
{
"id": "e3fe6242.bfaf18",
"type": "function",
"z": "6ca1a253.126bb4",
"name": "get acq_max_esd",
"func": "msg.payload = msg.payload.acq_max_esd;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 230,
"y": 320,
"wires": [
[
"a6057924.bc14"
]
]
},
{
"id": "edfb5b10.95636",
"type": "function",
"z": "626459d2.f9c98",
"name": "pump.js",
"func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"pump_manual_volume\");\nvar flowrate= global.get(\"pump_flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n volume = global.get(\"pump_manual_volume\");\n nb_step=volume*507\n msg.volume = volume;\n flowrate = global.get(\"pump_flowrate\");\n duration=(volume*60)/flowrate\n delay=(duration/nb_step)-0.005\n msg.topic = \"actuator/pump\";\n \n if(msg.payload === \"FORWARD\" & state===\"free\"){\n msg.payload='FORWARD '+delay+' '+nb_step;\n }\n if(msg.payload === \"BACKWARD\" & state===\"free\"){\n msg.payload='BACKWARD '+delay+' '+nb_step;\n }\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 640,
"y": 140,
"wires": [
[
"fb35e49.f64de18"
]
],
"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": "26686514.749b4a",
"type": "ui_button",
"z": "626459d2.f9c98",
"name": "BACKWARD",
"group": "4153382f.45437",
"order": 2,
"width": 6,
"height": 1,
"passthru": false,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "arrow_back",
"payload": "BACKWARD",
"payloadType": "str",
"topic": "actuator/pump",
"x": 470,
"y": 120,
"wires": [
[
"edfb5b10.95636"
]
]
},
{
"id": "bee2fd6d.cffb28",
"type": "ui_button",
"z": "626459d2.f9c98",
"name": "FORWARD",
"group": "4153382f.45437",
"order": 4,
"width": 6,
"height": 1,
"passthru": true,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "arrow_forward",
"payload": "FORWARD",
"payloadType": "str",
"topic": "actuator/pump",
"x": 470,
"y": 160,
"wires": [
[
"edfb5b10.95636"
]
]
},
{
"id": "fb35e49.f64de18",
"type": "switch",
"z": "626459d2.f9c98",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "actuator/pump",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 770,
"y": 140,
"wires": [
[
"f6aa3e03.85018"
],
[
"f6dcda51.633398"
]
]
},
{
"id": "f6dcda51.633398",
"type": "ui_toast",
"z": "626459d2.f9c98",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 930,
"y": 160,
"wires": [
[]
]
},
{
"id": "c3edd9e7.1ac36",
"type": "ui_button",
"z": "626459d2.f9c98",
"name": "stop pump",
"group": "4153382f.45437",
"order": 5,
"width": 4,
"height": 1,
"passthru": true,
"label": "STOP PUMP",
"tooltip": "",
"color": "",
"bgcolor": "#AD1625",
"icon": "",
"payload": "off",
"payloadType": "str",
"topic": "actuator/wait",
"x": 470,
"y": 200,
"wires": [
[
"2521ba15.88a58e"
]
]
},
{
"id": "f6aa3e03.85018",
"type": "mqtt out",
"z": "626459d2.f9c98",
"name": "",
"topic": "",
"qos": "",
"retain": "",
"broker": "e8ab36cc.74d77",
"x": 910,
"y": 120,
"wires": []
},
{
"id": "2521ba15.88a58e",
"type": "mqtt out",
"z": "626459d2.f9c98",
"name": "",
"topic": "",
"qos": "",
"retain": "",
"broker": "e8ab36cc.74d77",
"x": 610,
"y": 200,
"wires": []
},
{
"id": "2f9ec1a6.d5fb66",
"type": "ui_text_input",
"z": "626459d2.f9c98",
"name": "pump_manual_volume",
"label": "Volume to pass (ml)",
"tooltip": "",
"group": "4153382f.45437",
"order": 3,
"width": 8,
"height": 1,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "pump_manual_volume",
"x": 480,
"y": 80,
"wires": [
[]
]
},
{
"id": "50093f5.8e35ec",
"type": "function",
"z": "626459d2.f9c98",
"name": "get pump_manual_volume",
"func": "msg.payload = msg.payload.pump_manual_volume;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 220,
"y": 80,
"wires": [
[
"2f9ec1a6.d5fb66"
]
]
},
{
"id": "fa485315.928ae",
"type": "ui_slider",
"z": "626459d2.f9c98",
"name": "pump_flowrate",
"label": "Flowrate (ml/min)*",
"tooltip": "",
"group": "4153382f.45437",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "pump_flowrate",
"min": 0,
"max": "20",
"step": "0.1",
"x": 500,
"y": 40,
"wires": [
[]
]
},
{
"id": "f7b6f5e7.7b7ca",
"type": "function",
"z": "626459d2.f9c98",
"name": "get pump_flowrate",
"func": "msg.payload = msg.payload.pump_flowrate;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 190,
"y": 40,
"wires": [
[
"fa485315.928ae"
]
]
},
{
"id": "7297e2f7.dce564",
"type": "ui_text_input",
"z": "5c516299.73e054",
"name": "focus_nb_step",
"label": "Number of step(s)",
"tooltip": "",
"group": "69433259.f306fc",
"order": 2,
"width": 8,
"height": 1,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "focus_nb_step",
"x": 540,
"y": 40,
"wires": [
[]
]
},
{
"id": "60dc5851.6962b",
"type": "function",
"z": "5c516299.73e054",
"name": "get focus_nb_step",
"func": "msg.payload = msg.payload.focus_nb_step;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 230,
"y": 40,
"wires": [
[
"7297e2f7.dce564"
]
]
},
{
"id": "7200408d.a1be4",
"type": "ui_button",
"z": "5c516299.73e054",
"name": "DOWN",
"group": "69433259.f306fc",
"order": 3,
"width": 6,
"height": 1,
"passthru": true,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "arrow_downward",
"payload": "DOWN",
"payloadType": "str",
"topic": "actuator/focus",
"x": 520,
"y": 120,
"wires": [
[
"2e2a455b.5ff4fa"
]
]
},
{
"id": "7f823e6.d3bcfc",
"type": "ui_button",
"z": "5c516299.73e054",
"name": "UP",
"group": "69433259.f306fc",
"order": 1,
"width": 6,
"height": 1,
"passthru": false,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "arrow_upwards",
"payload": "UP",
"payloadType": "str",
"topic": "actuator/focus",
"x": 530,
"y": 81,
"wires": [
[
"2e2a455b.5ff4fa"
]
]
},
{
"id": "54482c7a.a384ac",
"type": "switch",
"z": "5c516299.73e054",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "actuator/focus",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 810,
"y": 100,
"wires": [
[
"2a7a3d34.08e2a2"
],
[
"4277442b.04d1b4"
]
]
},
{
"id": "4277442b.04d1b4",
"type": "ui_toast",
"z": "5c516299.73e054",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 970,
"y": 140,
"wires": [
[]
]
},
{
"id": "2e2a455b.5ff4fa",
"type": "function",
"z": "5c516299.73e054",
"name": "focus.js",
"func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"focus_nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"focus_nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 660,
"y": 100,
"wires": [
[
"54482c7a.a384ac"
]
],
"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": "73e0d0c.c07ab3",
"type": "ui_button",
"z": "5c516299.73e054",
"name": "stop focus",
"group": "69433259.f306fc",
"order": 4,
"width": 4,
"height": 1,
"passthru": true,
"label": "STOP FOCUS",
"tooltip": "",
"color": "",
"bgcolor": "#AD1625",
"icon": "",
"payload": "off",
"payloadType": "str",
"topic": "actuator/wait",
"x": 510,
"y": 160,
"wires": [
[
"8e86348d.69657"
]
]
},
{
"id": "2a7a3d34.08e2a2",
"type": "mqtt out",
"z": "5c516299.73e054",
"name": "",
"topic": "",
"qos": "",
"retain": "",
"broker": "e8ab36cc.74d77",
"x": 950,
"y": 80,
"wires": []
},
{
"id": "8e86348d.69657",
"type": "mqtt out",
"z": "5c516299.73e054",
"name": "",
"topic": "",
"qos": "",
"retain": "",
"broker": "e8ab36cc.74d77",
"x": 650,
"y": 160,
"wires": []
},
{
"id": "10f1e5c1.3cb69a",
"type": "ui_text_input",
"z": "efeebffd.34c7e",
"name": "sample_ship",
"label": "Name of the ship",
"tooltip": "",
"group": "417f91c9.193ab",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "sample_ship",
"x": 590,
"y": 120,
"wires": [
[]
]
},
{
"id": "da0c5a96.74c0e",
"type": "ui_dropdown",
"z": "efeebffd.34c7e",
"name": "sample_sampling_gear",
"label": "Sampling gear",
"tooltip": "",
"place": "Select",
"group": "417f91c9.193ab",
"order": 4,
"width": 0,
"height": 0,
"passthru": true,
"options": [
{
"label": "Plankton net",
"value": "net",
"type": "str"
},
{
"label": "Niskin bottle 12L",
"value": "niskin_12L",
"type": "str"
},
{
"label": "Niskin bottle 24L",
"value": "niskin_24L",
"type": "str"
},
{
"label": "Pass Hull",
"value": "pass_hull",
"type": "str"
},
{
"label": "Flask",
"value": "flask",
"type": "str"
}
],
"payload": "",
"topic": "sample_sampling_gear",
"x": 550,
"y": 200,
"wires": [
[]
]
},
{
"id": "aa90b06d.ca78e",
"type": "ui_text_input",
"z": "efeebffd.34c7e",
"name": "sample_operator",
"label": "Name of the operator",
"tooltip": "",
"group": "417f91c9.193ab",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "sample_operator",
"x": 570,
"y": 160,
"wires": [
[]
]
},
{
"id": "1cb896c7.6dfc11",
"type": "ui_text_input",
"z": "efeebffd.34c7e",
"name": "sample_project",
"label": "Name of the project*",
"tooltip": "",
"group": "417f91c9.193ab",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "sample_project",
"x": 580,
"y": 40,
"wires": [
[]
]
},
{
"id": "288ba4b3.a9a2cc",
"type": "ui_text_input",
"z": "efeebffd.34c7e",
"name": "sample_id",
"label": "ID of the station*",
"tooltip": "",
"group": "417f91c9.193ab",
"order": 5,
"width": 0,
"height": 0,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "sample_id",
"x": 590,
"y": 80,
"wires": [
[]
]
},
{
"id": "78f5791d.946bd8",
"type": "function",
"z": "efeebffd.34c7e",
"name": "get sample_projet",
"func": "msg.payload = msg.payload.sample_project;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 250,
"y": 40,
"wires": [
[
"1cb896c7.6dfc11"
]
]
},
{
"id": "2a09d440.119154",
"type": "function",
"z": "efeebffd.34c7e",
"name": "get sample_ship",
"func": "msg.payload = msg.payload.sample_ship;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 240,
"y": 120,
"wires": [
[
"10f1e5c1.3cb69a"
]
]
},
{
"id": "346d141f.ebab3c",
"type": "function",
"z": "efeebffd.34c7e",
"name": "get sample_id",
"func": "msg.payload = msg.payload.sample_id+1;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 240,
"y": 80,
"wires": [
[
"288ba4b3.a9a2cc"
]
]
},
{
"id": "2d438355.ed942c",
"type": "function",
"z": "efeebffd.34c7e",
"name": "get sample_operator",
"func": "msg.payload = msg.payload.sample_operator;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 260,
"y": 160,
"wires": [
[
"aa90b06d.ca78e"
]
]
},
{
"id": "ac4a71a.c35309",
"type": "function",
"z": "efeebffd.34c7e",
"name": "get sample_sampling_gear",
"func": "msg.payload = msg.payload.sample_sampling_gear;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 280,
"y": 200,
"wires": [
[
"da0c5a96.74c0e"
]
]
},
{
"id": "45482528.43f93c",
"type": "function",
"z": "ff9251a5.9c5e18",
"name": "get global",
"func": "msg.payload={\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"custom_nb_frame\":global.get(\"custom_nb_frame\"),\n \"custom_nb_step\":global.get(\"custom_nb_step\"),\n \"custom_segmentation\":global.get(\"custom_segmentation\"),\n \"custom_sleep_before\":global.get(\"custom_sleep_before\"),\n \"focus_nb_step\":global.get(\"focus_nb_step\"),\n \"pump_flowrate\":global.get(\"pump_flowrate\"),\n \"pump_manual_volume\":global.get(\"pump_manual_volume\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n \n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1260,
"y": 160,
"wires": [
[
"fe81be99.6859e8"
]
]
},
{
"id": "a5f18550.68466",
"type": "file",
"z": "ff9251a5.9c5e18",
"name": "",
"filename": "/home/pi/PlanktonScope/config.json",
"appendNewline": true,
"createDir": true,
"overwriteFile": "true",
"encoding": "none",
"x": 1640,
"y": 160,
"wires": [
[]
]
},
{
"id": "fe81be99.6859e8",
"type": "json",
"z": "ff9251a5.9c5e18",
"name": "config.json",
"property": "payload",
"action": "str",
"pretty": true,
"x": 1410,
"y": 160,
"wires": [
[
"a5f18550.68466"
]
]
},
{
"id": "b24cc280.5a59b",
"type": "file in",
"z": "ff9251a5.9c5e18",
"name": "",
"filename": "/home/pi/PlanktonScope/config.json",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"x": 360,
"y": 80,
"wires": [
[
"11e5237b.e558c5"
]
],
"info": "# PlanktonScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n"
},
{
"id": "4c6084c.1b7bb7c",
"type": "inject",
"z": "ff9251a5.9c5e18",
"name": "on_load",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"x": 120,
"y": 80,
"wires": [
[
"b24cc280.5a59b",
"845bb10c.d99208",
"a01c8373.701628"
]
],
"info": "# PlanktonScope Help\nWhen the **Pi** is booting, **Node-RED** will be initiated and this node will be activated once and execute the following nodes."
},
{
"id": "11e5237b.e558c5",
"type": "json",
"z": "ff9251a5.9c5e18",
"name": "config.json",
"property": "payload",
"action": "",
"pretty": false,
"x": 610,
"y": 80,
"wires": [
[
"9dc8498a.4a36b",
"9b67b810.97a618",
"32282348.35c09c",
"fe7c0e45.ee983",
"3e6ceaa0.5fad56",
"9e577327.d9a1f",
"c50792f5.6b5148"
]
]
},
{
"id": "f72f54db.590c9",
"type": "function",
"z": "ff9251a5.9c5e18",
"name": "set global",
"func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1080,
"y": 80,
"wires": [
[
"45482528.43f93c"
]
]
},
{
"id": "2372125a.7f69d6",
"type": "rpi-gpio out",
"z": "ff9251a5.9c5e18",
"name": "",
"pin": "40",
"set": "",
"level": "0",
"freq": "",
"out": "out",
"x": 440,
"y": 120,
"wires": []
},
{
"id": "bae08e6f.11bc28",
"type": "ui_template",
"z": "ff9251a5.9c5e18",
"group": "dc721eb.9ef51e",
"name": "Stream Pi Camera",
"order": 1,
"width": 24,
"height": 11,
"format": "<center><iframe id=\"inlineFrameExample\"\n title=\"Inline Frame Example\"\n height=\"600\"\n width=\"800\"\n frameborder=\"0\"\n src=\"http://192.168.4.1:8000/index.html\">\n</iframe></center>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 850,
"y": 320,
"wires": [
[]
]
},
{
"id": "845bb10c.d99208",
"type": "function",
"z": "ff9251a5.9c5e18",
"name": "init LED",
"func": "msg.payload=1;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 280,
"y": 120,
"wires": [
[
"2372125a.7f69d6"
]
]
},
{
"id": "9dc8498a.4a36b",
"type": "subflow:efeebffd.34c7e",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 830,
"y": 80,
"wires": [
[
"f72f54db.590c9"
]
]
},
{
"id": "9e577327.d9a1f",
"type": "subflow:5c516299.73e054",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 846,
"y": 242,
"wires": [
[
"f72f54db.590c9"
]
]
},
{
"id": "c50792f5.6b5148",
"type": "subflow:626459d2.f9c98",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 846,
"y": 282,
"wires": [
[
"f72f54db.590c9"
]
]
},
{
"id": "9b67b810.97a618",
"type": "subflow:6ca1a253.126bb4",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 840,
"y": 120,
"wires": [
[
"f72f54db.590c9"
],
[
"45482528.43f93c"
]
]
},
{
"id": "32282348.35c09c",
"type": "subflow:b45c6fb6.f6dfa8",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 820,
"y": 160,
"wires": [
[
"f72f54db.590c9"
],
[
"45482528.43f93c"
]
]
},
{
"id": "8e1d0d8d.fc54d8",
"type": "subflow:fbe9590f.bd63b8",
"z": "ff9251a5.9c5e18",
"name": "System commands",
"env": [],
"x": 850,
"y": 500,
"wires": []
},
{
"id": "f8a906b3.a2c81",
"type": "subflow:9882c53a.0ccc8",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 320,
"y": 280,
"wires": []
},
{
"id": "b1be7e1e.9ec3c8",
"type": "subflow:a8ad6dec.1a393",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 850,
"y": 420,
"wires": []
},
{
"id": "fe7c0e45.ee983",
"type": "subflow:5a287804.a10e2",
"z": "ff9251a5.9c5e18",
"name": "process metadata",
"env": [],
"x": 830,
"y": 200,
"wires": [
[
"f72f54db.590c9"
]
]
},
{
"id": "3e6ceaa0.5fad56",
"type": "subflow:863e8384.56889",
"z": "ff9251a5.9c5e18",
"name": "Acquisition inputs",
"env": [],
"x": 836,
"y": 362,
"wires": [
[
"f72f54db.590c9"
]
],
"icon": "node-red-dashboard/ui_switch.png"
},
{
"id": "a01c8373.701628",
"type": "subflow:c10e968b.87e488",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 300,
"y": 200,
"wires": []
},
{
"id": "1924ce1c.0459f2",
"type": "subflow:c1d3ff7c.4384f",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 290,
"y": 240,
"wires": []
},
{
"id": "d3892f94.428a28",
"type": "subflow:bba19d97.b32b1",
"z": "ff9251a5.9c5e18",
"name": "",
"env": [],
"x": 850,
"y": 460,
"wires": []
},
{
"id": "e73525a.1103158",
"type": "ui_switch",
"z": "ff9251a5.9c5e18",
"name": "",
"label": "LED",
"tooltip": "",
"group": "9c86b3b7.54841",
"order": 10,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"x": 270,
"y": 160,
"wires": [
[
"2372125a.7f69d6"
]
]
},
{
"id": "be37d12f.0898f",
"type": "file",
"z": "c1d3ff7c.4384f",
"name": "",
"filename": "/home/pi/PlanktonScope/script/main.py",
"appendNewline": false,
"createDir": true,
"overwriteFile": "true",
"encoding": "none",
"x": 530,
"y": 100,
"wires": [
[
"23f3e613.20ad82"
]
]
},
{
"id": "49e31e85.7ac51",
"type": "template",
"z": "c1d3ff7c.4384f",
"name": "main.py",
"field": "payload",
"fieldType": "msg",
"format": "python",
"syntax": "plain",
"template": "################################################################################\n#Actuator Libraries\n################################################################################\n\n#Library for exchaning messages with Node-RED\nimport paho.mqtt.client as mqtt\n\n#Library to control the PiCamera\nfrom picamera import PiCamera\n\n#Libraries to control the steppers for focusing and pumping\nfrom adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\n\n#Library to send command over I2C for the light module on the fan\nimport smbus\n\n################################################################################\n#Practical Libraries\n################################################################################\n\n#Library to get date and time for folder name and filename\nfrom datetime import datetime, timedelta\n\n#Library to be able to sleep for a duration\nfrom time import sleep\n\n#Libraries manipulate json format, execute bash commands\nimport json, shutil, os, subprocess\n\n################################################################################\n#Morphocut Libraries\n################################################################################\n\nfrom skimage.util import img_as_ubyte\nfrom morphocut import Call\nfrom morphocut.contrib.ecotaxa import EcotaxaWriter\nfrom morphocut.contrib.zooprocess import CalculateZooProcessFeatures\nfrom morphocut.core import Pipeline\nfrom morphocut.file import Find\nfrom morphocut.image import (ExtractROI,\n FindRegions,\n ImageReader,\n ImageWriter,\n RescaleIntensity,\n RGB2Gray\n)\nfrom morphocut.stat import RunningMedian\nfrom morphocut.str import Format\nfrom morphocut.stream import TQDM, Enumerate, FilterVariables\n\n################################################################################\n#Other image processing Libraries\n################################################################################\n\nfrom skimage.feature import canny\nfrom skimage.color import rgb2gray, label2rgb\nfrom skimage.morphology import disk\nfrom skimage.morphology import erosion, dilation, closing\nfrom skimage.measure import label, regionprops\nimport cv2\n\n################################################################################\n#Streaming PiCamera over server\n################################################################################\nimport io\nimport picamera\nimport logging\nimport socketserver\nfrom threading import Condition\nfrom http import server\nimport threading\n\n################################################################################\n#Creation of the webpage containing the PiCamera Streaming\n################################################################################\n\nPAGE=\"\"\"\\\n<html>\n<head>\n<title>PlanktonScope v2 | PiCamera Streaming</title>\n</head>\n<body>\n<img src=\"stream.mjpg\" width=\"640\" height=\"480\" />\n</body>\n</html>\n\"\"\"\n\n################################################################################\n#Classes for the PiCamera Streaming\n################################################################################\n\nclass StreamingOutput(object):\n def __init__(self):\n self.frame = None\n self.buffer = io.BytesIO()\n self.condition = Condition()\n\n def write(self, buf):\n if buf.startswith(b'\\xff\\xd8'):\n # New frame, copy the existing buffer's content and notify all\n # clients it's available\n self.buffer.truncate()\n with self.condition:\n self.frame = self.buffer.getvalue()\n self.condition.notify_all()\n self.buffer.seek(0)\n return self.buffer.write(buf)\n\nclass StreamingHandler(server.BaseHTTPRequestHandler):\n def do_GET(self):\n if self.path == '/':\n self.send_response(301)\n self.send_header('Location', '/index.html')\n self.end_headers()\n elif self.path == '/index.html':\n content = PAGE.encode('utf-8')\n self.send_resp
"output": "str",
"x": 300,
"y": 100,
"wires": [
[
"be37d12f.0898f"
]
]
},
{
"id": "f9705bc.3d322a8",
"type": "ui_switch",
"z": "863e8384.56889",
"name": "custom_segmentation",
"label": "Realize the segmentation",
"tooltip": "",
"group": "48649115.fcd01",
"order": 6,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "custom_segmentation",
"style": "",
"onvalue": "True",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "False",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"x": 520,
"y": 160,
"wires": [
[]
]
},
{
"id": "2de12b49.050f44",
"type": "debug",
"z": "c1d3ff7c.4384f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 1230,
"y": 200,
"wires": []
},
{
"id": "5079cccb.298d14",
"type": "exec",
"z": "c1d3ff7c.4384f",
"command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 430,
"y": 40,
"wires": [
[
"c47c2122.5eea38"
],
[],
[]
]
},
{
"id": "c47c2122.5eea38",
"type": "exec",
"z": "c1d3ff7c.4384f",
"command": "kill",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 910,
"y": 40,
"wires": [
[],
[],
[]
]
},
{
"id": "197215b2.165f22",
"type": "delay",
"z": "c1d3ff7c.4384f",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 160,
"y": 100,
"wires": [
[
"49e31e85.7ac51"
]
]
},
{
"id": "589fbae2.8ff914",
"type": "debug",
"z": "a8ad6dec.1a393",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 240,
"y": 140,
"wires": []
2020-01-08 14:32:46 +01:00
}
]