diff --git a/flows/main.json b/flows/main.json index ccc756f..075f560 100644 --- a/flows/main.json +++ b/flows/main.json @@ -406,7 +406,7 @@ "name": "Sample Location", "tab": "737ec584.2eea2c", "order": 2, - "disp": true, + "disp": false, "width": "10", "collapse": false }, @@ -584,7 +584,7 @@ "name": "Net Metadata", "tab": "737ec584.2eea2c", "order": 3, - "disp": true, + "disp": false, "width": "10", "collapse": false }, @@ -858,7 +858,7 @@ "height": 1 }, { - "id": "e53fb724.7feff8", + "id": "fa476959.0ed528", "type": "ui_spacer", "name": "spacer", "group": "3e1ba03d.f01d8", @@ -867,11 +867,11 @@ "height": 1 }, { - "id": "3e6c5bc0.8a0544", + "id": "82150cb5.2ef8b", "type": "ui_spacer", "name": "spacer", "group": "cf5d9f0e.d57e7", - "order": 13, + "order": 5, "width": 4, "height": 1 }, @@ -1849,7 +1849,7 @@ "type": "ui_dropdown", "z": "b771c342.49603", "name": "sample_sampling_gear", - "label": "Sampling gear", + "label": "Sampling gear*", "tooltip": "", "place": "Choose from list", "group": "3e1ba03d.f01d8", @@ -1906,7 +1906,7 @@ "type": "ui_text_input", "z": "b771c342.49603", "name": "sample_operator", - "label": "Name of the operator", + "label": "Name of the operator*", "tooltip": "", "group": "3e1ba03d.f01d8", "order": 4, @@ -2061,8 +2061,8 @@ "z": "b771c342.49603", "name": "", "events": "change", - "x": 340, - "y": 880, + "x": 400, + "y": 680, "wires": [ [] ] @@ -2081,8 +2081,8 @@ "raw": false, "topic": "", "name": "", - "x": 650, - "y": 1000, + "x": 710, + "y": 800, "wires": [ [] ] @@ -2092,13 +2092,13 @@ "type": "function", "z": "b771c342.49603", "name": "Check form", - "func": "var sample_project= global.get(\"sample_project\");\nvar sample_ship= global.get(\"sample_ship\");\nvar sample_id= global.get(\"sample_id\");\nvar sample_operator= global.get(\"sample_operator\");\nvar sample_sampling_gear= global.get(\"sample_sampling_gear\");\nvar object_lat= global.get(\"object_lat\");\nvar object_lon= global.get(\"object_lon\");\nvar object_date= global.get(\"object_date\");\nvar object_time= global.get(\"object_time\");\n\nif (sample_project === undefined || sample_project === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample project\"\n return [null, msg];\n}\n\nelse if (sample_ship === undefined || sample_ship === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ship\"\n return [null, msg];\n}\n\nelse if (sample_id === undefined || sample_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ID\"\n return [null, msg];\n}\n\nelse if (sample_operator === undefined || sample_operator === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample operator\"\n return [null, msg];\n}\n\nelse if (sample_sampling_gear === undefined || sample_sampling_gear === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample sampling gear\"\n return [null, msg];\n}\n\nelse if (object_lat === undefined || object_lat === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Latitude of sample\"\n return [null, msg];\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Longitude of sample\"\n return [null, msg];\n}\n\nelse if (object_date === undefined || object_date === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date of sample\"\n return [null, msg];\n}\n\nelse if (object_time === undefined || object_time === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time of sample\"\n return [null, msg];\n}\nelse if (sample_sampling_gear == \"net\"){\n var object_lat_end= global.get(\"object_lat_end\");\n var object_lon_end= global.get(\"object_lon_end\");\n var object_date_end= global.get(\"object_date_end\");\n var object_time_end= global.get(\"object_time_end\");\n\n if (object_lat_end === undefined || object_lat_end === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Latitude of retrieval\"\n return [null, msg];\n }\n \n else if (object_lon_end === undefined || object_lon_end === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Longitude of retrieval\"\n return [null, msg];\n }\n \n else if (object_date_end === undefined || object_date_end === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date of retrieval\"\n return [null, msg];\n }\n \n else if (object_time_end === undefined || object_time_end === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time of retrieval\"\n return [null, msg];\n }\n}\nmsg.topic = \"Change Tab\"\nmsg.payload={\"tab\":\"Optic Configuration\"};\n\nreturn [msg, null];", + "func": "var sample_project= global.get(\"sample_project\");\nvar sample_id= global.get(\"sample_id\");\nvar sample_operator= global.get(\"sample_operator\");\nvar sample_sampling_gear= global.get(\"sample_sampling_gear\");\nvar object_lat= global.get(\"object_lat\");\nvar object_lon= global.get(\"object_lon\");\nvar object_date= global.get(\"object_date\");\nvar object_time= global.get(\"object_time\");\n\nif (sample_project === undefined || sample_project === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample project\"\n return [null, msg];\n}\n\nelse if (sample_id === undefined || sample_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ID\"\n return [null, msg];\n}\n\nelse if (sample_operator === undefined || sample_operator === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample operator\"\n return [null, msg];\n}\n\nelse if (sample_sampling_gear === undefined || sample_sampling_gear === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample sampling gear\"\n return [null, msg];\n}\n\nelse if (object_lat === undefined || object_lat === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Latitude of sample\"\n return [null, msg];\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Longitude of sample\"\n return [null, msg];\n}\n\nelse if (object_date === undefined || object_date === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date of sample\"\n return [null, msg];\n}\n\nelse if (object_time === undefined || object_time === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time of sample\"\n return [null, msg];\n}\nelse if (sample_sampling_gear.startsWith(\"net\")){\n var object_lat_end = global.get(\"object_lat_end\");\n var object_lon_end = global.get(\"object_lon_end\");\n var object_date_end = global.get(\"object_date_end\");\n var object_time_end = global.get(\"object_time_end\");\n var sample_gear_net_opening = global.get(\"sample_gear_net_opening\");\n\n if (object_lat_end === undefined || object_lat_end === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Latitude of retrieval\"\n return [null, msg];\n }\n \n else if (object_lon_end === undefined || object_lon_end === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Longitude of retrieval\"\n return [null, msg];\n }\n \n else if (object_date_end === undefined || object_date_end === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date of retrieval\"\n return [null, msg];\n }\n \n else if (object_time_end === undefined || object_time_end === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time of retrieval\"\n return [null, msg];\n }\n \n else if (sample_gear_net_opening === undefined || sample_gear_net_opening === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Net opening dimension\"\n return [null, msg];\n }\n}\nmsg.topic = \"Change Tab\"\nmsg.payload={\"tab\":\"Optic Configuration\"};\n\nreturn [msg, null];", "outputs": 2, "noerr": 0, "initialize": "", "finalize": "", - "x": 350, - "y": 940, + "x": 410, + "y": 740, "wires": [ [ "726a7822.cd6298", @@ -2126,8 +2126,8 @@ "device": false, "gst": false, "att": false, - "x": 170, - "y": 1000, + "x": 230, + "y": 800, "wires": [ [] ] @@ -2138,101 +2138,12 @@ "z": "b771c342.49603", "name": "", "events": "change", - "x": 640, - "y": 920, + "x": 700, + "y": 720, "wires": [ [] ] }, - { - "id": "2d128018.6a809", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lat", - "label": "Latitude", - "tooltip": "36.5794° N", - "group": "cf5d9f0e.d57e7", - "order": 3, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": "1000", - "topic": "object_lat", - "x": 620, - "y": 560, - "wires": [ - [ - "7953b1b2.d53ed8" - ] - ] - }, - { - "id": "4626c0da.e0dd5", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lon", - "label": "Longitude", - "tooltip": "110.421° W", - "group": "cf5d9f0e.d57e7", - "order": 4, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": "1000", - "topic": "object_lon", - "x": 610, - "y": 600, - "wires": [ - [ - "7953b1b2.d53ed8" - ] - ] - }, - { - "id": "f00f321f.77d76", - "type": "ui_date_picker", - "z": "b771c342.49603", - "name": "object_date", - "label": "Date", - "group": "cf5d9f0e.d57e7", - "order": 5, - "width": 5, - "height": 1, - "passthru": true, - "topic": "object_date", - "x": 1250, - "y": 560, - "wires": [ - [ - "29f2b365.4327ec" - ] - ] - }, - { - "id": "207fbdbb.2fe2a2", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_time", - "label": "Time", - "tooltip": "UTC time, 03:23:00 or 15:45", - "group": "cf5d9f0e.d57e7", - "order": 6, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "object_time", - "x": 1250, - "y": 600, - "wires": [ - [ - "1a945afa.d60aad" - ] - ] - }, { "id": "6c792043.b6ff9", "type": "ui_ui_control", @@ -2591,8 +2502,8 @@ "payload": "{\"tab\":\"Home\"}", "payloadType": "json", "topic": "", - "x": 180, - "y": 880, + "x": 240, + "y": 680, "wires": [ [ "222c851d.5d0a3a" @@ -2617,8 +2528,8 @@ "payload": "{\"tab\":\"Home\"}", "payloadType": "json", "topic": "", - "x": 180, - "y": 940, + "x": 240, + "y": 740, "wires": [ [ "986d960a.c75908" @@ -3853,129 +3764,8 @@ "z": "b771c342.49603", "name": "", "env": [], - "x": 630, - "y": 960, - "wires": [ - [] - ] - }, - { - "id": "3cea1f2.20525e", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lat_end", - "label": "Latitude", - "tooltip": "36.5794° N", - "group": "cf5d9f0e.d57e7", - "order": 8, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": "1000", - "topic": "object_lat_end", - "x": 600, - "y": 680, - "wires": [ - [ - "7953b1b2.d53ed8" - ] - ] - }, - { - "id": "661818e.5a31368", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lon_end", - "label": "Longitude", - "tooltip": "110.421° W", - "group": "cf5d9f0e.d57e7", - "order": 9, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": "1000", - "topic": "object_lon_end", - "x": 600, - "y": 720, - "wires": [ - [ - "7953b1b2.d53ed8" - ] - ] - }, - { - "id": "f9d71e4b.2940a", - "type": "ui_date_picker", - "z": "b771c342.49603", - "name": "object_date_end", - "label": "Date", - "group": "cf5d9f0e.d57e7", - "order": 10, - "width": 5, - "height": 1, - "passthru": true, - "topic": "object_date_end", - "x": 1230, - "y": 680, - "wires": [ - [ - "29f2b365.4327ec" - ] - ] - }, - { - "id": "2a514f3b.97a6b", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_time_end", - "label": "Time", - "tooltip": "UTC time, 03:23:00 or 15:45", - "group": "cf5d9f0e.d57e7", - "order": 11, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "object_time_end", - "x": 1230, - "y": 720, - "wires": [ - [ - "1a945afa.d60aad" - ] - ] - }, - { - "id": "1a945afa.d60aad", - "type": "function", - "z": "b771c342.49603", - "name": "set time global", - "func": "msg.payload = msg.payload.replace(/\\D/g, \"\"); // remove non-digit characters\nif (msg.payload.length<5) msg.payload += \"00\";\n\nglobal.set(msg.topic,msg.payload);", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "x": 1540, - "y": 600, - "wires": [ - [] - ] - }, - { - "id": "29f2b365.4327ec", - "type": "function", - "z": "b771c342.49603", - "name": "set date global", - "func": "var date = new Date(msg.payload);\n\nglobal.set(msg.topic,date.toISOString().split('T')[0].replace(/-/gi, ''));", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "x": 1540, - "y": 560, + "x": 690, + "y": 760, "wires": [ [] ] @@ -4204,8 +3994,8 @@ "d": true, "name": "GPS Status", "scope": [], - "x": 190, - "y": 1080, + "x": 250, + "y": 880, "wires": [ [ "7116e906.9f50f" @@ -4218,15 +4008,15 @@ "z": "b771c342.49603", "d": true, "group": "cf5d9f0e.d57e7", - "order": 12, + "order": 4, "width": 6, "height": 1, "name": "GPS Status Display", "label": "GPS Status:", "format": "{{msg.status.text}}", "layout": "row-left", - "x": 690, - "y": 1080, + "x": 750, + "y": 880, "wires": [] }, { @@ -4355,8 +4145,8 @@ "type": "ui_text_input", "z": "b771c342.49603", "name": "object_depth_max", - "label": "Object depth Max", - "tooltip": "", + "label": "Sampling depth Max", + "tooltip": "in m", "group": "3e1ba03d.f01d8", "order": 8, "width": 5, @@ -4378,8 +4168,8 @@ "type": "ui_text_input", "z": "b771c342.49603", "name": "object_depth_min", - "label": "Object Depth Min", - "tooltip": "", + "label": "Sampling Depth Min", + "tooltip": "in m", "group": "3e1ba03d.f01d8", "order": 7, "width": 5, @@ -5599,135 +5389,6 @@ [] ] }, - { - "id": "a3b44a65.2d125", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lat", - "label": "Latitude", - "tooltip": "36.5794° N", - "group": "cef1e703.bcf3c8", - "order": 1, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": "1000", - "topic": "object_lat", - "x": 620, - "y": 440, - "wires": [ - [ - "7953b1b2.d53ed8" - ] - ] - }, - { - "id": "d285b897.2ef578", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lon", - "label": "Longitude", - "tooltip": "110.421° W", - "group": "cef1e703.bcf3c8", - "order": 2, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": "1000", - "topic": "object_lon", - "x": 610, - "y": 480, - "wires": [ - [ - "7953b1b2.d53ed8" - ] - ] - }, - { - "id": "6212dc39.bc143c", - "type": "ui_date_picker", - "z": "b771c342.49603", - "name": "object_date", - "label": "Date", - "group": "cef1e703.bcf3c8", - "order": 3, - "width": 5, - "height": 1, - "passthru": true, - "topic": "object_date", - "x": 1250, - "y": 440, - "wires": [ - [ - "29f2b365.4327ec" - ] - ] - }, - { - "id": "8a13b675.d7851", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_time", - "label": "Time", - "tooltip": "UTC time, 03:23:00 or 15:45", - "group": "cef1e703.bcf3c8", - "order": 4, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "object_time", - "x": 1250, - "y": 480, - "wires": [ - [ - "1a945afa.d60aad" - ] - ] - }, - { - "id": "31c13820.0e52f", - "type": "ui_template", - "z": "b771c342.49603", - "group": "cf5d9f0e.d57e7", - "name": "Net throw location", - "order": 2, - "width": 0, - "height": 0, - "format": "