@mxtommy/kip 3.9.0-beta.9 → 3.10.0-beta.1
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/.github/copilot-instructions.md +1 -1
- package/.github/instructions/angular.instructions.md +46 -0
- package/CHANGELOG.md +12 -0
- package/README.md +49 -13
- package/kip-plugin/src/index.ts +48 -0
- package/kip-plugin/tsconfig.plugin.json +13 -0
- package/package.json +13 -8
- package/plugin/index.js +46 -0
- package/public/3rdpartylicenses.txt +129 -129
- package/public/assets/apple-icon-180.png +0 -0
- package/public/assets/apple-splash-1125-2436.jpg +0 -0
- package/public/assets/apple-splash-1136-640.jpg +0 -0
- package/public/assets/apple-splash-1170-2532.jpg +0 -0
- package/public/assets/apple-splash-1179-2556.jpg +0 -0
- package/public/assets/apple-splash-1206-2622.jpg +0 -0
- package/public/assets/apple-splash-1242-2208.jpg +0 -0
- package/public/assets/apple-splash-1242-2688.jpg +0 -0
- package/public/assets/apple-splash-1284-2778.jpg +0 -0
- package/public/assets/apple-splash-1290-2796.jpg +0 -0
- package/public/assets/apple-splash-1320-2868.jpg +0 -0
- package/public/assets/apple-splash-1334-750.jpg +0 -0
- package/public/assets/apple-splash-1488-2266.jpg +0 -0
- package/public/assets/apple-splash-1536-2048.jpg +0 -0
- package/public/assets/apple-splash-1620-2160.jpg +0 -0
- package/public/assets/apple-splash-1640-2360.jpg +0 -0
- package/public/assets/apple-splash-1668-2224.jpg +0 -0
- package/public/assets/apple-splash-1668-2388.jpg +0 -0
- package/public/assets/apple-splash-1792-828.jpg +0 -0
- package/public/assets/apple-splash-2048-1536.jpg +0 -0
- package/public/assets/apple-splash-2048-2732.jpg +0 -0
- package/public/assets/apple-splash-2160-1620.jpg +0 -0
- package/public/assets/apple-splash-2208-1242.jpg +0 -0
- package/public/assets/apple-splash-2224-1668.jpg +0 -0
- package/public/assets/apple-splash-2266-1488.jpg +0 -0
- package/public/assets/apple-splash-2360-1640.jpg +0 -0
- package/public/assets/apple-splash-2388-1668.jpg +0 -0
- package/public/assets/apple-splash-2436-1125.jpg +0 -0
- package/public/assets/apple-splash-2532-1170.jpg +0 -0
- package/public/assets/apple-splash-2556-1179.jpg +0 -0
- package/public/assets/apple-splash-2622-1206.jpg +0 -0
- package/public/assets/apple-splash-2688-1242.jpg +0 -0
- package/public/assets/apple-splash-2732-2048.jpg +0 -0
- package/public/assets/apple-splash-2778-1284.jpg +0 -0
- package/public/assets/apple-splash-2796-1290.jpg +0 -0
- package/public/assets/apple-splash-2868-1320.jpg +0 -0
- package/public/assets/apple-splash-640-1136.jpg +0 -0
- package/public/assets/apple-splash-750-1334.jpg +0 -0
- package/public/assets/apple-splash-828-1792.jpg +0 -0
- package/public/assets/apple-touch-icon.png +0 -0
- package/public/assets/favicon-16x16.png +0 -0
- package/public/assets/favicon-32x32.png +0 -0
- package/public/assets/favicon-64x64.png +0 -0
- package/public/assets/favicon.ico +0 -0
- package/public/assets/favicon.svg +25 -73
- package/public/assets/faviconn.ico +0 -0
- package/public/assets/help-docs/configuration.md +4 -4
- package/public/assets/help-docs/dashboards.md +4 -2
- package/public/assets/help-docs/welcome.md +14 -9
- package/public/assets/icon-192x192.png +0 -0
- package/public/assets/icon-256x256.png +0 -0
- package/public/assets/icon-384x384.png +0 -0
- package/public/assets/icon-512x512.png +0 -0
- package/public/assets/icon-64x64.png +0 -0
- package/public/assets/icon-72x72.png +0 -0
- package/public/assets/manifest-icon-192.maskable.png +0 -0
- package/public/assets/manifest-icon-512.maskable.png +0 -0
- package/public/assets/svg/icons.svg +436 -45
- package/public/{chunk-CQXWGD3T.js → chunk-7OMETTVK.js} +2 -2
- package/public/chunk-A4ZPBM2P.js +1 -0
- package/public/chunk-BZF6OYAF.js +7 -0
- package/public/chunk-C4AGB2HA.js +11 -0
- package/public/chunk-FW2LAMAA.js +16 -0
- package/public/{chunk-2YVW3TBK.js → chunk-GJ33QBJ6.js} +1 -1
- package/public/chunk-GJADHEMH.js +11 -0
- package/public/chunk-HKUJILH7.js +6 -0
- package/public/chunk-J3WNXGAQ.js +64 -0
- package/public/{chunk-KTDDP73O.js → chunk-JFDPDIG2.js} +1 -1
- package/public/chunk-LRX3XYXK.js +4 -0
- package/public/chunk-MXKB5Z6M.js +5 -0
- package/public/chunk-NL52VRFS.js +1 -0
- package/public/chunk-OCI46H4J.js +2 -0
- package/public/chunk-PPS4X2U3.js +1 -0
- package/public/chunk-PTADMSJZ.js +1 -0
- package/public/chunk-T5GXSVMN.js +1 -0
- package/public/chunk-TDHAZ7DS.js +6 -0
- package/public/index.html +18 -16
- package/public/main-ZOSCXBJH.js +53 -0
- package/public/{styles-RECKN66R.css → styles-PDNHT2L2.css} +1 -1
- package/public/assets/favicon.png +0 -0
- package/public/assets/hammer.min.js +0 -7
- package/public/chunk-35L7BBBD.js +0 -15
- package/public/chunk-3LEMFOCV.js +0 -3
- package/public/chunk-4JJLPUET.js +0 -60
- package/public/chunk-6XCLXHSA.js +0 -1
- package/public/chunk-7R3XHBAS.js +0 -11
- package/public/chunk-CBUY7NMR.js +0 -2
- package/public/chunk-CY7XGKUT.js +0 -1
- package/public/chunk-HCXH72CD.js +0 -5
- package/public/chunk-HEQYEGSJ.js +0 -6
- package/public/chunk-J6T4PKPB.js +0 -2
- package/public/chunk-JY3WVS7C.js +0 -2
- package/public/chunk-NMEZOCU2.js +0 -1
- package/public/chunk-NS2FPVWM.js +0 -4
- package/public/chunk-PKNLASTF.js +0 -4
- package/public/chunk-Q2Y75POI.js +0 -1
- package/public/chunk-RRTCHHRC.js +0 -3
- package/public/chunk-T74UYW3I.js +0 -1
- package/public/chunk-TA4GACKT.js +0 -4
- package/public/chunk-TXPLRBW5.js +0 -2
- package/public/chunk-VHFBF47T.js +0 -1
- package/public/chunk-VYUMZVH2.js +0 -2
- package/public/chunk-ZBCOJLI4.js +0 -6
- package/public/main-FDZZCWB6.js +0 -53
|
@@ -57,7 +57,7 @@ Use this quick-start map to be productive in this repo. Prefer these concrete pa
|
|
|
57
57
|
|
|
58
58
|
## Project specifics & gotchas
|
|
59
59
|
- Always respect serve path /@mxtommy/kip/ (dev/prod). Assets and routing assume this base.
|
|
60
|
-
- CommonJS deps are explicitly allowed (howler,
|
|
60
|
+
- CommonJS deps are explicitly allowed (howler, js-quantities). Avoid introducing new CJS without adding to allowedCommonJsDependencies.
|
|
61
61
|
- Use standalone components, signals, @if/@for; follow .github/instructions/angular.instructions.md for style.
|
|
62
62
|
- Widget config UIs live under src/app/widget-config; path controls use custom validators (no Validators.required). Respect isPathConfigurable and pathRequired.
|
|
63
63
|
|
|
@@ -54,6 +54,10 @@ https://angular.dev/essentials/components
|
|
|
54
54
|
https://angular.dev/essentials/signals
|
|
55
55
|
https://angular.dev/essentials/templates
|
|
56
56
|
https://angular.dev/essentials/dependency-injection
|
|
57
|
+
https://angular.dev/guide/components/queries
|
|
58
|
+
|
|
59
|
+
viewChild('tileContainer', { static: false }) tileContainer!: ElementRef<HTMLDivElement>;
|
|
60
|
+
viewChildren('tile', { read: ElementRef }) tiles!: QueryList<ElementRef<HTMLElement>>;
|
|
57
61
|
|
|
58
62
|
## Best practices & Style guide
|
|
59
63
|
Here are the best practices and the style guide information.
|
|
@@ -100,6 +104,15 @@ Here is a link to the most recent Angular style guide https://angular.dev/style-
|
|
|
100
104
|
- Use the `providedIn: 'root'` option for singleton services
|
|
101
105
|
- Use the `inject()` function instead of constructor injection
|
|
102
106
|
|
|
107
|
+
### Dashboards
|
|
108
|
+
- Dashboards are managed via `DashboardService` and support custom names and icons for easy identification
|
|
109
|
+
- Use `DashboardService.add(name, configuration, icon?)` to create dashboards with optional icons
|
|
110
|
+
- Use `DashboardService.update(index, name, icon?)` to modify existing dashboards
|
|
111
|
+
- Use `DashboardService.duplicate(index, newName, newIcon?)` to duplicate dashboards with optional icon override
|
|
112
|
+
- Icons are Material Icons (e.g., 'dashboard', 'navigation') and can be selected via the `select-icon` component
|
|
113
|
+
- The `select-icon` component loads SVG icons from configurable files (default: 'assets/svg/icons.svg'), displays them in a grid, and outputs the selected icon name
|
|
114
|
+
- Integrate icon selection in dialogs by including `<select-icon [iconFile]="'assets/svg/icons.svg'" (selectedIcon)="onIconSelected($event)"></select-icon>`
|
|
115
|
+
|
|
103
116
|
---
|
|
104
117
|
|
|
105
118
|
## Cross-Reference Instructions
|
|
@@ -118,3 +131,36 @@ Here is a link to the most recent Angular style guide https://angular.dev/style-
|
|
|
118
131
|
- Use signals, standalone components, and modern control flow from this file within the KIP architecture from `COPILOT.md`
|
|
119
132
|
- For theming and colors, always use the KIP theme system described in `COPILOT.md`, not generic CSS approaches
|
|
120
133
|
- All services should follow both the Angular DI patterns here AND the KIP service architecture in `COPILOT.md`
|
|
134
|
+
|
|
135
|
+
## Referencing component children with queries (Angular 17+)
|
|
136
|
+
|
|
137
|
+
Use the modern signal-based query API for referencing elements, components, or directives in your template:
|
|
138
|
+
|
|
139
|
+
- Use `viewChild()` and `viewChildren()` from `@angular/core` (not the old decorators).
|
|
140
|
+
- These return signals or arrays, not QueryList.
|
|
141
|
+
- Example usage:
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
import { viewChild, viewChildren, ElementRef } from '@angular/core';
|
|
145
|
+
|
|
146
|
+
// In your component class:
|
|
147
|
+
tileContainer = viewChild('tileContainer')();
|
|
148
|
+
tiles = viewChildren('tile', { read: ElementRef });
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- In your template, add template reference variables:
|
|
152
|
+
|
|
153
|
+
```html
|
|
154
|
+
<div #tileContainer>
|
|
155
|
+
@for (item of items; let i = $index) {
|
|
156
|
+
<tile-large-icon #tile ...></tile-large-icon>
|
|
157
|
+
}
|
|
158
|
+
</div>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
- Access the element/component directly via the property (e.g., `this.tileContainer`, `this.tiles[0]`).
|
|
162
|
+
- `viewChildren()` returns a readonly array that updates automatically as the view changes.
|
|
163
|
+
- No need for `ngAfterViewInit` to access queries; they are available as soon as the view is rendered.
|
|
164
|
+
|
|
165
|
+
**Summary:**
|
|
166
|
+
Use `viewChild()` and `viewChildren()` for modern, reactive, and type-safe access to elements/components in your template. Avoid the legacy `@ViewChild`/`@ViewChildren` decorators and `QueryList` in new code.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v 3.9.0
|
|
2
|
+
# New Feature
|
|
3
|
+
* A new dashboard navigation experience. Introducing our all-new Dashboard sidenav designed for speed. Effortlessly jump between dashboards with a single tap, always knowing exactly where you are thanks to clear highlighting of your current dashboard.
|
|
4
|
+
* Discover the brand new Settings button at the top of the sidenav. Instantly access tools to manage your dashboards, plus quick links to Options, Data Inspector, and Help—all in one place.
|
|
5
|
+
* Personalize your dashboards with style: double-click any dashboard to open the new icon gallery and give each page a unique visual identity.
|
|
6
|
+
* All configuration controls are now streamlined as tabs within the Options page, making customization faster and more enjoyable than ever.
|
|
7
|
+
# Improvements
|
|
8
|
+
* Reduced GPU memory usage to improve performance and stability, especially on low-end hardware such as the RPi Zero 2.
|
|
9
|
+
* Added canvas bitmap blitting for better rendering speed and visual performance.
|
|
10
|
+
* Replaced HammerJS with native gesture support for improved responsiveness.
|
|
11
|
+
* Updated CSS to help prevent accidental page reloads and unwanted text selection on mobile devices.
|
|
12
|
+
* Enabled Notification audio on mobile.
|
|
1
13
|
# v 3.8.2
|
|
2
14
|
# Improvements
|
|
3
15
|
* Faster app loading with local font and font swap support
|
package/README.md
CHANGED
|
@@ -16,18 +16,6 @@ Key features include:
|
|
|
16
16
|
- **Multiple User Profiles**: Tailor configurations for different roles, devices, or use cases.
|
|
17
17
|
- **Cross-Device Compatibility**: Access KIP remotely on any device by navigating to `http://<Signal K Server URL>:<port>/@mxtommy/kip`.
|
|
18
18
|
|
|
19
|
-
Typical complementary components you may install (many are often bundled with Signal K distributions):
|
|
20
|
-
|
|
21
|
-
**Navigation & Charting**
|
|
22
|
-
- **Freeboard‑SK** – Multi‑station, web chart plotter dedicated to Signal K: routes, waypoints, charts, alarms, weather layers, and instrument overlays.
|
|
23
|
-
|
|
24
|
-
**Visual Flow / Automation**
|
|
25
|
-
- **Node‑RED** – Low‑code, flow‑based wiring of devices, APIs, online services, and custom logic (alert escalation, device control automation, data enrichment, protocol bridging).
|
|
26
|
-
|
|
27
|
-
**Data Storage & Analytics**
|
|
28
|
-
- **InfluxDB / other TSDB** – High‑resolution historical storage of sensor & performance metrics beyond what lightweight widget charts should retain.
|
|
29
|
-
- **Grafana** – Rich exploratory / comparative dashboards, ad‑hoc queries, alert rules on stored metrics, correlation across heterogeneous data sources.
|
|
30
|
-
|
|
31
19
|
KIP is open-source under the MIT license, built by the community and 100% free. Join the community on Discord or contribute to the project on GitHub!
|
|
32
20
|
|
|
33
21
|
## Read the Help introduction How-to
|
|
@@ -134,6 +122,32 @@ For example, Signal K will notify KIP when a water depth or temperature sensor r
|
|
|
134
122
|
## Multiple User Profiles
|
|
135
123
|
If you have different roles on board: captain, skipper, tactician, navigator, engineer—or simply different people with different needs, each can tailor KIP as they wish. The use of profiles also allows you to tie specific configuration arrangements to use cases or device form factors.
|
|
136
124
|
|
|
125
|
+
## Complementary Components
|
|
126
|
+
Typical complementary components you may install (many are often bundled with Signal K distributions):
|
|
127
|
+
|
|
128
|
+
**Navigation & Charting**
|
|
129
|
+
- **Freeboard‑SK** – Multi‑station, web chart plotter dedicated to Signal K: routes, waypoints, charts, alarms, weather layers, and instrument overlays.
|
|
130
|
+
|
|
131
|
+
**Visual Flow / Automation**
|
|
132
|
+
- **Node‑RED** – Low‑code, flow‑based wiring of devices, APIs, online services, and custom logic (alert escalation, device control automation, data enrichment, protocol bridging).
|
|
133
|
+
|
|
134
|
+
**Data Storage & Analytics**
|
|
135
|
+
- **InfluxDB / other TSDB** – High‑resolution historical storage of sensor & performance metrics beyond what lightweight widget charts should retain.
|
|
136
|
+
- **Grafana** – Rich exploratory / comparative dashboards, ad‑hoc queries, alert rules on stored metrics, correlation across heterogeneous data sources.
|
|
137
|
+
|
|
138
|
+
## Complementary Components
|
|
139
|
+
Typical complementary components you may install (many are often bundled with Signal K distributions):
|
|
140
|
+
|
|
141
|
+
**Navigation & Charting**
|
|
142
|
+
- **Freeboard‑SK** – Multi‑station, web chart plotter dedicated to Signal K: routes, waypoints, charts, alarms, weather layers, and instrument overlays.
|
|
143
|
+
|
|
144
|
+
**Visual Flow / Automation**
|
|
145
|
+
- **Node‑RED** – Low‑code, flow‑based wiring of devices, APIs, online services, and custom logic (alert escalation, device control automation, data enrichment, protocol bridging).
|
|
146
|
+
|
|
147
|
+
**Data Storage & Analytics**
|
|
148
|
+
- **InfluxDB / other TSDB** – High‑resolution historical storage of sensor & performance metrics beyond what lightweight widget charts should retain.
|
|
149
|
+
- **Grafana** – Rich exploratory / comparative dashboards, ad‑hoc queries, alert rules on stored metrics, correlation across heterogeneous data sources.
|
|
150
|
+
|
|
137
151
|
# Connect, Share, and Support
|
|
138
152
|
KIP has its own Discord Signal K channel for getting in touch. Join us at https://discord.gg/AMDYT2DQga
|
|
139
153
|
|
|
@@ -166,6 +180,28 @@ Keeping KIP focused preserves responsiveness (lower CPU / memory), reduces UI cl
|
|
|
166
180
|
|
|
167
181
|
In short: use KIP to see & act on live sailing information; use the complementary tools to store it long‑term, analyze it deeply, automate decisions, or build advanced integrations.
|
|
168
182
|
|
|
183
|
+
## Project Scope
|
|
184
|
+
What KIP IS about:
|
|
185
|
+
- Real‑time presentation of vessel & environment data (navigation, performance, systems) pulled from Signal K.
|
|
186
|
+
- Fast, legible, touchscreen‑friendly dashboards for underway decision making.
|
|
187
|
+
- Configurable widgets (gauges, charts, timers, controls) tuned for sailing operations.
|
|
188
|
+
|
|
189
|
+
What KIP deliberately IS NOT trying to become:
|
|
190
|
+
- A full data lake / long‑term time‑series historian.
|
|
191
|
+
- A general purpose automation / rules / orchestration engine.
|
|
192
|
+
- A universal external web‑app embedding or mash‑up framework.
|
|
193
|
+
- A low‑code integration hub for arbitrarily wiring protocols and services.
|
|
194
|
+
|
|
195
|
+
Those domains already have excellent, specialized open‑source tools. Instead of re‑implementing them, KIP plays nicely alongside them within a Signal K based onboard stack.
|
|
196
|
+
|
|
197
|
+
**Processing & Extensions**
|
|
198
|
+
- **Signal K Plugins** – Domain‑specific enrichment (polars, performance calculations, derived environmental data, routing aids) published directly into the Signal K data model that KIP can then display.
|
|
199
|
+
|
|
200
|
+
**Why this separation matters**
|
|
201
|
+
Keeping KIP focused preserves responsiveness (lower CPU / memory), reduces UI clutter, and accelerates iteration on core sailing UX. Heavy analytics, complex workflow logic, and broad third‑party embedding stay where they are strongest—outside—but still feed KIP through the common Signal K data fabric.
|
|
202
|
+
|
|
203
|
+
In short: use KIP to see & act on live sailing information; use the complementary tools to store it long‑term, analyze it deeply, automate decisions, or build advanced integrations.
|
|
204
|
+
|
|
169
205
|
**Tools**
|
|
170
206
|
Linux, Mac, RPi, or Windows dev platform supported
|
|
171
207
|
1. Install the latest Node version (v16+, v18 recommended)
|
|
@@ -193,7 +229,7 @@ Linux, Mac, RPi, or Windows dev platform supported
|
|
|
193
229
|
|
|
194
230
|
**Apple PWA Icon Generation**
|
|
195
231
|
Use the following tool and command line:
|
|
196
|
-
`npx pwa-asset-generator ./src/
|
|
232
|
+
`npx pwa-asset-generator ./src/assets/favicon.svg ./src/assets/ -i ./src/index.html -m ./src manifest.json -b "linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.15) 100%), radial-gradient(at top center, rgba(255,255,255,0.40) 0%, rgba(0,0,0,0.40) 120%) #989898" -p 5%`
|
|
197
233
|
|
|
198
234
|
**Share**
|
|
199
235
|
Once done with your work, from your fork's working branch, make a GitHub pull request to have your code reviewed, merged, and included in the next release.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Delta, Path, Plugin, ServerAPI, Value } from '@signalk/server-api'
|
|
2
|
+
|
|
3
|
+
export default (app: ServerAPI): Plugin => {
|
|
4
|
+
const plugin: Plugin = {
|
|
5
|
+
id: 'kip',
|
|
6
|
+
name: 'KIP',
|
|
7
|
+
description: 'KIP server plugin',
|
|
8
|
+
start: (settings, restartPlugin) => {
|
|
9
|
+
app.debug(`${plugin.name}: Starting plugin`);
|
|
10
|
+
app.registerPutHandler('vessels.self', 'plugins.displays.*', displayPutHandler);
|
|
11
|
+
},
|
|
12
|
+
stop: () => {
|
|
13
|
+
app.debug(`${plugin.name}: Stopping plugin`);
|
|
14
|
+
},
|
|
15
|
+
schema: () => {
|
|
16
|
+
properties: {
|
|
17
|
+
// plugin configuration goes here
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function displayPutHandler(context: string, path: string, value: Value): { state: 'COMPLETED'; statusCode: number; message?: string } {
|
|
23
|
+
app.debug(`${plugin.name}: PUT handler called for context ${context}, path ${path}, value ${value}`);
|
|
24
|
+
try {
|
|
25
|
+
const delta: Delta = {
|
|
26
|
+
updates: [
|
|
27
|
+
{
|
|
28
|
+
values: [
|
|
29
|
+
{
|
|
30
|
+
path: path as Path,
|
|
31
|
+
value: value
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
app.debug('Sending message: ', JSON.stringify(delta));
|
|
38
|
+
app.handleMessage(plugin.id, delta);
|
|
39
|
+
return { state: "COMPLETED" as const, statusCode: 200 };
|
|
40
|
+
|
|
41
|
+
} catch (error) {
|
|
42
|
+
app.error(`${plugin.name}: Error in PUT handler: ${error}`);
|
|
43
|
+
return { state: "COMPLETED" as const, statusCode: 500, message: (error as Error).message };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return plugin;
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../plugin",
|
|
6
|
+
"types": [],
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"sourceMap": false,
|
|
9
|
+
"module": "commonjs",
|
|
10
|
+
"moduleResolution": "node"
|
|
11
|
+
},
|
|
12
|
+
"include": ["./src/*.*"]
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxtommy/kip",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0-beta.1",
|
|
4
4
|
"description": "An advanced and versatile marine instrumentation package to display Signal K data.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -36,12 +36,16 @@
|
|
|
36
36
|
"appIcon": "assets/icon-72x72.png",
|
|
37
37
|
"displayName": "KIP Instrument MFD"
|
|
38
38
|
},
|
|
39
|
+
"main": "plugin/index.js",
|
|
40
|
+
"signalk-plugin-enabled-by-default": true,
|
|
39
41
|
"scripts": {
|
|
40
|
-
"dev": "ng serve --configuration=dev --serve-path=/@mxtommy/kip/",
|
|
41
|
-
"build-dev": "ng build --configuration=dev",
|
|
42
|
-
"build-prod": "ng build --configuration=production",
|
|
43
42
|
"test": "ng test",
|
|
44
43
|
"lint": "ng lint",
|
|
44
|
+
"dev": "ng serve --configuration=dev --serve-path=/@mxtommy/kip/",
|
|
45
|
+
"build:plugin": "tsc -p ./kip-plugin/tsconfig.plugin.json",
|
|
46
|
+
"build:dev": "ng build --configuration=dev",
|
|
47
|
+
"build:prod": "ng build --configuration=production",
|
|
48
|
+
"build:all": "npm run build:prod && npm run build:plugin",
|
|
45
49
|
"e2e": "ng e2e"
|
|
46
50
|
},
|
|
47
51
|
"devDependencies": {
|
|
@@ -63,13 +67,13 @@
|
|
|
63
67
|
"@godind/ng-canvas-gauges": "^6.2.1",
|
|
64
68
|
"@robloche/chartjs-plugin-streaming": "^3.1.0",
|
|
65
69
|
"@types/canvas-gauges": "^2.1.8",
|
|
66
|
-
"@types/hammerjs": "^2.0.45",
|
|
67
70
|
"@types/howler": "^2.2.10",
|
|
68
71
|
"@types/jasmine": "~3.6.0",
|
|
69
72
|
"@types/jasminewd2": "^2.0.9",
|
|
70
73
|
"@types/js-quantities": "^1.6.6",
|
|
71
74
|
"@types/lodash-es": "^4.17.9",
|
|
72
75
|
"@types/node": "^24.1.0",
|
|
76
|
+
"@zakj/no-sleep": "^0.13.5",
|
|
73
77
|
"angular-eslint": "20.1.1",
|
|
74
78
|
"chart.js": "^4.4.9",
|
|
75
79
|
"chartjs-adapter-date-fns": "^3.0.0",
|
|
@@ -80,7 +84,6 @@
|
|
|
80
84
|
"date-fns": "^2.30.0",
|
|
81
85
|
"eslint": "^9.29.0",
|
|
82
86
|
"gridstack": "^11.4.0",
|
|
83
|
-
"hammerjs": "^2.0.8",
|
|
84
87
|
"howler": "^2.2.4",
|
|
85
88
|
"jasmine-core": "~4.0.1",
|
|
86
89
|
"jasmine-spec-reporter": "~5.0.0",
|
|
@@ -96,15 +99,17 @@
|
|
|
96
99
|
"ngx-markdown": "^20.0.0",
|
|
97
100
|
"ngx-resize-observer": "^3.1.0",
|
|
98
101
|
"protractor": "~7.0.0",
|
|
99
|
-
"pwa-asset-generator": "^8.
|
|
102
|
+
"pwa-asset-generator": "^8.1.1",
|
|
100
103
|
"rxjs": "^7.8.2",
|
|
101
104
|
"sass": "^1.49.9",
|
|
102
105
|
"screenfull": "^6.0.2",
|
|
103
|
-
"@zakj/no-sleep": "^0.13.5",
|
|
104
106
|
"steelseries": "^2.0.9",
|
|
105
107
|
"ts-node": "^10.9.2",
|
|
106
108
|
"tslib": "^2.6.2",
|
|
107
109
|
"typescript": "^5.8.3",
|
|
108
110
|
"zone.js": "^0.15.1"
|
|
111
|
+
},
|
|
112
|
+
"dependencies": {
|
|
113
|
+
"@signalk/server-api": "^2.7.2"
|
|
109
114
|
}
|
|
110
115
|
}
|
package/plugin/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = (app) => {
|
|
4
|
+
const plugin = {
|
|
5
|
+
id: 'kip',
|
|
6
|
+
name: 'KIP',
|
|
7
|
+
description: 'KIP server plugin',
|
|
8
|
+
start: (settings, restartPlugin) => {
|
|
9
|
+
app.debug(`${plugin.name}: Starting plugin`);
|
|
10
|
+
app.registerPutHandler('vessels.self', 'plugins.displays.*', displayPutHandler);
|
|
11
|
+
},
|
|
12
|
+
stop: () => {
|
|
13
|
+
app.debug(`${plugin.name}: Stopping plugin`);
|
|
14
|
+
},
|
|
15
|
+
schema: () => {
|
|
16
|
+
properties: {
|
|
17
|
+
// plugin configuration goes here
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function displayPutHandler(context, path, value) {
|
|
22
|
+
app.debug(`${plugin.name}: PUT handler called for context ${context}, path ${path}, value ${value}`);
|
|
23
|
+
try {
|
|
24
|
+
const delta = {
|
|
25
|
+
updates: [
|
|
26
|
+
{
|
|
27
|
+
values: [
|
|
28
|
+
{
|
|
29
|
+
path: path,
|
|
30
|
+
value: value
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
app.debug('Sending message: ', JSON.stringify(delta));
|
|
37
|
+
app.handleMessage(plugin.id, delta);
|
|
38
|
+
return { state: "COMPLETED", statusCode: 200 };
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
app.error(`${plugin.name}: Error in PUT handler: ${error}`);
|
|
42
|
+
return { state: "COMPLETED", statusCode: 500, message: error.message };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return plugin;
|
|
46
|
+
};
|