planktoscope/flows/flow_villefranche.json

4808 lines
132 KiB
JSON

[
{
"id": "eaae323a.31b3",
"type": "tab",
"label": "Home",
"disabled": false,
"info": ""
},
{
"id": "b771c342.49603",
"type": "tab",
"label": "Sample",
"disabled": false,
"info": ""
},
{
"id": "bccd1f23.87219",
"type": "tab",
"label": "Optic Configuration",
"disabled": false,
"info": ""
},
{
"id": "baa1e3d9.cb29d",
"type": "tab",
"label": "Fluidic Acquisition",
"disabled": false,
"info": ""
},
{
"id": "cb95299c.2817c8",
"type": "tab",
"label": "Segmentation",
"disabled": false,
"info": ""
},
{
"id": "c1660bc.e7ff7f8",
"type": "tab",
"label": "Gallery",
"disabled": false,
"info": ""
},
{
"id": "1371dec5.76e671",
"type": "tab",
"label": "Settings",
"disabled": false,
"info": ""
},
{
"id": "da2c279f.cbe318",
"type": "ui_group",
"z": "",
"name": "Controller",
"tab": null,
"order": 6,
"disp": true,
"width": 6,
"collapse": false
},
{
"id": "833bc5bb.217ba8",
"type": "ui_group",
"z": "",
"name": "Preview",
"tab": "181bb236.1e94be",
"order": 1,
"disp": true,
"width": 14,
"collapse": false
},
{
"id": "3a6bb13f.c9703e",
"type": "ui_tab",
"z": "",
"name": "Home",
"icon": "home",
"order": 1,
"disabled": false,
"hidden": false
},
{
"id": "181bb236.1e94be",
"type": "ui_tab",
"z": "",
"name": "Optic Configuration",
"icon": "fa-eye",
"order": 3,
"disabled": false,
"hidden": false
},
{
"id": "c9194f02.9d5e9",
"type": "ui_tab",
"z": "",
"name": "Fluidic Acquisition",
"icon": "fa-flask",
"order": 4,
"disabled": false,
"hidden": false
},
{
"id": "8d16beb8.9b3fb",
"type": "ui_tab",
"z": "",
"name": "Segmentation",
"icon": "fa-crop",
"order": 5,
"disabled": false,
"hidden": false
},
{
"id": "d9cd733b.ab73d",
"type": "ui_tab",
"z": "",
"name": "Settings",
"icon": "fa-cogs",
"order": 7,
"disabled": false,
"hidden": false
},
{
"id": "4248342d.e55fac",
"type": "ui_group",
"z": "",
"name": "Optic Characterization",
"tab": "181bb236.1e94be",
"order": 2,
"disp": true,
"width": 10,
"collapse": false
},
{
"id": "858a0e3c.987fe",
"type": "ui_group",
"z": "",
"name": "Preview",
"tab": "c9194f02.9d5e9",
"order": 1,
"disp": true,
"width": "14",
"collapse": false
},
{
"id": "64903b47.4034e4",
"type": "ui_group",
"name": "Group 1",
"tab": "8d16beb8.9b3fb",
"order": 1,
"disp": true,
"width": 6
},
{
"id": "3da7da8f.179606",
"type": "ui_group",
"z": "",
"name": "Processor",
"tab": "d9cd733b.ab73d",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "cc8bc4eb.651868",
"type": "ui_base",
"theme": {
"name": "theme-dark",
"lightTheme": {
"default": "#0094CE",
"baseColor": "#5900ce",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": false,
"reset": false
},
"darkTheme": {
"default": "#097479",
"baseColor": "#097479",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": true,
"reset": false
},
"customTheme": {
"name": "Untitled Theme 1",
"default": "#4B7930",
"baseColor": "#4B7930",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
},
"themeState": {
"base-color": {
"default": "#097479",
"value": "#097479",
"edited": true
},
"page-titlebar-backgroundColor": {
"value": "#097479",
"edited": false
},
"page-backgroundColor": {
"value": "#111111",
"edited": false
},
"page-sidebar-backgroundColor": {
"value": "#000000",
"edited": false
},
"group-textColor": {
"value": "#0eb8c0",
"edited": false
},
"group-borderColor": {
"value": "#555555",
"edited": false
},
"group-backgroundColor": {
"value": "#333333",
"edited": false
},
"widget-textColor": {
"value": "#eeeeee",
"edited": false
},
"widget-backgroundColor": {
"value": "#097479",
"edited": false
},
"widget-borderColor": {
"value": "#333333",
"edited": false
},
"base-font": {
"value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
}
},
"angularTheme": {
"primary": "indigo",
"accents": "blue",
"warn": "red",
"background": "grey"
}
},
"site": {
"name": "Node-RED Dashboard",
"hideToolbar": "false",
"allowSwipe": "false",
"lockMenu": "true",
"allowTempTheme": "true",
"dateFormat": "DD/MM/YYYY",
"sizes": {
"sx": 56,
"sy": 56,
"gx": 5,
"gy": 5,
"cx": 5,
"cy": 5,
"px": 5,
"py": 5
}
}
},
{
"id": "36739a35.7cce36",
"type": "ui_tab",
"z": "",
"name": "Gallery",
"icon": "fa fa-file-image-o",
"order": 6,
"disabled": false,
"hidden": false
},
{
"id": "c0ebfc57.42527",
"type": "ui_group",
"name": "Group 1",
"tab": "36739a35.7cce36",
"order": 1,
"disp": true,
"width": 6
},
{
"id": "737ec584.2eea2c",
"type": "ui_tab",
"z": "",
"name": "Sample",
"icon": "fa-eyedropper",
"order": 2,
"disabled": false,
"hidden": false
},
{
"id": "6f97e7ae.270c48",
"type": "ui_group",
"z": "",
"name": "Group 1",
"tab": "3a6bb13f.c9703e",
"order": 1,
"disp": false,
"width": "4",
"collapse": false
},
{
"id": "3e1ba03d.f01d8",
"type": "ui_group",
"z": "",
"name": "Sample Identification",
"tab": "737ec584.2eea2c",
"order": 1,
"disp": true,
"width": 24,
"collapse": false
},
{
"id": "4e0cd5ea.17e59c",
"type": "ui_group",
"z": "",
"name": "Group 2",
"tab": "3a6bb13f.c9703e",
"order": 2,
"disp": false,
"width": "4",
"collapse": false
},
{
"id": "ef590206.24f6",
"type": "ui_group",
"z": "",
"name": "Group 3",
"tab": "3a6bb13f.c9703e",
"order": 3,
"disp": false,
"width": "4",
"collapse": false
},
{
"id": "ae8f6620.073358",
"type": "ui_group",
"z": "",
"name": "Group 4",
"tab": "3a6bb13f.c9703e",
"order": 4,
"disp": false,
"width": "4",
"collapse": false
},
{
"id": "196518b2.4d53b7",
"type": "ui_group",
"z": "",
"name": "Group 5",
"tab": "3a6bb13f.c9703e",
"order": 5,
"disp": false,
"width": "4",
"collapse": false
},
{
"id": "777a7c33.fcd804",
"type": "ui_group",
"z": "",
"name": "Group 6",
"tab": "3a6bb13f.c9703e",
"order": 6,
"disp": false,
"width": "4",
"collapse": false
},
{
"id": "cef1e703.bcf3c8",
"type": "ui_group",
"z": "",
"name": "Spatio Temporal",
"tab": "737ec584.2eea2c",
"order": 2,
"disp": true,
"width": 24,
"collapse": false
},
{
"id": "5517c651.b2f668",
"type": "ui_group",
"z": "",
"name": "Validation",
"tab": "737ec584.2eea2c",
"order": 3,
"disp": false,
"width": 24,
"collapse": false
},
{
"id": "fbd92986.1028c8",
"type": "ui_group",
"z": "",
"name": "Focus Adjustment",
"tab": "181bb236.1e94be",
"order": 3,
"disp": true,
"width": 10,
"collapse": false
},
{
"id": "707d9797.c8e798",
"type": "ui_group",
"z": "",
"name": "Fluidic Manual Manipulation",
"tab": "181bb236.1e94be",
"order": 4,
"disp": true,
"width": 14,
"collapse": false
},
{
"id": "7a0b4877.a5d268",
"type": "ui_group",
"z": "",
"name": "Validation",
"tab": "181bb236.1e94be",
"order": 5,
"disp": false,
"width": "10",
"collapse": false
},
{
"id": "567a49a4.244cb8",
"type": "ui_group",
"z": "",
"name": "Generic Information",
"tab": "c9194f02.9d5e9",
"order": 4,
"disp": true,
"width": 10,
"collapse": false
},
{
"id": "404c301a.19c4e",
"type": "ui_group",
"z": "",
"name": "Fraction size",
"tab": "c9194f02.9d5e9",
"order": 3,
"disp": true,
"width": "10",
"collapse": false
},
{
"id": "4322c187.e73e5",
"type": "ui_group",
"z": "",
"name": "Acquisition",
"tab": "c9194f02.9d5e9",
"order": 4,
"disp": true,
"width": 10,
"collapse": false
},
{
"id": "b7919ae2.c01788",
"type": "ui_group",
"z": "",
"name": "Validation",
"tab": "c9194f02.9d5e9",
"order": 5,
"disp": false,
"width": 14,
"collapse": false
},
{
"id": "b5d61bc7.54fe48",
"type": "ui_group",
"z": "",
"name": "Group 6",
"tab": "c9194f02.9d5e9",
"order": 6,
"disp": false,
"width": 10,
"collapse": false
},
{
"id": "1be83144.4fe4bf",
"type": "ui_group",
"z": "",
"name": "Group 2",
"tab": "d9cd733b.ab73d",
"order": 6,
"disp": false,
"width": 24,
"collapse": false
},
{
"id": "3ca00bf9.e5cac4",
"type": "ui_group",
"z": "",
"name": "Group 3",
"tab": "d9cd733b.ab73d",
"order": 5,
"disp": false,
"width": "24",
"collapse": false
},
{
"id": "b5ba3f26.2e722",
"type": "ui_group",
"z": "",
"name": "CPU Temperature",
"tab": "d9cd733b.ab73d",
"order": 2,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "806d69c8.67fc58",
"type": "ui_group",
"z": "",
"name": "Memory",
"tab": "d9cd733b.ab73d",
"order": 3,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "405183bc.d8991c",
"type": "ui_group",
"z": "",
"name": "Disk Usage",
"tab": "d9cd733b.ab73d",
"order": 4,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "4e78af2d.90be7",
"type": "ui_ui_control",
"z": "eaae323a.31b3",
"name": "",
"events": "change",
"x": 520,
"y": 60,
"wires": [
[]
]
},
{
"id": "2a65c3ec.49a6bc",
"type": "function",
"z": "eaae323a.31b3",
"name": "swtich tab",
"func": "\nmsg.payload={\"tab\":msg.payload};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 360,
"y": 60,
"wires": [
[
"4e78af2d.90be7"
]
]
},
{
"id": "9d6abe67.6bb3d",
"type": "ui_button",
"z": "cb95299c.2817c8",
"name": "",
"group": "64903b47.4034e4",
"order": 0,
"width": 0,
"height": 0,
"passthru": false,
"label": "Home",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "home",
"payload": "",
"payloadType": "str",
"topic": "Home",
"x": 70,
"y": 40,
"wires": [
[
"7be6422d.73949c"
]
]
},
{
"id": "f0fb77cf.8f1c28",
"type": "ui_ui_control",
"z": "cb95299c.2817c8",
"name": "",
"events": "change",
"x": 380,
"y": 40,
"wires": [
[]
]
},
{
"id": "7be6422d.73949c",
"type": "function",
"z": "cb95299c.2817c8",
"name": "change tab",
"func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 220,
"y": 40,
"wires": [
[
"f0fb77cf.8f1c28"
]
]
},
{
"id": "a66e925b.4155c",
"type": "ui_button",
"z": "1371dec5.76e671",
"name": "",
"group": "3ca00bf9.e5cac4",
"order": 1,
"width": 4,
"height": 1,
"passthru": false,
"label": "Home",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "home",
"payload": "",
"payloadType": "str",
"topic": "Home",
"x": 70,
"y": 40,
"wires": [
[
"75975366.93d6cc"
]
]
},
{
"id": "60fd157b.8a5aac",
"type": "ui_ui_control",
"z": "1371dec5.76e671",
"name": "",
"events": "change",
"x": 380,
"y": 40,
"wires": [
[]
]
},
{
"id": "75975366.93d6cc",
"type": "function",
"z": "1371dec5.76e671",
"name": "change tab",
"func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 220,
"y": 40,
"wires": [
[
"60fd157b.8a5aac"
]
]
},
{
"id": "2c8c45ab.610c0a",
"type": "ui_gauge",
"z": "1371dec5.76e671",
"name": "",
"group": "b5ba3f26.2e722",
"order": 1,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "CPU Temperature",
"label": "C",
"format": "{{value}}",
"min": "35",
"max": "55",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 510,
"y": 80,
"wires": []
},
{
"id": "ddcbbfa5.cd158",
"type": "exec",
"z": "1371dec5.76e671",
"command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "RPi Temp.",
"x": 310,
"y": 100,
"wires": [
[
"bc503fa5.f46dd",
"2c8c45ab.610c0a",
"cef370c7.1f7a"
],
[],
[]
]
},
{
"id": "704faf02.a00b8",
"type": "inject",
"z": "1371dec5.76e671",
"name": "",
"topic": "ouquoi",
"payload": "",
"payloadType": "date",
"repeat": "10",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 110,
"y": 100,
"wires": [
[
"ddcbbfa5.cd158",
"55749fd8.3aca5",
"c2b8d8b.0d90328"
]
]
},
{
"id": "cef370c7.1f7a",
"type": "ui_chart",
"z": "1371dec5.76e671",
"name": "",
"group": "b5ba3f26.2e722",
"order": 2,
"width": 0,
"height": 0,
"label": "",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "20",
"removeOlderPoints": "200",
"removeOlderUnit": "60",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": true,
"outputs": 1,
"x": 470,
"y": 120,
"wires": [
[]
]
},
{
"id": "55749fd8.3aca5",
"type": "exec",
"z": "1371dec5.76e671",
"command": "top -d 0.5 -b -n2 | grep \"Cpu(s)\"|tail -n 1 | awk '{print $2 + $4}' | tr -d \"\\n\"",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "CPU Load",
"x": 270,
"y": 200,
"wires": [
[
"e046247c.c466e8",
"4b2b9a70.6a9af4"
],
[],
[]
]
},
{
"id": "c2b8d8b.0d90328",
"type": "exec",
"z": "1371dec5.76e671",
"command": "free | grep Mem | awk '{print 100*($4+$6+$7)/$2}' | awk -F \".\" '{print $1}' | tr -d \"\\n\"",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "Free Memory",
"x": 280,
"y": 300,
"wires": [
[
"e84f6e08.5d147",
"c7c8d192.3df27"
],
[],
[]
]
},
{
"id": "e046247c.c466e8",
"type": "ui_gauge",
"z": "1371dec5.76e671",
"name": "",
"group": "3da7da8f.179606",
"order": 1,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Processor",
"label": "CPU",
"format": "{{value}}",
"min": 0,
"max": "100",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 480,
"y": 180,
"wires": []
},
{
"id": "e84f6e08.5d147",
"type": "ui_gauge",
"z": "1371dec5.76e671",
"name": "",
"group": "806d69c8.67fc58",
"order": 1,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Memory",
"label": "RAM",
"format": "{{value}}",
"min": 0,
"max": "200",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 480,
"y": 280,
"wires": []
},
{
"id": "3910d662.fa1f7a",
"type": "exec",
"z": "1371dec5.76e671",
"command": "df -h | grep /dev/root | awk -F ' ' '{print $3}' | tr -d G | tr \"\\n$\" \"\\ \" | sed 's/,/./' | tr -d \" \" ",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "Disk Usage",
"x": 270,
"y": 400,
"wires": [
[
"45e1912a.36a23",
"84ac8611.1a6ac8"
],
[],
[]
]
},
{
"id": "45e1912a.36a23",
"type": "ui_gauge",
"z": "1371dec5.76e671",
"name": "",
"group": "405183bc.d8991c",
"order": 1,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "Disk",
"label": "Go",
"format": "{{value}}",
"min": 0,
"max": "256",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 470,
"y": 380,
"wires": []
},
{
"id": "4b2b9a70.6a9af4",
"type": "ui_chart",
"z": "1371dec5.76e671",
"name": "",
"group": "3da7da8f.179606",
"order": 2,
"width": 0,
"height": 0,
"label": "",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "20",
"removeOlderPoints": "",
"removeOlderUnit": "60",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": true,
"outputs": 1,
"x": 470,
"y": 220,
"wires": [
[]
]
},
{
"id": "c7c8d192.3df27",
"type": "ui_chart",
"z": "1371dec5.76e671",
"name": "",
"group": "806d69c8.67fc58",
"order": 2,
"width": 0,
"height": 0,
"label": "",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "20",
"removeOlderPoints": "",
"removeOlderUnit": "60",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": true,
"outputs": 1,
"x": 470,
"y": 320,
"wires": [
[]
]
},
{
"id": "84ac8611.1a6ac8",
"type": "ui_chart",
"z": "1371dec5.76e671",
"name": "",
"group": "405183bc.d8991c",
"order": 2,
"width": 0,
"height": 0,
"label": "",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "4",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": true,
"outputs": 1,
"x": 470,
"y": 420,
"wires": [
[]
]
},
{
"id": "1cd5b4c0.46af9b",
"type": "inject",
"z": "1371dec5.76e671",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "60",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 90,
"y": 280,
"wires": [
[
"3910d662.fa1f7a"
]
]
},
{
"id": "96bbe41d.ee7928",
"type": "ui_switch",
"z": "1371dec5.76e671",
"name": "light_state",
"label": "Light",
"tooltip": "",
"group": "3ca00bf9.e5cac4",
"order": 2,
"width": 3,
"height": 1,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "on",
"onvalueType": "str",
"onicon": "wb_incandescent",
"oncolor": "red",
"offvalue": "off",
"offvalueType": "str",
"officon": "",
"offcolor": "blue",
"x": 1050,
"y": 140,
"wires": [
[
"51145654.0ce2d8"
]
]
},
{
"id": "8485d05.444903",
"type": "ui_switch",
"z": "1371dec5.76e671",
"name": "fan_state",
"label": "Fan",
"tooltip": "",
"group": "3ca00bf9.e5cac4",
"order": 3,
"width": 3,
"height": 1,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "on",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "off",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"x": 1040,
"y": 80,
"wires": [
[
"2549f778.4eb828"
]
]
},
{
"id": "2549f778.4eb828",
"type": "python3-function",
"z": "1371dec5.76e671",
"name": "fan.py",
"func": "#!/usr/bin/python\nimport smbus\nimport sys\n\nstate = msg[\"payload\"]\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif state == \"off\":\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif state == \"on\":\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)",
"outputs": 1,
"x": 1190,
"y": 80,
"wires": [
[]
]
},
{
"id": "a113b518.830008",
"type": "ui_button",
"z": "1371dec5.76e671",
"name": "",
"group": "3ca00bf9.e5cac4",
"order": 4,
"width": 7,
"height": 1,
"passthru": false,
"label": "Reboot",
"tooltip": "",
"color": "",
"bgcolor": "#AD1625",
"icon": "",
"payload": "off",
"payloadType": "str",
"topic": "reboot",
"x": 720,
"y": 320,
"wires": [
[
"ee57d11c.ed1dd",
"d9234d01.e630d"
]
]
},
{
"id": "d9a924bc.0ca078",
"type": "exec",
"z": "1371dec5.76e671",
"command": "sudo",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "2",
"oldrc": false,
"name": "cmd",
"x": 1030,
"y": 320,
"wires": [
[],
[],
[]
]
},
{
"id": "51145654.0ce2d8",
"type": "python3-function",
"z": "1371dec5.76e671",
"name": "light.py",
"func": "import RPi.GPIO as GPIO\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setwarnings(False)\nGPIO.setup(21,GPIO.OUT)\n\nstate = msg[\"payload\"]\n\n \nif state == \"on\":\n GPIO.output(21,GPIO.HIGH)\nif state == \"off\":\n GPIO.output(21,GPIO.LOW)",
"outputs": 1,
"x": 1200,
"y": 140,
"wires": [
[]
]
},
{
"id": "552d8bbb.cc4ca4",
"type": "ui_button",
"z": "1371dec5.76e671",
"name": "",
"group": "3ca00bf9.e5cac4",
"order": 5,
"width": 7,
"height": 1,
"passthru": false,
"label": "Shutdown",
"tooltip": "",
"color": "",
"bgcolor": "#AD1625",
"icon": "",
"payload": "off",
"payloadType": "str",
"topic": "shutdown",
"x": 720,
"y": 380,
"wires": [
[
"ee57d11c.ed1dd",
"d9234d01.e630d"
]
]
},
{
"id": "3517d063.27073",
"type": "link in",
"z": "1371dec5.76e671",
"name": "",
"links": [
"ec8da7a8.0eb558",
"d9234d01.e630d"
],
"x": 895,
"y": 140,
"wires": [
[
"96bbe41d.ee7928",
"8485d05.444903"
]
]
},
{
"id": "ee57d11c.ed1dd",
"type": "python3-function",
"z": "1371dec5.76e671",
"name": "action",
"func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg",
"outputs": 1,
"x": 870,
"y": 340,
"wires": [
[
"b7ab1ada.1f4158",
"d9a924bc.0ca078"
]
]
},
{
"id": "b7ab1ada.1f4158",
"type": "exec",
"z": "1371dec5.76e671",
"command": "i2cdetect -y 1",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "1",
"oldrc": false,
"name": "i2c update",
"x": 1050,
"y": 380,
"wires": [
[],
[],
[]
]
},
{
"id": "d9234d01.e630d",
"type": "link out",
"z": "1371dec5.76e671",
"name": "",
"links": [
"3517d063.27073"
],
"x": 835,
"y": 280,
"wires": []
},
{
"id": "bc503fa5.f46dd",
"type": "switch",
"z": "1371dec5.76e671",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "gt",
"v": "45",
"vt": "num"
},
{
"t": "lte",
"v": "38",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 670,
"y": 80,
"wires": [
[
"a25d6486.e1ce28"
],
[
"5d4f3e71.1bad4"
]
]
},
{
"id": "5d4f3e71.1bad4",
"type": "change",
"z": "1371dec5.76e671",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "off",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 840,
"y": 100,
"wires": [
[
"8485d05.444903"
]
]
},
{
"id": "a25d6486.e1ce28",
"type": "change",
"z": "1371dec5.76e671",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "on",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 840,
"y": 60,
"wires": [
[
"8485d05.444903"
]
]
},
{
"id": "37507791.4d5508",
"type": "http request",
"z": "1371dec5.76e671",
"name": "toggle timelapse",
"method": "GET",
"ret": "txt",
"paytoqs": false,
"url": "http://127.0.0.1/html/cmd_pipe.php?cmd={{{payload}}}",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 240,
"y": 780,
"wires": [
[]
]
},
{
"id": "b9ff73e.19bd49",
"type": "ui_switch",
"z": "1371dec5.76e671",
"d": true,
"name": "timelapse",
"label": "toggle acquisition",
"tooltip": "",
"group": "1be83144.4fe4bf",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "toggle",
"style": "",
"onvalue": "tl 1",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "tl 0",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"x": 80,
"y": 660,
"wires": [
[
"37507791.4d5508",
"df47f1bb.1b0bf"
]
]
},
{
"id": "9a52e6b.cbbc118",
"type": "exec",
"z": "1371dec5.76e671",
"command": "ls -l /var/www/html/media | grep \"th\" | tail -1 | awk -F \" \" '{print $9}' | tr -d \"\\n\"",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "get thumbail name",
"x": 770,
"y": 720,
"wires": [
[
"ca6bfbdf.4a71e8"
],
[],
[]
]
},
{
"id": "df47f1bb.1b0bf",
"type": "switch",
"z": "1371dec5.76e671",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "tl 0",
"vt": "str"
},
{
"t": "eq",
"v": "tl 1",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 230,
"y": 660,
"wires": [
[
"1cf57a24.20b176"
],
[
"faa67658.8edf18",
"c4524676.63b608"
]
]
},
{
"id": "faa67658.8edf18",
"type": "delay",
"z": "1371dec5.76e671",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 420,
"y": 720,
"wires": [
[
"9a52e6b.cbbc118"
]
]
},
{
"id": "ca6bfbdf.4a71e8",
"type": "ui_template",
"z": "1371dec5.76e671",
"d": true,
"group": "1be83144.4fe4bf",
"name": "",
"order": 2,
"width": 0,
"height": 0,
"format": "<div ng-bind-html=\"msg.payload\"></div>\n\n\n<img src=\"http://127.0.0.1/html/media/{{msg.payload}}\"/>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 980,
"y": 700,
"wires": [
[]
]
},
{
"id": "3e73267.51682da",
"type": "exec",
"z": "1371dec5.76e671",
"command": "i2cdetect -y 1",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "1",
"oldrc": false,
"name": "i2c update",
"x": 750,
"y": 620,
"wires": [
[],
[],
[]
]
},
{
"id": "e8c9d8e.f1d5428",
"type": "python3-function",
"z": "1371dec5.76e671",
"name": "wait RGB",
"func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\n \nreturn msg;",
"outputs": 1,
"x": 560,
"y": 600,
"wires": [
[
"3e73267.51682da"
]
]
},
{
"id": "1cf57a24.20b176",
"type": "function",
"z": "1371dec5.76e671",
"name": "set free",
"func": "global.set(\"state\",\"free\");\nreturn msg",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 600,
"wires": [
[
"e8c9d8e.f1d5428"
]
]
},
{
"id": "e3b347e3.b19f98",
"type": "python3-function",
"z": "1371dec5.76e671",
"name": "actuate RGB",
"func": "import smbus\nbus = smbus.SMBus(1)\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nreturn msg;",
"outputs": 1,
"x": 570,
"y": 660,
"wires": [
[
"3e73267.51682da"
]
]
},
{
"id": "c4524676.63b608",
"type": "function",
"z": "1371dec5.76e671",
"name": "set busy",
"func": "global.set(\"state\",\"busy\");\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 660,
"wires": [
[
"e3b347e3.b19f98"
]
]
},
{
"id": "6a84252a.d52a0c",
"type": "ui_template",
"z": "bccd1f23.87219",
"group": "833bc5bb.217ba8",
"name": "Stream Pi Camera",
"order": 1,
"width": 14,
"height": 9,
"format": "<center><iframe id=\"inlineFrameExample\"\n title=\"Inline Frame Example\"\n height=\"500\"\n width=\"666\"\n frameborder=\"0\"\n src=\"http://localhost/html/min.php\">\n</iframe></center>\n",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 110,
"y": 100,
"wires": [
[]
]
},
{
"id": "dc48dc42.98d18",
"type": "function",
"z": "bccd1f23.87219",
"name": "set global",
"func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);",
"outputs": 1,
"noerr": 0,
"x": 1480,
"y": 400,
"wires": [
[]
]
},
{
"id": "5b043fe6.df031",
"type": "function",
"z": "bccd1f23.87219",
"name": "focus.js",
"func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of step\"\n}\n\nelse {\n\n if(msg.topic === \"up\" & state ===\"free\"){\n nb_step = global.get(\"nb_step\");\n msg.nb_step = nb_step;\n msg.orientation = \"up\";\n msg.rgb = {r:255, g:0, b:255}\n msg.topic = \"Focus\"\n return msg;\n }\n \n if(msg.topic === \"down\" & state ===\"free\"){\n nb_step = global.get(\"nb_step\");\n msg.nb_step = nb_step;\n msg.orientation = \"down\";\n msg.rgb = {r:255, g:0, b:255}\n msg.topic = \"Focus\"\n return msg;\n }\n}\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 980,
"y": 280,
"wires": [
[
"e7f18662.70dcf8"
]
],
"info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"
},
{
"id": "8c19fb64.8a1828",
"type": "python3-function",
"z": "bccd1f23.87219",
"name": "focus.py",
"func": "\nimport sys\n\nfrom adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nnb_step = int(msg[\"nb_step\"])\norientation = msg[\"orientation\"]\n\nkit = MotorKit()\n\nstage = kit.stepper2\n\nstage.release()\n\n#0.25mm/step\n#31um/microsteps\n\n \nif orientation == 'up':\n for i in range(nb_step):\n stage.onestep(direction=stepper.FORWARD, style=stepper.MICROSTEP)\n sleep(0.001)\n \nif orientation == 'down':\n for i in range(nb_step):\n stage.onestep(direction=stepper.BACKWARD, style=stepper.MICROSTEP)\n sleep(0.001)\n \nstage.release()\n\nmsg[\"topic\"] = \"focus\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg",
"outputs": 1,
"x": 1280,
"y": 260,
"wires": [
[
"7b23bbd5.4483d4"
]
]
},
{
"id": "21816a62.827a56",
"type": "python3-function",
"z": "bccd1f23.87219",
"name": "pump.py",
"func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\nkit = MotorKit()\n\npump_stepper = kit.stepper1\n\npump_stepper.release()\n\n \nif orientation == \"forward\":\n orientation=stepper.BACKWARD\nif orientation == \"backward\":\n orientation=stepper.FORWARD\n \nnb_step=volume*507 #if sleep(0.05) in between 2 steps\n#35000steps for 69g\n \n#nb_step=vol*460 if sleep(0) in between 2 steps\nduration=(volume*60)/flowrate\n \ndelay=(duration/nb_step)-0.005\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=orientation, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg",
"outputs": 1,
"x": 580,
"y": 220,
"wires": [
[
"90fc64b2.db5df8"
]
]
},
{
"id": "7b68bdbe.e57094",
"type": "function",
"z": "bccd1f23.87219",
"name": "pump.js",
"func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"manual_volume\");\nvar flowrate= global.get(\"flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n if(msg.topic === \"forward\" & state===\"free\"){\n volume = global.get(\"manual_volume\");\n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = global.get(\"flowrate\");\n msg.rgb = {r:0, g:255, b:255};\n msg.topic = \"Pump\"\n }\n if(msg.topic === \"backward\" & state===\"free\"){\n volume = global.get(\"manual_volume\");\n msg.volume = volume;\n msg.orientation = \"backward\";\n msg.flowrate = global.get(\"flowrate\");\n msg.rgb = {r:0, g:255, b:255};\n msg.topic = \"Pump\";\n }\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 280,
"y": 240,
"wires": [
[
"7994feb9.fcfc9"
]
],
"info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"
},
{
"id": "c0199136.20bd7",
"type": "link out",
"z": "bccd1f23.87219",
"name": "",
"links": [
"a208caf.0d23338",
"d17415a3.fca5c8"
],
"x": 1235,
"y": 220,
"wires": []
},
{
"id": "da53c4c2.6b17b8",
"type": "python3-function",
"z": "bccd1f23.87219",
"name": "actuate RGB",
"func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;",
"outputs": 1,
"x": 1490,
"y": 460,
"wires": [
[
"1276a75f.d8d1a9"
]
]
},
{
"id": "8778c73a.ddc6e8",
"type": "exec",
"z": "bccd1f23.87219",
"command": "i2cdetect -y 1",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "1",
"oldrc": false,
"name": "i2c update",
"x": 1830,
"y": 500,
"wires": [
[],
[],
[]
]
},
{
"id": "a208caf.0d23338",
"type": "link in",
"z": "bccd1f23.87219",
"name": "",
"links": [
"c0199136.20bd7",
"2dff3966.a5b2d6"
],
"x": 1375,
"y": 460,
"wires": [
[
"da53c4c2.6b17b8"
]
]
},
{
"id": "9b5cac2c.6de57",
"type": "python3-function",
"z": "bccd1f23.87219",
"name": "wait RGB",
"func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nreturn msg;",
"outputs": 1,
"x": 1480,
"y": 540,
"wires": [
[
"8479740e.6373c8"
]
]
},
{
"id": "7b23bbd5.4483d4",
"type": "link out",
"z": "bccd1f23.87219",
"name": "",
"links": [
"e4351408.b0b288",
"2bc762dd.1115ce",
"a50134c.ed45ac8"
],
"x": 1395,
"y": 260,
"wires": []
},
{
"id": "e4351408.b0b288",
"type": "link in",
"z": "bccd1f23.87219",
"name": "",
"links": [
"7b23bbd5.4483d4",
"90fc64b2.db5df8"
],
"x": 1375,
"y": 540,
"wires": [
[
"9b5cac2c.6de57"
]
]
},
{
"id": "2dff3966.a5b2d6",
"type": "link out",
"z": "bccd1f23.87219",
"name": "",
"links": [
"a208caf.0d23338",
"d17415a3.fca5c8"
],
"x": 535,
"y": 180,
"wires": []
},
{
"id": "90fc64b2.db5df8",
"type": "link out",
"z": "bccd1f23.87219",
"name": "",
"links": [
"e4351408.b0b288",
"2bc762dd.1115ce",
"a50134c.ed45ac8"
],
"x": 695,
"y": 220,
"wires": []
},
{
"id": "1276a75f.d8d1a9",
"type": "function",
"z": "bccd1f23.87219",
"name": "set busy",
"func": "global.set(\"state\",\"busy\");\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1640,
"y": 460,
"wires": [
[
"8778c73a.ddc6e8"
]
]
},
{
"id": "8479740e.6373c8",
"type": "function",
"z": "bccd1f23.87219",
"name": "set free",
"func": "global.set(\"state\",\"free\");\nreturn msg",
"outputs": 1,
"noerr": 0,
"x": 1640,
"y": 540,
"wires": [
[
"8778c73a.ddc6e8"
]
]
},
{
"id": "17a53f92.824d2",
"type": "ui_template",
"z": "baa1e3d9.cb29d",
"group": "567a49a4.244cb8",
"name": "Instrument",
"order": 2,
"width": 0,
"height": 0,
"format": "<div>\n Instrument :\n <span id=\"acq_instrument\">\n PlanktonScope V2.1\n </span>\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 150,
"y": 400,
"wires": [
[]
]
},
{
"id": "d2b74a01.166498",
"type": "ui_template",
"z": "baa1e3d9.cb29d",
"group": "567a49a4.244cb8",
"name": "Software",
"order": 3,
"width": 0,
"height": 0,
"format": "<div>\n Software :\n <span id=\"acq_software\">\n Node-RED Dashboard V2.0\n </span>\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 160,
"y": 440,
"wires": [
[]
]
},
{
"id": "a5c019f.91d15e8",
"type": "ui_template",
"z": "baa1e3d9.cb29d",
"group": "567a49a4.244cb8",
"name": "Camera",
"order": 1,
"width": 0,
"height": 0,
"format": "<div>\n Camera :\n <span id=\"acq_camera_name\">\n Pi Camera v2.1\n </span>\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 160,
"y": 480,
"wires": [
[]
]
},
{
"id": "f59a2f0d.5e9af",
"type": "ui_numeric",
"z": "baa1e3d9.cb29d",
"name": "acq_minimum_mesh",
"label": "Min fraction size (μm)",
"tooltip": "",
"group": "404c301a.19c4e",
"order": 2,
"width": 5,
"height": 1,
"wrap": false,
"passthru": true,
"topic": "acq_minimum_mesh",
"format": "{{value}}",
"min": 0,
"max": "300",
"step": "10",
"x": 120,
"y": 100,
"wires": [
[
"fb887036.12429"
]
]
},
{
"id": "6008a8bb.259f08",
"type": "ui_numeric",
"z": "baa1e3d9.cb29d",
"name": "acq_maximum_mesh",
"label": "Max fraction size (μm)",
"tooltip": "",
"group": "404c301a.19c4e",
"order": 3,
"width": 5,
"height": 1,
"wrap": false,
"passthru": true,
"topic": "acq_maximum_mesh",
"format": "{{value}}",
"min": "200",
"max": "2000",
"step": "100",
"x": 120,
"y": 160,
"wires": [
[
"fb887036.12429"
]
]
},
{
"id": "6b34c456.83178c",
"type": "ui_text_input",
"z": "baa1e3d9.cb29d",
"name": "acq_id",
"label": "Acquisition unique ID*",
"tooltip": "",
"group": "4322c187.e73e5",
"order": 2,
"width": 5,
"height": 1,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "acq_id",
"x": 170,
"y": 300,
"wires": [
[
"a39af546.4c30c8"
]
]
},
{
"id": "314ebbc0.040b84",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "store generic",
"func": "global.set(\"acq_instrument\",\"PlanktonScope V2.1\");\nglobal.set(\"acq_software\",\"Node-RED Dashboard\");\nglobal.set(\"acq_camera\",\"Pi Camera V2.1\");\nglobal.set(\"acq_instrument_ID\",\"copepode\");",
"outputs": 1,
"noerr": 0,
"x": 370,
"y": 80,
"wires": [
[]
]
},
{
"id": "109cf039.1ca8d",
"type": "ui_button",
"z": "baa1e3d9.cb29d",
"name": "cancel",
"group": "b7919ae2.c01788",
"order": 3,
"width": 4,
"height": 1,
"passthru": false,
"label": "Cancel Acquisition",
"tooltip": "",
"color": "#AD1625",
"bgcolor": "white",
"icon": "pause_circle_filled",
"payload": "stop",
"payloadType": "str",
"topic": "cancel",
"x": 570,
"y": 120,
"wires": [
[
"c339e7a4.7e7608",
"995fa523.83cba8"
]
]
},
{
"id": "dae10d44.76f08",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "pump.js",
"func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}",
"outputs": 1,
"noerr": 0,
"x": 1140,
"y": 560,
"wires": [
[
"d3ab1a14.86b8b8",
"ff805ffc.f9134"
]
],
"info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"
},
{
"id": "7789839d.69b48c",
"type": "ui_template",
"z": "eaae323a.31b3",
"group": "4e0cd5ea.17e59c",
"name": "Optic Configuration",
"order": 1,
"width": 4,
"height": 4,
"format": "<md-button ng-click=\"send({payload:'Optic Configuration'})\" style=\"height:100%;\">\n <i class=\"fa fa-eye fa-5x\"></i>\n <div style=\"margin-top:30px;\">Optic Configuration</div>\n</md-button>",
"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": "<md-button ng-click=\"send({payload:'Fluidic Acquisition'})\" style=\"height:100%;\">\n <i class=\"fa fa-flask fa-5x\"></i>\n <div style=\"margin-top:30px;\">Fluidic Acquisition</div>\n</md-button>",
"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": "<md-button ng-click=\"send({payload:'Segmentation'})\" style=\"height:100%;\">\n <i class=\"fa fa-crop fa-5x\"></i>\n <div style=\"margin-top:30px;\">Segmentation</div>\n</md-button>",
"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": "<md-button ng-click=\"send({payload:'Gallery'})\" style=\"height:100%;\">\n <i class=\"fa fa-file-image-o fa-5x\"></i>\n <div style=\"margin-top:30px;\">Gallery</div>\n</md-button>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 160,
"y": 220,
"wires": [
[
"2a65c3ec.49a6bc"
]
]
},
{
"id": "f37444ff.d17068",
"type": "ui_text_input",
"z": "bccd1f23.87219",
"name": "nb_step",
"label": "Number of step(s)",
"tooltip": "",
"group": "fbd92986.1028c8",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "nb_step",
"x": 820,
"y": 340,
"wires": [
[
"2f51f4e2.4dcaec"
]
]
},
{
"id": "811cd88c.daf528",
"type": "ui_button",
"z": "bccd1f23.87219",
"name": "down",
"group": "fbd92986.1028c8",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "arrow_downward",
"payload": "down",
"payloadType": "str",
"topic": "down",
"x": 830,
"y": 300,
"wires": [
[
"5b043fe6.df031"
]
]
},
{
"id": "edda4df4.76de2",
"type": "ui_button",
"z": "bccd1f23.87219",
"name": "up",
"group": "fbd92986.1028c8",
"order": 1,
"width": 0,
"height": 0,
"passthru": false,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "arrow_upwards",
"payload": "up",
"payloadType": "str",
"topic": "up",
"x": 830,
"y": 260,
"wires": [
[
"5b043fe6.df031"
]
]
},
{
"id": "bb667f4c.06e44",
"type": "link out",
"z": "bccd1f23.87219",
"name": "",
"links": [
"e4892a16.664bf8"
],
"x": 235,
"y": 300,
"wires": []
},
{
"id": "e4892a16.664bf8",
"type": "link in",
"z": "bccd1f23.87219",
"name": "",
"links": [
"bb667f4c.06e44",
"2f51f4e2.4dcaec",
"4a0baa98.618744"
],
"x": 1375,
"y": 400,
"wires": [
[
"dc48dc42.98d18"
]
]
},
{
"id": "2f51f4e2.4dcaec",
"type": "link out",
"z": "bccd1f23.87219",
"name": "",
"links": [
"e4892a16.664bf8"
],
"x": 975,
"y": 340,
"wires": []
},
{
"id": "68962547.34a67c",
"type": "ui_text_input",
"z": "bccd1f23.87219",
"name": "manual_volume",
"label": "Volume to pass (ml)",
"tooltip": "",
"group": "707d9797.c8e798",
"order": 3,
"width": 4,
"height": 1,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "manual_volume",
"x": 100,
"y": 340,
"wires": [
[
"4a0baa98.618744"
]
]
},
{
"id": "4a0baa98.618744",
"type": "link out",
"z": "bccd1f23.87219",
"name": "",
"links": [
"e4892a16.664bf8"
],
"x": 235,
"y": 340,
"wires": []
},
{
"id": "34c81624.df1cea",
"type": "ui_slider",
"z": "bccd1f23.87219",
"name": "flowrate",
"label": "Flowrate (ml/min)*",
"tooltip": "",
"group": "707d9797.c8e798",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "flowrate",
"min": 0,
"max": "20",
"step": "0.1",
"x": 120,
"y": 300,
"wires": [
[
"bb667f4c.06e44"
]
]
},
{
"id": "c1b1469.9650eb8",
"type": "ui_template",
"z": "eaae323a.31b3",
"group": "777a7c33.fcd804",
"name": "Settings",
"order": 1,
"width": 4,
"height": 4,
"format": "<md-button ng-click=\"send({payload:'Settings'})\" style=\"height:100%;\">\n <i class=\"fa fa-cogs fa-5x\"></i>\n <div style=\"margin-top:30px;\">Settings</div>\n</md-button>",
"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": "<md-button ng-click=\"send({payload:'Sample'})\" style=\"height:100%;\">\n <i class=\"fa fa-eyedropper fa-5x\"></i>\n <div style=\"margin-top:30px;\">Sample</div>\n</md-button>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 160,
"y": 60,
"wires": [
[
"2a65c3ec.49a6bc"
]
]
},
{
"id": "4557d689.a4fa88",
"type": "ui_text_input",
"z": "b771c342.49603",
"name": "sample_ship",
"label": "Name of the ship",
"tooltip": "",
"group": "3e1ba03d.f01d8",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "sample_ship",
"x": 190,
"y": 80,
"wires": [
[
"f37a955f.9eee88"
]
]
},
{
"id": "fcfc31ae.af3af",
"type": "ui_dropdown",
"z": "b771c342.49603",
"name": "sample_sampling_gear",
"label": "Sampling gear",
"tooltip": "",
"place": "Select",
"group": "3e1ba03d.f01d8",
"order": 5,
"width": 0,
"height": 0,
"passthru": true,
"options": [
{
"label": "Plankton net",
"value": "net",
"type": "str"
},
{
"label": "Niskin bottle 12L",
"value": "niskin_12L",
"type": "str"
},
{
"label": "Niskin bottle 24L",
"value": "niskin_24L",
"type": "str"
},
{
"label": "Pass Hull",
"value": "pass_hull",
"type": "str"
}
],
"payload": "",
"topic": "sample_sampling_gear",
"x": 150,
"y": 200,
"wires": [
[
"9f501f49.45645"
]
]
},
{
"id": "82c5fc77.59c97",
"type": "ui_text_input",
"z": "b771c342.49603",
"name": "sample_operator",
"label": "Name of the operator",
"tooltip": "",
"group": "3e1ba03d.f01d8",
"order": 4,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "sample_operator",
"x": 170,
"y": 160,
"wires": [
[
"f37a955f.9eee88"
]
]
},
{
"id": "9c882b37.fde668",
"type": "ui_text_input",
"z": "b771c342.49603",
"name": "sample_project",
"label": "Name of the project*",
"tooltip": "",
"group": "3e1ba03d.f01d8",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "sample_project",
"x": 180,
"y": 40,
"wires": [
[
"f37a955f.9eee88"
]
]
},
{
"id": "94eb4221.9b92c",
"type": "ui_text_input",
"z": "b771c342.49603",
"name": "sample_id",
"label": "ID of the station*",
"tooltip": "",
"group": "3e1ba03d.f01d8",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "sample_id",
"x": 190,
"y": 120,
"wires": [
[
"f37a955f.9eee88"
]
]
},
{
"id": "f37a955f.9eee88",
"type": "function",
"z": "b771c342.49603",
"name": "set global join",
"func": "var value = msg.payload.split(' ').join('_');\nvar key = msg.topic;\n\nglobal.set(key,value);",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 40,
"wires": [
[]
]
},
{
"id": "9f501f49.45645",
"type": "function",
"z": "b771c342.49603",
"name": "set global",
"func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);",
"outputs": 1,
"noerr": 0,
"x": 400,
"y": 200,
"wires": [
[]
]
},
{
"id": "cc0ca68b.4263a8",
"type": "ui_dropdown",
"z": "baa1e3d9.cb29d",
"name": "acq_celltype",
"label": "Thickness flowcell*",
"tooltip": "",
"place": "Select option",
"group": "404c301a.19c4e",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"options": [
{
"label": "200 μm µ-Slide I Luer",
"value": 200,
"type": "num"
},
{
"label": "400 μm µ-Slide I Luer",
"value": 400,
"type": "num"
},
{
"label": "600 μm µ-Slide I Luer",
"value": 600,
"type": "num"
},
{
"label": "800 μm µ-Slide I Luer",
"value": 800,
"type": "num"
}
],
"payload": "",
"topic": "acq_celltype",
"x": 150,
"y": 40,
"wires": [
[
"fb887036.12429",
"314ebbc0.040b84"
]
]
},
{
"id": "fb887036.12429",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "set global",
"func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);",
"outputs": 1,
"noerr": 0,
"x": 360,
"y": 40,
"wires": [
[]
]
},
{
"id": "222c851d.5d0a3a",
"type": "ui_ui_control",
"z": "b771c342.49603",
"name": "",
"events": "change",
"x": 360,
"y": 480,
"wires": [
[]
]
},
{
"id": "52f6b103.1efb6",
"type": "ui_toast",
"z": "b771c342.49603",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 790,
"y": 580,
"wires": [
[]
]
},
{
"id": "986d960a.c75908",
"type": "function",
"z": "b771c342.49603",
"name": "Check form",
"func": "var sample_project= global.get(\"sample_project\");\nvar sample_ship= global.get(\"sample_ship\");\nvar sample_id= global.get(\"sample_id\");\nvar sample_operator= global.get(\"sample_operator\");\nvar sample_sampling_gear= global.get(\"sample_sampling_gear\");\nvar object_lat= global.get(\"object_lat\");\nvar object_lon= global.get(\"object_lon\");\nvar sample_day= global.get(\"sample_day\");\nvar sample_hour= global.get(\"sample_hour\");\n\nif (sample_project === undefined || sample_project === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample project\"\n}\n\nelse if (sample_ship === undefined || sample_ship === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ship\"\n}\n\nelse if (sample_id === undefined || sample_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ID\"\n}\n\nelse if (sample_operator === undefined || sample_operator === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample operator\"\n}\n\nelse if (sample_sampling_gear === undefined || sample_sampling_gear === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample sampling gear\"\n}\n\nelse if (object_lat === undefined || object_lat === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample latitude\"\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample longitude\"\n}\n\nelse if (sample_day === undefined || sample_day === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date\"\n}\n\nelse if (sample_hour === undefined || sample_hour === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time\"\n}\n\nelse {\n msg.topic = \"Change Tab\"\n msg.payload={\"tab\":\"Optic Configuration\"};\n}\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 370,
"y": 540,
"wires": [
[
"f5e66a2f.0d09d8"
]
]
},
{
"id": "18f44504.cac66b",
"type": "gpsd",
"z": "b771c342.49603",
"name": "",
"hostname": "localhost",
"port": "2947",
"tpv": true,
"sky": false,
"info": false,
"device": false,
"gst": false,
"att": false,
"x": 630,
"y": 40,
"wires": [
[]
]
},
{
"id": "726a7822.cd6298",
"type": "ui_ui_control",
"z": "b771c342.49603",
"name": "",
"events": "change",
"x": 780,
"y": 520,
"wires": [
[]
]
},
{
"id": "f5e66a2f.0d09d8",
"type": "switch",
"z": "b771c342.49603",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Change Tab",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 550,
"y": 540,
"wires": [
[
"726a7822.cd6298"
],
[
"52f6b103.1efb6"
]
]
},
{
"id": "2d128018.6a809",
"type": "ui_text_input",
"z": "b771c342.49603",
"name": "object_lat",
"label": "Lattitude (decimal degrees)",
"tooltip": "",
"group": "cef1e703.bcf3c8",
"order": 1,
"width": 12,
"height": 1,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "object_lat",
"x": 200,
"y": 260,
"wires": [
[
"9f501f49.45645"
]
]
},
{
"id": "4626c0da.e0dd5",
"type": "ui_text_input",
"z": "b771c342.49603",
"name": "object_lon",
"label": "Longitude (decimal degrees)",
"tooltip": "",
"group": "cef1e703.bcf3c8",
"order": 2,
"width": 12,
"height": 1,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "object_lon",
"x": 190,
"y": 300,
"wires": [
[
"9f501f49.45645"
]
]
},
{
"id": "f00f321f.77d76",
"type": "ui_date_picker",
"z": "b771c342.49603",
"name": "",
"label": "Date",
"group": "cef1e703.bcf3c8",
"order": 4,
"width": 12,
"height": 1,
"passthru": true,
"topic": "",
"x": 210,
"y": 340,
"wires": [
[
"3dba84a2.0de1bc"
]
]
},
{
"id": "207fbdbb.2fe2a2",
"type": "ui_text_input",
"z": "b771c342.49603",
"name": "",
"label": "Time :",
"tooltip": "",
"group": "cef1e703.bcf3c8",
"order": 3,
"width": 7,
"height": 1,
"passthru": true,
"mode": "time",
"delay": 300,
"topic": "",
"x": 210,
"y": 380,
"wires": [
[
"61f9d7df.83ffe8"
]
]
},
{
"id": "61f9d7df.83ffe8",
"type": "function",
"z": "b771c342.49603",
"name": "set time global",
"func": "var dt = new Date(msg.payload);\nglobal.set('sample_hour',dt.getHours()-1);\nglobal.set('sample_min',dt.getMinutes());",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 380,
"wires": [
[]
]
},
{
"id": "3dba84a2.0de1bc",
"type": "function",
"z": "b771c342.49603",
"name": "set date global",
"func": "var dt = new Date(msg.payload);\n\nglobal.set('sample_month',dt.getMonth() + 1);\nglobal.set('sample_day',dt.getDate());\nglobal.set('sample_year',dt.getFullYear());\n",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 340,
"wires": [
[]
]
},
{
"id": "6c792043.b6ff9",
"type": "ui_ui_control",
"z": "bccd1f23.87219",
"name": "",
"events": "change",
"x": 700,
"y": 520,
"wires": [
[]
]
},
{
"id": "902429eb.ceacb8",
"type": "ui_toast",
"z": "bccd1f23.87219",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 930,
"y": 620,
"wires": [
[]
]
},
{
"id": "fe840e05.b46f3",
"type": "function",
"z": "bccd1f23.87219",
"name": "Check form",
"func": "var acq_fnumber_objective= global.get(\"acq_fnumber_objective\");\n\nif (acq_fnumber_objective === undefined || acq_fnumber_objective === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Focal Length of the objective\"\n}\n\nelse {\n msg.topic = \"Change Tab\"\n msg.payload={\"tab\":\"Fluidic Acquisition\"};\n}\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 510,
"y": 580,
"wires": [
[
"652d812a.7d808"
]
]
},
{
"id": "f58a0c4.e207df",
"type": "ui_ui_control",
"z": "bccd1f23.87219",
"name": "",
"events": "change",
"x": 920,
"y": 560,
"wires": [
[]
]
},
{
"id": "652d812a.7d808",
"type": "switch",
"z": "bccd1f23.87219",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Change Tab",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 690,
"y": 580,
"wires": [
[
"f58a0c4.e207df"
],
[
"902429eb.ceacb8"
]
]
},
{
"id": "5846b1d4.7971b",
"type": "ui_button",
"z": "bccd1f23.87219",
"name": "backward",
"group": "707d9797.c8e798",
"order": 2,
"width": 5,
"height": 1,
"passthru": false,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "arrow_back",
"payload": "backward",
"payloadType": "str",
"topic": "backward",
"x": 120,
"y": 220,
"wires": [
[
"7b68bdbe.e57094"
]
]
},
{
"id": "2cab680b.baf888",
"type": "ui_button",
"z": "bccd1f23.87219",
"name": "foward",
"group": "707d9797.c8e798",
"order": 4,
"width": 5,
"height": 1,
"passthru": true,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "arrow_forward",
"payload": "forward",
"payloadType": "str",
"topic": "forward",
"x": 130,
"y": 260,
"wires": [
[
"7b68bdbe.e57094"
]
]
},
{
"id": "961d27e7.da65c8",
"type": "ui_switch",
"z": "bccd1f23.87219",
"name": "light_state",
"label": "Light",
"tooltip": "",
"group": "4248342d.e55fac",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"x": 90,
"y": 40,
"wires": [
[
"cbb8afed.0a026"
]
],
"icon": "font-awesome/fa-lightbulb-o"
},
{
"id": "cc966678.da8d08",
"type": "ui_dropdown",
"z": "bccd1f23.87219",
"name": "acq_fnumber_objective",
"label": "M12 Lens*",
"tooltip": "",
"place": "Select option",
"group": "4248342d.e55fac",
"order": 2,
"width": 0,
"height": 0,
"passthru": true,
"options": [
{
"label": "f 25mm 1/2\" 5MP IR",
"value": 25,
"type": "num"
},
{
"label": "f 16mm 1/2.5\" 5MP IR",
"value": 16,
"type": "num"
},
{
"label": "f 12mm 1/2.5\" 5MP IR",
"value": 12,
"type": "num"
},
{
"label": "f 8mm 1/2.5\" 5MP IR",
"value": 8,
"type": "num"
},
{
"label": "f 6mm 1/2.5\" 5MP IR",
"value": 6,
"type": "num"
}
],
"payload": "",
"topic": "acq_fnumber_objective",
"x": 870,
"y": 40,
"wires": [
[
"8038414a.34461"
]
]
},
{
"id": "9b515beb.4aea48",
"type": "ui_template",
"z": "bccd1f23.87219",
"group": "4248342d.e55fac",
"name": "Magnification",
"order": 3,
"width": 0,
"height": 0,
"format": "<div>\n Magnification : X\n <span id=\"obj_magnification\" ng-bind-html=\"msg.payload\">\n </span>\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 1430,
"y": 40,
"wires": [
[]
]
},
{
"id": "8038414a.34461",
"type": "function",
"z": "bccd1f23.87219",
"name": "calculate",
"func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1060,
"y": 40,
"wires": [
[
"ad87820f.b1d1e",
"d68a52ee.82e8e",
"238f26b1.e2089a",
"6e0f6d36.a6b854"
]
]
},
{
"id": "eca088f.6ceed78",
"type": "ui_template",
"z": "bccd1f23.87219",
"group": "4248342d.e55fac",
"name": "Pi Camera settings",
"order": 7,
"width": 0,
"height": 0,
"format": "<button style=\"height: 50px;\" class=\"md-raised md-button md-ink-ripple\" type=\"button\" onclick=\"window.location.href = 'http://127.0.0.1/html/';\">Pi Camera settings</button>\n",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 850,
"y": 100,
"wires": [
[]
]
},
{
"id": "3d2360ad.e41e7",
"type": "ui_template",
"z": "bccd1f23.87219",
"group": "4248342d.e55fac",
"name": "process_pixel",
"order": 4,
"width": 0,
"height": 0,
"format": "<div>\n Pixel resolution :\n <span id=\"process_pixel\" ng-bind-html=\"msg.payload\"></span>\n μm\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 1440,
"y": 80,
"wires": [
[]
]
},
{
"id": "8e66977b.9166a8",
"type": "ui_template",
"z": "bccd1f23.87219",
"group": "4248342d.e55fac",
"name": "min_size",
"order": 5,
"width": 0,
"height": 0,
"format": "<div>\n Smallest cells to explore :\n <span id=\"min_size\" ng-bind-html=\"msg.payload\"></span>\n μm\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 1420,
"y": 120,
"wires": [
[]
]
},
{
"id": "26b32f2c.c64fc",
"type": "ui_template",
"z": "bccd1f23.87219",
"group": "4248342d.e55fac",
"name": "max_size",
"order": 6,
"width": 0,
"height": 0,
"format": "<div>\n Biggest cells to explore :\n <span id=\"max_size\" ng-bind-html=\"msg.payload\"></span>\n μm\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 1420,
"y": 160,
"wires": [
[]
]
},
{
"id": "ad87820f.b1d1e",
"type": "function",
"z": "bccd1f23.87219",
"name": "get magnification",
"func": "var magnification = global.get(\"magnification\");\nmsg.payload = magnification;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1250,
"y": 40,
"wires": [
[
"9b515beb.4aea48"
]
]
},
{
"id": "d68a52ee.82e8e",
"type": "function",
"z": "bccd1f23.87219",
"name": "get process_pixel",
"func": "var process_pixel = global.get(\"process_pixel\");\nmsg.payload = process_pixel;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1250,
"y": 80,
"wires": [
[
"3d2360ad.e41e7"
]
]
},
{
"id": "238f26b1.e2089a",
"type": "function",
"z": "bccd1f23.87219",
"name": "get sug_min",
"func": "var sug_min = global.get(\"sug_min\");\nmsg.payload = sug_min;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1230,
"y": 120,
"wires": [
[
"8e66977b.9166a8"
]
]
},
{
"id": "6e0f6d36.a6b854",
"type": "function",
"z": "bccd1f23.87219",
"name": "get sug_max",
"func": "var sug_max = global.get(\"sug_max\");\nmsg.payload = sug_max;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1230,
"y": 160,
"wires": [
[
"26b32f2c.c64fc"
]
]
},
{
"id": "bb2bb7ce.1d1458",
"type": "ui_template",
"z": "baa1e3d9.cb29d",
"group": "858a0e3c.987fe",
"name": "Stream Pi Camera",
"order": 1,
"width": 14,
"height": 11,
"format": "<center><iframe id=\"inlineFrameExample\"\n title=\"Inline Frame Example\"\n height=\"600\"\n width=\"800\"\n frameborder=\"0\"\n src=\"http://localhost/html/min.php\">\n</iframe></center>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 590,
"y": 40,
"wires": [
[]
]
},
{
"id": "d0c5b57d.590818",
"type": "ui_ui_control",
"z": "baa1e3d9.cb29d",
"name": "",
"events": "change",
"x": 700,
"y": 80,
"wires": [
[]
]
},
{
"id": "2fb129de.024a06",
"type": "ui_toast",
"z": "baa1e3d9.cb29d",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 650,
"y": 540,
"wires": [
[]
]
},
{
"id": "61b4993e.1f3fb8",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "Check form",
"func": "var acq_celltype= global.get(\"acq_celltype\");\nvar acq_minimum_mesh= global.get(\"acq_minimum_mesh\");\nvar acq_maximum_mesh= global.get(\"acq_maximum_mesh\");\nvar acq_volume= global.get(\"acq_volume\");\nvar acq_id= global.get(\"acq_id\");\n\nif (acq_celltype === undefined || acq_celltype === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Type of the flowcell\"\n}\nelse if (acq_minimum_mesh === undefined || acq_minimum_mesh === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Lower fraction size\"\n}\nelse if (acq_maximum_mesh === undefined || acq_maximum_mesh === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Upper fraction size\"\n}\nelse if (acq_volume === undefined || acq_volume === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to image\"\n}\nelse if (acq_id === undefined || acq_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Acquisition ID\"\n}\nelse {\n msg.topic = \"Start\";\n}\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 730,
"y": 280,
"wires": [
[
"9e7bd689.f9c278"
]
]
},
{
"id": "9e7bd689.f9c278",
"type": "switch",
"z": "baa1e3d9.cb29d",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Start",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 870,
"y": 280,
"wires": [
[
"f7fa6acf.f6ed28"
],
[
"2fb129de.024a06"
]
]
},
{
"id": "16de754c.cc969b",
"type": "ui_button",
"z": "b771c342.49603",
"name": "",
"group": "5517c651.b2f668",
"order": 1,
"width": 12,
"height": 1,
"passthru": false,
"label": "Previous",
"tooltip": "",
"color": "#097479",
"bgcolor": "white",
"icon": "keyboard_return",
"payload": "{\"tab\":\"Home\"}",
"payloadType": "json",
"topic": "",
"x": 220,
"y": 480,
"wires": [
[
"222c851d.5d0a3a"
]
]
},
{
"id": "84f3d040.5f7ea",
"type": "ui_button",
"z": "b771c342.49603",
"name": "",
"group": "5517c651.b2f668",
"order": 2,
"width": 12,
"height": 1,
"passthru": false,
"label": "Continue",
"tooltip": "",
"color": "#097479",
"bgcolor": "white",
"icon": "keyboard_tab",
"payload": "{\"tab\":\"Home\"}",
"payloadType": "json",
"topic": "",
"x": 220,
"y": 540,
"wires": [
[
"986d960a.c75908"
]
]
},
{
"id": "f61aaed5.1e64",
"type": "ui_button",
"z": "bccd1f23.87219",
"name": "",
"group": "7a0b4877.a5d268",
"order": 1,
"width": 5,
"height": 1,
"passthru": false,
"label": "Previous",
"tooltip": "",
"color": "#097479",
"bgcolor": "white",
"icon": "keyboard_return",
"payload": "{\"tab\":\"Sample\"}",
"payloadType": "json",
"topic": "",
"x": 360,
"y": 520,
"wires": [
[
"6c792043.b6ff9"
]
]
},
{
"id": "9ba6ec0a.22c96",
"type": "ui_button",
"z": "bccd1f23.87219",
"name": "",
"group": "7a0b4877.a5d268",
"order": 2,
"width": 5,
"height": 1,
"passthru": false,
"label": "Continue",
"tooltip": "",
"color": "#097479",
"bgcolor": "white",
"icon": "keyboard_tab",
"payload": "{\"tab\":\"Home\"}",
"payloadType": "json",
"topic": "",
"x": 360,
"y": 580,
"wires": [
[
"fe840e05.b46f3"
]
]
},
{
"id": "c72f8fae.23bd4",
"type": "ui_button",
"z": "baa1e3d9.cb29d",
"name": "",
"group": "b7919ae2.c01788",
"order": 2,
"width": 5,
"height": 1,
"passthru": false,
"label": "Previous",
"tooltip": "",
"color": "#097479",
"bgcolor": "white",
"icon": "keyboard_return",
"payload": "{\"tab\":\"Optic Configuration\"}",
"payloadType": "json",
"topic": "",
"x": 560,
"y": 80,
"wires": [
[
"d0c5b57d.590818"
]
]
},
{
"id": "cf48a0b9.7f208",
"type": "ui_button",
"z": "baa1e3d9.cb29d",
"name": "",
"group": "b7919ae2.c01788",
"order": 5,
"width": 0,
"height": 0,
"passthru": false,
"label": "Start",
"tooltip": "",
"color": "#097479",
"bgcolor": "white",
"icon": "keyboard_tab",
"payload": "{\"tab\":\"Home\"}",
"payloadType": "json",
"topic": "",
"x": 570,
"y": 280,
"wires": [
[
"61b4993e.1f3fb8"
]
]
},
{
"id": "389bef3.d94c61",
"type": "ui_text_input",
"z": "baa1e3d9.cb29d",
"name": "acq_volume",
"label": "Volume to pass (ml)",
"tooltip": "",
"group": "4322c187.e73e5",
"order": 1,
"width": 5,
"height": 1,
"passthru": true,
"mode": "number",
"delay": 300,
"topic": "acq_volume",
"x": 150,
"y": 220,
"wires": [
[
"fb887036.12429"
]
]
},
{
"id": "a39af546.4c30c8",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "set global join",
"func": "var value = msg.payload.split(' ').join('_');\nvar key = msg.topic;\n\nglobal.set(key,value);",
"outputs": 1,
"noerr": 0,
"x": 380,
"y": 280,
"wires": [
[]
]
},
{
"id": "75b738f0.cea208",
"type": "ui_toast",
"z": "bccd1f23.87219",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 1290,
"y": 320,
"wires": [
[]
]
},
{
"id": "e7f18662.70dcf8",
"type": "switch",
"z": "bccd1f23.87219",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Focus",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1130,
"y": 280,
"wires": [
[
"c0199136.20bd7",
"8c19fb64.8a1828"
],
[
"75b738f0.cea208"
]
]
},
{
"id": "c2aeba5f.a2ac98",
"type": "ui_toast",
"z": "bccd1f23.87219",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 590,
"y": 280,
"wires": [
[]
]
},
{
"id": "7994feb9.fcfc9",
"type": "switch",
"z": "bccd1f23.87219",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Pump",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 430,
"y": 240,
"wires": [
[
"21816a62.827a56",
"2dff3966.a5b2d6"
],
[
"c2aeba5f.a2ac98"
]
]
},
{
"id": "201ad81d.4a6d78",
"type": "http request",
"z": "baa1e3d9.cb29d",
"name": "Start timelapse",
"method": "GET",
"ret": "txt",
"paytoqs": false,
"url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%201",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 980,
"y": 800,
"wires": [
[]
]
},
{
"id": "c339e7a4.7e7608",
"type": "http request",
"z": "baa1e3d9.cb29d",
"name": "Stop timelapse",
"method": "GET",
"ret": "txt",
"paytoqs": false,
"url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%200",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 720,
"y": 120,
"wires": [
[
"eaab9f19.c68ba"
]
]
},
{
"id": "b4d324de.a2bd28",
"type": "ui_worldmap",
"z": "b771c342.49603",
"group": "cef1e703.bcf3c8",
"order": 6,
"width": 0,
"height": 0,
"name": "",
"lat": "1.5",
"lon": "1.5",
"zoom": "4",
"layer": "OSM grey",
"cluster": "1",
"maxage": "",
"usermenu": "hide",
"layers": "hide",
"panit": "false",
"panlock": "false",
"zoomlock": "false",
"hiderightclick": "true",
"coords": "deg",
"showgrid": "false",
"path": "/worldmap",
"x": 780,
"y": 400,
"wires": []
},
{
"id": "cf3e1477.25af68",
"type": "function",
"z": "b771c342.49603",
"name": "set point",
"func": "var sample_id= global.get(\"sample_id\");\nvar object_lat= global.get(\"object_lat\");\nvar object_lon= global.get(\"object_lon\");\n\nif (sample_id === undefined || sample_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ID\"\n}\nelse if (object_lat === undefined || object_lat === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample latitude\"\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample longitude\"\n}\n\nelse {\n msg.topic = \"Place\"\n msg.payload={\"name\":sample_id, \"lat\":object_lat, \"lon\":object_lon}\n}\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 360,
"y": 440,
"wires": [
[
"105e9b1b.725865"
]
]
},
{
"id": "d7a44df2.0fb29",
"type": "ui_button",
"z": "b771c342.49603",
"name": "",
"group": "cef1e703.bcf3c8",
"order": 5,
"width": 5,
"height": 1,
"passthru": false,
"label": "Place",
"tooltip": "",
"color": "#333333",
"bgcolor": "white",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 210,
"y": 440,
"wires": [
[
"cf3e1477.25af68"
]
]
},
{
"id": "105e9b1b.725865",
"type": "switch",
"z": "b771c342.49603",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Place",
"vt": "str"
},
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 550,
"y": 440,
"wires": [
[
"b4d324de.a2bd28"
],
[
"10c9c12a.feae6f"
]
]
},
{
"id": "10c9c12a.feae6f",
"type": "ui_toast",
"z": "b771c342.49603",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 790,
"y": 460,
"wires": [
[]
]
},
{
"id": "32f57168.89cbae",
"type": "comment",
"z": "baa1e3d9.cb29d",
"name": "generic info",
"info": "",
"x": 150,
"y": 360,
"wires": []
},
{
"id": "44094d9d.62c6c4",
"type": "exec",
"z": "baa1e3d9.cb29d",
"command": "i2cdetect -y 1",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "1",
"oldrc": false,
"name": "i2c update",
"x": 1170,
"y": 120,
"wires": [
[],
[],
[]
]
},
{
"id": "eaab9f19.c68ba",
"type": "python3-function",
"z": "baa1e3d9.cb29d",
"name": "wait RGB",
"func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nreturn msg;",
"outputs": 1,
"x": 880,
"y": 120,
"wires": [
[
"154d5ce1.81ed03"
]
]
},
{
"id": "154d5ce1.81ed03",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "set free",
"func": "global.set(\"state\",\"free\");\nreturn msg",
"outputs": 1,
"noerr": 0,
"x": 1020,
"y": 120,
"wires": [
[
"44094d9d.62c6c4"
]
]
},
{
"id": "f07dec1d.147ce",
"type": "ui_text_input",
"z": "baa1e3d9.cb29d",
"name": "comment",
"label": "Comment",
"tooltip": "",
"group": "b7919ae2.c01788",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "comment",
"x": 160,
"y": 260,
"wires": [
[
"fb887036.12429"
]
]
},
{
"id": "8bd55b54.8e3938",
"type": "file",
"z": "baa1e3d9.cb29d",
"name": "logs.json",
"filename": "/var/www/logs.json",
"appendNewline": false,
"createDir": false,
"overwriteFile": "false",
"encoding": "none",
"x": 2000,
"y": 1340,
"wires": [
[
"20a2d27e.7ccafe"
]
]
},
{
"id": "99fd2803.0843a8",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "get global",
"func": "msg.payload = {\n \"comment\":global.get(\"comment\"),\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"sample_hour\":global.get(\"sample_hour\"),\n \"sample_minute\":global.get(\"sample_minute\"),\n \"sample_day\":global.get(\"sample_day\"),\n \"sample_month\":global.get(\"sample_month\"),\n \"sample_year\":global.get(\"sample_year\"),\n \n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \n \"acq_camera\":global.get(\"acq_camera\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_instrument_ID\":global.get(\"acq_instrument_ID\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_flowrate\":global.get(\"sug_flowrate\")\n }\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1820,
"y": 1340,
"wires": [
[
"8bd55b54.8e3938"
]
]
},
{
"id": "ae692178.d44d1",
"type": "python3-function",
"z": "baa1e3d9.cb29d",
"name": "pump.py",
"func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg",
"outputs": 1,
"x": 1240,
"y": 1260,
"wires": [
[
"783209c7.51c5a8"
]
]
},
{
"id": "a3fd6b29.2ef5f8",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "pump.js",
"func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}",
"outputs": 1,
"noerr": 0,
"x": 1040,
"y": 1360,
"wires": [
[
"ae692178.d44d1",
"e0f9efda.fa4ce"
]
],
"info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"
},
{
"id": "e0f9efda.fa4ce",
"type": "python3-function",
"z": "baa1e3d9.cb29d",
"name": "actuate RGB",
"func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;",
"outputs": 1,
"x": 1250,
"y": 1200,
"wires": [
[
"3b498e72.6e6292"
]
]
},
{
"id": "7baf5071.dc3b2",
"type": "exec",
"z": "baa1e3d9.cb29d",
"command": "i2cdetect -y 1",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "1",
"oldrc": false,
"name": "i2c update",
"x": 1570,
"y": 1200,
"wires": [
[],
[],
[]
]
},
{
"id": "783209c7.51c5a8",
"type": "link out",
"z": "baa1e3d9.cb29d",
"name": "",
"links": [
"e1354861.0bb648",
"2bc762dd.1115ce",
"a50134c.ed45ac8",
"f0ef065a.362028"
],
"x": 1335,
"y": 1260,
"wires": []
},
{
"id": "3b498e72.6e6292",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "set busy",
"func": "global.set(\"state\",\"busy\");\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1420,
"y": 1200,
"wires": [
[
"7baf5071.dc3b2"
]
]
},
{
"id": "cd56bb1c.8ce378",
"type": "ui_toast",
"z": "baa1e3d9.cb29d",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 1010,
"y": 1200,
"wires": [
[]
]
},
{
"id": "c82e467c.99e208",
"type": "switch",
"z": "baa1e3d9.cb29d",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Missing entry :",
"vt": "str"
},
{
"t": "eq",
"v": "Start",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 850,
"y": 1220,
"wires": [
[
"cd56bb1c.8ce378"
],
[
"a3fd6b29.2ef5f8",
"a642fc0b.b6dd7"
]
]
},
{
"id": "c6bd5987.c48f78",
"type": "http request",
"z": "baa1e3d9.cb29d",
"name": "Start timelapse",
"method": "GET",
"ret": "txt",
"paytoqs": false,
"url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%201",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 1100,
"y": 1600,
"wires": [
[]
]
},
{
"id": "8c15fd05.81b5",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "get duration acquisition",
"func": "msg.delay = global.get(\"duration\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1290,
"y": 1360,
"wires": [
[
"2ff9c0cb.7288b",
"34929df1.bfe602"
]
]
},
{
"id": "2ff9c0cb.7288b",
"type": "delay",
"z": "baa1e3d9.cb29d",
"name": "wait duration",
"pauseType": "delayv",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1510,
"y": 1360,
"wires": [
[
"99fd2803.0843a8",
"3475ecd5.6655f4",
"8f991d2e.6e8f3",
"e6a12f33.c7768"
]
]
},
{
"id": "a642fc0b.b6dd7",
"type": "delay",
"z": "baa1e3d9.cb29d",
"name": "",
"pauseType": "delay",
"timeout": "500",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 810,
"y": 1540,
"wires": [
[
"c6bd5987.c48f78",
"8c15fd05.81b5"
]
]
},
{
"id": "6aaa3bc6.b7dda4",
"type": "ui_gauge",
"z": "baa1e3d9.cb29d",
"name": "",
"group": "b5d61bc7.54fe48",
"order": 1,
"width": 10,
"height": 2,
"gtype": "donut",
"title": "",
"label": "%",
"format": "{{value}}",
"min": 0,
"max": "100",
"colors": [
"#ffffff",
"#ffffff",
"#097479"
],
"seg1": "",
"seg2": "",
"x": 2250,
"y": 1500,
"wires": []
},
{
"id": "34929df1.bfe602",
"type": "trigger",
"z": "baa1e3d9.cb29d",
"op1": "1",
"op2": "0",
"op1type": "str",
"op2type": "str",
"duration": "-1",
"extend": false,
"units": "s",
"reset": "done",
"bytopic": "all",
"name": "",
"x": 1960,
"y": 1600,
"wires": [
[
"e98903d2.f35c1"
]
]
},
{
"id": "3475ecd5.6655f4",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "stop",
"func": "global.set(\"time_to_wait\",0);\nmsg.payload=\"done\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1810,
"y": 1500,
"wires": [
[
"34929df1.bfe602",
"6aaa3bc6.b7dda4"
]
]
},
{
"id": "e98903d2.f35c1",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "pulse",
"func": "var time_to_wait= global.get(\"time_to_wait\");\n\nif (time_to_wait === undefined || time_to_wait === \"\"|| time_to_wait == NaN) {\n time_to_wait=0\n global.set(\"time_to_wait\",time_to_wait);\n}else {\n time_to_wait++;\n global.set(\"time_to_wait\",time_to_wait);\n duration=global.get(\"duration\")/1000;\n percent=(100* time_to_wait/duration).toFixed(0)\n msg.payload=percent;\n return msg;\n \n}",
"outputs": 1,
"noerr": 0,
"x": 2110,
"y": 1600,
"wires": [
[
"6aaa3bc6.b7dda4"
]
]
},
{
"id": "f0ef065a.362028",
"type": "link in",
"z": "baa1e3d9.cb29d",
"name": "",
"links": [
"a61d4164.135dd",
"783209c7.51c5a8",
"260e60f3.878ad",
"c5ee25c5.3c1848"
],
"x": 1635,
"y": 1560,
"wires": [
[
"3475ecd5.6655f4"
]
]
},
{
"id": "8f991d2e.6e8f3",
"type": "exec",
"z": "baa1e3d9.cb29d",
"command": "ls -l /var/www/html/media | grep \"th\" | tail -1 | awk -F \" \" '{print $9}' | awk -F \"_\" '{print $1\"_\"$2}'| tr -d \"\\n\"",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "get thumbail name",
"x": 1850,
"y": 1280,
"wires": [
[
"9dcdbf1f.4aa21"
],
[],
[]
]
},
{
"id": "e6a12f33.c7768",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "mkdir",
"func": "acq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/\"+acq_id\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1770,
"y": 1140,
"wires": [
[
"43c69256.b9633c"
]
]
},
{
"id": "43c69256.b9633c",
"type": "exec",
"z": "baa1e3d9.cb29d",
"command": "mkdir",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "mkdir acq_id",
"x": 1910,
"y": 1140,
"wires": [
[],
[],
[]
]
},
{
"id": "517f13e8.e0793c",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "move",
"func": "file_prefix=msg.payload;\nacq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/html/media/\"+file_prefix+\"* /var/www/\"+acq_id+\"/\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 2330,
"y": 1240,
"wires": [
[
"83a1d49e.a29a48"
]
]
},
{
"id": "9dcdbf1f.4aa21",
"type": "delay",
"z": "baa1e3d9.cb29d",
"name": "",
"pauseType": "delay",
"timeout": "200",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 2090,
"y": 1260,
"wires": [
[
"517f13e8.e0793c"
]
]
},
{
"id": "83a1d49e.a29a48",
"type": "exec",
"z": "baa1e3d9.cb29d",
"command": "mv",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 2480,
"y": 1260,
"wires": [
[],
[],
[]
]
},
{
"id": "20a2d27e.7ccafe",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "move",
"func": "file_prefix=msg.payload;\nacq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/logs.json /var/www/\"+acq_id+\"/\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 2330,
"y": 1320,
"wires": [
[
"87cff57.f6d3708"
]
]
},
{
"id": "87cff57.f6d3708",
"type": "exec",
"z": "baa1e3d9.cb29d",
"command": "mv",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 2480,
"y": 1340,
"wires": [
[],
[],
[]
]
},
{
"id": "d91229e3.bf0f18",
"type": "while-loop",
"z": "baa1e3d9.cb29d",
"name": "",
"condi": "global.get(\"job\")===\"run\"",
"x": 1330,
"y": 200,
"wires": [
[
"427871db.b4902",
"a61b71c3.afaf"
],
[
"427871db.b4902",
"a61b71c3.afaf"
]
]
},
{
"id": "217ff214.a25c2e",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "Run",
"func": "global.set(\"job\",\"run\")\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1030,
"y": 220,
"wires": [
[
"d91229e3.bf0f18"
]
]
},
{
"id": "995fa523.83cba8",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "Stop",
"func": "global.set(\"job\",\"stop\")\nmsg.payload=\"stop\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1030,
"y": 180,
"wires": [
[
"d91229e3.bf0f18"
]
]
},
{
"id": "d3ab1a14.86b8b8",
"type": "python3-function",
"z": "baa1e3d9.cb29d",
"name": "pump.py",
"func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg",
"outputs": 1,
"x": 1380,
"y": 520,
"wires": [
[
"444587e4.dc23a8"
]
]
},
{
"id": "ff805ffc.f9134",
"type": "python3-function",
"z": "baa1e3d9.cb29d",
"name": "actuate RGB",
"func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;",
"outputs": 1,
"x": 1390,
"y": 460,
"wires": [
[
"a27b3163.19c31"
]
]
},
{
"id": "444587e4.dc23a8",
"type": "link out",
"z": "baa1e3d9.cb29d",
"name": "",
"links": [
"e1354861.0bb648",
"2bc762dd.1115ce",
"a50134c.ed45ac8",
"17d09d70.b50223"
],
"x": 1475,
"y": 520,
"wires": []
},
{
"id": "a27b3163.19c31",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "set busy",
"func": "global.set(\"state\",\"busy\");\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1560,
"y": 460,
"wires": [
[]
]
},
{
"id": "7c974057.4d3f",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "get duration acquisition",
"func": "msg.delay = global.get(\"duration\");\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1430,
"y": 620,
"wires": [
[]
]
},
{
"id": "482c8e09.a77df",
"type": "python3-function",
"z": "baa1e3d9.cb29d",
"name": "pump.py",
"func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\n\npump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.SIMPLE)\nsleep(0.1)",
"outputs": 1,
"x": 1820,
"y": 280,
"wires": [
[]
]
},
{
"id": "427871db.b4902",
"type": "debug",
"z": "baa1e3d9.cb29d",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 1850,
"y": 220,
"wires": []
},
{
"id": "a61b71c3.afaf",
"type": "trigger",
"z": "baa1e3d9.cb29d",
"op1": "1",
"op2": "0",
"op1type": "str",
"op2type": "str",
"duration": "-250",
"extend": false,
"units": "ms",
"reset": "stop",
"bytopic": "all",
"name": "",
"x": 1620,
"y": 280,
"wires": [
[
"482c8e09.a77df"
]
]
},
{
"id": "f7fa6acf.f6ed28",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "pump.js",
"func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}",
"outputs": 1,
"noerr": 0,
"x": 1100,
"y": 340,
"wires": [
[
"dd817ccf.04ec"
]
],
"info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"
},
{
"id": "dd817ccf.04ec",
"type": "python3-function",
"z": "baa1e3d9.cb29d",
"name": "pump.py",
"func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg",
"outputs": 1,
"x": 1280,
"y": 340,
"wires": [
[]
]
},
{
"id": "7a5b8294.92ad3c",
"type": "ui_button",
"z": "baa1e3d9.cb29d",
"name": "",
"group": "b7919ae2.c01788",
"order": 4,
"width": 5,
"height": 1,
"passthru": false,
"label": "Show",
"tooltip": "",
"color": "#097479",
"bgcolor": "white",
"icon": "keyboard_tab",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 470,
"y": 380,
"wires": [
[
"e2919164.70927"
]
]
},
{
"id": "29be525e.0c87fe",
"type": "ui_template",
"z": "baa1e3d9.cb29d",
"group": "b5d61bc7.54fe48",
"name": "show global",
"order": 2,
"width": 0,
"height": 0,
"format": "<div>\n <span id=\"max_size\" ng-bind-html=\"msg.payload\"></span>\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 750,
"y": 380,
"wires": [
[]
]
},
{
"id": "e2919164.70927",
"type": "function",
"z": "baa1e3d9.cb29d",
"name": "get global",
"func": "msg.payload = {\n \"comment\":global.get(\"comment\"),\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"sample_hour\":global.get(\"sample_hour\"),\n \"sample_minute\":global.get(\"sample_minute\"),\n \"sample_day\":global.get(\"sample_day\"),\n \"sample_month\":global.get(\"sample_month\"),\n \"sample_year\":global.get(\"sample_year\"),\n \n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \n \"acq_camera\":global.get(\"acq_camera\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_instrument_ID\":global.get(\"acq_instrument_ID\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_flowrate\":global.get(\"sug_flowrate\")\n }\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 600,
"y": 380,
"wires": [
[
"29be525e.0c87fe",
"295bd912.8d2556"
]
]
},
{
"id": "295bd912.8d2556",
"type": "debug",
"z": "baa1e3d9.cb29d",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 760,
"y": 440,
"wires": []
},
{
"id": "7ca7754c.0f731c",
"type": "inject",
"z": "eaae323a.31b3",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 120,
"y": 420,
"wires": [
[
"4c6d21e3.0173c"
]
]
},
{
"id": "cbb8afed.0a026",
"type": "rpi-gpio out",
"z": "bccd1f23.87219",
"name": "",
"pin": "40",
"set": "",
"level": "0",
"freq": "",
"out": "out",
"x": 280,
"y": 80,
"wires": []
},
{
"id": "4c6d21e3.0173c",
"type": "function",
"z": "eaae323a.31b3",
"name": "",
"func": "var d = new Date();\nvar t = d.getTime();\npayload={\"time\":\"message\",\"timestamp\":msg.payload}\nmsg.payload=payload;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 250,
"y": 420,
"wires": [
[
"c82b48ad.8b5478"
]
]
},
{
"id": "a256071b.25a008",
"type": "file",
"z": "eaae323a.31b3",
"name": "",
"filename": "/home/pi/Desktop/log/test.log",
"appendNewline": true,
"createDir": true,
"overwriteFile": "false",
"encoding": "none",
"x": 600,
"y": 420,
"wires": [
[
"3cd4bf1e.11ae3"
]
]
},
{
"id": "3cd4bf1e.11ae3",
"type": "debug",
"z": "eaae323a.31b3",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 950,
"y": 420,
"wires": []
},
{
"id": "c82b48ad.8b5478",
"type": "csv",
"z": "eaae323a.31b3",
"name": "",
"sep": ",",
"hdrin": true,
"hdrout": "",
"multi": "one",
"ret": "\\n",
"temp": "timestamp,time",
"skip": "0",
"strings": true,
"x": 390,
"y": 420,
"wires": [
[
"a256071b.25a008"
]
]
}
]