signalk-polar-performance-plugin 1.4.0 → 2.0.0
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/CHANGELOG.md +12 -0
- package/README.md +41 -86
- package/docs/developer-reference.md +22 -130
- package/openApi.json +12 -798
- package/package.json +13 -7
- package/plugin/index.js +169 -518
- package/public/app.js +53 -638
- package/public/index.html +0 -2
- package/public/plotter.html +20 -106
- package/docs/import.png +0 -0
- package/docs/polar.png +0 -0
- package/docs/polar_management.png +0 -0
- package/plugin/PolarFileStore.js +0 -133
- package/plugin/PolarTable.js +0 -924
- package/plugin/SI.js +0 -21
- package/plugin/import/ExpeditionImporter.js +0 -152
- package/plugin/import/FormatRegistry.js +0 -21
- package/plugin/import/ImportService.js +0 -199
- package/plugin/import/JieterImporter.js +0 -18
- package/plugin/import/OrcSource.js +0 -396
- package/plugin/import/SourceRegistry.js +0 -17
- package/plugin/import/canonical.js +0 -73
- package/plugin/import/matrixText.js +0 -133
- package/plugin/index.js.bak +0 -1003
- package/test/PolarFileStore.test.js +0 -216
- package/test/PolarTable.test.js +0 -464
- package/test/api.test.js +0 -507
- package/test/migration.test.js +0 -170
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [2.0.0] - 2026-09-09
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- External polar provider integration: subscribes to `polars.activePolar` and `polars.performanceFactor` from Signal K (published by a polar provider plugin such as `signalk-polar-management`), decoupling polar storage and file import from live compute.
|
|
13
|
+
- Integration with standalone `polar-math` package for core polar calculations, interpolation models, and target evaluations.
|
|
14
|
+
- Optional peer dependency declaration for `signalk-polar-management`.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Major architectural split: removed built-in polar file storage, file parsers/converters, and ORC database importing. All polar management is now handled by a dedicated polar provider plugin.
|
|
18
|
+
- Simplified webapp UI: removed polar management and import tabs; Overview tab and Plotter now display the active polar and its metadata from Signal K.
|
|
19
|
+
- Output path safety: output paths are cleanly nullified when no active polar is present or when required instrument inputs are unavailable.
|
|
20
|
+
|
|
9
21
|
## [1.4.0] - 2026-09-01
|
|
10
22
|
|
|
11
23
|
### Changed
|
package/README.md
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
# Polar Performance — Signal K Plugin
|
|
2
2
|
|
|
3
|
-
Polar Performance
|
|
3
|
+
Polar Performance calculates live sailing performance metrics — target boat speeds, beat and run angles, target VMG, polar speed ratio, and optimum wind angles — in real time from your boat's instruments in Signal K. An integrated webapp and full-screen plotter let you inspect live values, target angles, and polar curves while sailing.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Architecture & Polar Providers
|
|
6
|
+
|
|
7
|
+
**Polar Performance works together with a polar provider plugin** (such as [signalk-polar-management](https://github.com/Asw1n/signalk-polar-management)).
|
|
8
|
+
|
|
9
|
+
Starting in version 2.0.0, polar file storage, file format conversion, ORC imports, and polar selection are decoupled from this compute plugin:
|
|
10
|
+
- **Polar Provider (`signalk-polar-management`):** Stores polar files, imports ORC/CSV/text polar files, manages polar metadata, and publishes the selected active polar to Signal K (`polars.activePolar`) along with any performance factor (`polars.performanceFactor`).
|
|
11
|
+
- **Performance Plugin (`signalk-polar-performance-plugin`):** Subscribes to the active polar and boat instrument data (TWS, TWA, STW/SOG), calculates real-time performance values using the [`polar-math`](https://github.com/Asw1n/polar-math) engine, and publishes the resulting performance metrics back to the Signal K delta stream.
|
|
12
|
+
|
|
13
|
+
When a polar lookup cannot be completed or required instrument data is missing/stale, output paths are cleanly set to `null` and the webapp status indicates the exact cause.
|
|
6
14
|
|
|
7
15
|
---
|
|
8
16
|
|
|
9
17
|
## Installation
|
|
10
18
|
|
|
11
|
-
Install from the Signal K App Store, or
|
|
19
|
+
Install both plugins from the Signal K App Store, or via npm:
|
|
12
20
|
|
|
13
21
|
```sh
|
|
14
22
|
cd ~/.signalk
|
|
15
|
-
npm install signalk-polar-performance-plugin
|
|
23
|
+
npm install signalk-polar-performance-plugin signalk-polar-management
|
|
16
24
|
```
|
|
17
25
|
|
|
18
|
-
Then restart Signal K and enable
|
|
26
|
+
Then restart Signal K and enable both plugins in **Server → Plugin Config**. Without a polar resource provider installed and enabled, Polar Performance will wait for an active polar to be published and indicate this in its status.
|
|
19
27
|
|
|
20
28
|
---
|
|
21
29
|
|
|
22
30
|
## Quick start
|
|
23
31
|
|
|
24
|
-
1. Open the webapp
|
|
25
|
-
2.
|
|
26
|
-
3.
|
|
27
|
-
4.
|
|
28
|
-
5. Enable the outputs you want in the **Outputs** tab.
|
|
32
|
+
1. Open the **Polar Management** webapp and import or select an active polar (and optionally set a performance factor).
|
|
33
|
+
2. Open the **Polar Performance** webapp from **Webapps → Polar Performance**.
|
|
34
|
+
3. The **Overview** tab shows the active polar's details, live performance numbers, and a polar diagram.
|
|
35
|
+
4. Enable the outputs you want in the **Outputs** tab.
|
|
29
36
|
|
|
30
37
|
---
|
|
31
38
|
|
|
@@ -35,36 +42,25 @@ The webapp is the primary interface for the plugin. Open it from the Signal K da
|
|
|
35
42
|
|
|
36
43
|
### Overview
|
|
37
44
|
|
|
38
|
-
|
|
45
|
+
Shows the currently active polar (name, boat type, sail number, year, source) and performance factor — read-only, selected in the polar management webapp — followed by a polar diagram on the left and live performance numbers on the right. The diagram shows a live TWS curve interpolated for the current wind speed, and two dots — the polar target speed (what the polar says you should be doing) and your actual boat speed — both at the current TWA. The targets section shows the beat and run angle and VMG interpolated from the polar for the current wind speed. Any data quality warnings appear at the bottom.
|
|
39
46
|
|
|
40
47
|
### Inputs
|
|
41
48
|
|
|
42
|
-
Shows the raw instrument values as they arrive from Signal K (before smoothing) and the smoothed values actually used for computation, side by side. Useful for spotting stale sensors or checking whether the smoother settings make sense for your data. Any missing inputs are listed as warnings.
|
|
49
|
+
Shows the raw instrument values as they arrive from Signal K (before smoothing) and the smoothed values actually used for computation, side by side. Useful for spotting stale sensors or checking whether the smoother settings make sense for your data. Smoother type/parameter and speed source are configured here. Any missing inputs are listed as warnings.
|
|
43
50
|
|
|
44
51
|
### Outputs
|
|
45
52
|
|
|
46
|
-
Shows the current value of each output path and lets you enable or disable each group with a toggle. Only enabled outputs are published to the Signal K bus.
|
|
47
|
-
|
|
48
|
-
### Settings
|
|
49
|
-
|
|
50
|
-
Lets you alter the settings of the plugin. Polar selection, performance adjustment, smoother type and parameter, and speed source. The polar diagram of the selected polar is shown.
|
|
53
|
+
Shows the current value of each output path and lets you enable or disable each group with a toggle. Only enabled outputs are published to the Signal K bus.
|
|
51
54
|
|
|
52
|
-
### Polars
|
|
53
|
-
|
|
54
|
-
Manage stored polars, import polars from the ORC database, and import text polars in supported formats.
|
|
55
55
|
---
|
|
56
56
|
|
|
57
57
|
## Configuration
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
### Active polar
|
|
62
|
-
|
|
63
|
-
Select the polar to use for calculations. The polar diagram in the Settings tab updates when you change this. If no polar is selected the plugin runs but publishes nothing; any previously published values are nullified immediately.
|
|
59
|
+
Most configuration is done through the webapp.
|
|
64
60
|
|
|
65
|
-
###
|
|
61
|
+
### Active polar and performance factor
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
These are **not** configured here. Select the active polar and set the performance factor in the polar management webapp (e.g. signalk-polar-management); this plugin reads them from the `polars.activePolar` and `polars.performanceFactor` Signal K paths. If no polar is active, the plugin runs but publishes nothing; any previously published values are nullified immediately.
|
|
68
64
|
|
|
69
65
|
### Smoother
|
|
70
66
|
|
|
@@ -164,47 +160,7 @@ Useful when you want downstream instruments to use the same smoothed values that
|
|
|
164
160
|
|
|
165
161
|
## Managing polars
|
|
166
162
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
The plugin can search the official ORC active certificate source directly. Go to **Polars → Import ORC Certificate**, type part of the certificate RefNo, boat name, class, or sail number and click Search. When you find your boat, click Import. The polar is saved locally and immediately available for selection.
|
|
170
|
-
|
|
171
|
-
Internet access is required only while searching or importing from ORC. In an isolated Signal K installation the ORC source is simply shown as unavailable; that is not treated as a plugin error. After import the polar is stored locally and no further internet access is needed.
|
|
172
|
-
|
|
173
|
-
### Importing text polars
|
|
174
|
-
|
|
175
|
-
If you have a polar in a supported text format, you can import it directly from the **Polars** tab. The plugin currently supports Jieter-style semicolon CSV and Expedition-style delimited text. Optional metadata such as display name, sail number, boat type, year, source label, and notes can be added during text import.
|
|
176
|
-
|
|
177
|
-
The Jieter CSV format uses semicolons as separators. The first row is a header with `twa/tws` in the first column followed by wind speeds in knots. Each subsequent row is a TWA in degrees followed by boat speeds in knots. Beat and run angles appear as separate rows with one non-zero speed per row (the VMG for that wind speed column).
|
|
178
|
-
|
|
179
|
-
**Example:**
|
|
180
|
-
```
|
|
181
|
-
twa/tws;6;8;10;12;14;16;20
|
|
182
|
-
52;4.57;5.59;6.33;6.87;7.23;7.45;7.65
|
|
183
|
-
60;4.93;5.93;6.66;7.15;7.47;7.68;7.94
|
|
184
|
-
75;5.17;6.18;6.91;7.37;7.68;7.92;8.31
|
|
185
|
-
90;5.29;6.43;7.23;7.71;8.03;8.29;8.57
|
|
186
|
-
110;5.38;6.56;7.36;7.84;8.22;8.6;9.31
|
|
187
|
-
120;5.2;6.38;7.23;7.76;8.16;8.55;9.36
|
|
188
|
-
135;4.65;5.84;6.78;7.43;7.87;8.25;9.03
|
|
189
|
-
150;3.92;5.05;5.97;6.7;7.2;7.58;8.17
|
|
190
|
-
46.9;4.23;0;0;0;0;0;0
|
|
191
|
-
44.8;0;5.09;0;0;0;0;0
|
|
192
|
-
144.2;4.19;0;0;0;0;0;0
|
|
193
|
-
146.4;0;5.25;0;0;0;0;0
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Extrapolation
|
|
197
|
-
|
|
198
|
-
The polar table covers a finite range of TWA values. The plugin extrapolates outside this range in two ways:
|
|
199
|
-
|
|
200
|
-
- **Close to the wind (beat zone):** A quadratic curve fitted to ensure continuity with the first measured point. The boat speed reaches zero at 25° (the assumed hard pinching angle).
|
|
201
|
-
- **Deep downwind (run zone):** A cosine-VMG model extending 30 % of the angular gap between the run angle and dead downwind. Beyond this limit the plugin returns no value rather than extrapolate further.
|
|
202
|
-
|
|
203
|
-
Values derived from extrapolated regions are indicated in the webapp warnings.
|
|
204
|
-
|
|
205
|
-
### Performance adjustment
|
|
206
|
-
|
|
207
|
-
The performance adjustment multiplier scales all polar speeds proportionally. Use it to calibrate the polar to your boat's actual performance. A value of `0.95` tells the plugin your boat achieves 95 % of the published polar — the polar diagram in Settings reflects this visually.
|
|
163
|
+
Polar storage, import (ORC, text formats), and active-polar/performance-factor selection are handled by a separate 'polars' resource-provider plugin, such as [signalk-polar-management](https://github.com/Asw1n/signalk-polar-management). See that plugin's documentation for import formats, the ORC certificate search, and extrapolation behaviour of the underlying `polar-math` library.
|
|
208
164
|
|
|
209
165
|
---
|
|
210
166
|
|
|
@@ -224,10 +180,22 @@ Install the [B&G Performance Plugin](https://www.npmjs.com/package/signalk-bandg
|
|
|
224
180
|
|
|
225
181
|
For laylines on charts: **Settings → Chart → Laylines → Targets → True wind angle → Actual**.
|
|
226
182
|
|
|
183
|
+

|
|
184
|
+
|
|
185
|
+
SailSteer screen -> Long press tile to add 'Performance -> Target TWA -> decollapse, choose SignalK':
|
|
186
|
+
|
|
187
|
+

|
|
188
|
+
|
|
189
|
+
Now the Target TWA is coming from SignalK and the laylines will be drawn based on its value:
|
|
190
|
+
|
|
191
|
+

|
|
192
|
+
|
|
227
193
|
### Garmin / Raymarine / other NMEA 2000
|
|
228
194
|
|
|
229
195
|
Use a Signal K → NMEA 2000 gateway plugin (such as `canboat` or `signalk-to-n2k`) to forward paths to the PGN fields your plotter expects for performance data. Consult your plotter's documentation for the relevant PGNs — most support Polar Speed, Target TWA, and VMG.
|
|
230
196
|
|
|
197
|
+
If you have a Raymarine MFD and can share setup instructions, please submit a PR or open an issue!
|
|
198
|
+
|
|
231
199
|
### OpenCPN / KIP / other Signal K displays
|
|
232
200
|
|
|
233
201
|
Subscribe directly to the paths listed in the Outputs section above.
|
|
@@ -253,7 +221,7 @@ The webapp shows warnings whenever something prevents accurate calculation:
|
|
|
253
221
|
| *True wind speed — no data* | `environment.wind.speedTrue` is not arriving from Signal K. |
|
|
254
222
|
| *True wind angle — no data* | `environment.wind.angleTrueWater` is not arriving. |
|
|
255
223
|
| *Boat speed — no data* | `navigation.speedThroughWater` (or SOG) is not arriving. |
|
|
256
|
-
| *No polar
|
|
224
|
+
| *No active polar* | No `polars.activePolar` is published. Select an active polar in the polar management webapp. |
|
|
257
225
|
| *Sailing in irons* | TWA is below the minimum angle in the polar. No output is produced. |
|
|
258
226
|
| *Pinching* | TWA is between the minimum polar angle and the beat angle. Values come from the extrapolated beat zone. |
|
|
259
227
|
| *Extrapolated beyond run angle* | TWA is deeper than the run angle. Values come from the cosine-VMG extrapolation model. |
|
|
@@ -273,28 +241,15 @@ Performance calculations are only as good as the inputs. A few things are worth
|
|
|
273
241
|
|
|
274
242
|
## For integrators and API users
|
|
275
243
|
|
|
276
|
-
If you want to
|
|
244
|
+
If you want to consume this plugin's live performance queries, use the developer reference:
|
|
277
245
|
|
|
278
|
-
- [Developer reference](docs/developer-reference.md) for the
|
|
246
|
+
- [Developer reference](docs/developer-reference.md) for the plugin REST API.
|
|
279
247
|
- [openApi.json](openApi.json) for the authoritative machine-readable contract.
|
|
248
|
+
- For the canonical `polarTable` structure, polar storage, and import, see [signalk-polar-management](https://github.com/Asw1n/signalk-polar-management) and the [polar-format](https://github.com/Asw1n/polar-format) / [polar-math](https://github.com/Asw1n/polar-math) packages it depends on.
|
|
280
249
|
|
|
281
250
|
---
|
|
282
251
|
|
|
283
252
|
## Known limitations
|
|
284
253
|
|
|
285
254
|
- Heel angle is not taken into account in the polar lookup. Most ORC polars are upright polars.
|
|
286
|
-
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-

|
|
290
|
-
|
|
291
|
-
- SailSteer screen -> Long press tile to add 'Performance -> Target TWA -> decollapse, choose SignalK'
|
|
292
|
-
|
|
293
|
-

|
|
294
|
-
|
|
295
|
-
Now the Target TWA is coming from SignalK and the laylines will be drawn based on it's value.
|
|
296
|
-
|
|
297
|
-

|
|
298
|
-
|
|
299
|
-
### Raymarine
|
|
300
|
-
If you have a Raymarine MFD and can tell more about this, please add to the README or tell me.
|
|
255
|
+
- Requires a 'polars' resource-provider plugin (e.g. `signalk-polar-management`) to be installed and running for polar storage, import, and active polar selection.
|
|
@@ -1,148 +1,40 @@
|
|
|
1
1
|
# Polar Performance Developer Reference
|
|
2
2
|
|
|
3
|
-
This document
|
|
3
|
+
This document covers the REST API this plugin still exposes. It no longer stores, imports,
|
|
4
|
+
or manages polar files — that is handled by a separate 'polars' resource-provider plugin
|
|
5
|
+
(e.g. [signalk-polar-management](https://github.com/Asw1n/signalk-polar-management)). For the
|
|
6
|
+
canonical `polarTable` format and its management API, see that plugin's documentation and the
|
|
7
|
+
[polar-format](https://github.com/Asw1n/polar-format) / [polar-math](https://github.com/Asw1n/polar-math)
|
|
8
|
+
packages it depends on.
|
|
4
9
|
|
|
5
10
|
For installation, day-to-day use, and webapp workflow, start with [../README.md](../README.md).
|
|
6
11
|
|
|
7
|
-
##
|
|
12
|
+
## How the active polar is resolved
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
This plugin subscribes to two Signal K paths published by the 'polars' resource provider:
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
- `polars.activePolar` — `{ href: '/resources/polars/<id>' }`, or absent if no polar is active.
|
|
17
|
+
- `polars.performanceFactor` — a number applied as a multiplier to all polar speeds.
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- `axes.tws` is a non-empty sorted array of true wind speeds in m/s.
|
|
18
|
-
- `axes.twa` is a non-empty sorted array of true wind angles in radians over the range `0..pi`.
|
|
19
|
-
- `values.boatSpeedMatrix` is a 2D array of boat speeds in m/s, indexed as `[twsRow][twaColumn]`.
|
|
20
|
-
- The number of matrix rows must match `axes.tws.length`.
|
|
21
|
-
- Each matrix row length must match `axes.twa.length`.
|
|
22
|
-
|
|
23
|
-
Optional metadata:
|
|
24
|
-
|
|
25
|
-
- `name`
|
|
26
|
-
- `sailnumber`
|
|
27
|
-
- `boatType`
|
|
28
|
-
- `year`
|
|
29
|
-
- `source`
|
|
30
|
-
- `notes`
|
|
31
|
-
|
|
32
|
-
Optional derived data:
|
|
33
|
-
|
|
34
|
-
- `derived.rows` can provide precomputed beat/run/max-speed targets for each TWS row.
|
|
35
|
-
- Each derived row uses the same TWS unit conventions as the main table.
|
|
36
|
-
- `beat` and `run` entries contain `twa`, `tbs`, and `vmg`, all in SI units.
|
|
37
|
-
|
|
38
|
-
Example:
|
|
39
|
-
|
|
40
|
-
```json
|
|
41
|
-
{
|
|
42
|
-
"kind": "polarTable",
|
|
43
|
-
"schemaVersion": "1.0.0",
|
|
44
|
-
"name": "Example Boat",
|
|
45
|
-
"sailnumber": "EX-1",
|
|
46
|
-
"boatType": "Example 36",
|
|
47
|
-
"year": 2025,
|
|
48
|
-
"source": "custom",
|
|
49
|
-
"notes": "Minimal canonical example",
|
|
50
|
-
"units": {
|
|
51
|
-
"tws": "m/s",
|
|
52
|
-
"twa": "rad",
|
|
53
|
-
"boatSpeed": "m/s"
|
|
54
|
-
},
|
|
55
|
-
"symmetry": {
|
|
56
|
-
"portStarboardSymmetric": true
|
|
57
|
-
},
|
|
58
|
-
"axes": {
|
|
59
|
-
"tws": [3.0864, 5.144],
|
|
60
|
-
"twa": [0.75398, 1.5708, 2.65465]
|
|
61
|
-
},
|
|
62
|
-
"values": {
|
|
63
|
-
"boatSpeedMatrix": [
|
|
64
|
-
[2.5051, 2.65465, 2.23368],
|
|
65
|
-
[3.16888, 3.34861, 2.74799]
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
"derived": {
|
|
69
|
-
"rows": [
|
|
70
|
-
{
|
|
71
|
-
"tws": 3.0864,
|
|
72
|
-
"beat": { "twa": 0.75398, "tbs": 2.5051, "vmg": 1.82652 },
|
|
73
|
-
"run": { "twa": 2.65465, "tbs": 2.23368, "vmg": 1.97371 },
|
|
74
|
-
"maxSpeed": 2.65465,
|
|
75
|
-
"maxSpeedAngle": 1.5708
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Notes:
|
|
83
|
-
|
|
84
|
-
- The resource `id` is not part of the `PUT /polars/:id` body; it comes from the URL path.
|
|
85
|
-
- If `derived` is omitted, the plugin can still load and query the polar from the axis and matrix data alone.
|
|
86
|
-
- Text imports and ORC imports are converted into this canonical structure before being stored.
|
|
87
|
-
- The authoritative machine-readable schema is in [../openApi.json](../openApi.json) under `PolarResource` and `PolarResourceBody`.
|
|
19
|
+
On a change to `polars.activePolar`, the plugin resolves `<id>` via the in-process
|
|
20
|
+
`app.resourcesApi.getResource('polars', id)` call and builds a `polar-math` `Polar` instance
|
|
21
|
+
from the returned canonical document. If the resource provider or the active polar becomes
|
|
22
|
+
unavailable, the last successfully loaded polar is kept until a valid update arrives.
|
|
88
23
|
|
|
89
24
|
## REST API
|
|
90
25
|
|
|
91
|
-
The plugin exposes a REST API under `/plugins/signalk-polar-performance-plugin/`. Authentication
|
|
92
|
-
|
|
93
|
-
### Operational endpoints
|
|
26
|
+
The plugin exposes a REST API under `/plugins/signalk-polar-performance-plugin/`. Authentication
|
|
27
|
+
follows Signal K server rules; the same session cookie used by the webapp works for direct API calls.
|
|
94
28
|
|
|
95
29
|
| Method | Path | Description |
|
|
96
30
|
|--------|------|-------------|
|
|
97
31
|
| `GET` | `/live` | Current smoothed TWS, TWA, BSP, polar speed, and polar state. |
|
|
98
32
|
| `GET` | `/status` | Full snapshot: raw inputs, smoothed inputs, and all enabled output values. |
|
|
99
|
-
| `GET` | `/meta` | Display unit metadata for all fields. |
|
|
100
|
-
| `GET` | `/settings` | Current plugin settings. |
|
|
33
|
+
| `GET` | `/meta` | Display unit metadata for all fields, plus a read-only summary of the active polar (name, boatType, sailnumber, year, source) and performance factor. |
|
|
34
|
+
| `GET` | `/settings` | Current plugin settings (smoother, output toggles, speed source — no polar selection). |
|
|
101
35
|
| `PUT` | `/settings` | Update settings. Body: JSON object with changed keys only. |
|
|
36
|
+
| `GET` | `/polar/axes/tws` | TWS axis of the currently active polar. 404 if none is active. |
|
|
37
|
+
| `GET` | `/polar/queries/curve?tws=&step=` | Interpolated curve for the active polar at the given TWS, with beat/run markers, performance factor already applied. |
|
|
102
38
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
| Method | Path | Description |
|
|
106
|
-
|--------|------|-------------|
|
|
107
|
-
| `GET` | `/polars` | List stored canonical polar resources with metadata. |
|
|
108
|
-
| `GET` | `/polars/active` | Get the active polar id. |
|
|
109
|
-
| `PUT` | `/polars/active` | Set the active polar. Body: JSON `{ id }`. |
|
|
110
|
-
| `DELETE` | `/polars/active` | Clear the active polar. |
|
|
111
|
-
| `GET` | `/polars/:id` | Get a stored canonical `polarTable` resource. |
|
|
112
|
-
| `PUT` | `/polars/:id` | Create or replace a canonical `polarTable` resource. |
|
|
113
|
-
| `DELETE` | `/polars/:id` | Delete a stored polar. |
|
|
114
|
-
| `GET` | `/polars/:id/meta` | Read stored metadata and TWS range for a polar. |
|
|
115
|
-
|
|
116
|
-
### Query endpoints
|
|
117
|
-
|
|
118
|
-
| Method | Path | Description |
|
|
119
|
-
|--------|------|-------------|
|
|
120
|
-
| `GET` | `/polars/:id/axes/tws` | Array of TWS values (m/s) in a stored polar. |
|
|
121
|
-
| `GET` | `/polars/:id/queries/curve?tws=<m/s>&step=<rad>` | Interpolated polar curve for a given TWS, with beat and run markers. |
|
|
122
|
-
| `GET` | `/polars/:id/queries/speed?tws=<m/s>&twa=<rad>` | Interpolated boat speed and interpolation state for a single TWS/TWA point. |
|
|
123
|
-
| `GET` | `/polars/:id/queries/targets?tws=<m/s>` | Optimal beat and run targets for a given TWS. |
|
|
124
|
-
| `GET` | `/polars/:id/queries/performance?tws=<m/s>&twa=<rad>&bsp=<m/s>` | Speed and VMG performance ratios against the polar. |
|
|
125
|
-
|
|
126
|
-
### Import endpoints
|
|
127
|
-
|
|
128
|
-
| Method | Path | Description |
|
|
129
|
-
|--------|------|-------------|
|
|
130
|
-
| `GET` | `/imports/formats` | List supported text import formats. |
|
|
131
|
-
| `POST` | `/imports/text/:format` | Import a text polar and store it as a canonical resource. |
|
|
132
|
-
| `GET` | `/imports/sources` | List supported external sources and their current availability. |
|
|
133
|
-
| `GET` | `/imports/sources/:source/search?q=<text>` | Search an external source for import candidates. |
|
|
134
|
-
| `POST` | `/imports/sources/:source/items/:externalId` | Import a source item and store it as a canonical resource. |
|
|
135
|
-
|
|
136
|
-
## External source availability
|
|
137
|
-
|
|
138
|
-
External sources are optional. Signal K may run in an isolated environment, so lack of internet access is not treated as a plugin error.
|
|
139
|
-
|
|
140
|
-
- `GET /imports/sources` reports source availability through `available` and `availabilityMessage`.
|
|
141
|
-
- The ORC source is shown as unavailable when the plugin cannot reach the official ORC index within a short timeout.
|
|
142
|
-
- ORC imports do not accept manual metadata overrides; imported metadata is owned by the source data.
|
|
143
|
-
- Certificate search results may be served from a cached ORC active-certificate index.
|
|
144
|
-
|
|
145
|
-
## Source of truth
|
|
146
|
-
|
|
147
|
-
- Use [../openApi.json](../openApi.json) as the authoritative machine-readable API contract.
|
|
148
|
-
- Use this document for a human-readable overview of the canonical format and endpoint categories.
|
|
39
|
+
The authoritative machine-readable schema for the two `/polar/*` endpoints is in
|
|
40
|
+
[../openApi.json](../openApi.json).
|