autom p0
This commit is contained in:
@@ -416,8 +416,8 @@
|
|||||||
"correl": "",
|
"correl": "",
|
||||||
"expiry": "",
|
"expiry": "",
|
||||||
"broker": "5bf949eb0a1b50a7",
|
"broker": "5bf949eb0a1b50a7",
|
||||||
"x": 110,
|
"x": 210,
|
||||||
"y": 100,
|
"y": 120,
|
||||||
"wires": []
|
"wires": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1301,7 +1301,7 @@
|
|||||||
"type": "function",
|
"type": "function",
|
||||||
"z": "86a34ee77bf6db10",
|
"z": "86a34ee77bf6db10",
|
||||||
"name": "format mqtt",
|
"name": "format mqtt",
|
||||||
"func": "let i0 = Number(flow.get(\"i0\")) || 0;\nlet i1 = Number(flow.get(\"i1\")) || 0;\nlet i2 = Number(flow.get(\"i2\")) || 0;\nlet i3 = Number(flow.get(\"i3\")) || 0;\nlet i4 = Number(flow.get(\"i4\")) || 0;\nlet i5 = Number(flow.get(\"i5\")) || 0;\nlet i6 = Number(flow.get(\"i6\")) || 0;\nlet i7 = Number(flow.get(\"i7\")) || 0;\n\nlet v0 = Number(flow.get(\"v0\")) || 0;\n\nif (typeof msg.payload[\"arret\"] === 'undefined') msg.payload[\"arret\"] = 1;\nif (typeof msg.payload[\"marche\"] === 'undefined') msg.payload[\"marche\"] = 0;\n\nif (typeof msg.payload[\"b0\"] === 'undefined') msg.payload[\"b0\"] = 0;\nif (typeof msg.payload[\"b1\"] === 'undefined') msg.payload[\"b1\"] = 0;\nif (typeof msg.payload[\"b2\"] === 'undefined') msg.payload[\"b2\"] = 0;\nif (typeof msg.payload[\"b3\"] === 'undefined') msg.payload[\"b3\"] = 0;\nif (typeof msg.payload[\"b4\"] === 'undefined') msg.payload[\"b4\"] = 0;\nif (typeof msg.payload[\"b5\"] === 'undefined') msg.payload[\"b5\"] = 0;\nif (typeof msg.payload[\"b6\"] === 'undefined') msg.payload[\"b6\"] = 0;\nif (typeof msg.payload[\"b7\"] === 'undefined') msg.payload[\"b7\"] = 0;\n\nmsg.payload[\"i0\"] = i0;\nmsg.payload[\"i1\"] = i1;\nmsg.payload[\"i2\"] = i2;\nmsg.payload[\"i3\"] = i3;\nmsg.payload[\"i4\"] = i4;\nmsg.payload[\"i5\"] = i5;\nmsg.payload[\"i6\"] = i6;\nmsg.payload[\"i7\"] = i7;\n\nmsg.payload[\"c0\"] = Number(global.get(\"c0\")) || 0;\nmsg.payload[\"c1\"] = Number(global.get(\"c1\")) || 0;\nmsg.payload[\"c2\"] = Number(global.get(\"c2\")) || 0;\nmsg.payload[\"c3\"] = Number(global.get(\"c3\")) || 0;\nmsg.payload[\"c4\"] = Number(global.get(\"c4\")) || 0;\nmsg.payload[\"c5\"] = Number(global.get(\"c5\")) || 0;\nmsg.payload[\"c6\"] = Number(global.get(\"c6\")) || 0;\nmsg.payload[\"c7\"] = Number(global.get(\"c7\")) || 0;\n\nmsg.payload[\"v0\"] = v0;\n\nreturn msg;",
|
"func": "let i0 = Number(flow.get(\"i0\")) || 0;\nlet i1 = Number(flow.get(\"i1\")) || 0;\nlet i2 = Number(flow.get(\"i2\")) || 0;\nlet i3 = Number(flow.get(\"i3\")) || 0;\nlet i4 = Number(flow.get(\"i4\")) || 0;\nlet i5 = Number(flow.get(\"i5\")) || 0;\nlet i6 = Number(flow.get(\"i6\")) || 0;\nlet i7 = Number(flow.get(\"i7\")) || 0;\n\nlet v0 = Number(global.get(\"v0\")) || 0;\n\nif (typeof msg.payload[\"arret\"] === 'undefined') msg.payload[\"arret\"] = 1;\nif (typeof msg.payload[\"marche\"] === 'undefined') msg.payload[\"marche\"] = 0;\n\nif (typeof msg.payload[\"b0\"] === 'undefined') msg.payload[\"b0\"] = 0;\nif (typeof msg.payload[\"b1\"] === 'undefined') msg.payload[\"b1\"] = 0;\nif (typeof msg.payload[\"b2\"] === 'undefined') msg.payload[\"b2\"] = 0;\nif (typeof msg.payload[\"b3\"] === 'undefined') msg.payload[\"b3\"] = 0;\nif (typeof msg.payload[\"b4\"] === 'undefined') msg.payload[\"b4\"] = 0;\nif (typeof msg.payload[\"b5\"] === 'undefined') msg.payload[\"b5\"] = 0;\nif (typeof msg.payload[\"b6\"] === 'undefined') msg.payload[\"b6\"] = 0;\nif (typeof msg.payload[\"b7\"] === 'undefined') msg.payload[\"b7\"] = 0;\n\nmsg.payload[\"i0\"] = i0;\nmsg.payload[\"i1\"] = i1;\nmsg.payload[\"i2\"] = i2;\nmsg.payload[\"i3\"] = i3;\nmsg.payload[\"i4\"] = i4;\nmsg.payload[\"i5\"] = i5;\nmsg.payload[\"i6\"] = i6;\nmsg.payload[\"i7\"] = i7;\n\nmsg.payload[\"c0\"] = Number(global.get(\"c0\")) || 0;\nmsg.payload[\"c1\"] = Number(global.get(\"c1\")) || 0;\nmsg.payload[\"c2\"] = Number(global.get(\"c2\")) || 0;\nmsg.payload[\"c3\"] = Number(global.get(\"c3\")) || 0;\nmsg.payload[\"c4\"] = Number(global.get(\"c4\")) || 0;\nmsg.payload[\"c5\"] = Number(global.get(\"c5\")) || 0;\nmsg.payload[\"c6\"] = Number(global.get(\"c6\")) || 0;\nmsg.payload[\"c7\"] = Number(global.get(\"c7\")) || 0;\n\nmsg.payload[\"v0\"] = v0;\nmsg.payload[\"p0\"] = Number(global.get(\"p0\")) || 0;\n\nreturn msg;",
|
||||||
"outputs": 1,
|
"outputs": 1,
|
||||||
"timeout": 0,
|
"timeout": 0,
|
||||||
"noerr": 0,
|
"noerr": 0,
|
||||||
@@ -4035,7 +4035,6 @@
|
|||||||
"id": "978ded7ba3456f70",
|
"id": "978ded7ba3456f70",
|
||||||
"type": "link in",
|
"type": "link in",
|
||||||
"z": "93dc5b41180d0746",
|
"z": "93dc5b41180d0746",
|
||||||
"d": true,
|
|
||||||
"name": "link in 2",
|
"name": "link in 2",
|
||||||
"links": [
|
"links": [
|
||||||
"c613454bd48662e1"
|
"c613454bd48662e1"
|
||||||
@@ -4105,6 +4104,7 @@
|
|||||||
"id": "ed71da98200376bd",
|
"id": "ed71da98200376bd",
|
||||||
"type": "link in",
|
"type": "link in",
|
||||||
"z": "93dc5b41180d0746",
|
"z": "93dc5b41180d0746",
|
||||||
|
"d": true,
|
||||||
"name": "link in 3",
|
"name": "link in 3",
|
||||||
"links": [
|
"links": [
|
||||||
"c613454bd48662e1"
|
"c613454bd48662e1"
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ int i0, i1, i2, i3, i4, i5, i6, i7;
|
|||||||
int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
|
int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
|
||||||
int m0, m1, m2, m3;
|
int m0, m1, m2, m3;
|
||||||
int v0;
|
int v0;
|
||||||
|
int p0;
|
||||||
|
|
||||||
int a0, a1, a2, a3, a4, a5, a6, a7;
|
int a0, a1, a2, a3, a4, a5, a6, a7;
|
||||||
int c0, c1, c2, c3, c4, c5, c6, c7;
|
int c0, c1, c2, c3, c4, c5, c6, c7;
|
||||||
@@ -145,7 +146,7 @@ public:
|
|||||||
v0 = j["v0"].get<int>();
|
v0 = j["v0"].get<int>();
|
||||||
|
|
||||||
if (j.contains("p0") && j["p0"].is_number())
|
if (j.contains("p0") && j["p0"].is_number())
|
||||||
v0 = j["p0"].get<int>();
|
p0 = j["p0"].get<int>();
|
||||||
|
|
||||||
process();
|
process();
|
||||||
mqtt_send(&client);
|
mqtt_send(&client);
|
||||||
|
|||||||
Reference in New Issue
Block a user