flow: add menu for machine version

This commit is contained in:
Romain Bazile 2021-09-06 18:54:34 +02:00
parent cc9da579b1
commit dd118ea7ca

View file

@ -7308,8 +7308,8 @@
"z": "1eaf21c8.f7a21e", "z": "1eaf21c8.f7a21e",
"name": "", "name": "",
"env": [], "env": [],
"x": 100, "x": 120,
"y": 180, "y": 400,
"wires": [ "wires": [
[ [
"e10f5e55.00b828", "e10f5e55.00b828",
@ -7337,8 +7337,8 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 330, "x": 350,
"y": 140, "y": 360,
"wires": [ "wires": [
[ [
"dee52a36.2af72" "dee52a36.2af72"
@ -7353,8 +7353,8 @@
"label": "", "label": "",
"tooltip": "", "tooltip": "",
"place": "", "place": "",
"group": "cee2ca2f.3dfe18", "group": "6be36295.0ab324",
"order": 3, "order": 4,
"width": 3, "width": 3,
"height": 1, "height": 1,
"passthru": false, "passthru": false,
@ -7369,12 +7369,18 @@
"label": "", "label": "",
"value": "waveshare", "value": "waveshare",
"type": "str" "type": "str"
},
{
"label": "",
"value": "pscope_hat",
"type": "str"
} }
], ],
"payload": "", "payload": "",
"topic": "stepper_type", "topic": "stepper_type",
"x": 610, "topicType": "str",
"y": 140, "x": 670,
"y": 360,
"wires": [ "wires": [
[ [
"2068e7f.f4efb18", "2068e7f.f4efb18",
@ -7390,8 +7396,8 @@
"links": [ "links": [
"45a7b5aa.2ed20c" "45a7b5aa.2ed20c"
], ],
"x": 955, "x": 1015,
"y": 160, "y": 380,
"wires": [] "wires": []
}, },
{ {
@ -7409,8 +7415,8 @@
"randomLast": "5", "randomLast": "5",
"randomUnits": "seconds", "randomUnits": "seconds",
"drop": false, "drop": false,
"x": 820, "x": 880,
"y": 160, "y": 380,
"wires": [ "wires": [
[ [
"e41870d7.300eb8" "e41870d7.300eb8"
@ -7457,8 +7463,8 @@
"z": "1eaf21c8.f7a21e", "z": "1eaf21c8.f7a21e",
"name": "", "name": "",
"env": [], "env": [],
"x": 840, "x": 900,
"y": 200, "y": 420,
"wires": [ "wires": [
[] []
] ]
@ -7482,8 +7488,8 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 340, "x": 360,
"y": 180, "y": 440,
"wires": [ "wires": [
[ [
"cd1987c7.027f58" "cd1987c7.027f58"
@ -7497,8 +7503,8 @@
"name": "stepper_reverse", "name": "stepper_reverse",
"label": "Invert stepper output", "label": "Invert stepper output",
"tooltip": "Stepper 1 is controlled by output 1 or the other way around", "tooltip": "Stepper 1 is controlled by output 1 or the other way around",
"group": "cee2ca2f.3dfe18", "group": "6be36295.0ab324",
"order": 4, "order": 5,
"width": 0, "width": 0,
"height": 0, "height": 0,
"passthru": false, "passthru": false,
@ -7513,8 +7519,8 @@
"offvalueType": "bool", "offvalueType": "bool",
"officon": "", "officon": "",
"offcolor": "", "offcolor": "",
"x": 600, "x": 660,
"y": 180, "y": 440,
"wires": [ "wires": [
[ [
"8e3b3d3c.955148", "8e3b3d3c.955148",
@ -7541,8 +7547,8 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 350, "x": 370,
"y": 220, "y": 400,
"wires": [ "wires": [
[ [
"ee58b91c.396108" "ee58b91c.396108"
@ -7556,16 +7562,17 @@
"name": "pump_steps_per_ml", "name": "pump_steps_per_ml",
"label": "Pump: steps per mL", "label": "Pump: steps per mL",
"tooltip": "", "tooltip": "",
"group": "cee2ca2f.3dfe18", "group": "6be36295.0ab324",
"order": 5, "order": 6,
"width": 0, "width": 0,
"height": 0, "height": 0,
"passthru": false, "passthru": false,
"mode": "number", "mode": "number",
"delay": "2000", "delay": "2000",
"topic": "pump_steps_per_ml", "topic": "pump_steps_per_ml",
"x": 580, "topicType": "str",
"y": 220, "x": 640,
"y": 400,
"wires": [ "wires": [
[ [
"2068e7f.f4efb18", "2068e7f.f4efb18",
@ -7577,9 +7584,9 @@
"id": "be888117.5cd67", "id": "be888117.5cd67",
"type": "ui_template", "type": "ui_template",
"z": "1eaf21c8.f7a21e", "z": "1eaf21c8.f7a21e",
"group": "cee2ca2f.3dfe18", "group": "6be36295.0ab324",
"name": "Stepper controller type header", "name": "Stepper controller type header",
"order": 2, "order": 3,
"width": 3, "width": 3,
"height": 1, "height": 1,
"format": "<div>Stepper controller type</div>", "format": "<div>Stepper controller type</div>",
@ -7597,9 +7604,9 @@
"id": "7534dfd9.8cf3e8", "id": "7534dfd9.8cf3e8",
"type": "ui_template", "type": "ui_template",
"z": "1eaf21c8.f7a21e", "z": "1eaf21c8.f7a21e",
"group": "cee2ca2f.3dfe18", "group": "6be36295.0ab324",
"name": "Information", "name": "Information",
"order": 1, "order": 2,
"width": 6, "width": 6,
"height": 3, "height": 3,
"format": "<div style=\"text-align: center;\">\n <p>Changing one of these values will make the python back-end to restart.</p>\n <p><strong style=\"font-size: large;\">If you are not sure, you probably should not be touching anything here!</strong></p>\n</div>", "format": "<div style=\"text-align: center;\">\n <p>Changing one of these values will make the python back-end to restart.</p>\n <p><strong style=\"font-size: large;\">If you are not sure, you probably should not be touching anything here!</strong></p>\n</div>",
@ -10773,5 +10780,120 @@
"8dd6f57f.b77f98" "8dd6f57f.b77f98"
] ]
] ]
},
{
"id": "a7e5c7f4.644678",
"type": "ui_dropdown",
"z": "1eaf21c8.f7a21e",
"name": "Machine Version",
"label": "Machine version",
"tooltip": "",
"place": "Select option",
"group": "6be36295.0ab324",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"multiple": false,
"options": [
{
"label": "",
"value": "PlanktoScope v1.0",
"type": "str"
},
{
"label": "PlanktoScope 2.1 (adafruit version)",
"value": "PlanktoScope v2.1",
"type": "str"
},
{
"label": "PlanktoScope 2.2 (waveshare hat)",
"value": "PlanktoScope v2.2",
"type": "str"
},
{
"label": "PlanktoScope 2.3 (custom hat)",
"value": "PlanktoScope v2.3",
"type": "str"
}
],
"payload": "",
"topic": "acq_instrument",
"topicType": "str",
"x": 590,
"y": 160,
"wires": [
[
"3e2c5c1c.4c57b4"
]
]
},
{
"id": "1cfadc66.3cde8c",
"type": "subflow:1c24ad9c.bebec2",
"z": "1eaf21c8.f7a21e",
"name": "",
"env": [],
"x": 690,
"y": 280,
"wires": [
[]
]
},
{
"id": "3e2c5c1c.4c57b4",
"type": "function",
"z": "1eaf21c8.f7a21e",
"name": "Set and update settings",
"func": "global.set(msg.topic,msg.payload);\n\nif (msg.payload.includes(\"2.1\")){\n msg_stepper_type = {topic:\"stepper_type\", payload:\"adafruit\"};\n msg_pump_steps = {topic:\"pump_steps_per_ml\", payload:1600};\n return [msg, msg_stepper_type, msg_pump_steps];\n}\nelse if (msg.payload.includes(\"2.2\")){\n msg_stepper_type = {topic:\"stepper_type\", payload:\"waveshare\"};\n msg_pump_steps = {topic:\"pump_steps_per_ml\", payload:2000};\n return [msg, msg_stepper_type, msg_pump_steps];\n}\nelse if (msg.payload.includes(\"2.3\")){\n msg_stepper_type = {topic:\"stepper_type\", payload:\"pscope_hat\"};\n msg_pump_steps = {topic:\"pump_steps_per_ml\", payload:3200};\n return [msg, msg_stepper_type, msg_pump_steps];\n}\nelse{\n return [msg, null, null];\n}",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 370,
"y": 280,
"wires": [
[
"1cfadc66.3cde8c"
],
[
"dee52a36.2af72"
],
[
"ee58b91c.396108"
]
]
},
{
"id": "427c312.fc5e65",
"type": "subflow:1c24ad9c.bebec2",
"z": "1eaf21c8.f7a21e",
"name": "",
"env": [],
"x": 150,
"y": 160,
"wires": [
[
"237809c1.2c64ce"
]
]
},
{
"id": "237809c1.2c64ce",
"type": "function",
"z": "1eaf21c8.f7a21e",
"name": "get acq_instrument",
"func": "msg.payload = msg.payload.acq_instrument;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 350,
"y": 160,
"wires": [
[
"a7e5c7f4.644678"
]
]
} }
] ]