@mxtommy/kip 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/.angulardoc.json +3 -3
  2. package/CHANGELOG.md +145 -135
  3. package/CONTRIBUTORS.md +16 -16
  4. package/README.md +102 -102
  5. package/angular.json +162 -153
  6. package/karma.conf.js +31 -31
  7. package/package.json +87 -84
  8. package/public/3rdpartylicenses.txt +301 -21
  9. package/public/assets/NoSleep.min.js +1 -1
  10. package/public/assets/fontawesome6/css/all.min.css +6 -0
  11. package/public/assets/fontawesome6/webfonts/fa-brands-400.ttf +0 -0
  12. package/public/assets/fontawesome6/webfonts/fa-brands-400.woff2 +0 -0
  13. package/public/assets/fontawesome6/webfonts/fa-regular-400.ttf +0 -0
  14. package/public/assets/fontawesome6/webfonts/fa-regular-400.woff2 +0 -0
  15. package/public/assets/fontawesome6/webfonts/fa-solid-900.ttf +0 -0
  16. package/public/assets/fontawesome6/webfonts/fa-solid-900.woff2 +0 -0
  17. package/public/assets/fontawesome6/webfonts/fa-v4compatibility.ttf +0 -0
  18. package/public/assets/fontawesome6/webfonts/fa-v4compatibility.woff2 +0 -0
  19. package/public/assets/icon-192x192.png +0 -0
  20. package/public/assets/icon-256x256.png +0 -0
  21. package/public/assets/icon-384x384.png +0 -0
  22. package/public/assets/icon-512x512.png +0 -0
  23. package/public/assets/steelseries-min.js +25 -25
  24. package/public/assets/steelseries-min.js.map +8 -8
  25. package/public/assets/steelseries.js +15834 -15834
  26. package/public/assets/svg-autopilot-inkscape-plain.svg +983 -983
  27. package/public/assets/svg-wind-inkscape.svg +1358 -1358
  28. package/public/assets/tween.js +381 -381
  29. package/public/index.html +19 -20
  30. package/public/main-es2018.98175eb4c61ccaf7eb17.js +1 -0
  31. package/public/main-es5.98175eb4c61ccaf7eb17.js +1 -0
  32. package/public/manifest.json +33 -0
  33. package/public/polyfills-es2018.3a61665863c173cd6ba3.js +1 -0
  34. package/public/polyfills-es5.44827ae4ff4e41de51fb.js +1 -0
  35. package/public/runtime-es2018.baedb88c6d2abacae2b8.js +1 -0
  36. package/public/runtime-es5.baedb88c6d2abacae2b8.js +1 -0
  37. package/public/styles.b92ae2c466c89712209d.css +5 -0
  38. package/src/app/alarm-menu/alarm-menu.component.html +55 -55
  39. package/src/app/alarm-menu/alarm-menu.component.scss +52 -53
  40. package/src/app/alarm-menu/alarm-menu.component.spec.ts +25 -25
  41. package/src/app/alarm-menu/alarm-menu.component.ts +186 -186
  42. package/src/app/app-help/app-help.component.css +4 -4
  43. package/src/app/app-help/app-help.component.html +135 -135
  44. package/src/app/app-help/app-help.component.ts +45 -45
  45. package/src/app/app.component.css +39 -39
  46. package/src/app/app.component.html +93 -93
  47. package/src/app/app.component.scss +79 -79
  48. package/src/app/app.component.spec.ts +32 -32
  49. package/src/app/app.component.ts +191 -192
  50. package/src/app/app.module.ts +200 -200
  51. package/src/app/config.blank.const.ts +51 -51
  52. package/src/app/config.blank.notification.const.ts +19 -19
  53. package/src/app/config.blank.units.const.ts +23 -23
  54. package/src/app/config.demo.const.ts +383 -383
  55. package/src/app/data-browser/data-browser.component.css +29 -29
  56. package/src/app/data-browser/data-browser.component.html +44 -44
  57. package/src/app/data-browser/data-browser.component.spec.ts +25 -25
  58. package/src/app/data-browser/data-browser.component.ts +91 -91
  59. package/src/app/data-browser-row/data-browser-row-unit-modal.html +17 -17
  60. package/src/app/data-browser-row/data-browser-row.component.css +9 -9
  61. package/src/app/data-browser-row/data-browser-row.component.html +4 -4
  62. package/src/app/data-browser-row/data-browser-row.component.ts +78 -78
  63. package/src/app/data-set.service.ts +273 -273
  64. package/src/app/dynamic-widget.directive.ts +11 -11
  65. package/src/app/gauge-steel/gauge-steel.component.css +4 -4
  66. package/src/app/gauge-steel/gauge-steel.component.html +4 -4
  67. package/src/app/gauge-steel/gauge-steel.component.spec.ts +25 -25
  68. package/src/app/gauge-steel/gauge-steel.component.ts +282 -282
  69. package/src/app/gauges-module/base-gauge.ts +300 -300
  70. package/src/app/gauges-module/linear-gauge.ts +49 -49
  71. package/src/app/gauges-module/radial-gauge.ts +47 -47
  72. package/src/app/layout-split/layout-split.component.html +30 -30
  73. package/src/app/layout-split/layout-split.component.scss +33 -33
  74. package/src/app/layout-split/layout-split.component.spec.ts +25 -25
  75. package/src/app/layout-split/layout-split.component.ts +59 -59
  76. package/src/app/layout-splits.service.ts +284 -284
  77. package/src/app/modal-path-selector/modal-path-selector.component.html +62 -62
  78. package/src/app/modal-path-selector/modal-path-selector.component.scss +39 -39
  79. package/src/app/modal-path-selector/modal-path-selector.component.spec.ts +25 -25
  80. package/src/app/modal-path-selector/modal-path-selector.component.ts +132 -132
  81. package/src/app/modal-widget/modal-widget.component.css +32 -32
  82. package/src/app/modal-widget/modal-widget.component.html +341 -341
  83. package/src/app/modal-widget/modal-widget.component.spec.ts +25 -25
  84. package/src/app/modal-widget/modal-widget.component.ts +84 -84
  85. package/src/app/notifications.service.ts +392 -392
  86. package/src/app/object-keys.pipe.spec.ts +8 -8
  87. package/src/app/object-keys.pipe.ts +13 -13
  88. package/src/app/reset-config/reset-config.component.html +3 -3
  89. package/src/app/reset-config/reset-config.component.spec.ts +25 -25
  90. package/src/app/reset-config/reset-config.component.ts +31 -31
  91. package/src/app/root-display/root-display.component.html +4 -4
  92. package/src/app/root-display/root-display.component.spec.ts +25 -25
  93. package/src/app/root-display/root-display.component.ts +57 -57
  94. package/src/app/safe.pipe.ts +15 -15
  95. package/src/app/settings/settings.component.css +9 -9
  96. package/src/app/settings/settings.component.html +25 -25
  97. package/src/app/settings/settings.component.spec.ts +25 -25
  98. package/src/app/settings/settings.component.ts +22 -22
  99. package/src/app/settings-config/settings-config.component.css +38 -38
  100. package/src/app/settings-config/settings-config.component.spec.ts +25 -25
  101. package/src/app/settings-config/settings-config.component.ts +161 -161
  102. package/src/app/settings-datasets/settings-datasets.component.html +43 -43
  103. package/src/app/settings-datasets/settings-datasets.component.scss +39 -39
  104. package/src/app/settings-datasets/settings-datasets.component.spec.ts +25 -25
  105. package/src/app/settings-datasets/settings-datasets.component.ts +98 -98
  106. package/src/app/settings-datasets/settings-datasets.modal.html +54 -54
  107. package/src/app/settings-notifications/settings-notifications.component.html +65 -65
  108. package/src/app/settings-notifications/settings-notifications.component.spec.ts +25 -25
  109. package/src/app/settings-notifications/settings-notifications.component.ts +29 -29
  110. package/src/app/settings-signalk/settings-signalk.component.html +8 -8
  111. package/src/app/settings-signalk/settings-signalk.component.spec.ts +25 -25
  112. package/src/app/settings-signalk/settings-signalk.component.ts +174 -174
  113. package/src/app/settings-units/settings-units.component.css +4 -4
  114. package/src/app/settings-units/settings-units.component.html +19 -19
  115. package/src/app/settings-units/settings-units.component.spec.ts +25 -25
  116. package/src/app/settings-units/settings-units.component.ts +62 -62
  117. package/src/app/settings-zones/settings-zones.component.css +21 -21
  118. package/src/app/settings-zones/settings-zones.component.html +70 -70
  119. package/src/app/settings-zones/settings-zones.modal.html +38 -38
  120. package/src/app/signalk-connection.service.ts +344 -344
  121. package/src/app/signalk-delta.service.spec.ts +15 -15
  122. package/src/app/signalk-delta.service.ts +97 -97
  123. package/src/app/signalk-full.service.ts +99 -99
  124. package/src/app/signalk-interfaces.ts +129 -129
  125. package/src/app/signalk-requests.service.spec.ts +12 -12
  126. package/src/app/signalk-requests.service.ts +180 -180
  127. package/src/app/svg-autopilot/svg-autopilot.component.html +1036 -1036
  128. package/src/app/svg-autopilot/svg-autopilot.component.spec.ts +25 -25
  129. package/src/app/svg-autopilot/svg-autopilot.component.ts +174 -174
  130. package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.html +119 -119
  131. package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.spec.ts +25 -25
  132. package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.ts +49 -49
  133. package/src/app/svg-wind/svg-wind.component.html +969 -969
  134. package/src/app/svg-wind/svg-wind.component.scss +76 -76
  135. package/src/app/svg-wind/svg-wind.component.spec.ts +25 -25
  136. package/src/app/svg-wind/svg-wind.component.ts +280 -280
  137. package/src/app/unit-window/unit-window.component.css +37 -37
  138. package/src/app/unit-window/unit-window.component.html +8 -8
  139. package/src/app/unit-window/unit-window.component.spec.ts +25 -25
  140. package/src/app/unit-window/unit-window.component.ts +134 -134
  141. package/src/app/unit-window/unit-window.modal.html +24 -24
  142. package/src/app/units.service.ts +300 -300
  143. package/src/app/widget-autopilot/widget-autopilot.component.html +78 -85
  144. package/src/app/widget-autopilot/widget-autopilot.component.scss +191 -191
  145. package/src/app/widget-autopilot/widget-autopilot.component.spec.ts +25 -25
  146. package/src/app/widget-autopilot/widget-autopilot.component.ts +774 -781
  147. package/src/app/widget-blank/widget-blank.component.scss +21 -22
  148. package/src/app/widget-blank/widget-blank.component.spec.ts +25 -25
  149. package/src/app/widget-blank/widget-blank.component.ts +17 -17
  150. package/src/app/widget-gauge/widget-gauge.component.css +25 -25
  151. package/src/app/widget-gauge/widget-gauge.component.html +29 -29
  152. package/src/app/widget-gauge/widget-gauge.component.spec.ts +25 -25
  153. package/src/app/widget-gauge/widget-gauge.component.ts +120 -120
  154. package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.html +126 -126
  155. package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.scss +94 -93
  156. package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.spec.ts +25 -25
  157. package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.ts +424 -424
  158. package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.html +1 -1
  159. package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.scss +69 -69
  160. package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.spec.ts +25 -25
  161. package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.ts +553 -553
  162. package/src/app/widget-historical/widget-historical.component.html +14 -14
  163. package/src/app/widget-historical/widget-historical.component.spec.ts +25 -25
  164. package/src/app/widget-historical/widget-historical.component.ts +306 -306
  165. package/src/app/widget-iframe/widget-iframe.component.css +11 -11
  166. package/src/app/widget-iframe/widget-iframe.component.html +21 -21
  167. package/src/app/widget-iframe/widget-iframe.component.spec.ts +25 -25
  168. package/src/app/widget-iframe/widget-iframe.component.ts +63 -63
  169. package/src/app/widget-list.service.ts +135 -135
  170. package/src/app/widget-manager.service.ts +141 -141
  171. package/src/app/widget-numeric/widget-numeric.component.html +1 -1
  172. package/src/app/widget-numeric/widget-numeric.component.scss +3 -3
  173. package/src/app/widget-numeric/widget-numeric.component.spec.ts +25 -25
  174. package/src/app/widget-simple-linear/widget-simple-linear.component.html +28 -28
  175. package/src/app/widget-simple-linear/widget-simple-linear.component.scss +64 -64
  176. package/src/app/widget-simple-linear/widget-simple-linear.component.spec.ts +25 -25
  177. package/src/app/widget-simple-linear/widget-simple-linear.component.ts +199 -199
  178. package/src/app/widget-state/widget-state.component.html +27 -27
  179. package/src/app/widget-state/widget-state.component.scss +68 -68
  180. package/src/app/widget-state/widget-state.component.spec.ts +25 -25
  181. package/src/app/widget-state/widget-state.component.ts +178 -178
  182. package/src/app/widget-switch/widget-switch.component.css +69 -69
  183. package/src/app/widget-switch/widget-switch.component.html +17 -17
  184. package/src/app/widget-switch/widget-switch.component.spec.ts +25 -25
  185. package/src/app/widget-switch/widget-switch.component.ts +134 -134
  186. package/src/app/widget-text-generic/widget-text-generic.component.html +9 -9
  187. package/src/app/widget-text-generic/widget-text-generic.component.spec.ts +25 -25
  188. package/src/app/widget-tutorial/widget-tutorial.component.html +34 -34
  189. package/src/app/widget-tutorial/widget-tutorial.component.spec.ts +25 -25
  190. package/src/app/widget-tutorial/widget-tutorial.component.ts +18 -18
  191. package/src/app/widget-unknown/widget-unknown.component.spec.ts +25 -25
  192. package/src/app/widget-wind/widget-wind.component.css +23 -23
  193. package/src/app/widget-wind/widget-wind.component.html +20 -20
  194. package/src/app/widget-wind/widget-wind.component.spec.ts +25 -25
  195. package/src/app/widget-wind/widget-wind.component.ts +369 -369
  196. package/src/assets/NoSleep.min.js +1 -1
  197. package/src/assets/fontawesome6/css/all.min.css +6 -0
  198. package/src/assets/fontawesome6/webfonts/fa-brands-400.ttf +0 -0
  199. package/src/assets/fontawesome6/webfonts/fa-brands-400.woff2 +0 -0
  200. package/src/assets/fontawesome6/webfonts/fa-regular-400.ttf +0 -0
  201. package/src/assets/fontawesome6/webfonts/fa-regular-400.woff2 +0 -0
  202. package/src/assets/fontawesome6/webfonts/fa-solid-900.ttf +0 -0
  203. package/src/assets/fontawesome6/webfonts/fa-solid-900.woff2 +0 -0
  204. package/src/assets/fontawesome6/webfonts/fa-v4compatibility.ttf +0 -0
  205. package/src/assets/fontawesome6/webfonts/fa-v4compatibility.woff2 +0 -0
  206. package/src/assets/icon-192x192.png +0 -0
  207. package/src/assets/icon-256x256.png +0 -0
  208. package/src/assets/icon-384x384.png +0 -0
  209. package/src/assets/icon-512x512.png +0 -0
  210. package/src/assets/steelseries-min.js +25 -25
  211. package/src/assets/steelseries-min.js.map +8 -8
  212. package/src/assets/steelseries.js +15834 -15834
  213. package/src/assets/svg-autopilot-inkscape-plain.svg +983 -983
  214. package/src/assets/svg-wind-inkscape.svg +1358 -1358
  215. package/src/assets/tween.js +381 -381
  216. package/src/index.html +20 -20
  217. package/src/main.ts +11 -11
  218. package/src/manifest.json +33 -0
  219. package/src/polyfills.ts +80 -76
  220. package/src/styles.scss +11 -11
  221. package/src/themes/darkBlueTheme.scss +117 -116
  222. package/src/themes/defaultTheme.scss +50 -49
  223. package/src/themes/highContrastTheme.scss +47 -46
  224. package/src/themes/modernTheme.scss +143 -142
  225. package/src/themes/nightMode.scss +185 -184
  226. package/src/themes/platypusTheme.scss +80 -79
  227. package/src/themes/signalkTheme.scss +112 -111
  228. package/src/tsconfig.app.json +15 -15
  229. package/src/tsconfig.spec.json +20 -20
  230. package/tsconfig.json +23 -23
  231. package/tslint.json +143 -143
  232. package/public/assets/font-awesome/HELP-US-OUT.txt +0 -7
  233. package/public/assets/font-awesome/css/font-awesome.css +0 -2337
  234. package/public/assets/font-awesome/css/font-awesome.min.css +0 -4
  235. package/public/assets/font-awesome/desktop.ini +0 -4
  236. package/public/assets/font-awesome/fonts/FontAwesome.otf +0 -0
  237. package/public/assets/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  238. package/public/assets/font-awesome/fonts/fontawesome-webfont.svg +0 -2671
  239. package/public/assets/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  240. package/public/assets/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  241. package/public/assets/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  242. package/public/assets/font-awesome/less/animated.less +0 -34
  243. package/public/assets/font-awesome/less/bordered-pulled.less +0 -25
  244. package/public/assets/font-awesome/less/core.less +0 -12
  245. package/public/assets/font-awesome/less/fixed-width.less +0 -6
  246. package/public/assets/font-awesome/less/font-awesome.less +0 -18
  247. package/public/assets/font-awesome/less/icons.less +0 -789
  248. package/public/assets/font-awesome/less/larger.less +0 -13
  249. package/public/assets/font-awesome/less/list.less +0 -19
  250. package/public/assets/font-awesome/less/mixins.less +0 -60
  251. package/public/assets/font-awesome/less/path.less +0 -15
  252. package/public/assets/font-awesome/less/rotated-flipped.less +0 -20
  253. package/public/assets/font-awesome/less/screen-reader.less +0 -5
  254. package/public/assets/font-awesome/less/stacked.less +0 -20
  255. package/public/assets/font-awesome/less/variables.less +0 -800
  256. package/public/assets/font-awesome/scss/_animated.scss +0 -34
  257. package/public/assets/font-awesome/scss/_bordered-pulled.scss +0 -25
  258. package/public/assets/font-awesome/scss/_core.scss +0 -12
  259. package/public/assets/font-awesome/scss/_fixed-width.scss +0 -6
  260. package/public/assets/font-awesome/scss/_icons.scss +0 -789
  261. package/public/assets/font-awesome/scss/_larger.scss +0 -13
  262. package/public/assets/font-awesome/scss/_list.scss +0 -19
  263. package/public/assets/font-awesome/scss/_mixins.scss +0 -60
  264. package/public/assets/font-awesome/scss/_path.scss +0 -15
  265. package/public/assets/font-awesome/scss/_rotated-flipped.scss +0 -20
  266. package/public/assets/font-awesome/scss/_screen-reader.scss +0 -5
  267. package/public/assets/font-awesome/scss/_stacked.scss +0 -20
  268. package/public/assets/font-awesome/scss/_variables.scss +0 -800
  269. package/public/assets/font-awesome/scss/font-awesome.scss +0 -18
  270. package/public/main-es2018.ab0adc5af3ab3e70c849.js +0 -1
  271. package/public/main-es5.ab0adc5af3ab3e70c849.js +0 -1
  272. package/public/polyfills-es2018.713f95af1f028e444854.js +0 -1
  273. package/public/polyfills-es5.c78877945523541d2597.js +0 -1
  274. package/public/runtime-es2018.a4dadbc03350107420a4.js +0 -1
  275. package/public/runtime-es5.a4dadbc03350107420a4.js +0 -1
  276. package/public/styles.71bb0d04cad96b5efbe1.css +0 -19
  277. package/src/assets/font-awesome/HELP-US-OUT.txt +0 -7
  278. package/src/assets/font-awesome/css/font-awesome.css +0 -2337
  279. package/src/assets/font-awesome/css/font-awesome.min.css +0 -4
  280. package/src/assets/font-awesome/desktop.ini +0 -4
  281. package/src/assets/font-awesome/fonts/FontAwesome.otf +0 -0
  282. package/src/assets/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  283. package/src/assets/font-awesome/fonts/fontawesome-webfont.svg +0 -2671
  284. package/src/assets/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  285. package/src/assets/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  286. package/src/assets/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  287. package/src/assets/font-awesome/less/animated.less +0 -34
  288. package/src/assets/font-awesome/less/bordered-pulled.less +0 -25
  289. package/src/assets/font-awesome/less/core.less +0 -12
  290. package/src/assets/font-awesome/less/fixed-width.less +0 -6
  291. package/src/assets/font-awesome/less/font-awesome.less +0 -18
  292. package/src/assets/font-awesome/less/icons.less +0 -789
  293. package/src/assets/font-awesome/less/larger.less +0 -13
  294. package/src/assets/font-awesome/less/list.less +0 -19
  295. package/src/assets/font-awesome/less/mixins.less +0 -60
  296. package/src/assets/font-awesome/less/path.less +0 -15
  297. package/src/assets/font-awesome/less/rotated-flipped.less +0 -20
  298. package/src/assets/font-awesome/less/screen-reader.less +0 -5
  299. package/src/assets/font-awesome/less/stacked.less +0 -20
  300. package/src/assets/font-awesome/less/variables.less +0 -800
  301. package/src/assets/font-awesome/scss/_animated.scss +0 -34
  302. package/src/assets/font-awesome/scss/_bordered-pulled.scss +0 -25
  303. package/src/assets/font-awesome/scss/_core.scss +0 -12
  304. package/src/assets/font-awesome/scss/_fixed-width.scss +0 -6
  305. package/src/assets/font-awesome/scss/_icons.scss +0 -789
  306. package/src/assets/font-awesome/scss/_larger.scss +0 -13
  307. package/src/assets/font-awesome/scss/_list.scss +0 -19
  308. package/src/assets/font-awesome/scss/_mixins.scss +0 -60
  309. package/src/assets/font-awesome/scss/_path.scss +0 -15
  310. package/src/assets/font-awesome/scss/_rotated-flipped.scss +0 -20
  311. package/src/assets/font-awesome/scss/_screen-reader.scss +0 -5
  312. package/src/assets/font-awesome/scss/_stacked.scss +0 -20
  313. package/src/assets/font-awesome/scss/_variables.scss +0 -800
  314. package/src/assets/font-awesome/scss/font-awesome.scss +0 -18
@@ -1,282 +1,282 @@
1
- import { Component, Input, AfterViewInit, OnInit, OnChanges, SimpleChanges, ViewChild, ElementRef } from '@angular/core';
2
- import { ResizedEvent } from 'angular-resize-event';
3
-
4
- declare var steelseries: any; // 3rd party
5
-
6
- export const SteelBackgroundColors = {
7
- 'darkGray': steelseries.BackgroundColor.DARK_GRAY,
8
- 'satinGray': steelseries.BackgroundColor.SATIN_GRAY,
9
- 'lightGray': steelseries.BackgroundColor.LIGHT_GRAY,
10
- 'white': steelseries.BackgroundColor.WHITE,
11
- 'black': steelseries.BackgroundColor.BLACK,
12
- 'beige': steelseries.BackgroundColor.BEIGE,
13
- 'brown': steelseries.BackgroundColor.BROWN,
14
- 'red': steelseries.BackgroundColor.RED,
15
- 'green': steelseries.BackgroundColor.GREEN,
16
- 'blue': steelseries.BackgroundColor.BLUE,
17
- 'anthracite': steelseries.BackgroundColor.ANTHRACITE,
18
- 'mud': steelseries.BackgroundColor.MUD,
19
- 'punchedSheet': steelseries.BackgroundColor.PUNCHED_SHEET,
20
- 'carbon': steelseries.BackgroundColor.CARBON,
21
- 'stainless': steelseries.BackgroundColor.STAINLESS,
22
- 'brushedMetal': steelseries.BackgroundColor.BRUSHED_METAL,
23
- 'brushedStainless': steelseries.BackgroundColor.BRUSHED_STAINLESS,
24
- 'turned': steelseries.BackgroundColor.TURNED
25
- }
26
-
27
- export const SteelFrameColors = {
28
- 'blackMetal': steelseries.FrameDesign.BLACK_METAL,
29
- 'metal': steelseries.FrameDesign.METAL,
30
- 'shinyMetal': steelseries.FrameDesign.SHINY_METAL,
31
- 'brass': steelseries.FrameDesign.BRASS,
32
- 'steel': steelseries.FrameDesign.STEEL,
33
- 'chrome': steelseries.FrameDesign.CHROME,
34
- 'gold': steelseries.FrameDesign.GOLD,
35
- 'anthracite': steelseries.FrameDesign.ANTHRACITE,
36
- 'tiltedGray': steelseries.FrameDesign.TILTED_GRAY,
37
- 'tiltedBlack': steelseries.FrameDesign.TILTED_BLACK,
38
- 'glossyMetal': steelseries.FrameDesign.GLOSSY_METAL
39
- }
40
-
41
-
42
- @Component({
43
- selector: 'gauge-steel',
44
- templateUrl: './gauge-steel.component.html',
45
- styleUrls: ['./gauge-steel.component.css']
46
- })
47
- export class GaugeSteelComponent implements OnInit, AfterViewInit, OnChanges {
48
-
49
- @ViewChild('wrapperDiv', {static: true, read: ElementRef}) wrapperDiv: ElementRef;
50
-
51
- @Input('widgetUUID') widgetUUID: string;
52
- @Input('gaugeType') gaugeType: string; // linear or radial
53
- @Input('barGauge') barGauge: boolean;
54
-
55
- @Input('radialSize') radialSize?: string;
56
-
57
- @Input('backgroundColor') backgroundColor?: string;
58
- @Input('frameColor') frameColor: string;
59
-
60
- @Input('minValue') minValue: number;
61
- @Input('maxValue') maxValue: number;
62
-
63
- @Input('zones') zones: Array<{ low: number; high: number; state: string}>;
64
-
65
- @Input('title') title: string;
66
- @Input('units') units: string;
67
-
68
- @Input('value') value: number;
69
- gaugeWidth: number = 0;
70
- gaugeHeight: number = 0;
71
- isInResizeWindow: boolean = false;
72
- gaugeStarted: boolean = false;
73
-
74
- constructor() { }
75
-
76
- gauge;
77
-
78
- gaugeOptions = {};
79
-
80
- // common options for both radial and linear
81
-
82
- sections;
83
-
84
-
85
- ngOnInit() {
86
-
87
- }
88
-
89
- ngAfterViewInit() {
90
- if (!this.gaugeType) { this.gaugeType = 'radial'; }
91
- }
92
-
93
- buildOptions() {
94
- this.gaugeOptions = {};
95
-
96
- //size
97
- if (this.gaugeType == 'radial') {
98
- this.gaugeOptions['size'] = Math.min(this.gaugeHeight, this.gaugeWidth); // radial takes only size as both the same
99
- } else {
100
- this.gaugeOptions['width'] = this.gaugeWidth;
101
- this.gaugeOptions['height'] = this.gaugeHeight;
102
- }
103
-
104
- //minMax
105
- this.gaugeOptions['minValue'] = this.minValue;
106
- this.gaugeOptions['maxValue'] = this.maxValue;
107
-
108
- //labels
109
- this.gaugeOptions['titleString'] = this.title;
110
- this.gaugeOptions['unitString'] = this.units;
111
-
112
- // Radial Arc size
113
- if (this.gaugeType == 'radial') {
114
- switch(this.radialSize) {
115
- case 'quarter':
116
- this.gaugeOptions['gaugeType'] = steelseries.GaugeType.TYPE1;
117
- break;
118
- case 'half':
119
- this.gaugeOptions['gaugeType'] = steelseries.GaugeType.TYPE2;
120
- break;
121
- case 'three-quarter':
122
- this.gaugeOptions['gaugeType'] = steelseries.GaugeType.TYPE3;
123
- break;
124
- case 'full':
125
- default:
126
- this.gaugeOptions['gaugeType'] = steelseries.GaugeType.TYPE4;
127
-
128
-
129
- }
130
- }
131
-
132
- // Zones
133
- // Define some sections
134
- if (this.zones) {
135
- let sections = [];
136
- let areas = []
137
- for (let i=0;i < this.zones.length; i++) {
138
- switch (this.zones[i].state) {
139
- case 'good':
140
- sections.push(steelseries.Section(this.zones[i].low, this.zones[i].high, 'rgba(0, 220, 0, 0.3)'));
141
- break;
142
- case 'warn':
143
- sections.push(steelseries.Section(this.zones[i].low, this.zones[i].high, 'rgba(220, 220, 0, 0.3)'));
144
- break;
145
- case 'alert':
146
- if (this.gaugeType == 'radial' && (!this.barGauge)) {
147
- areas.push(steelseries.Section(this.zones[i].low, this.zones[i].high, 'rgba(220, 0, 0, 0.3)'));
148
- } else {
149
- sections.push(steelseries.Section(this.zones[i].low, this.zones[i].high, 'rgba(220, 0, 0, 0.3)'));
150
- }
151
- }
152
- }
153
-
154
- this.gaugeOptions['section'] = sections;
155
- this.gaugeOptions['area'] = areas;
156
- this.gaugeOptions['useSectionColors'] = true;
157
- }
158
-
159
-
160
- //Colors
161
- if (SteelBackgroundColors[this.backgroundColor]) {
162
- this.gaugeOptions['backgroundColor'] = SteelBackgroundColors[this.backgroundColor];
163
- }
164
- if (SteelFrameColors[this.frameColor]) {
165
- this.gaugeOptions['frameDesign'] = SteelFrameColors[this.frameColor];
166
- }
167
- if (this.barGauge) {
168
- this.gaugeOptions['valueColor'] = steelseries.ColorDef.GREEN;
169
- }
170
-
171
-
172
- //defaults
173
- this.gaugeOptions['lcdVisible'] = true;
174
- this.gaugeOptions['thresholdVisible'] = false;
175
- this.gaugeOptions['threshold'] = this.maxValue;
176
- this.gaugeOptions['ledVisible'] = false;
177
- }
178
-
179
- startGauge() {
180
- this.gaugeStarted = true;
181
- this.buildOptions();
182
- // Initialzing gauges
183
- if (this.gaugeType == 'radial') {
184
- if (this.barGauge) {
185
- this.gauge = new steelseries.RadialBargraph(this.widgetUUID, this.gaugeOptions);
186
- } else {
187
- this.gauge = new steelseries.Radial(this.widgetUUID, this.gaugeOptions);
188
- }
189
- } else if (this.gaugeType == 'linear') {
190
- if (this.barGauge) {
191
- this.gauge = new steelseries.LinearBargraph(this.widgetUUID, this.gaugeOptions);
192
- } else {
193
- this.gauge = new steelseries.Linear(this.widgetUUID, this.gaugeOptions);
194
- }
195
- }
196
-
197
- }
198
-
199
- onResized(event: ResizedEvent) {
200
- if (event.newHeight < 50) {
201
- return;
202
- }
203
- if (event.newWidth < 50) {
204
- return;
205
- }
206
- if (!this.isInResizeWindow) {
207
- this.isInResizeWindow = true;
208
-
209
- setTimeout(() => {
210
- let rect = this.wrapperDiv.nativeElement.getBoundingClientRect();
211
- this.gaugeWidth = rect.width;
212
- this.gaugeHeight = rect.height;
213
- this.isInResizeWindow = false;
214
- this.startGauge();
215
- }, 1000);
216
- }
217
- }
218
-
219
- ngOnChanges(changes: SimpleChanges) {
220
- if (!this.gaugeStarted) { return; }
221
-
222
- if (changes.value) {
223
- if (! changes.value.firstChange) {
224
- this.gauge.setValueAnimated(changes.value.currentValue);
225
- }
226
- }
227
-
228
- if (changes.gaugeType) {
229
- if ( !changes.gaugeType.firstChange) {
230
- this.startGauge();//reset
231
- }
232
- }
233
-
234
- if (changes.barGauge) {
235
- if ( !changes.barGauge.firstChange) {
236
- this.startGauge();//reset
237
- }
238
- }
239
-
240
- if (changes.title) {
241
- if ( !changes.title.firstChange) {
242
- this.startGauge();//reset
243
- }
244
- }
245
-
246
- if (changes.units) {
247
- if ( !changes.units.firstChange) {
248
- this.startGauge();//reset
249
- }
250
- }
251
- if (changes.minValue) {
252
- if ( !changes.minValue.firstChange) {
253
- this.startGauge();//reset
254
- }
255
- }
256
- if (changes.maxValue) {
257
- if ( !changes.maxValue.firstChange) {
258
- this.startGauge();//reset
259
- }
260
- }
261
-
262
- if (changes.radialSize) {
263
- if ( !changes.radialSize.firstChange) {
264
- this.startGauge();//reset
265
- }
266
- }
267
-
268
- if (changes.backgroundColor) {
269
- if ( !changes.backgroundColor.firstChange) {
270
- this.startGauge();//reset
271
- }
272
- }
273
-
274
- if (changes.frameColor) {
275
- if ( !changes.frameColor.firstChange) {
276
- this.startGauge();//reset
277
- }
278
- }
279
-
280
- }
281
-
282
- }
1
+ import { Component, Input, AfterViewInit, OnInit, OnChanges, SimpleChanges, ViewChild, ElementRef } from '@angular/core';
2
+ import { ResizedEvent } from 'angular-resize-event';
3
+
4
+ declare var steelseries: any; // 3rd party
5
+
6
+ export const SteelBackgroundColors = {
7
+ 'darkGray': steelseries.BackgroundColor.DARK_GRAY,
8
+ 'satinGray': steelseries.BackgroundColor.SATIN_GRAY,
9
+ 'lightGray': steelseries.BackgroundColor.LIGHT_GRAY,
10
+ 'white': steelseries.BackgroundColor.WHITE,
11
+ 'black': steelseries.BackgroundColor.BLACK,
12
+ 'beige': steelseries.BackgroundColor.BEIGE,
13
+ 'brown': steelseries.BackgroundColor.BROWN,
14
+ 'red': steelseries.BackgroundColor.RED,
15
+ 'green': steelseries.BackgroundColor.GREEN,
16
+ 'blue': steelseries.BackgroundColor.BLUE,
17
+ 'anthracite': steelseries.BackgroundColor.ANTHRACITE,
18
+ 'mud': steelseries.BackgroundColor.MUD,
19
+ 'punchedSheet': steelseries.BackgroundColor.PUNCHED_SHEET,
20
+ 'carbon': steelseries.BackgroundColor.CARBON,
21
+ 'stainless': steelseries.BackgroundColor.STAINLESS,
22
+ 'brushedMetal': steelseries.BackgroundColor.BRUSHED_METAL,
23
+ 'brushedStainless': steelseries.BackgroundColor.BRUSHED_STAINLESS,
24
+ 'turned': steelseries.BackgroundColor.TURNED
25
+ }
26
+
27
+ export const SteelFrameColors = {
28
+ 'blackMetal': steelseries.FrameDesign.BLACK_METAL,
29
+ 'metal': steelseries.FrameDesign.METAL,
30
+ 'shinyMetal': steelseries.FrameDesign.SHINY_METAL,
31
+ 'brass': steelseries.FrameDesign.BRASS,
32
+ 'steel': steelseries.FrameDesign.STEEL,
33
+ 'chrome': steelseries.FrameDesign.CHROME,
34
+ 'gold': steelseries.FrameDesign.GOLD,
35
+ 'anthracite': steelseries.FrameDesign.ANTHRACITE,
36
+ 'tiltedGray': steelseries.FrameDesign.TILTED_GRAY,
37
+ 'tiltedBlack': steelseries.FrameDesign.TILTED_BLACK,
38
+ 'glossyMetal': steelseries.FrameDesign.GLOSSY_METAL
39
+ }
40
+
41
+
42
+ @Component({
43
+ selector: 'gauge-steel',
44
+ templateUrl: './gauge-steel.component.html',
45
+ styleUrls: ['./gauge-steel.component.css']
46
+ })
47
+ export class GaugeSteelComponent implements OnInit, AfterViewInit, OnChanges {
48
+
49
+ @ViewChild('wrapperDiv', {static: true, read: ElementRef}) wrapperDiv: ElementRef;
50
+
51
+ @Input('widgetUUID') widgetUUID: string;
52
+ @Input('gaugeType') gaugeType: string; // linear or radial
53
+ @Input('barGauge') barGauge: boolean;
54
+
55
+ @Input('radialSize') radialSize?: string;
56
+
57
+ @Input('backgroundColor') backgroundColor?: string;
58
+ @Input('frameColor') frameColor: string;
59
+
60
+ @Input('minValue') minValue: number;
61
+ @Input('maxValue') maxValue: number;
62
+
63
+ @Input('zones') zones: Array<{ low: number; high: number; state: string}>;
64
+
65
+ @Input('title') title: string;
66
+ @Input('units') units: string;
67
+
68
+ @Input('value') value: number;
69
+ gaugeWidth: number = 0;
70
+ gaugeHeight: number = 0;
71
+ isInResizeWindow: boolean = false;
72
+ gaugeStarted: boolean = false;
73
+
74
+ constructor() { }
75
+
76
+ gauge;
77
+
78
+ gaugeOptions = {};
79
+
80
+ // common options for both radial and linear
81
+
82
+ sections;
83
+
84
+
85
+ ngOnInit() {
86
+
87
+ }
88
+
89
+ ngAfterViewInit() {
90
+ if (!this.gaugeType) { this.gaugeType = 'radial'; }
91
+ }
92
+
93
+ buildOptions() {
94
+ this.gaugeOptions = {};
95
+
96
+ //size
97
+ if (this.gaugeType == 'radial') {
98
+ this.gaugeOptions['size'] = Math.min(this.gaugeHeight, this.gaugeWidth); // radial takes only size as both the same
99
+ } else {
100
+ this.gaugeOptions['width'] = this.gaugeWidth;
101
+ this.gaugeOptions['height'] = this.gaugeHeight;
102
+ }
103
+
104
+ //minMax
105
+ this.gaugeOptions['minValue'] = this.minValue;
106
+ this.gaugeOptions['maxValue'] = this.maxValue;
107
+
108
+ //labels
109
+ this.gaugeOptions['titleString'] = this.title;
110
+ this.gaugeOptions['unitString'] = this.units;
111
+
112
+ // Radial Arc size
113
+ if (this.gaugeType == 'radial') {
114
+ switch(this.radialSize) {
115
+ case 'quarter':
116
+ this.gaugeOptions['gaugeType'] = steelseries.GaugeType.TYPE1;
117
+ break;
118
+ case 'half':
119
+ this.gaugeOptions['gaugeType'] = steelseries.GaugeType.TYPE2;
120
+ break;
121
+ case 'three-quarter':
122
+ this.gaugeOptions['gaugeType'] = steelseries.GaugeType.TYPE3;
123
+ break;
124
+ case 'full':
125
+ default:
126
+ this.gaugeOptions['gaugeType'] = steelseries.GaugeType.TYPE4;
127
+
128
+
129
+ }
130
+ }
131
+
132
+ // Zones
133
+ // Define some sections
134
+ if (this.zones) {
135
+ let sections = [];
136
+ let areas = []
137
+ for (let i=0;i < this.zones.length; i++) {
138
+ switch (this.zones[i].state) {
139
+ case 'good':
140
+ sections.push(steelseries.Section(this.zones[i].low, this.zones[i].high, 'rgba(0, 220, 0, 0.3)'));
141
+ break;
142
+ case 'warn':
143
+ sections.push(steelseries.Section(this.zones[i].low, this.zones[i].high, 'rgba(220, 220, 0, 0.3)'));
144
+ break;
145
+ case 'alert':
146
+ if (this.gaugeType == 'radial' && (!this.barGauge)) {
147
+ areas.push(steelseries.Section(this.zones[i].low, this.zones[i].high, 'rgba(220, 0, 0, 0.3)'));
148
+ } else {
149
+ sections.push(steelseries.Section(this.zones[i].low, this.zones[i].high, 'rgba(220, 0, 0, 0.3)'));
150
+ }
151
+ }
152
+ }
153
+
154
+ this.gaugeOptions['section'] = sections;
155
+ this.gaugeOptions['area'] = areas;
156
+ this.gaugeOptions['useSectionColors'] = true;
157
+ }
158
+
159
+
160
+ //Colors
161
+ if (SteelBackgroundColors[this.backgroundColor]) {
162
+ this.gaugeOptions['backgroundColor'] = SteelBackgroundColors[this.backgroundColor];
163
+ }
164
+ if (SteelFrameColors[this.frameColor]) {
165
+ this.gaugeOptions['frameDesign'] = SteelFrameColors[this.frameColor];
166
+ }
167
+ if (this.barGauge) {
168
+ this.gaugeOptions['valueColor'] = steelseries.ColorDef.GREEN;
169
+ }
170
+
171
+
172
+ //defaults
173
+ this.gaugeOptions['lcdVisible'] = true;
174
+ this.gaugeOptions['thresholdVisible'] = false;
175
+ this.gaugeOptions['threshold'] = this.maxValue;
176
+ this.gaugeOptions['ledVisible'] = false;
177
+ }
178
+
179
+ startGauge() {
180
+ this.gaugeStarted = true;
181
+ this.buildOptions();
182
+ // Initialzing gauges
183
+ if (this.gaugeType == 'radial') {
184
+ if (this.barGauge) {
185
+ this.gauge = new steelseries.RadialBargraph(this.widgetUUID, this.gaugeOptions);
186
+ } else {
187
+ this.gauge = new steelseries.Radial(this.widgetUUID, this.gaugeOptions);
188
+ }
189
+ } else if (this.gaugeType == 'linear') {
190
+ if (this.barGauge) {
191
+ this.gauge = new steelseries.LinearBargraph(this.widgetUUID, this.gaugeOptions);
192
+ } else {
193
+ this.gauge = new steelseries.Linear(this.widgetUUID, this.gaugeOptions);
194
+ }
195
+ }
196
+
197
+ }
198
+
199
+ onResized(event: ResizedEvent) {
200
+ if (event.newRect.height < 50) {
201
+ return;
202
+ }
203
+ if (event.newRect.width < 50) {
204
+ return;
205
+ }
206
+ if (!this.isInResizeWindow) {
207
+ this.isInResizeWindow = true;
208
+
209
+ setTimeout(() => {
210
+ let rect = this.wrapperDiv.nativeElement.getBoundingClientRect();
211
+ this.gaugeWidth = rect.width;
212
+ this.gaugeHeight = rect.height;
213
+ this.isInResizeWindow = false;
214
+ this.startGauge();
215
+ }, 1000);
216
+ }
217
+ }
218
+
219
+ ngOnChanges(changes: SimpleChanges) {
220
+ if (!this.gaugeStarted) { return; }
221
+
222
+ if (changes.value) {
223
+ if (! changes.value.firstChange) {
224
+ this.gauge.setValueAnimated(changes.value.currentValue);
225
+ }
226
+ }
227
+
228
+ if (changes.gaugeType) {
229
+ if ( !changes.gaugeType.firstChange) {
230
+ this.startGauge();//reset
231
+ }
232
+ }
233
+
234
+ if (changes.barGauge) {
235
+ if ( !changes.barGauge.firstChange) {
236
+ this.startGauge();//reset
237
+ }
238
+ }
239
+
240
+ if (changes.title) {
241
+ if ( !changes.title.firstChange) {
242
+ this.startGauge();//reset
243
+ }
244
+ }
245
+
246
+ if (changes.units) {
247
+ if ( !changes.units.firstChange) {
248
+ this.startGauge();//reset
249
+ }
250
+ }
251
+ if (changes.minValue) {
252
+ if ( !changes.minValue.firstChange) {
253
+ this.startGauge();//reset
254
+ }
255
+ }
256
+ if (changes.maxValue) {
257
+ if ( !changes.maxValue.firstChange) {
258
+ this.startGauge();//reset
259
+ }
260
+ }
261
+
262
+ if (changes.radialSize) {
263
+ if ( !changes.radialSize.firstChange) {
264
+ this.startGauge();//reset
265
+ }
266
+ }
267
+
268
+ if (changes.backgroundColor) {
269
+ if ( !changes.backgroundColor.firstChange) {
270
+ this.startGauge();//reset
271
+ }
272
+ }
273
+
274
+ if (changes.frameColor) {
275
+ if ( !changes.frameColor.firstChange) {
276
+ this.startGauge();//reset
277
+ }
278
+ }
279
+
280
+ }
281
+
282
+ }