signalk-racer 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -93,7 +93,7 @@ This plugin uses WebSocket-based PUT requests to Signal K model paths.
93
93
  Used to **set** or **adjust** either end of the start line.
94
94
 
95
95
  #### Payload:
96
- ```json
96
+ ```
97
97
  {
98
98
  "end": "port" | "stb",
99
99
  "position": "bow" | { "latitude": ..., "longitude": ... },
@@ -114,7 +114,7 @@ Used to **set** or **adjust** either end of the start line.
114
114
  Used to **start**, **sync**, **reset**, or **set a fixed start time**.
115
115
 
116
116
  #### Payload:
117
- ```json
117
+ ```
118
118
  {
119
119
  "command": "start" | "reset" | "sync" | "adjust" | "set",
120
120
  "delta": 30,
@@ -141,4 +141,4 @@ Used to **start**, **sync**, **reset**, or **set a fixed start time**.
141
141
  ## 📬 Feedback
142
142
 
143
143
  Bug reports and suggestions are welcome at
144
- [https://github.com/gregw/signalk-racer](https://github.com/gregw/signalk-racer)
144
+ [https://github.com/gregw/signalk-racer](https://github.com/gregw/signalk-racer)
package/ReleaseNotes.md CHANGED
@@ -1,18 +1,28 @@
1
- ## 0.9.0 Initial Release
2
- + working DTL, Line Length, next TWA
3
- ## 0.9.1 Format Release
4
- + formating for the README.TXT
5
- ## 0.9.2 Set Start Line
6
- + Added API to set the start line
7
- + Added webapp to call start line API
8
- ## 0.9.3 KIP racer-timer integration
9
- + added timeToStart API
10
- ## 0.9.4 Trivial rename
11
- + Renamed README.md for npmjs
12
- ## 0.9.5 Restructured
13
- + Restructured the plugin to avoid initialization problem in new server
1
+ ## 0.9.7
2
+ + Cleaned up webapp UI
3
+ + reset to seconds when adjusting time
4
+
14
5
  ## 0.9.6 V2 API and Timer
15
6
  + Added new API V2 methods
16
7
  + Removed V1 methods
17
8
  + Webapp uses websocket
18
- + Server side timer
9
+ + Server side timer
10
+
11
+ ## 0.9.5 Restructured
12
+ + Restructured the plugin to avoid initialization problem in new server
13
+
14
+ ## 0.9.4 Trivial rename
15
+ + Renamed README.md for npmjs
16
+
17
+ ## 0.9.3 KIP racer-timer integration
18
+ + added timeToStart API
19
+
20
+ ## 0.9.2 Set Start Line
21
+ + Added API to set the start line
22
+ + Added webapp to call start line API
23
+
24
+ ## 0.9.1 Format Release
25
+ + formating for the README.TXT
26
+
27
+ ## 0.9.0 Initial Release
28
+ + working DTL, Line Length, next TWA
package/index.js CHANGED
@@ -7,22 +7,22 @@ module.exports = (app) => {
7
7
  properties: {
8
8
  startLineStb: {
9
9
  type: 'string',
10
- title: 'Line starboard waypoint name',
10
+ title: 'The start line starboard end (boat) waypoint name',
11
11
  default: 'startBoat'
12
12
  },
13
13
  startLinePort: {
14
14
  type: 'string',
15
- title: 'Line port waypoint name',
15
+ title: 'The start line port end (pin) waypoint name',
16
16
  default: 'startPin'
17
17
  },
18
18
  period: {
19
19
  type: 'number',
20
- title: 'Update period in micro seconds',
20
+ title: 'The subscription period in microseconds used for position and wind deltas',
21
21
  default: 1000
22
22
  },
23
23
  timer: {
24
24
  type: 'number',
25
- title: 'Timer default period in seconds',
25
+ title: 'Start Timer default initial period in seconds',
26
26
  default: 300
27
27
  },
28
28
  }
@@ -52,7 +52,7 @@ module.exports = (app) => {
52
52
  "units": "m",
53
53
  "description": "Bias of the start line for the starboard end",
54
54
  "displayName": "Bias of the start line for the starboard end",
55
- "shortName": "SLB"
55
+ "shortName": "Bias"
56
56
  }
57
57
  },
58
58
  {
@@ -61,7 +61,7 @@ module.exports = (app) => {
61
61
  "units": "rad",
62
62
  "description": "Heading of the next leg of the course",
63
63
  "displayName": "Heading of the next leg of the course",
64
- "shortName": "NHDG",
64
+ "shortName": "NextHDG",
65
65
  }
66
66
  },
67
67
  {
@@ -70,7 +70,7 @@ module.exports = (app) => {
70
70
  "units": "rad",
71
71
  "description": "TWA on the next leg of the course",
72
72
  "displayName": "TWA on the next leg of the course",
73
- "shortName": "NTWA",
73
+ "shortName": "NextTWA",
74
74
  }
75
75
  },
76
76
  ]
@@ -396,7 +396,8 @@ module.exports = (app) => {
396
396
  state.timeToStart += delta;
397
397
  if (state.timeToStart < 0) state.timeToStart = 0;
398
398
 
399
- const adjustedStart = new Date(Date.now() + state.timeToStart * 1000).toISOString();
399
+ let now = Date.now();
400
+ const adjustedStart = new Date(now - (now % 1000) + state.timeToStart * 1000).toISOString();
400
401
  state.startTime = adjustedStart;
401
402
 
402
403
  sendDeltas([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-racer",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "Signalk plugin to calculate values of interest to sail racers: such as Distance to Line; Next leg TWA.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/public/index.html CHANGED
@@ -21,7 +21,7 @@
21
21
  text-align: center;
22
22
  }
23
23
  button {
24
- padding: 1em 1.5em;
24
+ padding: 1em 1em;
25
25
  font-size: 1em;
26
26
  cursor: pointer;
27
27
  }
@@ -235,17 +235,13 @@
235
235
 
236
236
  <h1>Adjust Start Line</h1>
237
237
  <div style="display: flex; justify-content: center; align-items: center; gap: 3em; flex-wrap: wrap;">
238
-
239
-
240
- <div style="display: grid; grid-template-columns: repeat(11, auto); grid-template-rows: repeat(3, auto); gap: 0.5em;">
238
+ <div style="display: grid; grid-template-columns: repeat(10, auto); grid-template-rows: repeat(3, auto); gap: 0.5em;">
241
239
  <div></div>
242
240
  <div></div>
243
241
  <button class="port-rotate" onclick="sendAdjustStartLine('port', 0, 1)">+1°</button>
244
242
  <div></div>
245
243
  <div></div>
246
244
 
247
- <div></div>
248
-
249
245
  <div></div>
250
246
  <div></div>
251
247
  <button class="stb-rotate" onclick="sendAdjustStartLine('stb', 0, -1)">+1°</button>
@@ -260,14 +256,9 @@
260
256
  <button class="port-tweak" onclick="sendAdjustStartLine('port', -1, 0)">-1m</button>
261
257
  <button class="port-move" onclick="sendAdjustStartLine('port', -10, 0)">-10m</button>
262
258
 
263
- <div style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
264
- ---------------<br/>
265
- <label><input id="lineLength" readonly style="width: 5em; text-align: center;">(m)</label>
266
- </div>
267
-
268
259
  <button class="stb-move" onclick="sendAdjustStartLine('stb', -10, 0)">-10m</button>
269
260
  <button class="stb-tweak" onclick="sendAdjustStartLine('stb', -1, 0)">-1m</button>
270
- <button class="stb-set" onclick="sendSetStartLine('stb')">Starboard<br/>(boat)</button>
261
+ <button class="stb-set" onclick="sendSetStartLine('stb')">Stbd<br/>(boat)</button>
271
262
  <button class="stb-tweak" onclick="sendAdjustStartLine('stb', 1, 0)">+1m</button>
272
263
  <button class="stb-move" onclick="sendAdjustStartLine('stb', +10, 0)">+10m</button>
273
264
 
@@ -278,33 +269,27 @@
278
269
  <button class="port-rotate" onclick="sendAdjustStartLine('port', 0, -1)">-1°</button>
279
270
  <div></div>
280
271
  <div></div>
281
-
282
- <div style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
283
- <label>Bias: <input id="lineBias" readonly style="width: 5em; text-align: center;">(m)</label>
284
- </div>
285
-
286
272
  <div></div>
287
273
  <div></div>
288
274
  <button class="stb-rotate" onclick="sendAdjustStartLine('stb', 0, 1)">-1°</button>
289
275
  <div></div>
290
276
  <div></div>
291
277
  </div>
292
-
293
-
294
278
  </div>
295
279
 
296
- <div id="status">Connecting...</div>
280
+ <label>Length:&nbsp;<input id="lineLength" readonly style="width: 5em; text-align: center;">m</label>
281
+ <label>Bias:&nbsp;<input id="lineBias" readonly style="width: 5em; text-align: center;">m</label>
297
282
 
298
283
  <!-- Timer Display -->
299
284
  <div style="margin-top: 2em;">
300
- <div id="timeToStart" style="font-size: 3em; font-weight: bold;">00:00</div>
285
+ <div id="timeToStart" style="font-size: 4em; font-weight: bold;">00:00</div>
301
286
  </div>
302
287
 
303
288
  <!-- Start Time Row -->
304
289
  <div style="margin-top: 1em; display: flex; justify-content: center; align-items: center; gap: 1em;">
305
290
  <button class="button-timer-adjust" onclick="adjustStartTime(-60)">-1 min</button>
306
291
  <button class="button-timer-adjust" onclick="adjustStartTime(-1)">-1s</button>
307
- <label for="startTime">Start at: <input id="startTime" style="font-size: 1.5em; width: 10em; text-align: center;"></label>
292
+ <label for="startTime">Start at: <input id="startTime" style="font-size: 1.5em; width: 6em; text-align: center;"></label>
308
293
  <button class="button-timer-adjust" onclick="adjustStartTime(1)">+1s</button>
309
294
  <button class="button-timer-adjust" onclick="adjustStartTime(60)">+1 min</button>
310
295
  </div>
@@ -317,5 +302,7 @@
317
302
  <button class="button-timer-command" onclick="sendTimerCommand('reset')">Reset</button>
318
303
  </div>
319
304
 
305
+ <div id="status">Connecting...</div>
306
+
320
307
  </body>
321
308
  </html>