-
Notifications
You must be signed in to change notification settings - Fork 0
/
gps_monitor.json
347 lines (347 loc) · 12.2 KB
/
gps_monitor.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
[
{
"id": "c9354f75fb3adeea",
"type": "tab",
"label": "GPS Monitor",
"disabled": false,
"info": "",
"env": []
},
{
"id": "c88de8462b58b0f8",
"type": "serial in",
"z": "c9354f75fb3adeea",
"name": "GPSDO NMEA Output",
"serial": "260fa66d78fbe2c2",
"x": 180,
"y": 240,
"wires": [
[
"89b952f3b801aa0c"
]
]
},
{
"id": "89b952f3b801aa0c",
"type": "switch",
"z": "c9354f75fb3adeea",
"name": "Separate NMEA Sentences",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "GSA",
"vt": "str"
},
{
"t": "cont",
"v": "GGA",
"vt": "str"
},
{
"t": "cont",
"v": "GSV",
"vt": "str"
},
{
"t": "cont",
"v": "GLL",
"vt": "str"
},
{
"t": "cont",
"v": "RMC",
"vt": "str"
},
{
"t": "cont",
"v": "VTG",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 6,
"x": 520,
"y": 240,
"wires": [
[
"33c95b8c881b7434"
],
[
"f6d82f9deb347003"
],
[
"ad5511a7366f1579"
],
[],
[],
[]
]
},
{
"id": "f6d82f9deb347003",
"type": "function",
"z": "c9354f75fb3adeea",
"name": "Parse GGA sentence",
"func": "var str = msg.payload;\n\n//remove checksum at end that starts with asterisk\n\nvar chunks = str.split(\"*\");\n\n//take first part and then split into NMEA string parameters\n\nvar parts = chunks[0].split(\",\");\n\n//split time hhmmss and fractional seconds\n\nvar time = parts[1].split(\".\");\n\nvar utcTime = time[0];\n\nmsg.payload = \"UTC: \" + utcTime;\n\n/*For reference as follows\n\nmsg.payload = {\n identifier: parts[0],\n time: parts[1],\n latitude: parts[2],\n latHemi: parts[3],\n longitude: parts[4],\n lonHemi: parts[5],\n gpsQual: parts[6],\n numSats: parts[7],\n hdop: parts[8],\n altitude: parts[9],\n altUnit: parts[10],\n geoidalSep: parts[11],\n geoidalSepUnit: parts[12],\n diffDataAge: parts[13],\n diffStation: parts[14],\n }\n */\n \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 920,
"y": 220,
"wires": [
[
"6d9494fb88d03957"
]
]
},
{
"id": "3c12b911fcb953c8",
"type": "ui_chart",
"z": "c9354f75fb3adeea",
"name": "GPS SVID SNR Bar Chart",
"group": "d1f18380c9713791",
"order": 5,
"width": 7,
"height": 4,
"label": "",
"chartType": "bar",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "NO DATA",
"dot": false,
"ymin": "0",
"ymax": "60",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": true,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs": 1,
"useDifferentColor": false,
"className": "",
"x": 1230,
"y": 280,
"wires": [
[]
]
},
{
"id": "33c95b8c881b7434",
"type": "function",
"z": "c9354f75fb3adeea",
"name": "Parse GSA sentence",
"func": "var str = msg.payload;\n\n//remove checksum at end that starts with asterisk\n\nvar chunks = str.split(\"*\");\n\n//take first part and then split into NMEA string parameters\n\nvar parts = chunks[0].split(\",\");\n\n//parse part[2], which is GPS Fix Mode, and set button state\n//accordingly to show status\n\nif (parts[2]==1) msg.label = \"<font color=black>GPSDO: NO FIX\",\n msg.background = \"red\";\nelse if (parts[2]==2) msg.label =\"<font color=black>GPSDO: 2D FIX\",\n msg.background = \"yellow\";\nelse if (parts[2]==3) msg.label =\"<font color=white>GPSDO: 3D FIX\",\n msg.background = \"green\";\n \n//retrieve array that holds SNR data indexed by SVID\n\n//let svList = flow.get(\"svList\") || [];\nlet svSNRdata = flow.get(\"svSNRdata\");\n\n//build the arrays for the GPS status bar chart\n//get all 12 parts of each GSA sentence that list the SVIDs in use\n//and place them into an array\n//get the matching SNR data for each SVID and place that into \n//a matching array\n//null or undefined values become 0\n\nvar svList = []\nvar snrList = []\nfor (let i=0; i<=11; i++) {\n sv = parts[3+i] || \"0\";\n svList[i] = sv;\n snrIndex = parseInt(sv);\n snrList[i] = svSNRdata[snrIndex];\n}\n\n//update the state of the flow variables\n\n//flow.set(\"svList\", svList);\n\n//build the GPS status bar chart message\n\nmsg.payload=[{\n \"series\": \"SNR\",\n \"data\": [snrList],\n \"labels\": svList \n}];\nreturn msg;\n\n\n/* for reference as follows\n\nmsg.payload = {\n identifier: parts[0],\n autoMan: parts[1],\n fixMode: parts[2],\n svid1: parts[3],\n svid2: parts[4],\n svid3: parts[5],\n svid4: parts[6],\n svid5: parts[7],\n svid6: parts[8],\n svid7: parts[9],\n svid8: parts[10],\n svid9: parts[11],\n svid10: parts[12],\n svid11: parts[13],\n svid12: parts[14],\n pdop: parts[15],\n hdop: parts[16],\n vdop: parts[17]\n }\n */\nreturn;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 920,
"y": 160,
"wires": [
[
"1994c4bb349f28f3",
"3c12b911fcb953c8"
]
]
},
{
"id": "1994c4bb349f28f3",
"type": "ui_button",
"z": "c9354f75fb3adeea",
"name": "GPS Status",
"group": "d1f18380c9713791",
"order": 1,
"width": 7,
"height": 1,
"passthru": false,
"label": "{{msg.label}}",
"tooltip": "",
"color": "",
"bgcolor": "{{msg.background}}",
"className": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"topicType": "str",
"x": 1190,
"y": 160,
"wires": [
[]
]
},
{
"id": "ad5511a7366f1579",
"type": "function",
"z": "c9354f75fb3adeea",
"name": "Parse GSV sentences",
"func": "//this parsing routine develops a list of satellites and their \n//associated SNR values for display on a chart, the chart being\n//developed in the GSA message parsing function\n\nvar str = msg.payload;\n\n//remove checksum at end that starts with asterisk\n\nvar chunks = str.split(\"*\");\n\n//take first part and then split into NMEA string parameters\n\nvar parts = chunks[0].split(\",\");\n\n//retrieve the existing state of the flow variables\n\nlet svLabel = flow.get(\"svLabel\") || [];\nlet svSNRdata = flow.get(\"svSNRdata\") || [];\n\n//get all four possible parts of each GSV sentence and assign the\n//sv number and associated SNR to a label array (which is a little\n//redundant) and an SNR array, both indexed by SV number.\n//null or undefined values will go into array index [0], and that\n//index will be ignored by subsequent processing.\n\nfor (let i=0; i<=3; i++) {\n sv = parseInt(parts[4+4*i] || 0);\n snr = parseInt(parts[7+4*i] || 0);\n svLabel[sv] = sv;\n svSNRdata[sv] = snr;\n}\n\n//update the state of the flow variables\n\nflow.set(\"svLabel\", svLabel);\nflow.set(\"svSNRdata\", svSNRdata);\n\n\n/* for reference as follows\n\nmsg.payload = {\n identifier: parts[0],\n numMSGs: parts[1],\n msgNum: parts[2],\n totalSVs: parts[3],\n firstSVprn: parts[4],\n firstSVelev: parts[5],\n firstSVazim: parts[6],\n firstSVsnr: parts[7],\n secondSVprn: parts[8],\n secondSVelev: parts[9],\n secondSVazim: parts[10],\n secondSVsnr: parts[11],\n thirdSVprn: parts[12],\n thirdSVelev: parts[13],\n thirdSVazim: parts[14],\n thirdSVsnr: parts[15],\n fourthSVprn: parts[16],\n fourthSVelev: parts[17],\n fourthSVazim: parts[18],\n fourthSVsnr: parts[19],\n }\n */\n \nreturn;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 920,
"y": 280,
"wires": [
[]
]
},
{
"id": "6d9494fb88d03957",
"type": "ui_text",
"z": "c9354f75fb3adeea",
"group": "d1f18380c9713791",
"order": 3,
"width": 5,
"height": 1,
"name": "Display UTC Time",
"label": "",
"format": "<font size=1,font color=lightblue>{{msg.payload}}",
"layout": "col-center",
"className": "",
"x": 1210,
"y": 220,
"wires": []
},
{
"id": "c874d2d5079ad353",
"type": "ui_spacer",
"z": "c9354f75fb3adeea",
"name": "spacer",
"group": "17aaa8a63c2a9614",
"order": 7,
"width": 5,
"height": 1
},
{
"id": "5eae6f7b7c6260b1",
"type": "ui_spacer",
"z": "c9354f75fb3adeea",
"name": "spacer",
"group": "4af4d08c70d2f779",
"order": 6,
"width": 16,
"height": 1
},
{
"id": "fa83673768531d6a",
"type": "ui_spacer",
"z": "c9354f75fb3adeea",
"name": "spacer",
"group": "4af4d08c70d2f779",
"order": 7,
"width": 12,
"height": 1
},
{
"id": "858ded5b486ff749",
"type": "ui_spacer",
"z": "c9354f75fb3adeea",
"name": "spacer",
"group": "4af4d08c70d2f779",
"order": 14,
"width": 12,
"height": 1
},
{
"id": "1508732f118cefa7",
"type": "ui_spacer",
"z": "c9354f75fb3adeea",
"name": "spacer",
"group": "d1f18380c9713791",
"order": 2,
"width": 1,
"height": 1
},
{
"id": "12b7898d0cb7a96e",
"type": "ui_spacer",
"z": "c9354f75fb3adeea",
"name": "spacer",
"group": "d1f18380c9713791",
"order": 4,
"width": 1,
"height": 1
},
{
"id": "260fa66d78fbe2c2",
"type": "serial-port",
"serialport": "COM31",
"serialbaud": "9600",
"databits": "8",
"parity": "none",
"stopbits": "1",
"waitfor": "",
"dtr": "none",
"rts": "none",
"cts": "none",
"dsr": "none",
"newline": "\\n",
"bin": "false",
"out": "char",
"addchar": "",
"responsetimeout": "10000"
},
{
"id": "d1f18380c9713791",
"type": "ui_group",
"name": "GPSDO STATUS",
"tab": "7cfa0acacdc9425e",
"order": 5,
"disp": false,
"width": "7",
"collapse": false,
"className": ""
},
{
"id": "17aaa8a63c2a9614",
"type": "ui_group",
"name": "Antenna Control",
"tab": "7cfa0acacdc9425e",
"order": 3,
"disp": false,
"width": 5,
"collapse": false,
"className": ""
},
{
"id": "4af4d08c70d2f779",
"type": "ui_group",
"name": "KPA1500 Control",
"tab": "7cfa0acacdc9425e",
"order": 4,
"disp": false,
"width": 30,
"collapse": false,
"className": ""
},
{
"id": "7cfa0acacdc9425e",
"type": "ui_tab",
"name": "STATION CONTROLLER MAIN",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
}
]