UI: force default values to be saved, clearer expected units

This commit is contained in:
Romain Bazile 2020-12-16 13:09:55 +01:00
parent f2d84a3747
commit d732c8d4ce

View file

@ -1908,7 +1908,7 @@
"height": 0, "height": 0,
"passthru": true, "passthru": true,
"mode": "text", "mode": "text",
"delay": "1000", "delay": "0",
"topic": "sample_ship", "topic": "sample_ship",
"x": 670, "x": 670,
"y": 80, "y": 80,
@ -1988,7 +1988,7 @@
"height": 0, "height": 0,
"passthru": true, "passthru": true,
"mode": "text", "mode": "text",
"delay": "1000", "delay": "0",
"topic": "sample_operator", "topic": "sample_operator",
"x": 650, "x": 650,
"y": 160, "y": 160,
@ -2012,7 +2012,7 @@
"height": 0, "height": 0,
"passthru": true, "passthru": true,
"mode": "text", "mode": "text",
"delay": "1000", "delay": "0",
"topic": "sample_project", "topic": "sample_project",
"x": 660, "x": 660,
"y": 40, "y": 40,
@ -2035,7 +2035,7 @@
"height": 0, "height": 0,
"passthru": true, "passthru": true,
"mode": "text", "mode": "text",
"delay": "1000", "delay": "0",
"topic": "sample_id", "topic": "sample_id",
"x": 670, "x": 670,
"y": 120, "y": 120,
@ -3565,7 +3565,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "get sample_projet", "name": "get sample_projet",
"func": "msg.payload = msg.payload.sample_project;\nreturn msg;", "func": "msg.payload = msg.payload.sample_project;\nglobal.set(\"sample_projet\",msg.payload);\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -3583,7 +3583,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "get sample_ship", "name": "get sample_ship",
"func": "msg.payload = msg.payload.sample_ship;\nreturn msg;", "func": "msg.payload = msg.payload.sample_ship;\nglobal.set(\"sample_ship\",msg.payload);\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -3601,7 +3601,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "get sample_id", "name": "get sample_id",
"func": "msg.payload = msg.payload.sample_id;\nreturn msg;", "func": "msg.payload = msg.payload.sample_id;\nglobal.set(\"sample_id\",msg.payload);\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -3619,7 +3619,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "get sample_operator", "name": "get sample_operator",
"func": "msg.payload = msg.payload.sample_operator;\nreturn msg;", "func": "msg.payload = msg.payload.sample_operator;\nglobal.set(\"sample_operator\",msg.payload);\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -3637,7 +3637,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "get sample_sampling_gear", "name": "get sample_sampling_gear",
"func": "if (msg.payload.sample_sampling_gear === null){\n msg.payload = \"net\";\n}\nelse\n{\n msg.payload = msg.payload.sample_sampling_gear;\n}\nreturn msg;", "func": "if (msg.payload.sample_sampling_gear === null){\n msg.payload = \"net\";\n}\nelse\n{\n msg.payload = msg.payload.sample_sampling_gear;\n}\nglobal.set(\"sample_sampling_gear\",msg.payload);\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -3646,7 +3646,8 @@
"y": 200, "y": 200,
"wires": [ "wires": [
[ [
"fcfc31ae.af3af" "fcfc31ae.af3af",
"46eb1bf8.3dc5f4"
] ]
] ]
}, },
@ -3786,9 +3787,9 @@
"45911c98.2bd83c", "45911c98.2bd83c",
"1e09a4ab.72996b", "1e09a4ab.72996b",
"296c73f.78ff10c", "296c73f.78ff10c",
"f408a273.4fb538",
"8dff1648.82e42", "8dff1648.82e42",
"9f04c5ec.75f3d8" "9f04c5ec.75f3d8",
"f408a273.4fb538"
] ]
] ]
}, },
@ -4187,7 +4188,7 @@
"height": 1, "height": 1,
"passthru": true, "passthru": true,
"mode": "number", "mode": "number",
"delay": "1000", "delay": "0",
"topic": "object_depth_max", "topic": "object_depth_max",
"x": 650, "x": 650,
"y": 240, "y": 240,
@ -4210,7 +4211,7 @@
"height": 1, "height": 1,
"passthru": true, "passthru": true,
"mode": "number", "mode": "number",
"delay": "1000", "delay": "0",
"topic": "object_depth_min", "topic": "object_depth_min",
"x": 650, "x": 650,
"y": 280, "y": 280,
@ -5250,9 +5251,9 @@
"id": "cbb123ab.fd3428", "id": "cbb123ab.fd3428",
"type": "ui_ui_control", "type": "ui_ui_control",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "", "name": "show/hide net groups",
"events": "change", "events": "change",
"x": 1280, "x": 1320,
"y": 260, "y": 260,
"wires": [ "wires": [
[] []
@ -5414,7 +5415,7 @@
"height": 1, "height": 1,
"passthru": true, "passthru": true,
"mode": "number", "mode": "number",
"delay": "1000", "delay": "0",
"topic": "sample_concentrated_sample_volume", "topic": "sample_concentrated_sample_volume",
"x": 590, "x": 590,
"y": 360, "y": 360,
@ -5437,7 +5438,7 @@
"height": 1, "height": 1,
"passthru": true, "passthru": true,
"mode": "number", "mode": "number",
"delay": "1000", "delay": "0",
"topic": "sample_gear_net_opening", "topic": "sample_gear_net_opening",
"x": 620, "x": 620,
"y": 320, "y": 320,
@ -7622,18 +7623,18 @@
"id": "516375fd.2ed61c", "id": "516375fd.2ed61c",
"type": "ui_text_input", "type": "ui_text_input",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "sample_total_volume_start", "name": "sample_total_flowmeter_start",
"label": "Decknet flowmeter start", "label": "Decknet flowmeter start",
"tooltip": "", "tooltip": "in L",
"group": "cf5d9f0e.d57e7", "group": "cf5d9f0e.d57e7",
"order": 5, "order": 5,
"width": 5, "width": 5,
"height": 1, "height": 1,
"passthru": true, "passthru": false,
"mode": "text", "mode": "text",
"delay": 300, "delay": "0",
"topic": "sample_total_volume_start", "topic": "sample_total_flowmeter_start",
"x": 1340, "x": 1350,
"y": 180, "y": 180,
"wires": [ "wires": [
[ [
@ -7645,17 +7646,17 @@
"id": "470e382a.25691", "id": "470e382a.25691",
"type": "ui_text_input", "type": "ui_text_input",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "sample_total_volume_end", "name": "sample_total_flowmeter_end",
"label": "Decknet flowmeter end", "label": "Decknet flowmeter end",
"tooltip": "", "tooltip": "in L",
"group": "cf5d9f0e.d57e7", "group": "cf5d9f0e.d57e7",
"order": 6, "order": 6,
"width": 5, "width": 5,
"height": 1, "height": 1,
"passthru": true, "passthru": false,
"mode": "text", "mode": "text",
"delay": 300, "delay": "0",
"topic": "sample_total_volume_end", "topic": "sample_total_flowmeter_end",
"x": 1340, "x": 1340,
"y": 220, "y": 220,
"wires": [ "wires": [
@ -7669,7 +7670,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "Store sample_total_volume", "name": "Store sample_total_volume",
"func": "if (msg.topic == \"sample_total_volume_start\"){\n context.set(\"sample_total_volume_start\", msg.payload);\n}\nif (msg.topic == \"sample_total_volume_end\"){\n context.set(\"sample_total_volume_end\", msg.payload);\n}\nif (context.keys().length == 2){\n sample_total_volume = context.get(\"sample_total_volume_end\") - context.get(\"sample_total_volume_start\");\n global.set(\"sample_total_volume\", sample_total_volume);\n}\n\n", "func": "if (msg.topic == \"sample_total_flowmeter_start\"){\n context.set(\"sample_total_flowmeter_start\", msg.payload);\n}\nif (msg.topic == \"sample_total_flowmeter_end\"){\n context.set(\"sample_total_flowmeter_end\", msg.payload);\n}\nif (context.keys().length == 2){\n sample_total_volume = context.get(\"sample_total_flowmeter_end\") - context.get(\"sample_total_flowmeter_start\");\n global.set(\"sample_total_volume\", sample_total_volume);\n}\n\n",
"outputs": 2, "outputs": 2,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -7694,7 +7695,7 @@
"order": 4, "order": 4,
"width": 10, "width": 10,
"height": 1, "height": 1,
"format": "<div style=\"line-height: 100%;\">\n <p class=\"formlabel\" style=\"font-size: larger;\">Decknet flowmeter readings</p>\n <p style=\"font-size: smaller;\">Those values are used to calculate <font style=\"font-family: mono;\">sample_total_volume</font>.</p>\n</div>\n", "format": "<div style=\"line-height: 100%;\">\n <p class=\"formlabel\" style=\"font-size: larger;\">Decknet flowmeter readings</p>\n <p style=\"font-size: smaller;\">Those values are used to calculate <font style=\"font-family: mono;\">sample_total_volume</font>. Values are in L.</p>\n</div>\n",
"storeOutMessages": true, "storeOutMessages": true,
"fwdInMessages": true, "fwdInMessages": true,
"resendOnRefresh": true, "resendOnRefresh": true,
@ -8236,7 +8237,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "get sample_gear_net_opening", "name": "get sample_gear_net_opening",
"func": "if (msg.payload.sample_gear_net_opening === null){\n msg.payload = 0;\n}\nelse\n{\n msg.payload = msg.payload.sample_gear_net_opening;\n}\nreturn msg;", "func": "if (msg.payload.sample_gear_net_opening === null){\n msg.payload = 0;\n}\nelse\n{\n msg.payload = msg.payload.sample_gear_net_opening;\n}\nglobal.set(\"sample_gear_net_opening\",msg.payload);\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -8286,7 +8287,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "get object_depth_max", "name": "get object_depth_max",
"func": "if (msg.payload.object_depth_max === null){\n msg.payload = 0;\n}\nelse\n{\n msg.payload = msg.payload.object_depth_max;\n}\nreturn msg;", "func": "if (msg.payload.object_depth_max === null){\n msg.payload = 0;\n}\nelse\n{\n msg.payload = msg.payload.object_depth_max;\n}\nglobal.set(\"object_depth_max\",msg.payload);\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -8304,7 +8305,7 @@
"type": "function", "type": "function",
"z": "b771c342.49603", "z": "b771c342.49603",
"name": "get object_depth_min", "name": "get object_depth_min",
"func": "if (msg.payload.object_depth_min === null){\n msg.payload = 0;\n}\nelse\n{\n msg.payload = msg.payload.object_depth_min;\n}\nreturn msg;", "func": "if (msg.payload.object_depth_min === null){\n msg.payload = 0;\n}\nelse\n{\n msg.payload = msg.payload.object_depth_min;\n}\nglobal.set(\"object_depth_min\",msg.payload);\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",