@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,28 +0,0 @@
|
|
|
1
|
-
<div id="{{widgetUUID}}" #simpleLinear class="simpleLinearWidget" style="margin: 0px; padding: 0px; width: 100%; height: 100%;">
|
|
2
|
-
|
|
3
|
-
<svg-simple-linear-gauge class="simpleLinearGauge"
|
|
4
|
-
[displayName]="config.displayName"
|
|
5
|
-
[unitLabel]="unitsLabel"
|
|
6
|
-
[dataValue]="dataValue"
|
|
7
|
-
[barColor]="barColor"
|
|
8
|
-
[barColorGradient]="barColorGradient"
|
|
9
|
-
[barColorBackground]="barColorBackground"
|
|
10
|
-
[gaugeValue]="gaugeValue"
|
|
11
|
-
[gaugeMaxValue]="config.maxValue"
|
|
12
|
-
[gaugeMinValue]="config.minValue"
|
|
13
|
-
></svg-simple-linear-gauge>
|
|
14
|
-
|
|
15
|
-
<div class="settingsButton" *ngIf="unlockStatus">
|
|
16
|
-
<button type="button" color="accent" mat-mini-fab class="selector-fab" (click)="openWidgetSettings()">
|
|
17
|
-
<span class="fa-solid fa-cog"></span>
|
|
18
|
-
</button>
|
|
19
|
-
</div>
|
|
20
|
-
<div #primary class='primary' style="display: none;"></div>
|
|
21
|
-
<div #accent class='accent' style="display: none;"></div>
|
|
22
|
-
<div #warn class='warn' style="display: none;"></div>
|
|
23
|
-
<div #primaryDark class='primaryDark' style="display: none;"></div>
|
|
24
|
-
<div #accentDark class='accentDark' style="display: none;"></div>
|
|
25
|
-
<div #warnDark class='warnDark' style="display: none;"></div>
|
|
26
|
-
<div #background class='background' style="display: none;"></div>
|
|
27
|
-
<div #text class='text' style="display: none;"></div>
|
|
28
|
-
</div>
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
@use '~@angular/material' as mat;
|
|
2
|
-
|
|
3
|
-
@mixin widget-simple-linear-theme($theme) {
|
|
4
|
-
|
|
5
|
-
$ngGauge: map-get($theme, ngGauge);
|
|
6
|
-
$themeForeground: map-get($theme, foreground);
|
|
7
|
-
|
|
8
|
-
app-widget-simple-linear {
|
|
9
|
-
.primary {
|
|
10
|
-
color: mat.get-color-from-palette($ngGauge, primary-gaugeFaceLight);
|
|
11
|
-
}
|
|
12
|
-
.accent {
|
|
13
|
-
color: mat.get-color-from-palette($ngGauge, accent-gaugeFaceLight);
|
|
14
|
-
}
|
|
15
|
-
.warn {
|
|
16
|
-
color: mat.get-color-from-palette($ngGauge, warn-gaugeFaceLight);
|
|
17
|
-
}
|
|
18
|
-
.primaryDark {
|
|
19
|
-
color: mat.get-color-from-palette($ngGauge, primary-gaugeFaceDark);
|
|
20
|
-
}
|
|
21
|
-
.accentDark {
|
|
22
|
-
color: mat.get-color-from-palette($ngGauge, accent-gaugeFaceDark);
|
|
23
|
-
}
|
|
24
|
-
.warnDark {
|
|
25
|
-
color: mat.get-color-from-palette($ngGauge, warn-gaugeFaceDark);
|
|
26
|
-
}
|
|
27
|
-
.background {
|
|
28
|
-
color: mat.get-color-from-palette($themeForeground, divider);
|
|
29
|
-
}
|
|
30
|
-
.text {
|
|
31
|
-
color: mat.get-color-from-palette($themeForeground, text);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.simpleLinearGauge {
|
|
37
|
-
display:block;
|
|
38
|
-
position: relative;
|
|
39
|
-
border:none;
|
|
40
|
-
margin: 0px;
|
|
41
|
-
padding: 5px 0px;
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 100%;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.settingsButton {
|
|
47
|
-
position: absolute;
|
|
48
|
-
bottom: 5%;
|
|
49
|
-
left: 50%;
|
|
50
|
-
transform: translate(-50%);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.tab-group {
|
|
55
|
-
border: 1px solid #e8e8e8;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.tab-content {
|
|
59
|
-
padding: 16px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.full-width {
|
|
63
|
-
width: 100%;
|
|
64
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { WidgetSimpleLinearComponent } from './widget-simple-linear.component';
|
|
4
|
-
|
|
5
|
-
describe('WidgetSimpleLinearComponent', () => {
|
|
6
|
-
let component: WidgetSimpleLinearComponent;
|
|
7
|
-
let fixture: ComponentFixture<WidgetSimpleLinearComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(waitForAsync(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ WidgetSimpleLinearComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(WidgetSimpleLinearComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { ViewChild, Input, ElementRef, Component, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
-
import { Subscription } from 'rxjs';
|
|
3
|
-
import { MatDialog } from '@angular/material/dialog';
|
|
4
|
-
|
|
5
|
-
import { SignalKService } from '../signalk.service';
|
|
6
|
-
import { ModalWidgetComponent } from '../modal-widget/modal-widget.component';
|
|
7
|
-
import { WidgetManagerService, IWidget, IWidgetConfig } from '../widget-manager.service';
|
|
8
|
-
import { UnitsService } from '../units.service';
|
|
9
|
-
import { AppSettingsService } from '../app-settings.service';
|
|
10
|
-
|
|
11
|
-
const defaultConfig: IWidgetConfig = {
|
|
12
|
-
displayName: "Display Name",
|
|
13
|
-
filterSelfPaths: true,
|
|
14
|
-
paths: {
|
|
15
|
-
"gaugePath": {
|
|
16
|
-
description: "Numeric Data",
|
|
17
|
-
path: null,
|
|
18
|
-
source: null,
|
|
19
|
-
pathType: "number",
|
|
20
|
-
isPathConfigurable: true,
|
|
21
|
-
convertUnitTo: "v"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
minValue: 0,
|
|
25
|
-
maxValue: 14.4,
|
|
26
|
-
numInt: 1,
|
|
27
|
-
numDecimal: 2,
|
|
28
|
-
gaugeType: "simpleLinear", // Applied to Units label. abr = first letter only. full = full string
|
|
29
|
-
gaugeUnitLabelFormat: "full", // Applied to Units label. abr = first letter only. full = full string
|
|
30
|
-
barColor: 'accent',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
@Component({
|
|
34
|
-
selector: 'app-widget-simple-linear',
|
|
35
|
-
templateUrl: './widget-simple-linear.component.html',
|
|
36
|
-
styleUrls: ['./widget-simple-linear.component.scss']
|
|
37
|
-
})
|
|
38
|
-
export class WidgetSimpleLinearComponent implements OnInit, OnDestroy {
|
|
39
|
-
@Input('widgetUUID') widgetUUID: string;
|
|
40
|
-
@Input('unlockStatus') unlockStatus: boolean;
|
|
41
|
-
|
|
42
|
-
@ViewChild('primary', {static: true, read: ElementRef}) private primaryElement: ElementRef;
|
|
43
|
-
@ViewChild('accent', {static: true, read: ElementRef}) private accentElement: ElementRef;
|
|
44
|
-
@ViewChild('warn', {static: true, read: ElementRef}) private warnElement: ElementRef;
|
|
45
|
-
@ViewChild('primaryDark', {static: true, read: ElementRef}) private primaryDarkElement: ElementRef;
|
|
46
|
-
@ViewChild('accentDark', {static: true, read: ElementRef}) private accentDarkElement: ElementRef;
|
|
47
|
-
@ViewChild('warnDark', {static: true, read: ElementRef}) private warnDarkElement: ElementRef;
|
|
48
|
-
@ViewChild('background', {static: true, read: ElementRef}) private backgroundElement: ElementRef;
|
|
49
|
-
|
|
50
|
-
activeWidget: IWidget;
|
|
51
|
-
config: IWidgetConfig;
|
|
52
|
-
|
|
53
|
-
public unitsLabel:string = "";
|
|
54
|
-
public dataValue: string = "0";
|
|
55
|
-
public gaugeValue: Number = 0;
|
|
56
|
-
public barColor: string = "";
|
|
57
|
-
public barColorGradient: string = "";
|
|
58
|
-
public barColorBackground: string = "";
|
|
59
|
-
|
|
60
|
-
valueSub: Subscription = null;
|
|
61
|
-
|
|
62
|
-
// dynamics theme support
|
|
63
|
-
themeNameSub: Subscription = null;
|
|
64
|
-
|
|
65
|
-
constructor(
|
|
66
|
-
public dialog:MatDialog,
|
|
67
|
-
private signalKService: SignalKService,
|
|
68
|
-
private widgetManagerService: WidgetManagerService,
|
|
69
|
-
private unitsService: UnitsService,
|
|
70
|
-
private appSettingsService: AppSettingsService, // need for theme change subscription
|
|
71
|
-
) { }
|
|
72
|
-
|
|
73
|
-
ngOnInit(): void {
|
|
74
|
-
this.activeWidget = this.widgetManagerService.getWidget(this.widgetUUID);
|
|
75
|
-
if (this.activeWidget.config === null) {
|
|
76
|
-
// no data, let's set some!
|
|
77
|
-
this.widgetManagerService.updateWidgetConfig(this.widgetUUID, defaultConfig);
|
|
78
|
-
this.config = defaultConfig; // load default config.
|
|
79
|
-
} else {
|
|
80
|
-
this.config = this.activeWidget.config;
|
|
81
|
-
}
|
|
82
|
-
this.updateGaugeSettings();
|
|
83
|
-
this.subscribePath();
|
|
84
|
-
this.subscribeTheme();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
updateGaugeSettings() {
|
|
88
|
-
this.barColorBackground = window.getComputedStyle(this.backgroundElement.nativeElement).color;
|
|
89
|
-
|
|
90
|
-
switch (this.config.barColor) {
|
|
91
|
-
case "primary":
|
|
92
|
-
this.barColor = getComputedStyle(this.primaryElement.nativeElement).color;
|
|
93
|
-
this.barColorGradient = getComputedStyle(this.primaryDarkElement.nativeElement).color;
|
|
94
|
-
break;
|
|
95
|
-
|
|
96
|
-
case "accent":
|
|
97
|
-
this.barColor = getComputedStyle(this.accentElement.nativeElement).color;
|
|
98
|
-
this.barColorGradient = getComputedStyle(this.accentDarkElement.nativeElement).color;
|
|
99
|
-
break;
|
|
100
|
-
|
|
101
|
-
case "warn":
|
|
102
|
-
this.barColor = getComputedStyle(this.warnElement.nativeElement).color;
|
|
103
|
-
this.barColorGradient = getComputedStyle(this.warnDarkElement.nativeElement).color;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
subscribePath() {
|
|
109
|
-
this.unsubscribePath();
|
|
110
|
-
|
|
111
|
-
// set Units label sting based on gauge config
|
|
112
|
-
if (this.config.gaugeUnitLabelFormat == "abr") {
|
|
113
|
-
this.unitsLabel = this.config.paths['gaugePath'].convertUnitTo.substr(0,1);
|
|
114
|
-
} else {
|
|
115
|
-
this.unitsLabel = this.config.paths['gaugePath'].convertUnitTo;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (typeof(this.config.paths['gaugePath'].path) != 'string') { return } // nothing to sub to...
|
|
119
|
-
|
|
120
|
-
this.valueSub = this.signalKService.subscribePath(this.widgetUUID, this.config.paths['gaugePath'].path, this.config.paths['gaugePath'].source).subscribe(
|
|
121
|
-
newValue => {
|
|
122
|
-
if (newValue.value == null) {return}
|
|
123
|
-
|
|
124
|
-
// convert to unit and format value using widget settings
|
|
125
|
-
let value = this.unitsService.convertUnit(this.config.paths['gaugePath'].convertUnitTo, newValue.value).toFixed(this.config.numDecimal);
|
|
126
|
-
|
|
127
|
-
// Format display value using widget settings
|
|
128
|
-
let displayValue = value;
|
|
129
|
-
if (this.config.numDecimal != 0){
|
|
130
|
-
this.dataValue = displayValue.padStart((this.config.numInt + this.config.numDecimal + 1), "0");
|
|
131
|
-
} else {
|
|
132
|
-
this.dataValue = displayValue.padStart(this.config.numInt, "0");
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Format value for gauge bar
|
|
136
|
-
let gaugeValue = Number(value);
|
|
137
|
-
|
|
138
|
-
// Limit gauge bar animation overflow to gauge settings
|
|
139
|
-
if (gaugeValue >= this.config.maxValue) {
|
|
140
|
-
this.gaugeValue = this.config.maxValue;
|
|
141
|
-
} else if (gaugeValue <= this.config.minValue) {
|
|
142
|
-
this.gaugeValue = this.config.minValue;
|
|
143
|
-
} else {
|
|
144
|
-
this.gaugeValue = gaugeValue;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
unsubscribePath() {
|
|
151
|
-
if (this.valueSub !== null) {
|
|
152
|
-
this.valueSub.unsubscribe();
|
|
153
|
-
this.valueSub = null;
|
|
154
|
-
this.signalKService.unsubscribePath(this.widgetUUID, this.config.paths['gaugePath'].path)
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Subscribe to theme event
|
|
159
|
-
subscribeTheme() {
|
|
160
|
-
this.themeNameSub = this.appSettingsService.getThemeNameAsO().subscribe(
|
|
161
|
-
themeChange => {
|
|
162
|
-
setTimeout(() => { // delay so browser getComputedStyles has time to complete theme style change.
|
|
163
|
-
this.updateGaugeSettings();
|
|
164
|
-
}, 50);
|
|
165
|
-
})
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
unsubscribeTheme(){
|
|
169
|
-
if (this.themeNameSub !== null) {
|
|
170
|
-
this.themeNameSub.unsubscribe();
|
|
171
|
-
this.themeNameSub = null;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
openWidgetSettings() {
|
|
176
|
-
let dialogRef = this.dialog.open(ModalWidgetComponent, {
|
|
177
|
-
width: '80%',
|
|
178
|
-
data: this.config
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
dialogRef.afterClosed().subscribe(result => {
|
|
182
|
-
// save new settings
|
|
183
|
-
if (result) {
|
|
184
|
-
console.log(result);
|
|
185
|
-
this.unsubscribePath(); //unsub now as we will change variables so wont know what was subbed before...
|
|
186
|
-
this.config = result;
|
|
187
|
-
this.updateGaugeSettings();
|
|
188
|
-
this.widgetManagerService.updateWidgetConfig(this.widgetUUID, this.config);
|
|
189
|
-
this.subscribePath();
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
ngOnDestroy() {
|
|
195
|
-
this.unsubscribePath();
|
|
196
|
-
this.unsubscribeTheme();
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<div class="wrapper">
|
|
2
|
-
<!--
|
|
3
|
-
<div class="indicatorBorder">
|
|
4
|
-
aaa
|
|
5
|
-
</div> -->
|
|
6
|
-
|
|
7
|
-
<div class="indicatorBorder stateOn" *ngIf="state" (mousedown)="handleClickDown();" (mouseup)="handleClickUp();" (mouseout)="handleClickUp();">
|
|
8
|
-
<div class="textValue " >
|
|
9
|
-
{{ config.displayName }}
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<div class="indicatorBorder stateOff" *ngIf="!state" (mousedown)="handleClickDown()" (mouseup)="handleClickUp();" (mouseout)="handleClickUp();">
|
|
15
|
-
<div class="textValue " >
|
|
16
|
-
{{ config.displayName }}
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<div class="settingsButton" *ngIf="unlockStatus">
|
|
23
|
-
<button color="accent" mat-mini-fab class="selector-fab" (click)="openWidgetSettings()">
|
|
24
|
-
<span class="fa-solid fa-cog"></span>
|
|
25
|
-
</button>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
@use '~@angular/material' as mat;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
@mixin widget-state-theme($theme) {
|
|
5
|
-
|
|
6
|
-
$primary: map-get($theme, primary);
|
|
7
|
-
$accent: map-get($theme, accent);
|
|
8
|
-
$warn: map-get($theme, warn);
|
|
9
|
-
$background: map-get($theme, background);
|
|
10
|
-
$foreground: map-get($theme, foreground);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.stateOn {
|
|
14
|
-
background-color: mat.get-color-from-palette($accent, 'A700');
|
|
15
|
-
color: mat.get-color-from-palette($accent, 'A700-contrast');
|
|
16
|
-
}
|
|
17
|
-
.stateOff {
|
|
18
|
-
background-color: mat.get-color-from-palette($accent, 100);
|
|
19
|
-
color: mat.get-color-from-palette($accent, '100-contrast');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.wrapper {
|
|
25
|
-
position: relative;
|
|
26
|
-
width: 100%;
|
|
27
|
-
height: 100%;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.textGenericLabel {
|
|
32
|
-
position: absolute;
|
|
33
|
-
top: 5%;
|
|
34
|
-
left: 5%;
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
.textValue {
|
|
40
|
-
position: absolute;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
font-family: "Arial", Times, serif;
|
|
47
|
-
font-weight: bold;
|
|
48
|
-
box-sizing: border-box;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.indicatorBorder {
|
|
52
|
-
margin-left: 5%;
|
|
53
|
-
margin-right: 5%;
|
|
54
|
-
top: 5%;
|
|
55
|
-
position: relative;
|
|
56
|
-
width: 90%;
|
|
57
|
-
height: 90%;
|
|
58
|
-
box-sizing: border-box;
|
|
59
|
-
border: solid 0.3em;
|
|
60
|
-
border-radius: 2em / 2em;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.settingsButton {
|
|
64
|
-
position: absolute;
|
|
65
|
-
bottom: 5%;
|
|
66
|
-
left: 50%;
|
|
67
|
-
transform: translate(-50%);
|
|
68
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { WidgetStateComponent } from './widget-state.component';
|
|
4
|
-
|
|
5
|
-
describe('WidgetStateComponent', () => {
|
|
6
|
-
let component: WidgetStateComponent;
|
|
7
|
-
let fixture: ComponentFixture<WidgetStateComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(waitForAsync(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ WidgetStateComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(WidgetStateComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should be created', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { Component, Input, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
-
import { Subscription } from 'rxjs';
|
|
3
|
-
import { MatDialog } from '@angular/material/dialog';
|
|
4
|
-
|
|
5
|
-
import { ModalWidgetComponent } from '../modal-widget/modal-widget.component';
|
|
6
|
-
import { SignalKService } from '../signalk.service';
|
|
7
|
-
import { SignalkRequestsService, skRequest } from '../signalk-requests.service';
|
|
8
|
-
import { WidgetManagerService, IWidget, IWidgetConfig } from '../widget-manager.service';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const defaultConfig: IWidgetConfig = {
|
|
12
|
-
displayName: null,
|
|
13
|
-
filterSelfPaths: true,
|
|
14
|
-
paths: {
|
|
15
|
-
"boolPath": {
|
|
16
|
-
description: "Boolean Data",
|
|
17
|
-
path: null,
|
|
18
|
-
source: null,
|
|
19
|
-
pathType: "boolean",
|
|
20
|
-
isPathConfigurable: true,
|
|
21
|
-
convertUnitTo: "unitless"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
putEnable: false,
|
|
25
|
-
putMomentary: false,
|
|
26
|
-
putMomentaryValue: true
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@Component({
|
|
31
|
-
selector: 'app-widget-state',
|
|
32
|
-
templateUrl: './widget-state.component.html',
|
|
33
|
-
styleUrls: ['./widget-state.component.scss']
|
|
34
|
-
})
|
|
35
|
-
export class WidgetStateComponent implements OnInit, OnDestroy {
|
|
36
|
-
|
|
37
|
-
@Input('widgetUUID') widgetUUID: string;
|
|
38
|
-
@Input('unlockStatus') unlockStatus: boolean;
|
|
39
|
-
|
|
40
|
-
valueSub: Subscription = null;
|
|
41
|
-
activeWidget: IWidget;
|
|
42
|
-
config: IWidgetConfig;
|
|
43
|
-
|
|
44
|
-
state: boolean = null;
|
|
45
|
-
pressed = false;
|
|
46
|
-
timeoutHandler;
|
|
47
|
-
|
|
48
|
-
skRequestSub = new Subscription; // Request result observer
|
|
49
|
-
|
|
50
|
-
constructor(
|
|
51
|
-
public dialog:MatDialog,
|
|
52
|
-
private SignalKService: SignalKService,
|
|
53
|
-
private SignalkRequestsService: SignalkRequestsService,
|
|
54
|
-
private WidgetManagerService: WidgetManagerService) {
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
ngOnInit() {
|
|
58
|
-
this.activeWidget = this.WidgetManagerService.getWidget(this.widgetUUID);
|
|
59
|
-
if (this.activeWidget.config === null) {
|
|
60
|
-
// no data, let's set some!
|
|
61
|
-
this.WidgetManagerService.updateWidgetConfig(this.widgetUUID, defaultConfig);
|
|
62
|
-
this.config = defaultConfig; // load default config.
|
|
63
|
-
} else {
|
|
64
|
-
this.config = this.activeWidget.config;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
this.subscribePath();
|
|
68
|
-
this.subscribeSKRequest();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
ngOnDestroy() {
|
|
72
|
-
this.unsubscribePath();
|
|
73
|
-
this.subscribeSKRequest();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
subscribePath() {
|
|
77
|
-
this.unsubscribePath();
|
|
78
|
-
if (typeof(this.config.paths['boolPath'].path) != 'string') { return } // nothing to sub to...
|
|
79
|
-
|
|
80
|
-
this.valueSub = this.SignalKService.subscribePath(this.widgetUUID, this.config.paths['boolPath'].path, this.config.paths['boolPath'].source).subscribe(
|
|
81
|
-
newValue => {
|
|
82
|
-
this.state = newValue.value;
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
unsubscribePath() {
|
|
88
|
-
if (this.valueSub !== null) {
|
|
89
|
-
this.valueSub.unsubscribe();
|
|
90
|
-
this.valueSub = null;
|
|
91
|
-
this.SignalKService.unsubscribePath(this.widgetUUID, this.config.paths['boolPath'].path)
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
subscribeSKRequest() {
|
|
96
|
-
this.skRequestSub = this.SignalkRequestsService.subscribeRequest().subscribe(requestResult => {
|
|
97
|
-
if (requestResult.widgetUUID == this.widgetUUID) {
|
|
98
|
-
if (requestResult.statusCode != 200){
|
|
99
|
-
let errMsg = requestResult.statusCode + " - " +requestResult.statusCodeDescription;
|
|
100
|
-
if (requestResult.message){
|
|
101
|
-
errMsg = errMsg + " Server Message: " + requestResult.message;
|
|
102
|
-
}
|
|
103
|
-
alert('[Widget Name: ' + errMsg);
|
|
104
|
-
} else {
|
|
105
|
-
console.log("AP Received: \n" + JSON.stringify(requestResult));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
unsubscribeSKRequest() {
|
|
112
|
-
this.skRequestSub.unsubscribe();
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
openWidgetSettings() {
|
|
116
|
-
let dialogRef = this.dialog.open(ModalWidgetComponent, {
|
|
117
|
-
width: '80%',
|
|
118
|
-
data: this.config
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
dialogRef.afterClosed().subscribe(result => {
|
|
122
|
-
// save new settings
|
|
123
|
-
if (result) {
|
|
124
|
-
console.log(result);
|
|
125
|
-
this.unsubscribePath();//unsub now as we will change variables so wont know what was subbed before...
|
|
126
|
-
this.config = result;
|
|
127
|
-
this.WidgetManagerService.updateWidgetConfig(this.widgetUUID, this.config);
|
|
128
|
-
this.subscribePath();
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
handleClickDown() {
|
|
134
|
-
if (!this.config.putEnable) { return; }
|
|
135
|
-
|
|
136
|
-
if (!this.config.putMomentary) {
|
|
137
|
-
//on/off mode. Send whatever we're not :)
|
|
138
|
-
this.SignalkRequestsService.putRequest(
|
|
139
|
-
this.config.paths['boolPath'].path,
|
|
140
|
-
this.config.paths['boolPath'].source,
|
|
141
|
-
this.widgetUUID
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
if (!this.state) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
} else {
|
|
148
|
-
// momentary mode
|
|
149
|
-
this.pressed = true;
|
|
150
|
-
|
|
151
|
-
// send it once to start
|
|
152
|
-
this.SignalkRequestsService.putRequest(this.config.paths['boolPath'].path, this.config.paths['boolPath'].source, this.widgetUUID);
|
|
153
|
-
|
|
154
|
-
//send it again every 20ms
|
|
155
|
-
this.timeoutHandler = setInterval(() => {
|
|
156
|
-
this.SignalkRequestsService.putRequest(this.config.paths['boolPath'].path, this.config.paths['boolPath'].source, this.widgetUUID);
|
|
157
|
-
this.config.putMomentaryValue;
|
|
158
|
-
}, 100);
|
|
159
|
-
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
handleClickUp() {
|
|
165
|
-
if (!this.config.putEnable || !this.pressed) { return; }
|
|
166
|
-
|
|
167
|
-
if (this.config.putMomentary) {
|
|
168
|
-
this.pressed = false;
|
|
169
|
-
clearInterval(this.timeoutHandler);
|
|
170
|
-
// momentary mode
|
|
171
|
-
this.SignalkRequestsService.putRequest(this.config.paths['boolPath'].path, this.config.paths['boolPath'].source, this.widgetUUID);
|
|
172
|
-
if (!this.config.putMomentaryValue) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
.mainWrapper {
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.settingsButton {
|
|
8
|
-
position: absolute;
|
|
9
|
-
bottom: 5%;
|
|
10
|
-
left: 50%;
|
|
11
|
-
transform: translate(-50%);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.switchContainer {
|
|
15
|
-
position: relative;
|
|
16
|
-
margin: auto;
|
|
17
|
-
height: 100%;
|
|
18
|
-
width: 100%;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.switch {
|
|
22
|
-
position: relative;
|
|
23
|
-
display: inline-block;
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 100%;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/* Hide default HTML checkbox */
|
|
29
|
-
.switch input {display:none;}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/* The slider */
|
|
33
|
-
.slider {
|
|
34
|
-
position: absolute;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
top: 0;
|
|
37
|
-
left: 0;
|
|
38
|
-
right: 0;
|
|
39
|
-
bottom: 0;
|
|
40
|
-
background-color: #ccc;
|
|
41
|
-
-webkit-transition: .4s;
|
|
42
|
-
transition: .4s;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.slider:before {
|
|
46
|
-
position: absolute;
|
|
47
|
-
content: "";
|
|
48
|
-
height: 80%;
|
|
49
|
-
width: 45%;
|
|
50
|
-
left: 5%;
|
|
51
|
-
bottom: 10%;
|
|
52
|
-
background-color: white;
|
|
53
|
-
-webkit-transition: .4s;
|
|
54
|
-
transition: .4s;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
input:checked + .slider {
|
|
58
|
-
background-color: #2196F3;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
input:focus + .slider {
|
|
62
|
-
box-shadow: 0 0 1px #2196F3;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
input:checked + .slider:before {
|
|
66
|
-
-webkit-transform: translateX(95%);
|
|
67
|
-
-ms-transform: translateX(95%);
|
|
68
|
-
transform: translateX(95%);
|
|
69
|
-
}
|
|
70
|
-
|