2
0

monte charge

This commit is contained in:
2026-01-14 07:37:16 +01:00
parent 4abcca860b
commit 187c5ed794
4 changed files with 400 additions and 109 deletions

View File

@@ -2,7 +2,7 @@
{ {
"id": "86a34ee77bf6db10", "id": "86a34ee77bf6db10",
"type": "tab", "type": "tab",
"label": "Flux 1", "label": "Principal",
"disabled": false, "disabled": false,
"info": "", "info": "",
"env": [] "env": []
@@ -10,7 +10,15 @@
{ {
"id": "b5e17af18ea9731a", "id": "b5e17af18ea9731a",
"type": "tab", "type": "tab",
"label": "Flux 2", "label": "F18",
"disabled": false,
"info": "",
"env": []
},
{
"id": "93dc5b41180d0746",
"type": "tab",
"label": "Flux 3",
"disabled": false, "disabled": false,
"info": "", "info": "",
"env": [] "env": []
@@ -146,7 +154,7 @@
{ {
"id": "02fab8cbf37e2bb7", "id": "02fab8cbf37e2bb7",
"type": "ui-group", "type": "ui-group",
"name": "Alimentation", "name": "Général",
"page": "bb436fe040268d40", "page": "bb436fe040268d40",
"width": "2", "width": "2",
"height": 1, "height": 1,
@@ -224,6 +232,20 @@
"height": 1, "height": 1,
"className": "" "className": ""
}, },
{
"id": "050148aff99031d4",
"type": "ui-group",
"name": "Réservoir",
"page": "bb436fe040268d40",
"width": "4",
"height": 1,
"order": 7,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{ {
"id": "699fb0d470d36c5f", "id": "699fb0d470d36c5f",
"type": "ui-button", "type": "ui-button",
@@ -466,7 +488,7 @@
"id": "dec1e73483e26a7d", "id": "dec1e73483e26a7d",
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "set marche", "name": "send marche",
"func": "msg.payload = {\n \"marche\": 1\n};\n\nreturn msg;", "func": "msg.payload = {\n \"marche\": 1\n};\n\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
@@ -559,7 +581,8 @@
"y": 1480, "y": 1480,
"wires": [ "wires": [
[ [
"586e5d5f736036fc" "586e5d5f736036fc",
"5ff7cf747202687b"
] ]
] ]
}, },
@@ -920,7 +943,7 @@
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "reset", "name": "reset",
"func": "flow.set(\"i0\", 0);\nflow.set(\"i1\", 0);\nflow.set(\"i2\", 0);\nflow.set(\"i3\", 0);\nflow.set(\"i4\", 0);\nflow.set(\"i5\", 0);\nflow.set(\"i6\", 0);\nflow.set(\"i7\", 0);\n\nglobal.set(\"a0\", 0);\nglobal.set(\"a1\", 0);\nglobal.set(\"a2\", 0);\nglobal.set(\"a3\", 0);\nglobal.set(\"a4\", 0);\nglobal.set(\"a5\", 0);\nglobal.set(\"a6\", 0);\nglobal.set(\"a7\", 0);\n\nflow.set(\"m0\", 0);\nflow.set(\"m1\", 0);\nflow.set(\"m2\", 0);\nflow.set(\"m3\", 0);\n\nglobal.set(\"p0\", 0);\n\nflow.set(\"v0\", 0);\n\nglobal.set(\"c0\", 1);\nglobal.set(\"c1\", 1);\nglobal.set(\"c2\", 0);\nglobal.set(\"c3\", 0);\nglobal.set(\"c4\", 0);\nglobal.set(\"c5\", 0);\nglobal.set(\"c6\", 0);\nglobal.set(\"c7\", 0);\n\nglobal.set(\"flag0\", 0);\n\nmsg.payload = false;\n\nreturn msg;", "func": "flow.set(\"i0\", 0);\nflow.set(\"i1\", 0);\nflow.set(\"i2\", 0);\nflow.set(\"i3\", 0);\nflow.set(\"i4\", 0);\nflow.set(\"i5\", 0);\nflow.set(\"i6\", 0);\nflow.set(\"i7\", 0);\n\nglobal.set(\"a0\", 0);\nglobal.set(\"a1\", 0);\nglobal.set(\"a2\", 0);\nglobal.set(\"a3\", 0);\nglobal.set(\"a4\", 0);\nglobal.set(\"a5\", 0);\nglobal.set(\"a6\", 0);\nglobal.set(\"a7\", 0);\n\nglobal.set(\"m0\", 0);\nglobal.set(\"m1\", 0);\nglobal.set(\"m2\", 0);\nglobal.set(\"m3\", 0);\n\nglobal.set(\"p0\", 0);\n\nglobal.set(\"v0\", 0);\n\nglobal.set(\"c0\", 1);\nglobal.set(\"c1\", 1);\nglobal.set(\"c2\", 0);\nglobal.set(\"c3\", 0);\nglobal.set(\"c4\", 0);\nglobal.set(\"c5\", 0);\nglobal.set(\"c6\", 0);\nglobal.set(\"c7\", 0);\n\nglobal.set(\"s8\", 0);\nglobal.set(\"s9\", 0);\n\nglobal.set(\"flag0\", 0);\n\nmsg.payload = false;\n\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
@@ -1713,7 +1736,7 @@
"id": "be228653fc2bdb0f", "id": "be228653fc2bdb0f",
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "set arret", "name": "send arret",
"func": "msg.payload = {\n \"arret\": 0\n};\n\nreturn msg;", "func": "msg.payload = {\n \"arret\": 0\n};\n\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
@@ -1746,8 +1769,8 @@
"topic": "", "topic": "",
"payload": "{\"t\":0}", "payload": "{\"t\":0}",
"payloadType": "json", "payloadType": "json",
"x": 1230, "x": 1250,
"y": 140, "y": 1000,
"wires": [ "wires": [
[ [
"37bdef06b07499f2", "37bdef06b07499f2",
@@ -1759,7 +1782,8 @@
"4f19905f0d970ca1", "4f19905f0d970ca1",
"c76542262137e660", "c76542262137e660",
"3c5d996abc900e3d", "3c5d996abc900e3d",
"6d425818a9a96be2" "6d425818a9a96be2",
"c613454bd48662e1"
] ]
] ]
}, },
@@ -1810,8 +1834,8 @@
"height": 0, "height": 0,
"color": "", "color": "",
"className": "", "className": "",
"x": 1660, "x": 1680,
"y": 40, "y": 820,
"wires": [] "wires": []
}, },
{ {
@@ -1819,7 +1843,7 @@
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "m0", "name": "m0",
"func": "flow.set(\"m0\", Number(msg.payload.m0));\nmsg.payload = msg.payload.m0 * 10;\nreturn msg;", "func": "global.set(\"m0\", Number(msg.payload.m0));\nmsg.payload = msg.payload.m0 * 10;\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
@@ -1839,7 +1863,7 @@
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "m1", "name": "m1",
"func": "flow.set(\"m1\", Number(msg.payload.m1));\nmsg.payload = msg.payload.m1 * 10;\nreturn msg;", "func": "global.set(\"m1\", Number(msg.payload.m1));\nmsg.payload = msg.payload.m1 * 10;\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
@@ -1859,7 +1883,7 @@
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "m2", "name": "m2",
"func": "flow.set(\"m2\", Number(msg.payload.m2));\nmsg.payload = msg.payload.m2 * 10;\nreturn msg;", "func": "global.set(\"m2\", Number(msg.payload.m2));\nmsg.payload = msg.payload.m2 * 10;\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
@@ -1879,7 +1903,7 @@
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "m3", "name": "m3",
"func": "flow.set(\"m3\", Number(msg.payload.m3));\nmsg.payload = msg.payload.m3 * 10;\nreturn msg;", "func": "global.set(\"m3\", Number(msg.payload.m3));\nmsg.payload = msg.payload.m3 * 10;\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
@@ -1898,19 +1922,20 @@
"id": "30d93ea6f5e8d0c1", "id": "30d93ea6f5e8d0c1",
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "function 2", "name": "p0",
"func": "let p0 = Number(global.get(\"p0\")) || 0;\n\nif (flow.get(\"m0\")) {\n p0++;\n if (p0 > 100) p0 = 100;\n global.set(\"p0\", p0);\n}\n\nif (flow.get(\"m1\")) {\n p0--;\n if (p0 < 0) p0 = 0;\n global.set(\"p0\", p0);\n}\n\nmsg.payload = p0;\n\nreturn msg;", "func": "msg.payload = global.get(\"p0\");\nreturn msg;\n",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1480, "x": 1490,
"y": 40, "y": 820,
"wires": [ "wires": [
[ [
"8a9cc277cf3f445b" "8a9cc277cf3f445b",
"ffe1e88c3c60e495"
] ]
] ]
}, },
@@ -1919,7 +1944,7 @@
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "v0", "name": "v0",
"func": "flow.set(\"v0\", Number(msg.payload));\nreturn msg;", "func": "global.set(\"v0\", Number(msg.payload));\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
@@ -2302,8 +2327,8 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1650, "x": 1670,
"y": 100, "y": 880,
"wires": [] "wires": []
}, },
{ {
@@ -2326,8 +2351,8 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1650, "x": 1670,
"y": 140, "y": 920,
"wires": [] "wires": []
}, },
{ {
@@ -2350,8 +2375,8 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1650, "x": 1670,
"y": 180, "y": 960,
"wires": [] "wires": []
}, },
{ {
@@ -2366,8 +2391,8 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 1490,
"y": 100, "y": 880,
"wires": [ "wires": [
[ [
"3a4fc72ec7ac5e24" "3a4fc72ec7ac5e24"
@@ -2386,8 +2411,8 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 1490,
"y": 140, "y": 920,
"wires": [ "wires": [
[ [
"f9dc47909191e3c8" "f9dc47909191e3c8"
@@ -2406,8 +2431,8 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 1490,
"y": 180, "y": 960,
"wires": [ "wires": [
[ [
"010deed59c85eb88" "010deed59c85eb88"
@@ -2434,8 +2459,8 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1650, "x": 1670,
"y": 220, "y": 1000,
"wires": [] "wires": []
}, },
{ {
@@ -2443,8 +2468,8 @@
"type": "ui-text", "type": "ui-text",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"group": "6b44d4b22cd7b3dc", "group": "6b44d4b22cd7b3dc",
"order": 16, "order": 13,
"width": "2", "width": "1",
"height": "1", "height": "1",
"name": "", "name": "",
"label": "c4", "label": "c4",
@@ -2458,8 +2483,8 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1650, "x": 1670,
"y": 260, "y": 1040,
"wires": [] "wires": []
}, },
{ {
@@ -2467,13 +2492,13 @@
"type": "ui-text", "type": "ui-text",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"group": "6b44d4b22cd7b3dc", "group": "6b44d4b22cd7b3dc",
"order": 15, "order": 14,
"width": "1", "width": "1",
"height": "1", "height": "1",
"name": "", "name": "",
"label": "c5", "label": "c5",
"format": "{{msg.payload}}", "format": "{{msg.payload}}",
"layout": "row-right", "layout": "row-left",
"style": false, "style": false,
"font": "", "font": "",
"fontSize": 16, "fontSize": 16,
@@ -2482,8 +2507,8 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1650, "x": 1670,
"y": 300, "y": 1080,
"wires": [] "wires": []
}, },
{ {
@@ -2491,7 +2516,7 @@
"type": "ui-text", "type": "ui-text",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"group": "6b44d4b22cd7b3dc", "group": "6b44d4b22cd7b3dc",
"order": 13, "order": 15,
"width": "1", "width": "1",
"height": "1", "height": "1",
"name": "", "name": "",
@@ -2506,8 +2531,8 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1650, "x": 1670,
"y": 340, "y": 1120,
"wires": [] "wires": []
}, },
{ {
@@ -2515,8 +2540,8 @@
"type": "ui-text", "type": "ui-text",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"group": "6b44d4b22cd7b3dc", "group": "6b44d4b22cd7b3dc",
"order": 17, "order": 16,
"width": "2", "width": "1",
"height": "1", "height": "1",
"name": "", "name": "",
"label": "c7", "label": "c7",
@@ -2530,8 +2555,8 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1650, "x": 1670,
"y": 380, "y": 1160,
"wires": [] "wires": []
}, },
{ {
@@ -2546,8 +2571,8 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 1490,
"y": 220, "y": 1000,
"wires": [ "wires": [
[ [
"ee9fdf6abaeac67b" "ee9fdf6abaeac67b"
@@ -2566,8 +2591,8 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 1490,
"y": 260, "y": 1040,
"wires": [ "wires": [
[ [
"a6a2a869c90e9632" "a6a2a869c90e9632"
@@ -2586,8 +2611,8 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 1490,
"y": 300, "y": 1080,
"wires": [ "wires": [
[ [
"67f154181e143217" "67f154181e143217"
@@ -2606,8 +2631,8 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 1490,
"y": 340, "y": 1120,
"wires": [ "wires": [
[ [
"8f07f55780eaea54" "8f07f55780eaea54"
@@ -2626,8 +2651,8 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 1490,
"y": 380, "y": 1160,
"wires": [ "wires": [
[ [
"3e9c527b9179cc5a" "3e9c527b9179cc5a"
@@ -2654,8 +2679,8 @@
"className": "", "className": "",
"value": "payloads", "value": "payloads",
"valueType": "msg", "valueType": "msg",
"x": 1850, "x": 1870,
"y": 100, "y": 880,
"wires": [] "wires": []
}, },
{ {
@@ -2678,8 +2703,8 @@
"className": "", "className": "",
"value": "payloads", "value": "payloads",
"valueType": "msg", "valueType": "msg",
"x": 1850, "x": 1870,
"y": 140, "y": 920,
"wires": [] "wires": []
}, },
{ {
@@ -2702,32 +2727,8 @@
"className": "", "className": "",
"value": "payloads", "value": "payloads",
"valueType": "msg", "valueType": "msg",
"x": 1850, "x": 1870,
"y": 180, "y": 960,
"wires": []
},
{
"id": "072b58c153a7e6be",
"type": "ui-text",
"z": "86a34ee77bf6db10",
"group": "6b44d4b22cd7b3dc",
"order": 14,
"width": "2",
"height": "1",
"name": "",
"label": "Actionneur 3",
"format": "{{msg.payload}}",
"layout": "row-spread",
"style": false,
"font": "",
"fontSize": 16,
"color": "#717171",
"wrapText": false,
"className": "",
"value": "payloads",
"valueType": "msg",
"x": 1850,
"y": 220,
"wires": [] "wires": []
}, },
{ {
@@ -2748,8 +2749,8 @@
"color": "#717171", "color": "#717171",
"wrapText": false, "wrapText": false,
"className": "", "className": "",
"value": "payload", "value": "🠙",
"valueType": "msg", "valueType": "str",
"x": 870, "x": 870,
"y": 1760, "y": 1760,
"wires": [] "wires": []
@@ -2772,8 +2773,8 @@
"color": "#717171", "color": "#717171",
"wrapText": false, "wrapText": false,
"className": "", "className": "",
"value": "payload", "value": "🠛",
"valueType": "msg", "valueType": "str",
"x": 870, "x": 870,
"y": 1800, "y": 1800,
"wires": [] "wires": []
@@ -2785,7 +2786,9 @@
"name": "main_out", "name": "main_out",
"mode": "link", "mode": "link",
"links": [ "links": [
"e5da08ba69fe6fb8" "e5da08ba69fe6fb8",
"15a9f57de2693451",
"9f6a891964ca0501"
], ],
"x": 655, "x": 655,
"y": 1940, "y": 1940,
@@ -2796,7 +2799,7 @@
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "s9 🠙", "name": "s9 🠙",
"func": "msg.payload = \"🠙\";\nmsg.ui_update = msg.payload.s9 == 1 ? { \"color\": \"#000\"} : { \"color\": \"#ddd\"};\nreturn msg;", "func": "msg.ui_update = msg.payload.s9 == 1 ? { \"color\": \"#000\"} : { \"color\": \"#ddd\"};\nglobal.set(\"s9\", msg.payload.s9);\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
@@ -2816,7 +2819,7 @@
"type": "function", "type": "function",
"z": "86a34ee77bf6db10", "z": "86a34ee77bf6db10",
"name": "s9 🠛", "name": "s9 🠛",
"func": "msg.payload = \"🠛\"\nmsg.ui_update = msg.payload.s9 == 1 ? { \"color\": \"#000\"} : { \"color\": \"#ddd\"};\nreturn msg;", "func": "msg.ui_update = msg.payload.s9 == 1 ? { \"color\": \"#000\"} : { \"color\": \"#ddd\"};\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": 0, "timeout": 0,
"noerr": 0, "noerr": 0,
@@ -2994,6 +2997,117 @@
] ]
] ]
}, },
{
"id": "c613454bd48662e1",
"type": "link out",
"z": "86a34ee77bf6db10",
"name": "main_tick",
"mode": "link",
"links": [
"978ded7ba3456f70",
"5dac1387a71bc55e",
"ed71da98200376bd"
],
"x": 1225,
"y": 820,
"wires": []
},
{
"id": "5ff7cf747202687b",
"type": "debug",
"z": "86a34ee77bf6db10",
"name": "debug 2",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 380,
"y": 1620,
"wires": []
},
{
"id": "ffe1e88c3c60e495",
"type": "function",
"z": "86a34ee77bf6db10",
"name": "function 3",
"func": "msg.payload = msg.payload * 30;\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1680,
"y": 760,
"wires": [
[
"3ad77e23a54df2d0"
]
]
},
{
"id": "3ad77e23a54df2d0",
"type": "ui-gauge",
"z": "86a34ee77bf6db10",
"name": "",
"group": "050148aff99031d4",
"order": 1,
"value": "payload",
"valueType": "msg",
"width": "4",
"height": "5",
"gtype": "gauge-tank",
"gstyle": "needle",
"title": "gauge",
"alwaysShowTitle": false,
"floatingTitlePosition": "top-left",
"units": "units",
"icon": "",
"prefix": "",
"suffix": "",
"segments": [
{
"from": "0",
"color": "#e01b24",
"text": "",
"textType": "label"
},
{
"from": "500",
"color": "#ff7800",
"text": "",
"textType": "label"
},
{
"from": "1000",
"color": "#f6d32d",
"text": "",
"textType": "label"
},
{
"from": "1500",
"color": "#2397d1",
"text": "",
"textType": "label"
}
],
"min": 0,
"max": "3000",
"sizeThickness": 16,
"sizeGap": 4,
"sizeKeyThickness": 8,
"styleRounded": true,
"styleGlow": false,
"className": "",
"x": 1870,
"y": 760,
"wires": [
[]
]
},
{ {
"id": "cefd0feeeaf4227c", "id": "cefd0feeeaf4227c",
"type": "function", "type": "function",
@@ -3825,6 +3939,7 @@
"id": "e5da08ba69fe6fb8", "id": "e5da08ba69fe6fb8",
"type": "link in", "type": "link in",
"z": "b5e17af18ea9731a", "z": "b5e17af18ea9731a",
"d": true,
"name": "link in 1", "name": "link in 1",
"links": [ "links": [
"397735dd2560f7cf" "397735dd2560f7cf"
@@ -3917,5 +4032,109 @@
"x": 730, "x": 730,
"y": 600, "y": 600,
"wires": [] "wires": []
},
{
"id": "978ded7ba3456f70",
"type": "link in",
"z": "93dc5b41180d0746",
"d": true,
"name": "link in 2",
"links": [
"c613454bd48662e1"
],
"x": 105,
"y": 100,
"wires": [
[
"efb9e7de1cbdadfc"
]
]
},
{
"id": "efb9e7de1cbdadfc",
"type": "function",
"z": "93dc5b41180d0746",
"name": "niveau",
"func": "let p0 = Number(global.get(\"p0\")) || 0;\n\nif (global.get(\"m0\")) {\n p0++;\n if (p0 > 100) p0 = 100;\n global.set(\"p0\", p0);\n}\n\nif (global.get(\"m1\")) {\n p0--;\n if (p0 < 0) p0 = 0;\n global.set(\"p0\", p0);\n}\n\nmsg.payload = p0;\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 290,
"y": 100,
"wires": [
[]
]
},
{
"id": "5dac1387a71bc55e",
"type": "link in",
"z": "93dc5b41180d0746",
"d": true,
"name": "link in 4",
"links": [
"c613454bd48662e1"
],
"x": 105,
"y": 160,
"wires": [
[
"0254cb2f1f7015da"
]
]
},
{
"id": "0254cb2f1f7015da",
"type": "function",
"z": "93dc5b41180d0746",
"name": "monte charge",
"func": "let p0 = Number(global.get(\"p0\")) || 0;\n\nlet sens = global.get(\"s9\");\n\nif (global.get(\"m0\")) {\n p0 += sens;\n if (p0 > 100) p0 = 100;\n if (p0 < 0) p0 = 0;\n global.set(\"p0\", p0);\n\n global.set(\"c0\", (p0 >= 9 && p0 <= 11));\n global.set(\"c1\", (p0 >= 19 && p0 <= 21));\n global.set(\"c2\", (p0 >= 29 && p0 <= 31));\n global.set(\"c3\", (p0 >= 39 && p0 <= 41));\n global.set(\"c4\", (p0 >= 49 && p0 <= 51));\n global.set(\"c5\", (p0 >= 59 && p0 <= 61));\n global.set(\"c6\", (p0 >= 69 && p0 <= 71));\n global.set(\"c7\", (p0 >= 79 && p0 <= 81)); \n}\n\nmsg.payload = p0;\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 160,
"wires": [
[]
]
},
{
"id": "ed71da98200376bd",
"type": "link in",
"z": "93dc5b41180d0746",
"name": "link in 3",
"links": [
"c613454bd48662e1"
],
"x": 105,
"y": 220,
"wires": [
[
"24ee793574d63484"
]
]
},
{
"id": "24ee793574d63484",
"type": "function",
"z": "93dc5b41180d0746",
"name": "function 2",
"func": "let p0 = Number(global.get(\"p0\")) || 0;\nlet v0 = Number(global.get(\"v0\")) || 0;\n\nif (global.get(\"m0\")) {\n p0 += 0.3;\n}\n\nif (global.get(\"m2\")) {\n p0 += 0.3;\n}\n\nif (global.get(\"m3\")) {\n p0 += 0.3;\n}\n\nif (global.get(\"m4\")) {\n p0 += 0.3;\n}\n\np0 = p0 - v0 / 100;\n\nif (p0 > 100) p0 = 100;\nif (p0 < 0) p0 = 0;\nglobal.set(\"p0\", p0);\nmsg.payload = p0;\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 300,
"y": 220,
"wires": [
[]
]
} }
] ]

58
18.md Normal file
View File

@@ -0,0 +1,58 @@
ci = (c0 == 1 && c1 == 1 && c2 == 0 && c3 == 0 && c5 == 0 && c6 == 0);
if (marche_frontmontant == 1 && ci == 1) {
mode_auto = 1;
etape = 1;
}
if (arret_frontdescedant == 1) {
mode_auto = 0;
}
if (etape == 1 && c6 == 1) {
etape = 2;
}
if (etape == 2 && c2 == 1) {
etape = 3;
}
if (etape == 3 && tempo == 0) {
tempo = millis();
}
if (etape == 3 && millis() > tempo + 3000) {
etape = 4;
tempo = 0;
}
if (etape == 4 && c1 == 1) {
etape = 5;
}
if (etape == 5 && c3 == 1) {
etape = 6;
}
if (etape == 6 && c5_frontdescendant == 1) {
etape = 1;
}
s0 = mode_auto == 1;
if (ci && mode_auto == 0) {
s8 = 1;
} else if (ci && mode_auto == 1) {
s8 = 2;
} else if (mode_auto) {
s8 = 3;
} else {
s8 = 0;
}
s10 = etape;
a0 = (etape == 1);
a1 = (etape == 2 || etape == 3);
a2 = (etape == 5);
a3 = (etape == 6);

View File

@@ -141,7 +141,11 @@ public:
if (j.contains("c7") && j["c7"].is_number()) if (j.contains("c7") && j["c7"].is_number())
c7 = j["c7"].get<int>(); c7 = j["c7"].get<int>();
if (j.contains("v0") && j["v0"].is_number()) v0 = j["v0"].get<int>(); if (j.contains("v0") && j["v0"].is_number())
v0 = j["v0"].get<int>();
if (j.contains("p0") && j["p0"].is_number())
v0 = j["p0"].get<int>();
process(); process();
mqtt_send(&client); mqtt_send(&client);

View File

@@ -26,6 +26,18 @@ int b6_frontmontant = 0;
int b7_precedent = 0; int b7_precedent = 0;
int b7_frontmontant = 0; int b7_frontmontant = 0;
int cycle = 0;
long unsigned tempo = 0;
int compteur = 0;
int sens = 1;
int ci = 0;
int mode_auto = 0;
int etape = 0;
int c5_frontdescendant = 0;
int c5_precedent = 0;
int main() int main()
{ {
mqtt_open(&client); mqtt_open(&client);
@@ -53,17 +65,12 @@ void process() {
b6_frontmontant = b6 > b6_precedent; b6_frontmontant = b6 > b6_precedent;
b7_frontmontant = b7 > b7_precedent; b7_frontmontant = b7 > b7_precedent;
s0 = i0; marche_frontmontant = marche > marche_precedent;
arret_frontdescedant = arret < arret_precedent;
c5_frontdescendant = c5 < c5_precedent;
if (b1_frontmontant == 1) m0 = i0;
{ m1 = i1;
s1 = !s1; // Inversion
}
if (b2_frontmontant == 1)
{
s2 = !s2; // Inversion
}
// Prêt pour un nouveau tour // Prêt pour un nouveau tour
// L'état courant devient l'état précédent // L'état courant devient l'état précédent
@@ -75,4 +82,7 @@ void process() {
b5_precedent = b5; b5_precedent = b5;
b6_precedent = b6; b6_precedent = b6;
b7_precedent = b7; b7_precedent = b7;
marche_precedent = marche;
arret_precedent = arret;
c5_precedent = c5;
} }