Skip to content

Commit

Permalink
v1.3.0 Dashboard Radio Option resolves #40
Browse files Browse the repository at this point in the history
  • Loading branch information
kd9lsv committed Jan 22, 2023
1 parent 279351b commit 212532f
Show file tree
Hide file tree
Showing 2 changed files with 216 additions and 43 deletions.
255 changes: 214 additions & 41 deletions flow.json
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,9 @@
"d37ea6046424b974",
"89588cb6bf69a8d0",
"d9503f18f29524db",
"27f4e52f97117294"
"27f4e52f97117294",
"b660ee693411d757",
"0ca8c50b9058010c"
],
"x": 1074,
"y": 1979,
Expand Down Expand Up @@ -1060,13 +1062,15 @@
"b946bc8caa8d1dfa",
"323b33d53e2baade",
"b9e129bdae4de517",
"b1abd7f75fd32f6f",
"5bbc72a4e604df32",
"e4e19daf40493fb9",
"3d1ebae60e058858",
"572d2215a6ea16bb",
"5a5a85080d107e92",
"0baeb2e7ae556661"
"0baeb2e7ae556661",
"ab3f6963df6eaf43",
"cfe25ee37e99db50",
"bcc4223e74a54492"
],
"x": 1014,
"y": 1511.5,
Expand Down Expand Up @@ -7387,15 +7391,15 @@
"type": "template",
"z": "407d2b774fe67647",
"g": "94f44b7ea0e29d1d",
"name": "SQL Select Rate",
"name": "SQL Select Rate Radio",
"field": "topic",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "select count(call) as rate from qsos where StationName='{{{payload.RadioInfo.StationName}}}' and timestamp >= datetime('now','-1 hours');",
"output": "str",
"x": 1410,
"y": 2380,
"x": 1510,
"y": 2360,
"wires": [
[
"97aba946591c7289"
Expand All @@ -7411,7 +7415,7 @@
"sqlquery": "msg.topic",
"sql": "",
"name": "QSO Database",
"x": 1620,
"x": 1740,
"y": 2380,
"wires": [
[
Expand All @@ -7429,11 +7433,11 @@
"width": 3,
"height": 2,
"name": "Radio 2 QSO Rate",
"label": "Q's/Hr",
"label": "{{msg.choice}} Q's/Hr",
"format": "<font color={{msg.color}}>{{msg.rate}}</font>",
"layout": "col-center",
"className": "",
"x": 2230,
"x": 2350,
"y": 2380,
"wires": []
},
Expand Down Expand Up @@ -7547,11 +7551,11 @@
"drop": true,
"allowrate": false,
"outputs": 1,
"x": 1180,
"x": 1040,
"y": 2380,
"wires": [
[
"89588cb6bf69a8d0"
"0ca8c50b9058010c"
]
]
},
Expand All @@ -7561,7 +7565,7 @@
"z": "407d2b774fe67647",
"g": "94f44b7ea0e29d1d",
"name": "",
"x": 1980,
"x": 2100,
"y": 2380,
"wires": [
[
Expand Down Expand Up @@ -7595,7 +7599,7 @@
"from": "",
"to": "",
"reg": false,
"x": 1790,
"x": 1910,
"y": 2380,
"wires": [
[
Expand Down Expand Up @@ -9483,26 +9487,6 @@
]
]
},
{
"id": "b1abd7f75fd32f6f",
"type": "template",
"z": "407d2b774fe67647",
"g": "a9afc3cb2db49407",
"name": "SQL Select Rate",
"field": "topic",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "select count(call) as rate from qsos where StationName='{{{payload.RadioInfo.StationName}}}' and timestamp >= datetime('now','-1 hours');",
"output": "str",
"x": 1370,
"y": 1560,
"wires": [
[
"3d1ebae60e058858"
]
]
},
{
"id": "5bbc72a4e604df32",
"type": "delay",
Expand All @@ -9524,9 +9508,7 @@
"x": 1120,
"y": 1560,
"wires": [
[
"b1abd7f75fd32f6f"
]
[]
]
},
{
Expand Down Expand Up @@ -9556,7 +9538,7 @@
"sqlquery": "msg.topic",
"sql": "",
"name": "QSO Database",
"x": 1600,
"x": 1820,
"y": 1560,
"wires": [
[
Expand Down Expand Up @@ -9584,7 +9566,7 @@
"from": "",
"to": "",
"reg": false,
"x": 1810,
"x": 2010,
"y": 1560,
"wires": [
[
Expand All @@ -9598,7 +9580,7 @@
"z": "407d2b774fe67647",
"g": "a9afc3cb2db49407",
"name": "",
"x": 1980,
"x": 2180,
"y": 1560,
"wires": [
[
Expand Down Expand Up @@ -9626,7 +9608,7 @@
"format": "<font color={{msg.color}}>{{msg.rate}}</font>",
"layout": "col-center",
"className": "",
"x": 2290,
"x": 2450,
"y": 1560,
"wires": []
},
Expand Down Expand Up @@ -10947,6 +10929,120 @@
]
]
},
{
"id": "b660ee693411d757",
"type": "template",
"z": "407d2b774fe67647",
"g": "94f44b7ea0e29d1d",
"name": "SQL Select Rate OP",
"field": "topic",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "select count(operator) as rate from qsos where operator='{{payload.RadioInfo.OpCall}}' and timestamp >= datetime('now','-1 hours');",
"output": "str",
"x": 1500,
"y": 2400,
"wires": [
[
"97aba946591c7289"
]
]
},
{
"id": "0ca8c50b9058010c",
"type": "function",
"z": "407d2b774fe67647",
"g": "94f44b7ea0e29d1d",
"name": "Dashboard Rate Choice",
"func": "let dashboardqrate=global.get(\"dashboardqrate\");\n\nif (dashboardqrate == \"radio\"){\nmsg.choice=\"Radio\";\nreturn [msg,null]\n}\nelse if (dashboardqrate == \"op\"){\nmsg.choice=\"Operator\";\nreturn [null,msg]\n}\n",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1250,
"y": 2380,
"wires": [
[
"89588cb6bf69a8d0"
],
[
"b660ee693411d757"
]
],
"outputLabels": [
"Radio",
"Operator"
]
},
{
"id": "cfe25ee37e99db50",
"type": "function",
"z": "407d2b774fe67647",
"g": "a9afc3cb2db49407",
"name": "Dashboard Rate Choice",
"func": "let dashboardqrate=global.get(\"dashboardqrate\");\n\nif (dashboardqrate == \"radio\"){\nmsg.choice=\"Radio\";\nreturn [msg,null]\n}\nelse if (dashboardqrate == \"op\"){\nmsg.choice=\"Operator\";\nreturn [null,msg]\n}\n",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1330,
"y": 1560,
"wires": [
[
"ab3f6963df6eaf43"
],
[
"bcc4223e74a54492"
]
],
"outputLabels": [
"Radio",
"Operator"
]
},
{
"id": "ab3f6963df6eaf43",
"type": "template",
"z": "407d2b774fe67647",
"g": "a9afc3cb2db49407",
"name": "SQL Select Rate Radio",
"field": "topic",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "select count(call) as rate from qsos where StationName='{{{payload.RadioInfo.StationName}}}' and timestamp >= datetime('now','-1 hours');",
"output": "str",
"x": 1570,
"y": 1540,
"wires": [
[
"3d1ebae60e058858"
]
]
},
{
"id": "bcc4223e74a54492",
"type": "template",
"z": "407d2b774fe67647",
"g": "a9afc3cb2db49407",
"name": "SQL Select Rate OP",
"field": "topic",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "select count(operator) as rate from qsos where operator='{{payload.RadioInfo.OpCall}}' and timestamp >= datetime('now','-1 hours');",
"output": "str",
"x": 1560,
"y": 1580,
"wires": [
[
"3d1ebae60e058858"
]
]
},
{
"id": "8da88eb5e82e503d",
"type": "link in",
Expand Down Expand Up @@ -30688,7 +30784,8 @@
"y": 2500,
"wires": [
[
"55b371fcdda16d59"
"55b371fcdda16d59",
"b75f7c1d9016de43"
]
]
},
Expand Down Expand Up @@ -30890,6 +30987,82 @@
]
]
},
{
"id": "4b6949f18173593d",
"type": "function",
"z": "204548a488401a1b",
"name": "Store DashboardQRate",
"func": "let dashboardqrate = msg.payload;\n\nglobal.set('dashboardqrate',dashboardqrate);\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 2130,
"y": 2600,
"wires": [
[
"b75f7c1d9016de43"
]
]
},
{
"id": "0837ad45ed24fb8c",
"type": "ui_dropdown",
"z": "204548a488401a1b",
"name": "Dashboard Hourly QSO Rate",
"label": "Dashboard Rate Option",
"tooltip": "Choose which value that you would like to choose for the Radio Values on the dashboard.",
"place": "Select Rate",
"group": "475c1eff5d97ffe5",
"order": 4,
"width": 6,
"height": 1,
"passthru": false,
"multiple": false,
"options": [
{
"label": "Radio",
"value": "radio",
"type": "str"
},
{
"label": "Operator",
"value": "op",
"type": "str"
}
],
"payload": "",
"topic": "Hourly QSO Rate",
"topicType": "str",
"className": "",
"x": 1880,
"y": 2600,
"wires": [
[
"4b6949f18173593d"
]
]
},
{
"id": "b75f7c1d9016de43",
"type": "function",
"z": "204548a488401a1b",
"name": "Get DashboardQRate",
"func": "msg.payload = global.get('dashboardqrate');\n\nif (msg.payload == undefined)\n{\n msg.payload = \"radio\";\n return msg;\n}\n\n\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1640,
"y": 2600,
"wires": [
[
"0837ad45ed24fb8c"
]
]
},
{
"id": "135549f560738315",
"type": "link out",
Expand Down
Loading

0 comments on commit 212532f

Please sign in to comment.