main.json: update to add branch selection

This commit is contained in:
Romain Bazile 2021-05-11 02:27:15 +02:00
parent 8eb2bd011c
commit 19e03558ac

View file

@ -720,15 +720,6 @@
"width": "12", "width": "12",
"collapse": true "collapse": true
}, },
{
"id": "537a50c5.f6f428",
"type": "ui_spacer",
"name": "spacer",
"group": "3ca00bf9.e5cac4",
"order": 2,
"width": 1,
"height": 1
},
{ {
"id": "9e409235.73cd7", "id": "9e409235.73cd7",
"type": "ui_group", "type": "ui_group",
@ -771,51 +762,6 @@
"disabled": false, "disabled": false,
"hidden": false "hidden": false
}, },
{
"id": "dcb4c0a9.288b38",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 2,
"width": 3,
"height": 1
},
{
"id": "778e749.ced338c",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 4,
"width": 3,
"height": 1
},
{
"id": "e7b7752b.d85918",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 5,
"width": 4,
"height": 1
},
{
"id": "8bc9bd19.816888",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 7,
"width": 4,
"height": 1
},
{
"id": "165dcd04.e6d253",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 9,
"width": 8,
"height": 1
},
{ {
"id": "b0fb559a.6966a8", "id": "b0fb559a.6966a8",
"type": "ui_tab", "type": "ui_tab",
@ -984,6 +930,69 @@
"width": 4, "width": 4,
"height": 1 "height": 1
}, },
{
"id": "7da406a5.27eb4",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 4,
"width": 3,
"height": 1
},
{
"id": "77f746b.53f1538",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 6,
"width": 3,
"height": 1
},
{
"id": "d85ab67c.dc7a9",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 7,
"width": 3,
"height": 1
},
{
"id": "5bbb684a.85e138",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 9,
"width": 3,
"height": 1
},
{
"id": "11b62f82.d3965",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 10,
"width": 4,
"height": 1
},
{
"id": "d160563f.c1a0e8",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 12,
"width": 4,
"height": 1
},
{
"id": "ff30b2d8.51102",
"type": "ui_spacer",
"name": "spacer",
"group": "1be83144.4fe4bf",
"order": 14,
"width": 8,
"height": 1
},
{ {
"id": "4e78af2d.90be7", "id": "4e78af2d.90be7",
"type": "ui_ui_control", "type": "ui_ui_control",
@ -1431,12 +1440,13 @@
"label": "Fan", "label": "Fan",
"tooltip": "", "tooltip": "",
"group": "3ca00bf9.e5cac4", "group": "3ca00bf9.e5cac4",
"order": 3, "order": 2,
"width": 1, "width": 2,
"height": 1, "height": 1,
"passthru": true, "passthru": true,
"decouple": "false", "decouple": "false",
"topic": "", "topic": "",
"topicType": "str",
"style": "", "style": "",
"onvalue": "on", "onvalue": "on",
"onvalueType": "str", "onvalueType": "str",
@ -1446,6 +1456,7 @@
"offvalueType": "str", "offvalueType": "str",
"officon": "", "officon": "",
"offcolor": "", "offcolor": "",
"animate": true,
"x": 940, "x": 940,
"y": 40, "y": 40,
"wires": [ "wires": [
@ -3329,11 +3340,10 @@
"payload": "start", "payload": "start",
"payloadType": "str", "payloadType": "str",
"x": 130, "x": 130,
"y": 580, "y": 620,
"wires": [ "wires": [
[ [
"452af41c.43940c", "452af41c.43940c"
"b3c21aa9.8c06c"
] ]
] ]
}, },
@ -3834,45 +3844,6 @@
[] []
] ]
}, },
{
"id": "b3c21aa9.8c06c",
"type": "exec",
"z": "1371dec5.76e671",
"command": "git --git-dir /home/pi/PlanktonScope/.git/ rev-parse --short master",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "git rev",
"x": 310,
"y": 540,
"wires": [
[
"3e64877a.9684b"
],
[],
[]
]
},
{
"id": "3e64877a.9684b",
"type": "function",
"z": "1371dec5.76e671",
"name": "store version",
"func": "msg.payload = \"PlanktoScope v2.2-\"+msg.payload.trim()\n\nglobal.set(\"acq_software\",msg.payload);\n\nreturn msg\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 590,
"y": 520,
"wires": [
[
"8343fa69.49339"
]
]
},
{ {
"id": "68fa1227.dbdd5c", "id": "68fa1227.dbdd5c",
"type": "function", "type": "function",
@ -4020,22 +3991,6 @@
"y": 600, "y": 600,
"wires": [] "wires": []
}, },
{
"id": "8343fa69.49339",
"type": "ui_text",
"z": "1371dec5.76e671",
"group": "ce9e278.781eed8",
"order": 3,
"width": 0,
"height": 0,
"name": "",
"label": "Software version",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 840,
"y": 520,
"wires": []
},
{ {
"id": "f783aefd.c3bfd8", "id": "f783aefd.c3bfd8",
"type": "ui_text", "type": "ui_text",
@ -6136,7 +6091,7 @@
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "", "name": "",
"group": "1be83144.4fe4bf", "group": "1be83144.4fe4bf",
"order": 15, "order": 13,
"width": 2, "width": 2,
"height": 1, "height": 1,
"passthru": false, "passthru": false,
@ -6148,6 +6103,7 @@
"payload": "reboot", "payload": "reboot",
"payloadType": "str", "payloadType": "str",
"topic": "reboot", "topic": "reboot",
"topicType": "str",
"x": 420, "x": 420,
"y": 680, "y": 680,
"wires": [ "wires": [
@ -6181,7 +6137,7 @@
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "", "name": "",
"group": "1be83144.4fe4bf", "group": "1be83144.4fe4bf",
"order": 17, "order": 15,
"width": 2, "width": 2,
"height": 1, "height": 1,
"passthru": false, "passthru": false,
@ -6193,6 +6149,7 @@
"payload": "shutdown", "payload": "shutdown",
"payloadType": "str", "payloadType": "str",
"topic": "shutdown", "topic": "shutdown",
"topicType": "str",
"x": 410, "x": 410,
"y": 760, "y": 760,
"wires": [ "wires": [
@ -6208,8 +6165,8 @@
"name": "action", "name": "action",
"func": "#!/usr/bin/python\nimport smbus\n\nbus = smbus.SMBus(1)\n#turn off LED\nbus.write_byte_data(0x0d, 0x07, 0x00)\n#turn off Fan\nbus.write_byte_data(0x0d, 0x08, 0x00)\n\n#msg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", "func": "#!/usr/bin/python\nimport smbus\n\nbus = smbus.SMBus(1)\n#turn off LED\nbus.write_byte_data(0x0d, 0x07, 0x00)\n#turn off Fan\nbus.write_byte_data(0x0d, 0x08, 0x00)\n\n#msg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg",
"outputs": 1, "outputs": 1,
"x": 690, "x": 590,
"y": 460, "y": 720,
"wires": [ "wires": [
[ [
"611a8b1c.a829b4" "611a8b1c.a829b4"
@ -6227,7 +6184,7 @@
"timer": "", "timer": "",
"oldrc": false, "oldrc": false,
"name": "", "name": "",
"x": 1120, "x": 1090,
"y": 600, "y": 600,
"wires": [ "wires": [
[], [],
@ -6266,7 +6223,7 @@
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "Restart Python", "name": "Restart Python",
"group": "1be83144.4fe4bf", "group": "1be83144.4fe4bf",
"order": 12, "order": 11,
"width": 4, "width": 4,
"height": 1, "height": 1,
"passthru": true, "passthru": true,
@ -6383,7 +6340,7 @@
"payload": "", "payload": "",
"payloadType": "str", "payloadType": "str",
"topic": "", "topic": "",
"x": 1340, "x": 1260,
"y": 720, "y": 720,
"wires": [ "wires": [
[ [
@ -6515,7 +6472,7 @@
"level": "1", "level": "1",
"freq": "", "freq": "",
"out": "out", "out": "out",
"x": 420, "x": 410,
"y": 80, "y": 80,
"wires": [] "wires": []
}, },
@ -6570,7 +6527,7 @@
"timer": "1", "timer": "1",
"oldrc": false, "oldrc": false,
"name": "git user.name", "name": "git user.name",
"x": 1140, "x": 1150,
"y": 60, "y": 60,
"wires": [ "wires": [
[], [],
@ -6626,7 +6583,7 @@
"timer": "1", "timer": "1",
"oldrc": false, "oldrc": false,
"name": "git user.email", "name": "git user.email",
"x": 1130, "x": 1150,
"y": 140, "y": 140,
"wires": [ "wires": [
[], [],
@ -6659,7 +6616,7 @@
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "Update", "name": "Update",
"group": "1be83144.4fe4bf", "group": "1be83144.4fe4bf",
"order": 9, "order": 8,
"width": 6, "width": 6,
"height": 1, "height": 1,
"passthru": false, "passthru": false,
@ -6672,7 +6629,7 @@
"payloadType": "str", "payloadType": "str",
"topic": "update", "topic": "update",
"topicType": "str", "topicType": "str",
"x": 440, "x": 300,
"y": 460, "y": 460,
"wires": [ "wires": [
[ [
@ -6691,15 +6648,16 @@
"timer": "", "timer": "",
"oldrc": false, "oldrc": false,
"name": "Update", "name": "Update",
"x": 720, "x": 480,
"y": 460, "y": 460,
"wires": [ "wires": [
[ [
"64f61762.68c788", "64f61762.68c788",
"8b511c2b.9c24c8" "8b511c2b.9c24c8",
"83c5a708.a5715",
"d334d264.8a7728"
], ],
[ [
"64f61762.68c788",
"8b511c2b.9c24c8" "8b511c2b.9c24c8"
], ],
[] []
@ -6714,13 +6672,13 @@
"order": 1, "order": 1,
"width": 12, "width": 12,
"height": 2, "height": 2,
"format": "<div><center>If you want to update to the latest code version of Node-Red and Python, please click here.\nWe are trying to save your configuration changes with git stash and restore them afterwards, but clearly, things may break!\nIf you have made changes to the flow, you will lose them. Please commit those changes from Node-Red interface, from the Project History tab.</center></div>", "format": "<div><center>If you want to update to the latest code version of Node-Red and Python, please click here.\nWe are trying to save your configuration changes with git stash and restore them afterwards, but clearly, things may break!\nAlso, you can choose the branch you want to update to. BE CAREFUL, selecting a branch WILL update the code immediately.\nIf you have made changes to the flow, you will lose them. Please commit those changes from Node-Red interface, from the Project History tab.</center></div>",
"storeOutMessages": true, "storeOutMessages": true,
"fwdInMessages": true, "fwdInMessages": true,
"resendOnRefresh": true, "resendOnRefresh": true,
"templateScope": "local", "templateScope": "local",
"x": 410, "x": 410,
"y": 180, "y": 200,
"wires": [ "wires": [
[] []
] ]
@ -7852,8 +7810,8 @@
"links": [ "links": [
"e41870d7.300eb8" "e41870d7.300eb8"
], ],
"x": 155, "x": 175,
"y": 300, "y": 560,
"wires": [ "wires": [
[ [
"466eb611.4da048" "466eb611.4da048"
@ -8280,8 +8238,8 @@
"topic": "", "topic": "",
"payload": "start", "payload": "start",
"payloadType": "str", "payloadType": "str",
"x": 1170, "x": 1110,
"y": 460, "y": 720,
"wires": [ "wires": [
[ [
"7a1dedf.1c63094" "7a1dedf.1c63094"
@ -8781,8 +8739,8 @@
"links": [ "links": [
"e08cfcb8.2a67e8" "e08cfcb8.2a67e8"
], ],
"x": 435, "x": 455,
"y": 460, "y": 720,
"wires": [ "wires": [
[ [
"4af9112d.87767" "4af9112d.87767"
@ -8875,20 +8833,6 @@
] ]
] ]
}, },
{
"id": "b3448fbb.351d28",
"type": "rpi-gpio out",
"z": "1371dec5.76e671",
"name": "Fan",
"pin": "33",
"set": false,
"level": "0",
"freq": "25000",
"out": "pwm",
"x": 1110,
"y": 40,
"wires": []
},
{ {
"id": "f6ff420b.0af648", "id": "f6ff420b.0af648",
"type": "ui_slider", "type": "ui_slider",
@ -8903,7 +8847,6 @@
"passthru": true, "passthru": true,
"outs": "end", "outs": "end",
"topic": "focus_speed", "topic": "focus_speed",
"topicType": "str",
"min": "250", "min": "250",
"max": "2500", "max": "2500",
"step": "250", "step": "250",
@ -8958,7 +8901,6 @@
"payload": "{\"action\":\"move\",\"direction\":\"UP\",\"distance\":0.1}", "payload": "{\"action\":\"move\",\"direction\":\"UP\",\"distance\":0.1}",
"payloadType": "json", "payloadType": "json",
"topic": "actuator/focus", "topic": "actuator/focus",
"topicType": "str",
"x": 350, "x": 350,
"y": 520, "y": 520,
"wires": [ "wires": [
@ -8985,7 +8927,6 @@
"payload": "{\"action\":\"move\",\"direction\":\"DOWN\",\"distance\":0.1}", "payload": "{\"action\":\"move\",\"direction\":\"DOWN\",\"distance\":0.1}",
"payloadType": "json", "payloadType": "json",
"topic": "actuator/focus", "topic": "actuator/focus",
"topicType": "str",
"x": 340, "x": 340,
"y": 600, "y": 600,
"wires": [ "wires": [
@ -9040,7 +8981,6 @@
"wrap": false, "wrap": false,
"passthru": true, "passthru": true,
"topic": "acq_maximum_mesh", "topic": "acq_maximum_mesh",
"topicType": "str",
"format": "{{value}}", "format": "{{value}}",
"min": "200", "min": "200",
"max": "2000", "max": "2000",
@ -9067,7 +9007,6 @@
"wrap": false, "wrap": false,
"passthru": true, "passthru": true,
"topic": "acq_minimum_mesh", "topic": "acq_minimum_mesh",
"topicType": "str",
"format": "{{value}}", "format": "{{value}}",
"min": 0, "min": 0,
"max": "300", "max": "300",
@ -9091,12 +9030,12 @@
"timer": "", "timer": "",
"oldrc": false, "oldrc": false,
"name": "Get git revision", "name": "Get git revision",
"x": 640, "x": 660,
"y": 340, "y": 340,
"wires": [ "wires": [
[ [
"af2b8d95.195bb8", "af2b8d95.195bb8",
"b6bc9b81.ff942" "aa2dbb6.4cd9948"
], ],
[], [],
[] []
@ -9113,7 +9052,7 @@
"timer": "", "timer": "",
"oldrc": false, "oldrc": false,
"name": "Get git branch", "name": "Get git branch",
"x": 640, "x": 660,
"y": 260, "y": 260,
"wires": [ "wires": [
[ [
@ -9129,8 +9068,8 @@
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "get git branch", "name": "get git branch",
"group": "1be83144.4fe4bf", "group": "1be83144.4fe4bf",
"order": 4, "order": 3,
"width": 4, "width": 5,
"height": 1, "height": 1,
"passthru": false, "passthru": false,
"label": "Update branch list", "label": "Update branch list",
@ -9141,7 +9080,6 @@
"payload": "", "payload": "",
"payloadType": "str", "payloadType": "str",
"topic": "", "topic": "",
"topicType": "str",
"x": 410, "x": 410,
"y": 260, "y": 260,
"wires": [ "wires": [
@ -9156,7 +9094,7 @@
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "Git branch list", "name": "Git branch list",
"label": "Switch branch to", "label": "Switch branch to",
"tooltip": "", "tooltip": "If you choose something, the code WILL be updated to that branch, don't touch if you don't know what you are doing!",
"place": "branch", "place": "branch",
"group": "1be83144.4fe4bf", "group": "1be83144.4fe4bf",
"order": 5, "order": 5,
@ -9166,13 +9104,13 @@
"multiple": false, "multiple": false,
"options": [], "options": [],
"payload": "", "payload": "",
"topic": "topic", "topic": "branch",
"topicType": "msg", "topicType": "str",
"x": 1020, "x": 1320,
"y": 260, "y": 340,
"wires": [ "wires": [
[ [
"d037a624.60bea8" "2d2ef1fd.40e6e6"
] ]
] ]
}, },
@ -9186,7 +9124,7 @@
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"x": 830, "x": 930,
"y": 260, "y": 260,
"wires": [ "wires": [
[ [
@ -9220,58 +9158,82 @@
] ]
] ]
}, },
{
"id": "d037a624.60bea8",
"type": "exec",
"z": "9daf9e2b.019fc",
"command": "git --git-dir=/home/pi/PlanktonScope/.git checkout",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "git checkout branch",
"x": 1270,
"y": 260,
"wires": [
[],
[
"d334d264.8a7728",
"83c5a708.a5715"
],
[]
]
},
{ {
"id": "af2b8d95.195bb8", "id": "af2b8d95.195bb8",
"type": "ui_text", "type": "ui_text",
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"group": "1be83144.4fe4bf", "group": "1be83144.4fe4bf",
"order": 2, "order": 2,
"width": 12, "width": 7,
"height": 1, "height": 1,
"name": "", "name": "",
"label": "Current code version", "label": "Current code version",
"format": "{{msg.payload}}", "format": "{{msg.payload}}",
"layout": "row-center", "layout": "row-center",
"x": 1040, "x": 920,
"y": 340, "y": 320,
"wires": [] "wires": []
}, },
{ {
"id": "b6bc9b81.ff942", "id": "aa2dbb6.4cd9948",
"type": "function", "type": "link out",
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "save process_commit", "name": "get git revision",
"func": "global.set(\"process_commit\", msg.payload);\n", "links": [
"be6bddd3.2004f"
],
"x": 835,
"y": 360,
"wires": []
},
{
"id": "5112444.5be803c",
"type": "ui_text",
"z": "1371dec5.76e671",
"group": "ce9e278.781eed8",
"order": 3,
"width": 0,
"height": 0,
"name": "[System Monitoring] version",
"label": "Software version",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 800,
"y": 520,
"wires": []
},
{
"id": "16548734.7fe631",
"type": "function",
"z": "1371dec5.76e671",
"name": "store version",
"func": "msg.payload = \"PlanktoScope-\"+msg.payload.trim()\n\nglobal.set(\"acq_software\",msg.payload);\n\nreturn msg\n",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"x": 1040, "x": 590,
"y": 380, "y": 520,
"wires": [ "wires": [
[] [
"5112444.5be803c"
]
]
},
{
"id": "be6bddd3.2004f",
"type": "link in",
"z": "1371dec5.76e671",
"name": "git version",
"links": [
"aa2dbb6.4cd9948"
],
"x": 455,
"y": 520,
"wires": [
[
"16548734.7fe631"
]
] ]
} }
] ]