@mxtommy/kip 1.3.0 → 2.0.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/CHANGELOG.md +38 -3
- package/CONTRIBUTORS.md +4 -4
- package/KipGaugeSample3-1024x508.png +0 -0
- package/LICENSE +21 -0
- package/README.md +80 -42
- package/package.json +52 -46
- package/public/3rdpartylicenses.txt +47 -419
- package/public/assets/NoSleep.min.js +2 -2
- package/public/assets/icon-64x64.png +0 -0
- package/public/assets/icon-72x72.png +0 -0
- package/public/index.html +3 -3
- package/public/main.f3d15cc777474f5f.js +1 -0
- package/public/manifest.json +9 -4
- package/public/polyfills.64db6be9cdc8f808.js +1 -0
- package/public/runtime.e75056c32c37f59d.js +1 -0
- package/public/styles.6b1c2c92be18a2cc.css +1 -0
- package/.angulardoc.json +0 -4
- package/angular.json +0 -162
- package/e2e/app.e2e-spec.ts +0 -14
- package/e2e/app.po.ts +0 -11
- package/e2e/tsconfig.e2e.json +0 -14
- package/karma.conf.js +0 -31
- package/protractor.conf.js +0 -28
- package/public/assets/svg-autopilot-inkscape-plain.svg +0 -983
- package/public/assets/svg-wind-inkscape.svg +0 -1358
- package/public/main-es2018.98175eb4c61ccaf7eb17.js +0 -1
- package/public/main-es5.98175eb4c61ccaf7eb17.js +0 -1
- package/public/polyfills-es2018.3a61665863c173cd6ba3.js +0 -1
- package/public/polyfills-es5.44827ae4ff4e41de51fb.js +0 -1
- package/public/runtime-es2018.baedb88c6d2abacae2b8.js +0 -1
- package/public/runtime-es5.baedb88c6d2abacae2b8.js +0 -1
- package/public/styles.b92ae2c466c89712209d.css +0 -5
- package/src/app/alarm-menu/alarm-menu.component.html +0 -55
- package/src/app/alarm-menu/alarm-menu.component.scss +0 -52
- package/src/app/alarm-menu/alarm-menu.component.spec.ts +0 -25
- package/src/app/alarm-menu/alarm-menu.component.ts +0 -186
- package/src/app/app-help/app-help.component.css +0 -4
- package/src/app/app-help/app-help.component.html +0 -135
- package/src/app/app-help/app-help.component.ts +0 -45
- package/src/app/app-settings.service.spec.ts +0 -15
- package/src/app/app-settings.service.ts +0 -478
- package/src/app/app.component.css +0 -39
- package/src/app/app.component.html +0 -93
- package/src/app/app.component.scss +0 -79
- package/src/app/app.component.spec.ts +0 -32
- package/src/app/app.component.ts +0 -191
- package/src/app/app.module.ts +0 -200
- package/src/app/config.blank.const.ts +0 -52
- package/src/app/config.blank.notification.const.ts +0 -19
- package/src/app/config.blank.units.const.ts +0 -23
- package/src/app/config.demo.const.ts +0 -384
- package/src/app/data-browser/data-browser.component.css +0 -29
- package/src/app/data-browser/data-browser.component.html +0 -44
- package/src/app/data-browser/data-browser.component.spec.ts +0 -25
- package/src/app/data-browser/data-browser.component.ts +0 -91
- package/src/app/data-browser-row/data-browser-row-unit-modal.html +0 -17
- package/src/app/data-browser-row/data-browser-row.component.css +0 -10
- package/src/app/data-browser-row/data-browser-row.component.html +0 -5
- package/src/app/data-browser-row/data-browser-row.component.ts +0 -79
- package/src/app/data-set.service.spec.ts +0 -15
- package/src/app/data-set.service.ts +0 -273
- package/src/app/dynamic-widget.directive.spec.ts +0 -8
- package/src/app/dynamic-widget.directive.ts +0 -11
- package/src/app/filter-self.pipe.spec.ts +0 -8
- package/src/app/filter-self.pipe.ts +0 -14
- package/src/app/fit-text.directive.spec.ts +0 -8
- package/src/app/fit-text.directive.ts +0 -61
- package/src/app/gauge-steel/gauge-steel.component.css +0 -5
- package/src/app/gauge-steel/gauge-steel.component.html +0 -4
- package/src/app/gauge-steel/gauge-steel.component.spec.ts +0 -25
- package/src/app/gauge-steel/gauge-steel.component.ts +0 -282
- package/src/app/gauges-module/base-gauge.ts +0 -301
- package/src/app/gauges-module/gauges.module.ts +0 -17
- package/src/app/gauges-module/linear-gauge.ts +0 -50
- package/src/app/gauges-module/radial-gauge.ts +0 -48
- package/src/app/layout-split/layout-split.component.html +0 -30
- package/src/app/layout-split/layout-split.component.scss +0 -33
- package/src/app/layout-split/layout-split.component.spec.ts +0 -25
- package/src/app/layout-split/layout-split.component.ts +0 -59
- package/src/app/layout-splits.service.spec.ts +0 -15
- package/src/app/layout-splits.service.ts +0 -284
- package/src/app/modal-path-selector/modal-path-selector.component.html +0 -62
- package/src/app/modal-path-selector/modal-path-selector.component.scss +0 -39
- package/src/app/modal-path-selector/modal-path-selector.component.spec.ts +0 -25
- package/src/app/modal-path-selector/modal-path-selector.component.ts +0 -132
- package/src/app/modal-widget/modal-widget.component.css +0 -33
- package/src/app/modal-widget/modal-widget.component.html +0 -341
- package/src/app/modal-widget/modal-widget.component.spec.ts +0 -25
- package/src/app/modal-widget/modal-widget.component.ts +0 -84
- package/src/app/notifications.service.spec.ts +0 -12
- package/src/app/notifications.service.ts +0 -392
- package/src/app/object-keys.pipe.spec.ts +0 -8
- package/src/app/object-keys.pipe.ts +0 -13
- package/src/app/reset-config/reset-config.component.css +0 -0
- package/src/app/reset-config/reset-config.component.html +0 -3
- package/src/app/reset-config/reset-config.component.spec.ts +0 -25
- package/src/app/reset-config/reset-config.component.ts +0 -31
- package/src/app/root-display/root-display.component.css +0 -0
- package/src/app/root-display/root-display.component.html +0 -4
- package/src/app/root-display/root-display.component.spec.ts +0 -25
- package/src/app/root-display/root-display.component.ts +0 -57
- package/src/app/safe.pipe.ts +0 -16
- package/src/app/settings/settings.component.css +0 -9
- package/src/app/settings/settings.component.html +0 -25
- package/src/app/settings/settings.component.spec.ts +0 -25
- package/src/app/settings/settings.component.ts +0 -22
- package/src/app/settings-config/settings-config.component.css +0 -39
- package/src/app/settings-config/settings-config.component.html +0 -118
- package/src/app/settings-config/settings-config.component.spec.ts +0 -25
- package/src/app/settings-config/settings-config.component.ts +0 -161
- package/src/app/settings-datasets/settings-datasets.component.html +0 -43
- package/src/app/settings-datasets/settings-datasets.component.scss +0 -39
- package/src/app/settings-datasets/settings-datasets.component.spec.ts +0 -25
- package/src/app/settings-datasets/settings-datasets.component.ts +0 -98
- package/src/app/settings-datasets/settings-datasets.modal.html +0 -54
- package/src/app/settings-notifications/settings-notifications.component.css +0 -0
- package/src/app/settings-notifications/settings-notifications.component.html +0 -65
- package/src/app/settings-notifications/settings-notifications.component.spec.ts +0 -25
- package/src/app/settings-notifications/settings-notifications.component.ts +0 -29
- package/src/app/settings-signalk/settings-signalk.component.css +0 -3
- package/src/app/settings-signalk/settings-signalk.component.html +0 -89
- package/src/app/settings-signalk/settings-signalk.component.spec.ts +0 -25
- package/src/app/settings-signalk/settings-signalk.component.ts +0 -174
- package/src/app/settings-units/settings-units.component.css +0 -4
- package/src/app/settings-units/settings-units.component.html +0 -19
- package/src/app/settings-units/settings-units.component.spec.ts +0 -25
- package/src/app/settings-units/settings-units.component.ts +0 -62
- package/src/app/settings-zones/settings-zones.component.css +0 -22
- package/src/app/settings-zones/settings-zones.component.html +0 -70
- package/src/app/settings-zones/settings-zones.component.ts +0 -154
- package/src/app/settings-zones/settings-zones.modal.css +0 -14
- package/src/app/settings-zones/settings-zones.modal.html +0 -39
- package/src/app/signalk-connection.service.ts +0 -344
- package/src/app/signalk-delta.service.spec.ts +0 -15
- package/src/app/signalk-delta.service.ts +0 -97
- package/src/app/signalk-full.service.spec.ts +0 -15
- package/src/app/signalk-full.service.ts +0 -99
- package/src/app/signalk-interfaces.ts +0 -129
- package/src/app/signalk-requests.service.spec.ts +0 -12
- package/src/app/signalk-requests.service.ts +0 -180
- package/src/app/signalk.service.spec.ts +0 -15
- package/src/app/signalk.service.ts +0 -428
- package/src/app/svg-autopilot/svg-autopilot.component.html +0 -1036
- package/src/app/svg-autopilot/svg-autopilot.component.spec.ts +0 -25
- package/src/app/svg-autopilot/svg-autopilot.component.ts +0 -174
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.html +0 -119
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.scss +0 -0
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.spec.ts +0 -25
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.ts +0 -49
- package/src/app/svg-wind/svg-wind.component.css +0 -0
- package/src/app/svg-wind/svg-wind.component.html +0 -969
- package/src/app/svg-wind/svg-wind.component.scss +0 -76
- package/src/app/svg-wind/svg-wind.component.spec.ts +0 -25
- package/src/app/svg-wind/svg-wind.component.ts +0 -280
- package/src/app/unit-window/unit-window.component.css +0 -37
- package/src/app/unit-window/unit-window.component.html +0 -8
- package/src/app/unit-window/unit-window.component.spec.ts +0 -25
- package/src/app/unit-window/unit-window.component.ts +0 -134
- package/src/app/unit-window/unit-window.modal.html +0 -25
- package/src/app/units.service.ts +0 -300
- package/src/app/widget-autopilot/widget-autopilot.component.html +0 -78
- package/src/app/widget-autopilot/widget-autopilot.component.scss +0 -191
- package/src/app/widget-autopilot/widget-autopilot.component.spec.ts +0 -25
- package/src/app/widget-autopilot/widget-autopilot.component.ts +0 -774
- package/src/app/widget-blank/widget-blank.component.html +0 -5
- package/src/app/widget-blank/widget-blank.component.scss +0 -21
- package/src/app/widget-blank/widget-blank.component.spec.ts +0 -25
- package/src/app/widget-blank/widget-blank.component.ts +0 -17
- package/src/app/widget-gauge/widget-gauge.component.css +0 -26
- package/src/app/widget-gauge/widget-gauge.component.html +0 -29
- package/src/app/widget-gauge/widget-gauge.component.spec.ts +0 -25
- package/src/app/widget-gauge/widget-gauge.component.ts +0 -120
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.html +0 -126
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.scss +0 -94
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.spec.ts +0 -25
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.ts +0 -424
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.html +0 -122
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.scss +0 -69
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.spec.ts +0 -25
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.ts +0 -553
- package/src/app/widget-historical/widget-historical.component.css +0 -31
- package/src/app/widget-historical/widget-historical.component.html +0 -14
- package/src/app/widget-historical/widget-historical.component.scss +0 -0
- package/src/app/widget-historical/widget-historical.component.spec.ts +0 -25
- package/src/app/widget-historical/widget-historical.component.ts +0 -306
- package/src/app/widget-iframe/widget-iframe.component.css +0 -12
- package/src/app/widget-iframe/widget-iframe.component.html +0 -21
- package/src/app/widget-iframe/widget-iframe.component.spec.ts +0 -25
- package/src/app/widget-iframe/widget-iframe.component.ts +0 -63
- package/src/app/widget-list.service.spec.ts +0 -15
- package/src/app/widget-list.service.ts +0 -135
- package/src/app/widget-manager.service.spec.ts +0 -15
- package/src/app/widget-manager.service.ts +0 -141
- package/src/app/widget-numeric/widget-numeric.component.html +0 -13
- package/src/app/widget-numeric/widget-numeric.component.scss +0 -52
- package/src/app/widget-numeric/widget-numeric.component.spec.ts +0 -25
- package/src/app/widget-numeric/widget-numeric.component.ts +0 -457
- package/src/app/widget-simple-linear/widget-simple-linear.component.html +0 -28
- package/src/app/widget-simple-linear/widget-simple-linear.component.scss +0 -64
- package/src/app/widget-simple-linear/widget-simple-linear.component.spec.ts +0 -25
- package/src/app/widget-simple-linear/widget-simple-linear.component.ts +0 -199
- package/src/app/widget-state/widget-state.component.html +0 -27
- package/src/app/widget-state/widget-state.component.scss +0 -68
- package/src/app/widget-state/widget-state.component.spec.ts +0 -25
- package/src/app/widget-state/widget-state.component.ts +0 -178
- package/src/app/widget-switch/widget-switch.component.css +0 -70
- package/src/app/widget-switch/widget-switch.component.html +0 -17
- package/src/app/widget-switch/widget-switch.component.spec.ts +0 -25
- package/src/app/widget-switch/widget-switch.component.ts +0 -134
- package/src/app/widget-text-generic/widget-text-generic.component.css +0 -55
- package/src/app/widget-text-generic/widget-text-generic.component.html +0 -9
- package/src/app/widget-text-generic/widget-text-generic.component.spec.ts +0 -25
- package/src/app/widget-text-generic/widget-text-generic.component.ts +0 -253
- package/src/app/widget-tutorial/widget-tutorial.component.css +0 -0
- package/src/app/widget-tutorial/widget-tutorial.component.html +0 -34
- package/src/app/widget-tutorial/widget-tutorial.component.spec.ts +0 -25
- package/src/app/widget-tutorial/widget-tutorial.component.ts +0 -18
- package/src/app/widget-unknown/widget-unknown.component.css +0 -0
- package/src/app/widget-unknown/widget-unknown.component.html +0 -3
- package/src/app/widget-unknown/widget-unknown.component.spec.ts +0 -25
- package/src/app/widget-unknown/widget-unknown.component.ts +0 -15
- package/src/app/widget-wind/widget-wind.component.css +0 -24
- package/src/app/widget-wind/widget-wind.component.html +0 -20
- package/src/app/widget-wind/widget-wind.component.spec.ts +0 -25
- package/src/app/widget-wind/widget-wind.component.ts +0 -369
- package/src/assets/.gitkeep +0 -0
- package/src/assets/NoSleep.min.js +0 -2
- package/src/assets/alarm.mp3 +0 -0
- package/src/assets/alert.mp3 +0 -0
- package/src/assets/alertl.old.mp3 +0 -0
- package/src/assets/emergency.mp3 +0 -0
- package/src/assets/fontawesome6/css/all.min.css +0 -6
- package/src/assets/fontawesome6/webfonts/fa-brands-400.ttf +0 -0
- package/src/assets/fontawesome6/webfonts/fa-brands-400.woff2 +0 -0
- package/src/assets/fontawesome6/webfonts/fa-regular-400.ttf +0 -0
- package/src/assets/fontawesome6/webfonts/fa-regular-400.woff2 +0 -0
- package/src/assets/fontawesome6/webfonts/fa-solid-900.ttf +0 -0
- package/src/assets/fontawesome6/webfonts/fa-solid-900.woff2 +0 -0
- package/src/assets/fontawesome6/webfonts/fa-v4compatibility.ttf +0 -0
- package/src/assets/fontawesome6/webfonts/fa-v4compatibility.woff2 +0 -0
- package/src/assets/icon-192x192.png +0 -0
- package/src/assets/icon-256x256.png +0 -0
- package/src/assets/icon-384x384.png +0 -0
- package/src/assets/icon-512x512.png +0 -0
- package/src/assets/notification.mp3 +0 -0
- package/src/assets/steelseries-min.js +0 -25
- package/src/assets/steelseries-min.js.map +0 -8
- package/src/assets/steelseries.js +0 -15834
- package/src/assets/svg-autopilot-inkscape-plain.svg +0 -983
- package/src/assets/svg-wind-inkscape.svg +0 -1358
- package/src/assets/tween-min.js +0 -1
- package/src/assets/tween.js +0 -381
- package/src/assets/warn.mp3 +0 -0
- package/src/environments/environment.prod.ts +0 -3
- package/src/environments/environment.ts +0 -8
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -20
- package/src/main.ts +0 -11
- package/src/manifest.json +0 -33
- package/src/polyfills.ts +0 -80
- package/src/styles.css +0 -47
- package/src/styles.scss +0 -157
- package/src/test.ts +0 -32
- package/src/themes/darkBlueTheme.scss +0 -117
- package/src/themes/defaultTheme.scss +0 -50
- package/src/themes/highContrastTheme.scss +0 -47
- package/src/themes/modernTheme.scss +0 -143
- package/src/themes/nightMode.scss +0 -185
- package/src/themes/platypusTheme.scss +0 -80
- package/src/themes/signalkTheme.scss +0 -112
- package/src/tsconfig.app.json +0 -15
- package/src/tsconfig.spec.json +0 -20
- package/src/typings.d.ts +0 -5
- package/tsconfig.json +0 -24
- package/tslint.json +0 -143
- /package/{KipGaugeSample-1-1024x545.png → KipGaugeSample1-1024x545.png} +0 -0
- /package/{KipMonitor-1024x488.png → KipGaugeSample2-1024x488.png} +0 -0
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import { IAppConfig, IThemeConfig, IWidgetConfig, ILayoutConfig, INotificationConfig } from './app-settings.service';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// Demo Mode config settings file
|
|
5
|
-
export const DemoAppConfig: IAppConfig = {
|
|
6
|
-
"configVersion": 6,
|
|
7
|
-
"kipUUID": newUuid(),
|
|
8
|
-
"signalKUrl": "http://demo.signalk.org",
|
|
9
|
-
"signalKToken": null,
|
|
10
|
-
"dataSets": [
|
|
11
|
-
{
|
|
12
|
-
"uuid": "afbe4e41-26f5-404f-a55d-9f7b9b76fbd1",
|
|
13
|
-
"path": "self.environment.wind.speedTrue",
|
|
14
|
-
"signalKSource": "default",
|
|
15
|
-
"updateTimer": 1,
|
|
16
|
-
"dataPoints": 15
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"unitDefaults": {
|
|
20
|
-
"Unitless": 'unitless',
|
|
21
|
-
"Speed": 'knots',
|
|
22
|
-
"Flow": 'l/h',
|
|
23
|
-
"Temperature": 'celsius',
|
|
24
|
-
"Length": 'm',
|
|
25
|
-
"Volume": 'liter',
|
|
26
|
-
"Current": 'A',
|
|
27
|
-
"Potential": 'V',
|
|
28
|
-
"Charge": 'C',
|
|
29
|
-
"Power": 'W',
|
|
30
|
-
"Energy": 'J',
|
|
31
|
-
"Pressure": 'mmHg',
|
|
32
|
-
"Density": 'kg/m3',
|
|
33
|
-
"Time": 'Hours',
|
|
34
|
-
"Angular Velocity": 'deg/min',
|
|
35
|
-
"Angle": 'deg',
|
|
36
|
-
"Frequency": 'Hz',
|
|
37
|
-
"Ratio": 'ratio'
|
|
38
|
-
},
|
|
39
|
-
"notificationConfig": {
|
|
40
|
-
"disableNotifications": false,
|
|
41
|
-
"menuGrouping": true,
|
|
42
|
-
"security": {
|
|
43
|
-
"disableSecurity": true,
|
|
44
|
-
},
|
|
45
|
-
"devices": {
|
|
46
|
-
"disableDevices": false,
|
|
47
|
-
"showNormalState": false,
|
|
48
|
-
},
|
|
49
|
-
"sound": {
|
|
50
|
-
"disableSound": false,
|
|
51
|
-
"muteNormal": false,
|
|
52
|
-
"muteWarning": false,
|
|
53
|
-
"muteAlert": false,
|
|
54
|
-
"muteAlarm": false,
|
|
55
|
-
"muteEmergency": false,
|
|
56
|
-
},
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const DemoThemeConfig: IThemeConfig = {
|
|
61
|
-
"themeName": "modern-dark"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const DemoWidgetConfig: IWidgetConfig = {
|
|
65
|
-
"widgets": [
|
|
66
|
-
{
|
|
67
|
-
"uuid": "7298b3be-232f-48bf-9b3d-3b445131a908",
|
|
68
|
-
"type": "WidgetNumeric",
|
|
69
|
-
"config": {
|
|
70
|
-
"paths": {
|
|
71
|
-
"numericPath": {
|
|
72
|
-
"description": "Numeric Data",
|
|
73
|
-
"path": "self.environment.depth.belowTransducer",
|
|
74
|
-
"source": "default",
|
|
75
|
-
"pathType": "number",
|
|
76
|
-
"isPathConfigurable": true,
|
|
77
|
-
"convertUnitTo": "m"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"displayName": "Depth",
|
|
81
|
-
"filterSelfPaths": true,
|
|
82
|
-
"showMin": false,
|
|
83
|
-
"showMax": false,
|
|
84
|
-
"numDecimal": 1,
|
|
85
|
-
"numInt": 1
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"uuid": "7298b3be-232f-48bf-9b3d-3b433131a908",
|
|
90
|
-
"type": "WidgetWindComponent",
|
|
91
|
-
"config": {
|
|
92
|
-
"paths": {
|
|
93
|
-
"headingPath": {
|
|
94
|
-
"description": "Heading",
|
|
95
|
-
"path": "self.navigation.courseOverGroundTrue",
|
|
96
|
-
"source": "default",
|
|
97
|
-
"pathType": "number",
|
|
98
|
-
"isPathConfigurable": true,
|
|
99
|
-
"convertUnitTo": "deg"
|
|
100
|
-
},
|
|
101
|
-
"trueWindAngle": {
|
|
102
|
-
"description": "True Wind Angle",
|
|
103
|
-
"path": "self.environment.wind.angleTrueWater",
|
|
104
|
-
"source": "default",
|
|
105
|
-
"pathType": "number",
|
|
106
|
-
"isPathConfigurable": true,
|
|
107
|
-
"convertUnitTo": "deg"
|
|
108
|
-
},
|
|
109
|
-
"trueWindSpeed": {
|
|
110
|
-
"description": "True Wind Speed",
|
|
111
|
-
"path": "self.environment.wind.speedTrue",
|
|
112
|
-
"source": "default",
|
|
113
|
-
"pathType": "number",
|
|
114
|
-
"isPathConfigurable": true,
|
|
115
|
-
"convertUnitTo": "knots"
|
|
116
|
-
},
|
|
117
|
-
"appWindAngle": {
|
|
118
|
-
"description": "Apparent Wind Angle",
|
|
119
|
-
"path": "self.environment.wind.angleApparent",
|
|
120
|
-
"source": "default",
|
|
121
|
-
"pathType": "number",
|
|
122
|
-
"isPathConfigurable": true,
|
|
123
|
-
"convertUnitTo": "deg"
|
|
124
|
-
},
|
|
125
|
-
"appWindSpeed": {
|
|
126
|
-
"description": "Apparent Wind Speed",
|
|
127
|
-
"path": "self.environment.wind.speedApparent",
|
|
128
|
-
"source": "default",
|
|
129
|
-
"pathType": "number",
|
|
130
|
-
"isPathConfigurable": true,
|
|
131
|
-
"convertUnitTo": "knots"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"filterSelfPaths": true,
|
|
135
|
-
"windSectorEnable": true,
|
|
136
|
-
"windSectorWindowSeconds": 10,
|
|
137
|
-
"laylineEnable": true,
|
|
138
|
-
"laylineAngle": 35
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"uuid": "912b86e4-e068-49e9-9f75-a2292d772578",
|
|
143
|
-
"type": "WidgetGaugeNgRadialComponent",
|
|
144
|
-
"config": {
|
|
145
|
-
"displayName": "SOG",
|
|
146
|
-
"filterSelfPaths": true,
|
|
147
|
-
"paths": {
|
|
148
|
-
"gaugePath": {
|
|
149
|
-
"description": "Numeric Data",
|
|
150
|
-
"path": "self.navigation.speedOverGround",
|
|
151
|
-
"source": "default",
|
|
152
|
-
"pathType": "number",
|
|
153
|
-
"isPathConfigurable": true,
|
|
154
|
-
"convertUnitTo": "knots"
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
"gaugeType": "ngRadial",
|
|
158
|
-
"gaugeTicks": false,
|
|
159
|
-
"radialSize": "measuring",
|
|
160
|
-
"minValue": 0,
|
|
161
|
-
"maxValue": 10,
|
|
162
|
-
"numInt": 1,
|
|
163
|
-
"numDecimal": 1,
|
|
164
|
-
"barColor": "accent"
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"uuid": "85525ebc-c40c-41e6-8379-05d573a331e1",
|
|
169
|
-
"type": "WidgetGaugeNgLinearComponent",
|
|
170
|
-
"config": {
|
|
171
|
-
"displayName": "Apparent Wind Speed",
|
|
172
|
-
"filterSelfPaths": true,
|
|
173
|
-
"paths": {
|
|
174
|
-
"gaugePath": {
|
|
175
|
-
"description": "Numeric Data",
|
|
176
|
-
"path": "self.environment.wind.speedApparent",
|
|
177
|
-
"source": "default",
|
|
178
|
-
"pathType": "number",
|
|
179
|
-
"isPathConfigurable": true,
|
|
180
|
-
"convertUnitTo": "knots"
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
"gaugeType": "ngLinearHorizontal",
|
|
184
|
-
"gaugeTicks": true,
|
|
185
|
-
"minValue": 0,
|
|
186
|
-
"maxValue": 30,
|
|
187
|
-
"numInt": 1,
|
|
188
|
-
"numDecimal": 1,
|
|
189
|
-
"barColor": "accent"
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"uuid": "a49a59c6-b83d-40e0-b759-9d153da69105",
|
|
194
|
-
"type": "WidgetNumeric",
|
|
195
|
-
"config": {
|
|
196
|
-
"paths": {
|
|
197
|
-
"numericPath": {
|
|
198
|
-
"description": "Numeric Data",
|
|
199
|
-
"path": "self.navigation.speedThroughWater",
|
|
200
|
-
"source": "default",
|
|
201
|
-
"pathType": "number",
|
|
202
|
-
"isPathConfigurable": true,
|
|
203
|
-
"convertUnitTo": "knots"
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
"displayName": "Speed",
|
|
207
|
-
"filterSelfPaths": true,
|
|
208
|
-
"showMin": true,
|
|
209
|
-
"showMax": true,
|
|
210
|
-
"numDecimal": 1,
|
|
211
|
-
"numInt": 1
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"uuid": "62fa8155-10fd-49cb-a495-cee6e9491b8a",
|
|
216
|
-
"type": "WidgetNumeric",
|
|
217
|
-
"config": {
|
|
218
|
-
"paths": {
|
|
219
|
-
"numericPath": {
|
|
220
|
-
"description": "Numeric Data",
|
|
221
|
-
"path": "self.performance.velocityMadeGood",
|
|
222
|
-
"source": "default",
|
|
223
|
-
"pathType": "number",
|
|
224
|
-
"isPathConfigurable": true,
|
|
225
|
-
"convertUnitTo": "knots"
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
"displayName": "VMG",
|
|
229
|
-
"filterSelfPaths": true,
|
|
230
|
-
"showMin": true,
|
|
231
|
-
"showMax": true,
|
|
232
|
-
"numDecimal": 1,
|
|
233
|
-
"numInt": 1
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
"uuid": "42de0119-481c-4466-8b50-1407533ac2aa",
|
|
238
|
-
"type": "WidgetHistorical",
|
|
239
|
-
"config": {
|
|
240
|
-
"convertUnitTo": "knots",
|
|
241
|
-
"displayName": "WindSpeed True",
|
|
242
|
-
"filterSelfPaths": true,
|
|
243
|
-
"dataSetUUID": "afbe4e41-26f5-404f-a55d-9f7b9b76fbd1",
|
|
244
|
-
"invertData": false,
|
|
245
|
-
"displayMinMax": false,
|
|
246
|
-
"includeZero": true,
|
|
247
|
-
"minValue": null,
|
|
248
|
-
"maxValue": null,
|
|
249
|
-
"verticalGraph": false
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"uuid": "66eb9453-73a2-4f69-9fc6-ececd3f96ce6",
|
|
254
|
-
"type": "WidgetGaugeNgRadialComponent",
|
|
255
|
-
"config": {
|
|
256
|
-
"displayName": "COG (True)",
|
|
257
|
-
"filterSelfPaths": true,
|
|
258
|
-
"paths": {
|
|
259
|
-
"gaugePath": {
|
|
260
|
-
"description": "Numeric Data",
|
|
261
|
-
"path": "self.navigation.courseOverGroundTrue",
|
|
262
|
-
"source": "default",
|
|
263
|
-
"pathType": "number",
|
|
264
|
-
"isPathConfigurable": true,
|
|
265
|
-
"convertUnitTo": "deg"
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
"gaugeType": "ngRadial",
|
|
269
|
-
"gaugeTicks": false,
|
|
270
|
-
"radialSize": "baseplateCompass",
|
|
271
|
-
"minValue": 0,
|
|
272
|
-
"maxValue": 360,
|
|
273
|
-
"numInt": 1,
|
|
274
|
-
"numDecimal": 0,
|
|
275
|
-
"barColor": "accent"
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
]
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
export const DemoLayoutConfig: ILayoutConfig = {
|
|
282
|
-
"splitSets": [
|
|
283
|
-
{
|
|
284
|
-
"uuid": "isplitsx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
|
|
285
|
-
"direction": "horizontal",
|
|
286
|
-
"splitAreas": [
|
|
287
|
-
{
|
|
288
|
-
"uuid": "d107e54d-2db5-4abf-aba7-b96ce19f5abd",
|
|
289
|
-
"type": "splitSet",
|
|
290
|
-
"size": 30.079353380503136
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"uuid": "9249373f-7aa4-4673-8004-3e4e900e0b3d",
|
|
294
|
-
"type": "splitSet",
|
|
295
|
-
"size": 38.1436713836478
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
"uuid": "d5be7f74-28c0-484c-a0cd-e623eb5db837",
|
|
299
|
-
"type": "splitSet",
|
|
300
|
-
"size": 31.776975235849058
|
|
301
|
-
}
|
|
302
|
-
]
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
"uuid": "9249373f-7aa4-4673-8004-3e4e900e0b3d",
|
|
306
|
-
"parentUUID": "isplitsx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
|
|
307
|
-
"direction": "vertical",
|
|
308
|
-
"splitAreas": [
|
|
309
|
-
{
|
|
310
|
-
"uuid": "7298b3be-232f-48bf-9b3d-3b433131a908",
|
|
311
|
-
"type": "widget",
|
|
312
|
-
"size": 71.69133771929825
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
"uuid": "85525ebc-c40c-41e6-8379-05d573a331e1",
|
|
316
|
-
"type": "widget",
|
|
317
|
-
"size": 28.308662280701753
|
|
318
|
-
}
|
|
319
|
-
]
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"uuid": "d107e54d-2db5-4abf-aba7-b96ce19f5abd",
|
|
323
|
-
"parentUUID": "isplitsx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
|
|
324
|
-
"direction": "vertical",
|
|
325
|
-
"splitAreas": [
|
|
326
|
-
{
|
|
327
|
-
"uuid": "7298b3be-232f-48bf-9b3d-3b445131a908",
|
|
328
|
-
"type": "widget",
|
|
329
|
-
"size": 33.13526570048309
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
"uuid": "a49a59c6-b83d-40e0-b759-9d153da69105",
|
|
333
|
-
"type": "widget",
|
|
334
|
-
"size": 33.432367149758456
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
"uuid": "62fa8155-10fd-49cb-a495-cee6e9491b8a",
|
|
338
|
-
"type": "widget",
|
|
339
|
-
"size": 33.432367149758456
|
|
340
|
-
}
|
|
341
|
-
]
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
"uuid": "d5be7f74-28c0-484c-a0cd-e623eb5db837",
|
|
345
|
-
"parentUUID": "isplitsx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
|
|
346
|
-
"direction": "vertical",
|
|
347
|
-
"splitAreas": [
|
|
348
|
-
{
|
|
349
|
-
"uuid": "912b86e4-e068-49e9-9f75-a2292d772578",
|
|
350
|
-
"type": "widget",
|
|
351
|
-
"size": 25
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
"uuid": "42de0119-481c-4466-8b50-1407533ac2aa",
|
|
355
|
-
"type": "widget",
|
|
356
|
-
"size": 25
|
|
357
|
-
}
|
|
358
|
-
]
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
"uuid": "d735c561-d413-4f7e-93d9-2c494e16184e",
|
|
362
|
-
"direction": "horizontal",
|
|
363
|
-
"splitAreas": [
|
|
364
|
-
{
|
|
365
|
-
"uuid": "66eb9453-73a2-4f69-9fc6-ececd3f96ce6",
|
|
366
|
-
"type": "widget",
|
|
367
|
-
"size": 100
|
|
368
|
-
}
|
|
369
|
-
]
|
|
370
|
-
}
|
|
371
|
-
],
|
|
372
|
-
"rootSplits": [
|
|
373
|
-
"isplitsx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
|
|
374
|
-
"d735c561-d413-4f7e-93d9-2c494e16184e"
|
|
375
|
-
]
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
function newUuid() {
|
|
380
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
|
381
|
-
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
|
|
382
|
-
return v.toString(16);
|
|
383
|
-
});
|
|
384
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
.full-display {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
position: relative;
|
|
5
|
-
z-index: 500;
|
|
6
|
-
}
|
|
7
|
-
.full-width {
|
|
8
|
-
width: 100%;
|
|
9
|
-
}
|
|
10
|
-
.full-height {
|
|
11
|
-
height: 100%;
|
|
12
|
-
}
|
|
13
|
-
.mat-column-path {
|
|
14
|
-
flex: 0 0 50%;
|
|
15
|
-
width: 50%;
|
|
16
|
-
}
|
|
17
|
-
.mat-table {
|
|
18
|
-
overflow: auto;
|
|
19
|
-
max-height: 270px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.table-container{
|
|
23
|
-
max-height: 70vh;
|
|
24
|
-
overflow: auto;
|
|
25
|
-
}
|
|
26
|
-
.paginator{
|
|
27
|
-
width: 100%;
|
|
28
|
-
position: sticky;
|
|
29
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<div class="full-display" (window:resize)="onResize($event)">
|
|
2
|
-
<mat-form-field>
|
|
3
|
-
<mat-label>Filter</mat-label>
|
|
4
|
-
<input matInput (keyup)="applyFilter($event)" placeholder="Ex: navigation" value="self." #input>
|
|
5
|
-
</mat-form-field>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<div class="mat-elevation-z8 full-width table-container">
|
|
9
|
-
<table mat-table class="full-display" [dataSource]="tableData" [trackBy]="trackByPath" matSort matSortActive="path" matSortDirection="asc">
|
|
10
|
-
|
|
11
|
-
<!-- Path Column -->
|
|
12
|
-
<ng-container matColumnDef="path">
|
|
13
|
-
<th mat-header-cell *matHeaderCellDef mat-sort-header> Path </th>
|
|
14
|
-
<td mat-cell *matCellDef="let element"> {{element.path}} </td>
|
|
15
|
-
</ng-container>
|
|
16
|
-
|
|
17
|
-
<!-- Source/value Column -->
|
|
18
|
-
<ng-container matColumnDef="defaultSource">
|
|
19
|
-
<th mat-header-cell *matHeaderCellDef mat-sort-header> Source / Value</th>
|
|
20
|
-
<td mat-cell *matCellDef="let element">
|
|
21
|
-
<table width="100%">
|
|
22
|
-
<tr width="100%" *ngFor="let item of element.sources |keyvalue; trackBy: trackBySource">
|
|
23
|
-
<data-browser-row width="100%" [path]="element.path" [source]="item.key" [pathValue]="item.value.value"></data-browser-row>
|
|
24
|
-
</tr>
|
|
25
|
-
</table>
|
|
26
|
-
</td>
|
|
27
|
-
</ng-container>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
|
|
32
|
-
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
|
33
|
-
|
|
34
|
-
<!-- Row shown when there is no matching data. -->
|
|
35
|
-
<tr class="mat-row" *matNoDataRow>
|
|
36
|
-
<td class="mat-cell" colspan="4">No data matching the filter "{{input.value}}"</td>
|
|
37
|
-
</tr>
|
|
38
|
-
</table>
|
|
39
|
-
</div>
|
|
40
|
-
<div class="paginator">
|
|
41
|
-
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DataBrowserComponent } from './data-browser.component';
|
|
4
|
-
|
|
5
|
-
describe('DataBrowserComponent', () => {
|
|
6
|
-
let component: DataBrowserComponent;
|
|
7
|
-
let fixture: ComponentFixture<DataBrowserComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(waitForAsync(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ DataBrowserComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(DataBrowserComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, AfterViewInit, ViewChild,ElementRef,ChangeDetectorRef} from '@angular/core';
|
|
2
|
-
import { Subscription, Observable, ReplaySubject } from 'rxjs';
|
|
3
|
-
import { MatTableDataSource } from '@angular/material/table';
|
|
4
|
-
import { MatPaginator } from '@angular/material/paginator';
|
|
5
|
-
import { MatSort } from '@angular/material/sort';
|
|
6
|
-
|
|
7
|
-
import { AppSettingsService } from '../app-settings.service';
|
|
8
|
-
import { SignalKService } from '../signalk.service';
|
|
9
|
-
import { IPathObject, IPathAndMetaObjects } from "../signalk-interfaces";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@Component({
|
|
13
|
-
selector: 'data-browser',
|
|
14
|
-
templateUrl: './data-browser.component.html',
|
|
15
|
-
styleUrls: ['./data-browser.component.css']
|
|
16
|
-
})
|
|
17
|
-
export class DataBrowserComponent implements OnInit, AfterViewInit {
|
|
18
|
-
|
|
19
|
-
@ViewChild(MatPaginator) paginator: MatPaginator;
|
|
20
|
-
@ViewChild(MatSort) sort: MatSort;
|
|
21
|
-
|
|
22
|
-
pathsSub: Subscription;
|
|
23
|
-
pageSize = 10;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
tableData = new MatTableDataSource([]);
|
|
27
|
-
|
|
28
|
-
displayedColumns: string[] = ['path', 'defaultSource'];
|
|
29
|
-
|
|
30
|
-
constructor(
|
|
31
|
-
private appSettingsService: AppSettingsService,
|
|
32
|
-
private SignalKService: SignalKService,
|
|
33
|
-
private el:ElementRef,
|
|
34
|
-
private cdRef: ChangeDetectorRef,
|
|
35
|
-
) {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
onResize(event) {
|
|
40
|
-
this.setNumPerPage(event.target.innerHeight);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
ngOnInit() {
|
|
44
|
-
setTimeout(()=>{
|
|
45
|
-
this.pathsSub = this.SignalKService.getPathsObservable().subscribe(paths => {
|
|
46
|
-
this.tableData.data = paths
|
|
47
|
-
})},0); // settimeout to make it async otherwise delays page load
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
ngAfterViewInit() {
|
|
52
|
-
this.tableData.paginator = this.paginator;
|
|
53
|
-
this.tableData.sort = this.sort;
|
|
54
|
-
this.tableData.filter = "self.";
|
|
55
|
-
this.setNumPerPage(window.innerHeight);
|
|
56
|
-
this.cdRef.detectChanges();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
applyFilter(event: Event) {
|
|
60
|
-
const filterValue = (event.target as HTMLInputElement).value;
|
|
61
|
-
this.tableData.filter = filterValue.trim().toLowerCase();
|
|
62
|
-
|
|
63
|
-
if (this.tableData.paginator) {
|
|
64
|
-
this.tableData.paginator.firstPage();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
trackByPath(index: number, item: IPathObject): string {
|
|
69
|
-
return `${item.path}`;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
trackBySource(index: number, item): string {
|
|
73
|
-
return `${item.key}`;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
setNumPerPage(heightPx: number){
|
|
78
|
-
if (heightPx > 750 && heightPx < 900) {
|
|
79
|
-
this.pageSize = 10;
|
|
80
|
-
}
|
|
81
|
-
else if (heightPx > 900) {
|
|
82
|
-
this.pageSize = 15;
|
|
83
|
-
} else {
|
|
84
|
-
this.pageSize = 5;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<div mat-dialog-content>
|
|
2
|
-
<p>Select Unit type</p>
|
|
3
|
-
<mat-form-field appearance="fill" color="accent">
|
|
4
|
-
<mat-label>Unit</mat-label>
|
|
5
|
-
<mat-select [(value)]="data.selectedUnit">
|
|
6
|
-
<mat-optgroup *ngFor="let unitgroup of data.units.conversions" [label]="unitgroup.group">
|
|
7
|
-
<mat-option *ngFor="let unit of unitgroup.units" [value]="unit.measure">
|
|
8
|
-
{{unit.measure}}
|
|
9
|
-
</mat-option>
|
|
10
|
-
</mat-optgroup>
|
|
11
|
-
</mat-select>
|
|
12
|
-
</mat-form-field>
|
|
13
|
-
</div>
|
|
14
|
-
<div mat-dialog-actions>
|
|
15
|
-
<button mat-button (click)="onNoClick()">Cancel</button>
|
|
16
|
-
<button mat-button [mat-dialog-close]="data.selectedUnit" cdkFocusInitial>Ok</button>
|
|
17
|
-
</div>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { Component, Input, OnInit, ViewEncapsulation, Inject } from '@angular/core';
|
|
2
|
-
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
3
|
-
|
|
4
|
-
import { SignalKService } from '../signalk.service';
|
|
5
|
-
import { UnitsService } from '../units.service';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'data-browser-row',
|
|
10
|
-
templateUrl: './data-browser-row.component.html',
|
|
11
|
-
styleUrls: ['./data-browser-row.component.css'],
|
|
12
|
-
encapsulation: ViewEncapsulation.None,
|
|
13
|
-
})
|
|
14
|
-
export class DataBrowserRowComponent implements OnInit {
|
|
15
|
-
|
|
16
|
-
@Input('path') path: string;
|
|
17
|
-
@Input('source') source: string;
|
|
18
|
-
@Input('pathValue') pathValue: any;
|
|
19
|
-
|
|
20
|
-
units = null;
|
|
21
|
-
selectedUnit: string = "unitless"
|
|
22
|
-
|
|
23
|
-
constructor(
|
|
24
|
-
private signalKService: SignalKService,
|
|
25
|
-
private unitsService: UnitsService,
|
|
26
|
-
public dialog: MatDialog
|
|
27
|
-
) {
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
ngOnInit() {
|
|
32
|
-
this.units = this.signalKService.getConversionsForPath(this.path);
|
|
33
|
-
this.selectedUnit = this.units.default;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
convertValue(value: any) {
|
|
37
|
-
if (typeof(value) != "number") {
|
|
38
|
-
return value; //is a string or bool or ??
|
|
39
|
-
}
|
|
40
|
-
let converted = this.unitsService.convertUnit(this.selectedUnit, value);
|
|
41
|
-
|
|
42
|
-
return converted;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
openDialog(): void {
|
|
46
|
-
const dialogRef = this.dialog.open(DialogUnitSelect, {
|
|
47
|
-
width: '250px',
|
|
48
|
-
data: {selectedUnit: this.selectedUnit, units: this.units}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
dialogRef.afterClosed().subscribe(result => {
|
|
52
|
-
if (result) {
|
|
53
|
-
this.selectedUnit = result;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@Component({
|
|
62
|
-
selector: 'dialog-unit-selector',
|
|
63
|
-
templateUrl: 'data-browser-row-unit-modal.html',
|
|
64
|
-
})
|
|
65
|
-
export class DialogUnitSelect {
|
|
66
|
-
|
|
67
|
-
selectedUnit = null;
|
|
68
|
-
|
|
69
|
-
constructor(
|
|
70
|
-
public dialogRef: MatDialogRef<DialogUnitSelect>,
|
|
71
|
-
@Inject(MAT_DIALOG_DATA) public data) {
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
onNoClick(): void {
|
|
76
|
-
this.dialogRef.close();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
}
|