@flexem/fc-gui 3.0.0-alpha.16 → 3.0.0-alpha.160

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 (567) hide show
  1. package/CHANGELOG.md +492 -69
  2. package/README.md +4 -4
  3. package/assets/img/alert.svg +18 -18
  4. package/assets/img/black_first_page.png +0 -0
  5. package/assets/img/black_last_page.png +0 -0
  6. package/assets/img/black_next_page.png +0 -0
  7. package/assets/img/black_previous_page.png +0 -0
  8. package/assets/img/first_page.svg +19 -19
  9. package/assets/img/last_page.svg +19 -19
  10. package/assets/img/next_page.svg +14 -14
  11. package/assets/img/previous_page.svg +14 -14
  12. package/bundles/@flexem/fc-gui.umd.js +25472 -20764
  13. package/bundles/@flexem/fc-gui.umd.js.map +1 -1
  14. package/bundles/@flexem/fc-gui.umd.min.js +5 -5
  15. package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
  16. package/communication/index.d.ts +1 -1
  17. package/communication/index.js +1 -1
  18. package/communication/variable/index.d.ts +5 -5
  19. package/communication/variable/index.js +4 -4
  20. package/communication/variable/variable-communicator.d.ts +16 -12
  21. package/communication/variable/variable-definition.d.ts +10 -10
  22. package/communication/variable/variable-definition.js +14 -14
  23. package/communication/variable/variable-state-enum.d.ts +8 -7
  24. package/communication/variable/variable-state-enum.js +9 -8
  25. package/communication/variable/variable-state-enum.metadata.json +1 -1
  26. package/communication/variable/variable-state.d.ts +6 -6
  27. package/communication/variable/variable-state.js +6 -6
  28. package/communication/variable/variable-value.d.ts +11 -8
  29. package/communication/variable/variable-value.js +11 -8
  30. package/communication/variable/variable-value.metadata.json +1 -1
  31. package/config/alarm/alarm.store.d.ts +6 -0
  32. package/config/alarm/alarm.store.js +0 -0
  33. package/config/alarm/alarm.store.metadata.json +1 -0
  34. package/config/alarm/get-alarms-args.d.ts +12 -0
  35. package/config/alarm/get-alarms-args.js +13 -0
  36. package/config/alarm/get-alarms-args.metadata.json +1 -0
  37. package/config/alarm/index.d.ts +2 -0
  38. package/config/alarm/index.js +1 -0
  39. package/config/alarm/index.metadata.json +1 -0
  40. package/config/config-store.d.ts +17 -15
  41. package/config/graph/graph-result.d.ts +9 -9
  42. package/config/graph/graph-result.js +13 -13
  43. package/config/graph/graph-store.d.ts +9 -9
  44. package/config/graph/graph-type.d.ts +4 -4
  45. package/config/graph/graph-type.js +5 -5
  46. package/config/graph/graph.d.ts +6 -6
  47. package/config/graph/graph.js +6 -6
  48. package/config/gui-feature-config.d.ts +3 -0
  49. package/config/gui-feature-config.js +3 -0
  50. package/config/gui-feature-config.metadata.json +1 -0
  51. package/config/history-data/get-history-data-args.d.ts +22 -22
  52. package/config/history-data/get-history-data-args.js +21 -21
  53. package/config/history-data/historical-curve.time-range.d.ts +18 -18
  54. package/config/history-data/historical-curve.time-range.js +19 -19
  55. package/config/history-data/history-data-value.d.ts +6 -6
  56. package/config/history-data/history-data-value.js +6 -6
  57. package/config/history-data/history-data.model.d.ts +7 -7
  58. package/config/history-data/history-data.model.js +7 -7
  59. package/config/history-data/history-data.store.d.ts +10 -10
  60. package/config/history-data/index.d.ts +4 -4
  61. package/config/history-data/index.js +3 -3
  62. package/config/image/image-store.d.ts +6 -6
  63. package/config/index.d.ts +12 -10
  64. package/config/index.js +8 -6
  65. package/config/index.metadata.json +1 -1
  66. package/config/variable/get-variable-name-args.d.ts +6 -6
  67. package/config/variable/get-variable-name-args.js +7 -7
  68. package/config/variable/index.d.ts +2 -2
  69. package/config/variable/index.js +1 -1
  70. package/config/variable/variable-store.d.ts +8 -7
  71. package/config/view/view-store.d.ts +20 -20
  72. package/config/view/view.model.d.ts +4 -4
  73. package/config/view/view.model.js +5 -5
  74. package/core/index.d.ts +1 -1
  75. package/core/index.js +1 -1
  76. package/core/stringifying-map.d.ts +11 -11
  77. package/core/stringifying-map.js +24 -24
  78. package/core/stringifying-set.d.ts +10 -10
  79. package/core/stringifying-set.js +21 -21
  80. package/elements/air-quality/air-quality-element.d.ts +31 -0
  81. package/elements/air-quality/air-quality-element.js +194 -0
  82. package/elements/air-quality/air-quality-element.metadata.json +1 -0
  83. package/elements/alarm/alarm-element.d.ts +69 -0
  84. package/elements/alarm/alarm-element.js +497 -0
  85. package/elements/alarm/alarm-element.metadata.json +1 -0
  86. package/elements/bar-graph-element.d.ts +29 -21
  87. package/elements/bar-graph-element.js +244 -114
  88. package/elements/bar-graph-element.metadata.json +1 -1
  89. package/elements/base/base-element.d.ts +11 -11
  90. package/elements/base/base-element.js +9 -9
  91. package/elements/base/conditional-control-element.d.ts +16 -16
  92. package/elements/base/conditional-control-element.js +87 -87
  93. package/elements/base/conditional-display-element.d.ts +24 -24
  94. package/elements/base/conditional-display-element.js +86 -86
  95. package/elements/base/conditional-dynamic-display-element.d.ts +26 -26
  96. package/elements/base/conditional-dynamic-display-element.js +142 -142
  97. package/elements/base/conditional-enable-element.d.ts +21 -21
  98. package/elements/base/conditional-enable-element.js +100 -100
  99. package/elements/base/index.d.ts +3 -3
  100. package/elements/base/index.js +3 -3
  101. package/elements/base/readable-element.d.ts +20 -15
  102. package/elements/base/readable-element.js +122 -58
  103. package/elements/base/readable-element.metadata.json +1 -1
  104. package/elements/base/state-control-element.d.ts +26 -24
  105. package/elements/base/state-control-element.js +196 -180
  106. package/elements/character-display/character-display-element.d.ts +35 -35
  107. package/elements/character-display/character-display-element.js +312 -311
  108. package/elements/character-display/character-display-element.metadata.json +1 -1
  109. package/elements/datetime-display/datetime-display-element.d.ts +22 -21
  110. package/elements/datetime-display/datetime-display-element.js +140 -132
  111. package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
  112. package/elements/datetime-display/time-zone-select-json.d.ts +8 -0
  113. package/elements/datetime-display/time-zone-select-json.js +558 -0
  114. package/elements/historical-curve/historical-curve-element-status.d.ts +6 -6
  115. package/elements/historical-curve/historical-curve-element-status.js +7 -7
  116. package/elements/historical-curve/historical-curve.element.d.ts +96 -59
  117. package/elements/historical-curve/historical-curve.element.js +990 -364
  118. package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
  119. package/elements/historical-curve/historical-curve.element.option.d.ts +13 -13
  120. package/elements/historical-curve/historical-curve.time-period.d.ts +4 -4
  121. package/elements/main-element.d.ts +46 -45
  122. package/elements/main-element.js +373 -307
  123. package/elements/main-element.metadata.json +1 -1
  124. package/elements/meter-element.d.ts +26 -20
  125. package/elements/meter-element.js +139 -70
  126. package/elements/meter-element.metadata.json +1 -1
  127. package/elements/numerical-display/numerical-display-element.d.ts +60 -41
  128. package/elements/numerical-display/numerical-display-element.js +476 -361
  129. package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
  130. package/elements/per-view-variable-communicator.d.ts +20 -17
  131. package/elements/per-view-variable-communicator.js +59 -45
  132. package/elements/per-view-variable-communicator.metadata.json +1 -1
  133. package/elements/pipe/pipe-element.d.ts +19 -19
  134. package/elements/pipe/pipe-element.js +141 -141
  135. package/elements/ring-graph/ring-graph-element.d.ts +31 -19
  136. package/elements/ring-graph/ring-graph-element.js +250 -89
  137. package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
  138. package/elements/scroll-alarm/scroll-alarm-element.d.ts +74 -0
  139. package/elements/scroll-alarm/scroll-alarm-element.js +761 -0
  140. package/elements/scroll-alarm/scroll-alarm-element.metadata.json +1 -0
  141. package/elements/shared/graph/graph-state-element.d.ts +28 -27
  142. package/elements/shared/graph/graph-state-element.js +139 -110
  143. package/elements/shared/graph/graph-state-element.metadata.json +1 -1
  144. package/elements/shared/math-utils.d.ts +2 -2
  145. package/elements/shared/math-utils.js +14 -14
  146. package/elements/shared/text/text-element.d.ts +22 -8
  147. package/elements/shared/text/text-element.js +106 -68
  148. package/elements/shared/text/text-element.metadata.json +1 -1
  149. package/elements/shared/text/text-state-element.d.ts +58 -23
  150. package/elements/shared/text/text-state-element.js +286 -136
  151. package/elements/shared/text/text-state-element.metadata.json +1 -1
  152. package/elements/shared/text/text-state.model.d.ts +5 -5
  153. package/elements/shared/text/text-utils.d.ts +5 -5
  154. package/elements/shared/text/text-utils.js +45 -45
  155. package/elements/static-elements/hyperlink-element.d.ts +40 -14
  156. package/elements/static-elements/hyperlink-element.js +197 -48
  157. package/elements/static-elements/hyperlink-element.metadata.json +1 -1
  158. package/elements/static-elements/image-element.d.ts +14 -14
  159. package/elements/static-elements/image-element.js +41 -41
  160. package/elements/static-elements/text-element.d.ts +42 -16
  161. package/elements/static-elements/text-element.js +205 -55
  162. package/elements/static-elements/text-element.metadata.json +1 -1
  163. package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +21 -20
  164. package/elements/switch-indicator-light/bit-indicator-light-operator.js +85 -78
  165. package/elements/switch-indicator-light/bit-indicator-light-operator.metadata.json +1 -1
  166. package/elements/switch-indicator-light/bit-switch-operator.d.ts +19 -19
  167. package/elements/switch-indicator-light/bit-switch-operator.js +107 -107
  168. package/elements/switch-indicator-light/current-stateId-value.d.ts +6 -6
  169. package/elements/switch-indicator-light/current-stateId-value.js +8 -8
  170. package/elements/switch-indicator-light/indicator-light-operator.d.ts +8 -8
  171. package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +48 -39
  172. package/elements/switch-indicator-light/switch-indicator-light-element.js +302 -251
  173. package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
  174. package/elements/switch-indicator-light/switch-operator.d.ts +6 -6
  175. package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +19 -18
  176. package/elements/switch-indicator-light/word-indicator-light-operator.js +72 -65
  177. package/elements/switch-indicator-light/word-indicator-light-operator.metadata.json +1 -1
  178. package/elements/switch-indicator-light/word-switch-operator.d.ts +18 -18
  179. package/elements/switch-indicator-light/word-switch-operator.js +75 -75
  180. package/elements/table/table-element.d.ts +9 -9
  181. package/elements/table/table-element.js +6 -6
  182. package/elements/vector-graphics/ellipse-element.d.ts +9 -9
  183. package/elements/vector-graphics/ellipse-element.js +6 -6
  184. package/elements/vector-graphics/poly-line-element.d.ts +12 -12
  185. package/elements/vector-graphics/poly-line-element.js +19 -19
  186. package/elements/vector-graphics/polygon-element.d.ts +12 -12
  187. package/elements/vector-graphics/polygon-element.js +19 -19
  188. package/elements/vector-graphics/rectangle-element.d.ts +9 -9
  189. package/elements/vector-graphics/rectangle-element.js +6 -6
  190. package/elements/vector-graphics/sector-element.d.ts +9 -9
  191. package/elements/vector-graphics/sector-element.js +6 -6
  192. package/elements/vector-graphics/straight-line-element.d.ts +12 -12
  193. package/elements/vector-graphics/straight-line-element.js +19 -19
  194. package/elements/video/video-element.d.ts +37 -27
  195. package/elements/video/video-element.js +258 -160
  196. package/elements/video/video-element.metadata.json +1 -1
  197. package/elements/view-operation/view-operation.element.d.ts +62 -36
  198. package/elements/view-operation/view-operation.element.js +348 -194
  199. package/elements/view-operation/view-operation.element.metadata.json +1 -1
  200. package/elements/weather/weater-element.d.ts +38 -38
  201. package/elements/weather/weater-element.js +237 -238
  202. package/gui/gui-context.d.ts +33 -16
  203. package/gui/gui-host.d.ts +50 -50
  204. package/gui/gui-host.js +173 -173
  205. package/gui/gui-view.d.ts +45 -42
  206. package/gui/gui-view.js +265 -204
  207. package/gui/gui-view.metadata.json +1 -1
  208. package/gui/gui.component.d.ts +45 -42
  209. package/gui/gui.component.html +3 -3
  210. package/gui/gui.component.js +240 -227
  211. package/gui/gui.component.metadata.json +1 -1
  212. package/gui/interfaces/gui-options.d.ts +6 -6
  213. package/gui.module.d.ts +2 -2
  214. package/gui.module.js +78 -78
  215. package/localization/index.d.ts +2 -2
  216. package/localization/index.js +2 -2
  217. package/localization/localization.service.d.ts +62 -51
  218. package/localization/localization.service.js +61 -50
  219. package/localization/localization.service.metadata.json +1 -1
  220. package/localization/localization.service.zh_CN.d.ts +2 -2
  221. package/localization/localization.service.zh_CN.js +59 -48
  222. package/localization/localization.service.zh_CN.metadata.json +1 -1
  223. package/logger/console-logger.service.d.ts +13 -13
  224. package/logger/console-logger.service.js +38 -38
  225. package/logger/index.d.ts +2 -2
  226. package/logger/index.js +2 -2
  227. package/logger/logger.service.d.ts +14 -14
  228. package/logger/logger.service.js +2 -2
  229. package/modal/alert/alert-modal.component.d.ts +10 -10
  230. package/modal/alert/alert-modal.component.html +11 -11
  231. package/modal/alert/alert-modal.component.js +38 -38
  232. package/modal/alert/alert-modal.component.less +59 -59
  233. package/modal/confirm-operation/confirm-operation-modal.component.d.ts +10 -10
  234. package/modal/confirm-operation/confirm-operation-modal.component.html +16 -16
  235. package/modal/confirm-operation/confirm-operation-modal.component.js +41 -41
  236. package/modal/confirm-operation/confirm-operation-modal.component.less +58 -58
  237. package/modal/verify-password/verify-password-modal.component.d.ts +18 -18
  238. package/modal/verify-password/verify-password-modal.component.html +22 -22
  239. package/modal/verify-password/verify-password-modal.component.js +66 -66
  240. package/modal/verify-password/verify-password-modal.component.less +65 -65
  241. package/modal/write-character/write-character-modal-args.d.ts +7 -7
  242. package/modal/write-character/write-character-modal-args.js +8 -8
  243. package/modal/write-character/write-character-modal.component.d.ts +25 -25
  244. package/modal/write-character/write-character-modal.component.html +21 -21
  245. package/modal/write-character/write-character-modal.component.js +74 -74
  246. package/modal/write-character/write-character-modal.component.less +49 -49
  247. package/modal/write-value/write-value-modal-args.d.ts +16 -12
  248. package/modal/write-value/write-value-modal-args.js +14 -12
  249. package/modal/write-value/write-value-modal-args.metadata.json +1 -1
  250. package/modal/write-value/write-value-modal.component.d.ts +60 -54
  251. package/modal/write-value/write-value-modal.component.html +26 -21
  252. package/modal/write-value/write-value-modal.component.js +279 -204
  253. package/modal/write-value/write-value-modal.component.less +56 -56
  254. package/modal/write-value/write-value-modal.component.metadata.json +1 -1
  255. package/modal/write-value/write-value-model-result.d.ts +3 -3
  256. package/model/air-quality/air-quality-info.d.ts +23 -0
  257. package/model/air-quality/air-quality-info.js +4 -0
  258. package/model/air-quality/air-quality-info.metadata.json +1 -0
  259. package/model/air-quality/air-quality.model.d.ts +7 -0
  260. package/model/air-quality/air-quality.model.js +0 -0
  261. package/model/air-quality/air-quality.model.metadata.json +1 -0
  262. package/model/alarm/alarm.model.d.ts +13 -0
  263. package/model/alarm/alarm.model.js +0 -0
  264. package/model/alarm/alarm.model.metadata.json +1 -0
  265. package/model/bar-graph/FontStyleData.d.ts +7 -7
  266. package/model/bar-graph/bar-graph-direction.d.ts +6 -6
  267. package/model/bar-graph/bar-graph-direction.js +7 -7
  268. package/model/bar-graph/bar-graph.d.ts +26 -22
  269. package/model/base/base-element-model.d.ts +5 -5
  270. package/model/base/base-element-model.js +2 -2
  271. package/model/base/conditional-control-model.d.ts +6 -6
  272. package/model/base/conditional-display-model.d.ts +9 -9
  273. package/model/base/conditional-dynamic-display-model.d.ts +13 -13
  274. package/model/base/conditional-enable-model.d.ts +9 -9
  275. package/model/base/font-setting-model.d.ts +29 -8
  276. package/model/base/font-setting-model.metadata.json +1 -1
  277. package/model/base/index.d.ts +7 -7
  278. package/model/base/index.js +1 -1
  279. package/model/base/readable-model.d.ts +14 -10
  280. package/model/base/security-model.d.ts +6 -6
  281. package/model/character-display/character-display.d.ts +19 -19
  282. package/model/datetime-display/date-format-type.d.ts +5 -5
  283. package/model/datetime-display/date-format-type.js +6 -6
  284. package/model/datetime-display/datetime-display-settings.d.ts +17 -17
  285. package/model/datetime-display/datetime-display.d.ts +21 -20
  286. package/model/datetime-display/datetime-separator-type.d.ts +6 -6
  287. package/model/datetime-display/datetime-separator-type.js +7 -7
  288. package/model/datetime-display/time-format-type.d.ts +4 -4
  289. package/model/datetime-display/time-format-type.js +5 -5
  290. package/model/historical-curve/curve-type.d.ts +5 -5
  291. package/model/historical-curve/curve-type.js +6 -6
  292. package/model/historical-curve/historical-curve-axis-settings.d.ts +17 -6
  293. package/model/historical-curve/historical-curve-axis-settings.js +5 -0
  294. package/model/historical-curve/historical-curve-axis-settings.metadata.json +1 -1
  295. package/model/historical-curve/historical-curve-chanel.model.d.ts +22 -14
  296. package/model/historical-curve/historical-curve.data-settings.d.ts +9 -9
  297. package/model/historical-curve/historical-curve.display-settings.d.ts +19 -19
  298. package/model/historical-curve/historical-curve.model.d.ts +8 -8
  299. package/model/historical-curve/index.d.ts +4 -4
  300. package/model/hyperlink/hyperlink.model.d.ts +8 -8
  301. package/model/image/image-fill-type.d.ts +4 -4
  302. package/model/image/image-fill-type.js +5 -5
  303. package/model/image/image.d.ts +9 -9
  304. package/model/index.d.ts +15 -15
  305. package/model/index.js +8 -8
  306. package/model/meter/meter.d.ts +17 -13
  307. package/model/numerical-display/index.d.ts +8 -8
  308. package/model/numerical-display/index.js +2 -2
  309. package/model/numerical-display/numerical-display.d.ts +29 -29
  310. package/model/numerical-display/numerical-operation-settings.d.ts +6 -6
  311. package/model/numerical-display/numerical-operation-type.d.ts +4 -4
  312. package/model/numerical-display/numerical-operation-type.js +5 -5
  313. package/model/numerical-display/numerical-operation.d.ts +19 -11
  314. package/model/numerical-display/proportional-conversion.d.ts +4 -4
  315. package/model/numerical-display/type-settings.d.ts +6 -6
  316. package/model/numerical-display/zoom.d.ts +4 -4
  317. package/model/pipe/flow-direction-type.d.ts +4 -4
  318. package/model/pipe/flow-direction-type.js +5 -5
  319. package/model/pipe/index.d.ts +2 -2
  320. package/model/pipe/index.js +1 -1
  321. package/model/pipe/pipe.d.ts +17 -17
  322. package/model/poly-line/poly-line-model.d.ts +4 -4
  323. package/model/polygon/polygon-model.d.ts +4 -4
  324. package/model/ring-graph/ring-graph.model.d.ts +33 -25
  325. package/model/scroll-alarm/scroll-alarm.model.d.ts +21 -0
  326. package/model/scroll-alarm/scroll-alarm.model.js +0 -0
  327. package/model/scroll-alarm/scroll-alarm.model.metadata.json +1 -0
  328. package/model/settings/background/view-background-fill-type.d.ts +5 -5
  329. package/model/settings/background/view-background-fill-type.js +6 -6
  330. package/model/settings/background/view-background.model.d.ts +8 -8
  331. package/model/settings/index.d.ts +3 -3
  332. package/model/settings/index.js +2 -2
  333. package/model/settings/popup/view-popup-backdrop-type.d.ts +4 -4
  334. package/model/settings/popup/view-popup-backdrop-type.js +5 -5
  335. package/model/settings/popup/view-popup-location-type.d.ts +4 -4
  336. package/model/settings/popup/view-popup-location-type.js +5 -5
  337. package/model/settings/popup/view-popup-setting.model.d.ts +17 -17
  338. package/model/settings/popup/view-popup-setting.model.js +2 -2
  339. package/model/settings/view-settings.model.d.ts +6 -6
  340. package/model/shared/alarm/alarm-range.model.d.ts +6 -6
  341. package/model/shared/arc.model.d.ts +4 -4
  342. package/model/shared/binary.d.ts +7 -7
  343. package/model/shared/binary.js +37 -37
  344. package/model/shared/condition/bit-condition-item-observer.d.ts +14 -14
  345. package/model/shared/condition/bit-condition-item-observer.js +53 -53
  346. package/model/shared/condition/bit-condition-logic.d.ts +4 -4
  347. package/model/shared/condition/bit-condition-logic.js +5 -5
  348. package/model/shared/condition/bit-condition-model.d.ts +8 -8
  349. package/model/shared/condition/bit-condition.d.ts +4 -4
  350. package/model/shared/condition/condition-control-result-value.d.ts +5 -5
  351. package/model/shared/condition/condition-helper.d.ts +4 -4
  352. package/model/shared/condition/condition-helper.js +22 -22
  353. package/model/shared/condition/condition-item-model.d.ts +10 -10
  354. package/model/shared/condition/condition-item-observer.d.ts +12 -12
  355. package/model/shared/condition/condition-item-observer.js +14 -14
  356. package/model/shared/condition/condition-items-observer.d.ts +5 -5
  357. package/model/shared/condition/condition-items-result-observer.d.ts +16 -16
  358. package/model/shared/condition/condition-items-result-observer.js +87 -87
  359. package/model/shared/condition/condition-model.d.ts +6 -6
  360. package/model/shared/condition/condition-type.d.ts +4 -4
  361. package/model/shared/condition/condition-type.js +5 -5
  362. package/model/shared/condition/convert-condition-model.d.ts +5 -5
  363. package/model/shared/condition/index.d.ts +11 -11
  364. package/model/shared/condition/index.js +4 -4
  365. package/model/shared/condition/relation-condition-result-state.d.ts +6 -6
  366. package/model/shared/condition/relation-condition-result-state.js +8 -8
  367. package/model/shared/condition/relation-condition-result.d.ts +8 -8
  368. package/model/shared/condition/relation-condition-result.js +7 -7
  369. package/model/shared/condition/relation-type.d.ts +5 -5
  370. package/model/shared/condition/relation-type.js +6 -6
  371. package/model/shared/condition/relational-operator.d.ts +8 -8
  372. package/model/shared/condition/relational-operator.js +9 -9
  373. package/model/shared/condition/variable-value-logic-model.d.ts +11 -11
  374. package/model/shared/condition/variable-value-type.d.ts +4 -4
  375. package/model/shared/condition/variable-value-type.js +5 -5
  376. package/model/shared/condition/word-condition-item-observer.d.ts +21 -21
  377. package/model/shared/condition/word-condition-item-observer.js +165 -165
  378. package/model/shared/condition/word-condition-model.d.ts +8 -8
  379. package/model/shared/condition/word-condition.d.ts +5 -5
  380. package/model/shared/data-type/display-data-type.d.ts +5 -5
  381. package/model/shared/data-type/display-data-type.js +6 -6
  382. package/model/shared/data-type/fbox-data-type.d.ts +15 -15
  383. package/model/shared/data-type/fbox-data-type.js +16 -16
  384. package/model/shared/data-type/fcloud-data-Type.d.ts +8 -8
  385. package/model/shared/data-type/fcloud-data-Type.js +9 -9
  386. package/model/shared/dynamic-display/dynamic-behavior-type.d.ts +5 -5
  387. package/model/shared/dynamic-display/dynamic-behavior-type.js +6 -6
  388. package/model/shared/dynamic-display/dynamic-display-behavior-model.d.ts +5 -5
  389. package/model/shared/dynamic-display/dynamic-display-model.d.ts +10 -10
  390. package/model/shared/dynamic-display/dynamic-display-result-model.d.ts +7 -7
  391. package/model/shared/dynamic-display/dynamic-display-result-model.js +7 -7
  392. package/model/shared/dynamic-display/dynamic-display.d.ts +11 -11
  393. package/model/shared/dynamic-display/dynamic-display.js +35 -35
  394. package/model/shared/graph/custom-style.d.ts +14 -14
  395. package/model/shared/graph/graph-setting.d.ts +10 -10
  396. package/model/shared/index.d.ts +8 -8
  397. package/model/shared/index.js +3 -3
  398. package/model/shared/point.model.d.ts +4 -4
  399. package/model/shared/rotation/rotation-behavior-model.d.ts +4 -4
  400. package/model/shared/rotation/rotation-behavior.d.ts +9 -9
  401. package/model/shared/rotation/rotation-behavior.js +101 -101
  402. package/model/shared/rotation/rotation-direction-type.d.ts +4 -4
  403. package/model/shared/rotation/rotation-direction-type.js +5 -5
  404. package/model/shared/rotation/rotation-model.d.ts +14 -14
  405. package/model/shared/rotation/rotation-observer-model.d.ts +4 -4
  406. package/model/shared/rotation/rotation-observer.d.ts +11 -11
  407. package/model/shared/rotation/rotation-observer.js +28 -28
  408. package/model/shared/scale/scale-mark.model.d.ts +6 -6
  409. package/model/shared/scale/scale-model.d.ts +20 -20
  410. package/model/shared/size.model.d.ts +7 -7
  411. package/model/shared/size.model.js +12 -12
  412. package/model/shared/state/index.d.ts +1 -1
  413. package/model/shared/state/index.js +1 -1
  414. package/model/shared/state/state.d.ts +9 -8
  415. package/model/shared/state/state.js +10 -9
  416. package/model/shared/state/state.metadata.json +1 -1
  417. package/model/shared/text/font.d.ts +10 -10
  418. package/model/shared/text/index.d.ts +2 -2
  419. package/model/shared/text/text.d.ts +8 -5
  420. package/model/shared/translation/translation-behavior-model.d.ts +4 -4
  421. package/model/shared/translation/translation-behavior.d.ts +12 -12
  422. package/model/shared/translation/translation-behavior.js +63 -63
  423. package/model/shared/translation/translation-direction-type.d.ts +4 -4
  424. package/model/shared/translation/translation-direction-type.js +5 -5
  425. package/model/shared/translation/translation-model.d.ts +12 -12
  426. package/model/shared/translation/translation-observer-model.d.ts +4 -4
  427. package/model/shared/translation/translation-observer.d.ts +10 -10
  428. package/model/shared/translation/translation-observer.js +27 -27
  429. package/model/shared/variable/variable-identifier.model.d.ts +5 -5
  430. package/model/shared/variable/variable-name.model.d.ts +5 -5
  431. package/model/straight-line/straight-line-model.d.ts +4 -4
  432. package/model/switch-indicator-light/bit-indicator-light-settings.d.ts +8 -8
  433. package/model/switch-indicator-light/bit-switch-operation.d.ts +6 -6
  434. package/model/switch-indicator-light/bit-switch-operation.js +7 -7
  435. package/model/switch-indicator-light/bit-switch-settings.d.ts +11 -11
  436. package/model/switch-indicator-light/fault-flicker.d.ts +5 -5
  437. package/model/switch-indicator-light/flicker.d.ts +5 -5
  438. package/model/switch-indicator-light/flicker.js +6 -6
  439. package/model/switch-indicator-light/index.d.ts +14 -14
  440. package/model/switch-indicator-light/index.js +5 -5
  441. package/model/switch-indicator-light/indicator-light-fault-flicker.d.ts +5 -5
  442. package/model/switch-indicator-light/indicator-light-settings.d.ts +7 -7
  443. package/model/switch-indicator-light/indicator-light-type.d.ts +4 -4
  444. package/model/switch-indicator-light/indicator-light-type.js +5 -5
  445. package/model/switch-indicator-light/switch-indicator-light.d.ts +35 -33
  446. package/model/switch-indicator-light/switch-indicator-state.d.ts +8 -8
  447. package/model/switch-indicator-light/switch-settings.d.ts +7 -7
  448. package/model/switch-indicator-light/switch-type.d.ts +4 -4
  449. package/model/switch-indicator-light/switch-type.js +5 -5
  450. package/model/switch-indicator-light/word-indicator-light-settings.d.ts +6 -6
  451. package/model/switch-indicator-light/word-switch-operation.d.ts +5 -5
  452. package/model/switch-indicator-light/word-switch-operation.js +6 -6
  453. package/model/switch-indicator-light/word-switch-settings.d.ts +13 -13
  454. package/model/table/table-model.d.ts +9 -9
  455. package/model/text/text.model.d.ts +7 -7
  456. package/model/video/video.model.d.ts +8 -8
  457. package/model/view-operation/index.d.ts +2 -2
  458. package/model/view-operation/index.js +1 -1
  459. package/model/view-operation/view-operation-element.model.d.ts +25 -19
  460. package/model/view-operation/view-operation-type.d.ts +18 -18
  461. package/model/view-operation/view-operation-type.js +19 -19
  462. package/model/weather/weather-info.d.ts +11 -11
  463. package/model/weather/weather-info.js +2 -2
  464. package/model/weather/weather.model.d.ts +7 -7
  465. package/package.json +1 -1
  466. package/public_api.d.ts +14 -14
  467. package/public_api.js +12 -11
  468. package/remote/communication/variable/remote-variable-communicator.d.ts +59 -30
  469. package/remote/communication/variable/remote-variable-communicator.js +395 -215
  470. package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
  471. package/remote/communication/variable/remote-variable-protocol.d.ts +18 -13
  472. package/remote/config/graph/get-released-graph-state-result.d.ts +6 -6
  473. package/remote/config/graph/get-released-graph-states.d.ts +4 -4
  474. package/remote/config/graph/graph-state-key.d.ts +6 -6
  475. package/remote/config/graph/graph-state-result.d.ts +5 -5
  476. package/remote/config/graph/graph-state.d.ts +4 -4
  477. package/remote/config/graph/remote-graph-protocol.d.ts +11 -11
  478. package/remote/config/graph/remote-graph-store.d.ts +16 -16
  479. package/remote/config/graph/remote-graph-store.js +101 -101
  480. package/remote/config/image/remote-image-protocol.d.ts +4 -4
  481. package/remote/config/image/remote-image-store.d.ts +8 -8
  482. package/remote/config/image/remote-image-store.js +19 -19
  483. package/remote/config/view/remote-view-protocol.d.ts +8 -8
  484. package/remote/config/view/remote-view-store.d.ts +13 -13
  485. package/remote/config/view/remote-view-store.js +39 -39
  486. package/remote/config/view/view-result.d.ts +4 -4
  487. package/remote/index.d.ts +14 -14
  488. package/remote/index.js +4 -4
  489. package/security/index.d.ts +1 -1
  490. package/security/security-checker.d.ts +3 -3
  491. package/service/index.d.ts +8 -4
  492. package/service/index.js +1 -0
  493. package/service/index.metadata.json +1 -1
  494. package/service/language.service.d.ts +37 -0
  495. package/service/language.service.js +0 -0
  496. package/service/language.service.metadata.json +1 -0
  497. package/service/operation-record/create-operation-record-args.d.ts +5 -5
  498. package/service/operation-record/index.d.ts +3 -3
  499. package/service/operation-record/operation-record.service.d.ts +4 -4
  500. package/service/operation-record/variable-option.model.d.ts +5 -5
  501. package/service/permission-checker.d.ts +3 -3
  502. package/service/released-variable/index.d.ts +1 -0
  503. package/service/released-variable/index.js +0 -0
  504. package/service/released-variable/index.metadata.json +1 -0
  505. package/service/released-variable/released-variable.service.d.ts +4 -0
  506. package/service/released-variable/released-variable.service.js +0 -0
  507. package/service/released-variable/released-variable.service.metadata.json +1 -0
  508. package/service/system-text-library.service.d.ts +77 -0
  509. package/service/system-text-library.service.js +29 -0
  510. package/service/system-text-library.service.metadata.json +1 -0
  511. package/service/text-library.service.d.ts +49 -0
  512. package/service/text-library.service.js +0 -0
  513. package/service/text-library.service.metadata.json +1 -0
  514. package/service/video/index.d.ts +2 -2
  515. package/service/video/video-url.d.ts +4 -4
  516. package/service/video/video.service.d.ts +4 -4
  517. package/service/weather.service.d.ts +4 -3
  518. package/settings/display-mode.d.ts +10 -10
  519. package/settings/display-mode.js +11 -11
  520. package/settings/global-settings.d.ts +7 -7
  521. package/settings/global-settings.js +13 -13
  522. package/settings/index.d.ts +3 -3
  523. package/settings/index.js +3 -3
  524. package/settings/view-resize-mode.d.ts +10 -10
  525. package/settings/view-resize-mode.js +11 -11
  526. package/shared/config-is-empty-error.d.ts +3 -3
  527. package/shared/config-is-empty-error.js +7 -7
  528. package/shared/disposable.d.ts +3 -3
  529. package/shared/graph-extended-style.d.ts +4 -4
  530. package/shared/gui-consts.d.ts +33 -30
  531. package/shared/gui-consts.js +33 -30
  532. package/shared/gui-consts.metadata.json +1 -1
  533. package/shared/index.d.ts +5 -5
  534. package/shared/index.js +3 -3
  535. package/shared/operation-helper.d.ts +6 -6
  536. package/shared/operation-helper.js +38 -38
  537. package/utils/access-permission.d.ts +5 -5
  538. package/utils/access-permission.js +6 -6
  539. package/utils/access-permission.service.d.ts +11 -11
  540. package/utils/access-permission.service.js +30 -30
  541. package/utils/auto-focus.directive.d.ts +6 -6
  542. package/utils/auto-focus.directive.js +27 -27
  543. package/utils/bs-modal-drag.directive.d.ts +7 -7
  544. package/utils/bs-modal-drag.directive.js +38 -38
  545. package/utils/data-type/data-type.service.d.ts +57 -57
  546. package/utils/data-type/data-type.service.js +155 -155
  547. package/utils/data-type/fbox-data-type.service.d.ts +54 -54
  548. package/utils/data-type/fbox-data-type.service.js +300 -260
  549. package/utils/data-type/fcloud-data-type.service.d.ts +55 -55
  550. package/utils/data-type/fcloud-data-type.service.js +203 -203
  551. package/utils/fraction-digit.service.d.ts +41 -41
  552. package/utils/fraction-digit.service.js +133 -133
  553. package/utils/graph-util.d.ts +5 -5
  554. package/utils/graph-util.js +19 -19
  555. package/utils/guid.d.ts +6 -6
  556. package/utils/guid.js +27 -27
  557. package/utils/index.d.ts +7 -7
  558. package/utils/index.js +7 -7
  559. package/utils/numerical-operation-type.d.ts +4 -4
  560. package/utils/numerical-operation-type.js +5 -5
  561. package/utils/numerical-operation.service.d.ts +17 -17
  562. package/utils/numerical-operation.service.js +201 -177
  563. package/utils/variable-util.d.ts +5 -5
  564. package/utils/variable-util.js +11 -11
  565. package/view/popup-view.service.d.ts +7 -7
  566. package/view/view.service.d.ts +6 -6
  567. package/view/view.service.js +20 -20
@@ -1,361 +1,476 @@
1
- import { LOGGER_SERVICE_TOKEN } from '../../logger';
2
- import { WriteValueModalArgs } from '../../modal/write-value/write-value-modal-args';
3
- import { State, DisplayDataType } from '../../model';
4
- import { AccessPermissionService, DataTypeService, FractionDigitService, NumericalOperationService } from '../../utils';
5
- import { ReadableElement } from '../base/readable-element';
6
- import { GraphStateElement } from '../shared/graph/graph-state-element';
7
- import { TextElementModal } from '../shared/text/text-element';
8
- import { AlertModalComponent } from '../../modal/alert/alert-modal.component';
9
- import { WriteValueModalComponent } from '../../modal/write-value/write-value-modal.component';
10
- import { ConfirmOperationModalComponent } from '../../modal/confirm-operation/confirm-operation-modal.component';
11
- import { VerifyPasswordModalComponent } from '../../modal/verify-password/verify-password-modal.component';
12
- import { isNil } from 'lodash';
13
- import { FCloudDataType } from '../../model/shared/data-type/fcloud-data-Type';
14
- export class NumericalDisplayElement extends ReadableElement {
15
- constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, securityChecker, variableStore, localization, signalRAppId) {
16
- super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
17
- this.modalService = modalService;
18
- this.graphStore = graphStore;
19
- this.operationRecordService = operationRecordService;
20
- this.securityChecker = securityChecker;
21
- this.displayText = '';
22
- this.enableDataParsed = false;
23
- this.logger = injector.get(LOGGER_SERVICE_TOKEN);
24
- this.dataTypeService = injector.get(DataTypeService);
25
- this.fractionDigitService = injector.get(FractionDigitService);
26
- this.accessPermissionService = injector.get(AccessPermissionService);
27
- this.numericalOperationService = injector.get(NumericalOperationService);
28
- if (!isNil(this.model.displayDataType)) {
29
- if (this.model.displayDataType === DisplayDataType.Binary) {
30
- this.model.dataType = FCloudDataType.Binary;
31
- }
32
- if (this.model.displayDataType === DisplayDataType.Hex) {
33
- this.model.dataType = FCloudDataType.Hex;
34
- }
35
- }
36
- // version小于6时是老版本,默认支持数据解析
37
- if (this.model.version < 6 || this.model.enableDataParsed) {
38
- this.enableDataParsed = true;
39
- }
40
- this.initElement();
41
- }
42
- get writeVariableName() {
43
- return this.readVariableName;
44
- }
45
- dispose() {
46
- if (this.displayForeignObject) {
47
- this.displayForeignObject.remove();
48
- }
49
- if (this.$element) {
50
- this.$element.remove();
51
- }
52
- }
53
- initElement() {
54
- const { rootElement } = this;
55
- rootElement.selectAll('*').remove();
56
- let width = null, height = null;
57
- if (this.model.size) {
58
- width = this.model.size.width;
59
- height = this.model.size.height;
60
- }
61
- if (!width || !height) {
62
- width = 60;
63
- height = 38;
64
- }
65
- rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
66
- this.initVariableText(width, height);
67
- this.initGraphAndText(width, height);
68
- if (!this.accessPermissionService.canWrite(this.model.accessPermission) || null == this.model.dataType) {
69
- return;
70
- }
71
- this.rootElement.style('cursor', 'hand');
72
- this.$element.click(__ => {
73
- if (!this.isInitialized) {
74
- return;
75
- }
76
- if (!this.isEnable) {
77
- const message = !this.isGrantedPermission ? this.localization.permissiontip : this.localization.conditionIsNotMetTip;
78
- const modalRef = this.modalService.show(AlertModalComponent, { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
79
- const onClosedSub = modalRef.content.onClosed.subscribe(() => {
80
- modalRef.hide();
81
- onClosedSub.unsubscribe();
82
- });
83
- return;
84
- }
85
- if (this.model.useSecurity) {
86
- const modalRef = this.modalService.show(ConfirmOperationModalComponent, {
87
- backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
88
- });
89
- const onClosedSub = modalRef.content.onClosed.subscribe(result => {
90
- modalRef.hide();
91
- onClosedSub.unsubscribe();
92
- if (result) {
93
- this.checkElementPassword();
94
- }
95
- });
96
- }
97
- else {
98
- this.checkElementPassword();
99
- }
100
- });
101
- }
102
- checkElementPassword() {
103
- if (this.model.enablePassword) {
104
- const modalRef = this.modalService.show(VerifyPasswordModalComponent, { initialState: { securityChecker: this.securityChecker }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
105
- const onClosedSub = modalRef.content.onClosed.subscribe(result => {
106
- modalRef.hide();
107
- onClosedSub.unsubscribe();
108
- if (result) {
109
- this.doWriteValue();
110
- }
111
- });
112
- }
113
- else {
114
- this.doWriteValue();
115
- }
116
- }
117
- initVariableText(width, height) {
118
- if (!this.model.showVariableText) {
119
- return;
120
- }
121
- const font = {
122
- isUnderline: this.model.variableText.font.isUnderline,
123
- isBold: this.model.variableText.font.isBold,
124
- isItalic: this.model.variableText.font.isItalic,
125
- fontSize: this.model.variableText.font.fontSize,
126
- fontFamily: this.model.variableText.font.fontFamily,
127
- color: this.model.variableText.font.color,
128
- textAlign: this.model.variableText.font.textAlign
129
- };
130
- const textElement = new TextElementModal(this.model.variableText.content + ':', font, width * 7 / 11, height, true);
131
- this.$element.append(textElement.Element);
132
- }
133
- initGraphAndText(width, height) {
134
- let translateX = '';
135
- if (this.model.showVariableText) {
136
- translateX = `translate(${width * 7 / 11},0)`;
137
- width = width * 4 / 11;
138
- }
139
- else {
140
- translateX = 'translate(0,0)';
141
- }
142
- if (this.model.useGraph === true) {
143
- const graphStateElement = new GraphStateElement(this.model.graphSetting, width, height, this.graphStore, this.logger);
144
- graphStateElement.Element.setAttribute('transform', translateX);
145
- this.$element.append(graphStateElement.Element);
146
- graphStateElement.switchToState(0);
147
- }
148
- let isUnderline = false;
149
- let isBold = false;
150
- let isItalic = false;
151
- let fontFamily = 'Microsoft YaHei';
152
- if (this.model.font) {
153
- const fontStyle = this.model.font.split(' ');
154
- isUnderline = this.model.isUnderline;
155
- isBold = $.inArray('bold', fontStyle) >= 0;
156
- isItalic = $.inArray('Italic', fontStyle) >= 0;
157
- fontFamily = this.model.font.split(' ').pop();
158
- }
159
- const font = {
160
- isUnderline: isUnderline,
161
- isBold: isBold,
162
- isItalic: isItalic,
163
- fontSize: this.model.fontSize,
164
- fontFamily: fontFamily,
165
- color: this.model.stroke,
166
- textAlign: this.model.textAlign
167
- };
168
- const textElement = new TextElementModal('', font, width, height);
169
- textElement.Element.setAttribute('transform', translateX);
170
- this.$element.append(textElement.Element);
171
- }
172
- doWriteValue() {
173
- if (null == this.writeVariableName) {
174
- return;
175
- }
176
- const args = new WriteValueModalArgs(this.writeVariableName, this.model.dataType, this.model.fBoxDataType, this.model.integerDigits, this.model.fractionDigits, this.numericalOperationService.getNumericalOperations(this.model), this.model.version, this.enableDataParsed);
177
- const modalRef = this.modalService.show(WriteValueModalComponent, {
178
- initialState: { args: args }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
179
- });
180
- const onClosedSub = modalRef.content.onClosed.subscribe(result => {
181
- modalRef.hide();
182
- onClosedSub.unsubscribe();
183
- if (result) {
184
- const writeValue = this.dataTypeService.formatToDecimal(this.model.version, result.value, this.model.dataType);
185
- this.variableCommunicator.write(this.writeVariableName, writeValue).subscribe();
186
- this.recordOperation(result.value);
187
- }
188
- });
189
- }
190
- recordOperation(newValue) {
191
- if (this.model.isRecordOperation || this.model.isRecordOperation === undefined) {
192
- this.operationRecordService.record({
193
- variableOptionModel: {
194
- variableName: this.writeVariableName,
195
- originValue: this.formatDisplayTextUnit(this.displayText),
196
- newValue: this.formatDisplayTextUnit(this.formatNumericalDisplayText(this.model.dataType, this.model.fractionDigits, newValue))
197
- },
198
- operationDescription: this.model.operationDescription
199
- });
200
- }
201
- }
202
- changeStates() {
203
- super.changeStates();
204
- if (this.state === State.Normal || this.state === State.Disable) {
205
- this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
206
- }
207
- else {
208
- if (this.preState !== this.state) {
209
- this.updateDisplayText('');
210
- }
211
- }
212
- }
213
- updateVariableValue(value) {
214
- this.displayText = this.formatNumericalDisplayText(this.model.dataType, this.model.fractionDigits, value);
215
- this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
216
- }
217
- updateDisplayText(text) {
218
- if (!this.displayForeignObject) {
219
- if (this.model.showVariableText) {
220
- this.displayForeignObject = this.$element.find('foreignObject').eq(1);
221
- }
222
- else {
223
- this.displayForeignObject = this.$element.find('foreignObject').eq(0);
224
- }
225
- }
226
- if (isNil(text)) {
227
- this.displayForeignObject.remove();
228
- }
229
- else {
230
- const textList = this.displayForeignObject.find('.text-list');
231
- const textArray = text.toString().split('\n');
232
- if (textList.length === textArray.length) {
233
- for (let index = 0; index < textList.length; index++) {
234
- textList[index].innerText = textArray[index];
235
- }
236
- }
237
- else {
238
- this.displayForeignObject.remove();
239
- const width = this.displayForeignObject.attr('width');
240
- const height = this.displayForeignObject.attr('height');
241
- const transform = this.displayForeignObject.attr('transform');
242
- this.displayForeignObject = $(this.rebuildTextElement(width, height, transform, text));
243
- }
244
- }
245
- }
246
- rebuildTextElement(width, height, transform, text) {
247
- let isUnderline = false;
248
- let isBold = false;
249
- let isItalic = false;
250
- let fontFamily = 'Microsoft YaHei';
251
- if (this.model.font) {
252
- const fontStyle = this.model.font.split(' ');
253
- isUnderline = this.model.isUnderline;
254
- isBold = $.inArray('bold', fontStyle) >= 0;
255
- isItalic = $.inArray('Italic', fontStyle) >= 0;
256
- fontFamily = this.model.font.split(' ').pop();
257
- }
258
- const font = {
259
- isUnderline: isUnderline,
260
- isBold: isBold,
261
- isItalic: isItalic,
262
- fontSize: this.model.fontSize,
263
- fontFamily: fontFamily,
264
- color: this.model.stroke,
265
- textAlign: this.model.textAlign
266
- };
267
- const textElement = new TextElementModal(text, font, Number(width), Number(height));
268
- textElement.Element.setAttribute('transform', transform);
269
- this.$element.append(textElement.Element);
270
- return textElement.Element;
271
- }
272
- formatNumericalDisplayText(dataType, fractionDigits, value) {
273
- if (null == value || value.toString().trim().length <= 0) {
274
- return '';
275
- }
276
- value = +value;
277
- // 16进制数
278
- if (this.dataTypeService.isHexType(this.model.version, dataType)) {
279
- // eslint-disable-next-line no-bitwise
280
- return (value >>> 0).toString(16).toUpperCase();
281
- }
282
- // 2进制
283
- if (this.dataTypeService.isBinaryType(this.model.version, dataType)) {
284
- // eslint-disable-next-line no-bitwise
285
- const formatValue = (value >>> 0).toString(2);
286
- if (formatValue.length < 17) {
287
- return formatValue;
288
- }
289
- const constOne = '1111111111111111';
290
- if (formatValue.indexOf(constOne) === 0) {
291
- return formatValue.replace(constOne, '');
292
- }
293
- const constZero = '0000000000000000';
294
- if (formatValue.indexOf(constZero) === 0) {
295
- return formatValue.replace(constZero, '');
296
- }
297
- return formatValue;
298
- }
299
- if (!this.isNumeric(value) || null == fractionDigits || fractionDigits < 0) {
300
- return value;
301
- }
302
- // 数据解析
303
- if (!this.enableDataParsed) {
304
- return value;
305
- }
306
- const supportFractionDigits = this.dataTypeService.isSupportFractionDigit(this.model.version, dataType);
307
- if (!supportFractionDigits) {
308
- return value;
309
- }
310
- // 数值运算
311
- if (this.dataTypeService.isSupportNumericalOperation(this.model.version, dataType)) {
312
- if (this.model.enableNumericalOperation && this.isNumeric(value)) {
313
- return this.numericalOperationService.getNumericalOperationedValue(this.model, value, fractionDigits);
314
- }
315
- }
316
- // 浮点数
317
- if (this.dataTypeService.isFloat(this.model.version, dataType)) {
318
- return this.formatFloatDisplayText(fractionDigits, value);
319
- }
320
- // 有符号数及无符号数
321
- if (fractionDigits === 0) {
322
- return value;
323
- }
324
- let displayText = Number(value).toFixed(0).toString();
325
- const isNegative = +displayText < 0;
326
- if (isNegative) {
327
- displayText = displayText.slice(1, displayText.length);
328
- }
329
- if (displayText.length > fractionDigits) {
330
- const dotPosition = displayText.length - fractionDigits;
331
- displayText = displayText.substr(0, dotPosition) + '.' + displayText.substr(dotPosition);
332
- }
333
- else {
334
- const fillZeroCount = fractionDigits - displayText.length;
335
- for (let i = 0; i < fillZeroCount; i++) {
336
- displayText = `0${displayText}`;
337
- }
338
- displayText = `0.${displayText}`;
339
- }
340
- return isNegative ? `-${displayText}` : displayText;
341
- }
342
- formatFloatDisplayText(fractionDigits, text) {
343
- let value = Number(text);
344
- if (!isNil(fractionDigits)) {
345
- value = +value.toFixed(fractionDigits + 2);
346
- }
347
- else {
348
- return value.toFixed(0);
349
- }
350
- return this.fractionDigitService.roundingToFixedFractionDigits(value, fractionDigits);
351
- }
352
- isNumeric(num) {
353
- return !isNaN(num);
354
- }
355
- formatDisplayTextUnit(displayText) {
356
- if (this.model.showUnit !== false && this.model.unit) {
357
- return `${displayText} ${this.model.unit}`;
358
- }
359
- return displayText;
360
- }
361
- }
1
+ import { LOGGER_SERVICE_TOKEN } from '../../logger';
2
+ import { WriteValueModalArgs } from '../../modal/write-value/write-value-modal-args';
3
+ import { State, DisplayDataType } from '../../model';
4
+ import { AccessPermissionService, DataTypeService, FractionDigitService, NumericalOperationService } from '../../utils';
5
+ import { ReadableElement } from '../base/readable-element';
6
+ import { GraphStateElement } from '../shared/graph/graph-state-element';
7
+ import { TextElementModal } from '../shared/text/text-element';
8
+ import { AlertModalComponent } from '../../modal/alert/alert-modal.component';
9
+ import { WriteValueModalComponent } from '../../modal/write-value/write-value-modal.component';
10
+ import { ConfirmOperationModalComponent } from '../../modal/confirm-operation/confirm-operation-modal.component';
11
+ import { VerifyPasswordModalComponent } from '../../modal/verify-password/verify-password-modal.component';
12
+ import { isNil } from 'lodash';
13
+ import { FCloudDataType } from '../../model/shared/data-type/fcloud-data-Type';
14
+ var variableRwTypeEnum;
15
+ (function (variableRwTypeEnum) {
16
+ variableRwTypeEnum[variableRwTypeEnum["read"] = 4] = "read";
17
+ variableRwTypeEnum[variableRwTypeEnum["witer"] = 2] = "witer";
18
+ variableRwTypeEnum[variableRwTypeEnum["readWiter"] = 6] = "readWiter";
19
+ })(variableRwTypeEnum || (variableRwTypeEnum = {}));
20
+ export class NumericalDisplayElement extends ReadableElement {
21
+ constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, releasedVariableService, securityChecker, variableStore, localization, signalRAppId, guiContext) {
22
+ super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
23
+ this.modalService = modalService;
24
+ this.graphStore = graphStore;
25
+ this.operationRecordService = operationRecordService;
26
+ this.releasedVariableService = releasedVariableService;
27
+ this.securityChecker = securityChecker;
28
+ this.guiContext = guiContext;
29
+ this.displayText = '';
30
+ this.enableDataParsed = false;
31
+ // 上下限变量的实时缓存值(仅当上下限配置为变量类型时使用)
32
+ this._resolvedUpperLimitValue = undefined;
33
+ this._resolvedLowerLimitValue = undefined;
34
+ this.logger = injector.get(LOGGER_SERVICE_TOKEN);
35
+ this.dataTypeService = injector.get(DataTypeService);
36
+ this.fractionDigitService = injector.get(FractionDigitService);
37
+ this.accessPermissionService = injector.get(AccessPermissionService);
38
+ this.numericalOperationService = injector.get(NumericalOperationService);
39
+ if (!isNil(this.model.displayDataType)) {
40
+ if (this.model.displayDataType === DisplayDataType.Binary) {
41
+ this.model.dataType = FCloudDataType.Binary;
42
+ }
43
+ if (this.model.displayDataType === DisplayDataType.Hex) {
44
+ this.model.dataType = FCloudDataType.Hex;
45
+ }
46
+ }
47
+ // version小于6时是老版本,默认支持数据解析
48
+ if (this.model.version < 6 || this.model.enableDataParsed) {
49
+ this.enableDataParsed = true;
50
+ }
51
+ this.initElement();
52
+ }
53
+ /** 当数值上限配置为变量类型时,返回变量名;否则返回 undefined */
54
+ get upperLimitVariableName() {
55
+ const upper = this.model.numericalUpperLimit;
56
+ if (upper && typeof upper === 'object' && upper.type === 1 && upper.variableName) {
57
+ return upper.variableName;
58
+ }
59
+ return undefined;
60
+ }
61
+ /** 当数值下限配置为变量类型时,返回变量名;否则返回 undefined */
62
+ get lowerLimitVariableName() {
63
+ const lower = this.model.numericalLowerLimit;
64
+ if (lower && typeof lower === 'object' && lower.type === 1 && lower.variableName) {
65
+ return lower.variableName;
66
+ }
67
+ return undefined;
68
+ }
69
+ get writeVariableName() {
70
+ return this.readVariableName;
71
+ }
72
+ dispose() {
73
+ if (this.displayForeignObject) {
74
+ this.displayForeignObject.remove();
75
+ }
76
+ if (this.$element) {
77
+ this.$element.remove();
78
+ }
79
+ }
80
+ /**
81
+ * 重写父类方法,处理"当前语种ID"系统变量
82
+ * 当值为null时,显示默认语种ID
83
+ */
84
+ reportValueChanged(value) {
85
+ var _a, _b, _c;
86
+ // 拦截上下限变量推送,更新缓存值
87
+ if (this.upperLimitVariableName && value.variableName === this.upperLimitVariableName) {
88
+ const num = Number(value.value);
89
+ this._resolvedUpperLimitValue = (value.value != null && !isNaN(num)) ? num : undefined;
90
+ return;
91
+ }
92
+ if (this.lowerLimitVariableName && value.variableName === this.lowerLimitVariableName) {
93
+ const num = Number(value.value);
94
+ this._resolvedLowerLimitValue = (value.value != null && !isNaN(num)) ? num : undefined;
95
+ return;
96
+ }
97
+ // 处理系统变量"当前语种ID"
98
+ if (value.variableName === '当前语种ID') {
99
+ let displayValue = value.value;
100
+ // 如果值为null,使用默认语种ID
101
+ if (displayValue === null || displayValue === undefined) {
102
+ displayValue = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getDefaultLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : 0;
103
+ }
104
+ this.updateVariableValue(displayValue);
105
+ return;
106
+ }
107
+ // 其他变量调用父类方法
108
+ super.reportValueChanged(value);
109
+ }
110
+ initElement() {
111
+ const { rootElement } = this;
112
+ rootElement.selectAll('*').remove();
113
+ let width = null, height = null;
114
+ if (this.model.size) {
115
+ width = this.model.size.width;
116
+ height = this.model.size.height;
117
+ }
118
+ if (!width || !height) {
119
+ width = 60;
120
+ height = 38;
121
+ }
122
+ rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
123
+ this.initVariableText(width, height);
124
+ this.initGraphAndText(width, height);
125
+ if (!this.accessPermissionService.canWrite(this.model.accessPermission) || null == this.model.dataType) {
126
+ return;
127
+ }
128
+ this.rootElement.style('cursor', 'hand');
129
+ this.$element.click(__ => {
130
+ if (!this.isInitialized) {
131
+ return;
132
+ }
133
+ if (!this.isEnable) {
134
+ const message = !this.isGrantedPermission ? this.localization.permissiontip : this.localization.conditionIsNotMetTip;
135
+ const modalRef = this.modalService.show(AlertModalComponent, { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
136
+ const onClosedSub = modalRef.content.onClosed.subscribe(() => {
137
+ modalRef.hide();
138
+ onClosedSub.unsubscribe();
139
+ });
140
+ return;
141
+ }
142
+ if (this.model.useSecurity) {
143
+ const modalRef = this.modalService.show(ConfirmOperationModalComponent, {
144
+ backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
145
+ });
146
+ const onClosedSub = modalRef.content.onClosed.subscribe(result => {
147
+ modalRef.hide();
148
+ onClosedSub.unsubscribe();
149
+ if (result) {
150
+ this.checkElementPassword();
151
+ }
152
+ });
153
+ }
154
+ else {
155
+ this.checkElementPassword();
156
+ }
157
+ });
158
+ }
159
+ checkElementPassword() {
160
+ if (this.model.enablePassword) {
161
+ const modalRef = this.modalService.show(VerifyPasswordModalComponent, { initialState: { securityChecker: this.securityChecker }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
162
+ const onClosedSub = modalRef.content.onClosed.subscribe(result => {
163
+ modalRef.hide();
164
+ onClosedSub.unsubscribe();
165
+ if (result) {
166
+ this.doWriteValue();
167
+ }
168
+ });
169
+ }
170
+ else {
171
+ this.doWriteValue();
172
+ }
173
+ }
174
+ initVariableText(width, height) {
175
+ if (!this.model.showVariableText) {
176
+ return;
177
+ }
178
+ const font = {
179
+ isUnderline: this.model.variableText.font.isUnderline,
180
+ isBold: this.model.variableText.font.isBold,
181
+ isItalic: this.model.variableText.font.isItalic,
182
+ fontSize: this.model.variableText.font.fontSize,
183
+ fontFamily: this.model.variableText.font.fontFamily,
184
+ color: this.model.variableText.font.color,
185
+ textAlign: this.model.variableText.font.textAlign
186
+ };
187
+ const textElement = new TextElementModal(this.model.variableText.content + ':', font, width * 7 / 11, height, true);
188
+ this.$element.append(textElement.Element);
189
+ }
190
+ initGraphAndText(width, height) {
191
+ let translateX = '';
192
+ if (this.model.showVariableText) {
193
+ translateX = `translate(${width * 7 / 11},0)`;
194
+ width = width * 4 / 11;
195
+ }
196
+ else {
197
+ translateX = 'translate(0,0)';
198
+ }
199
+ if (this.model.useGraph === true) {
200
+ const graphStateElement = new GraphStateElement(this.model.graphSetting, width, height, this.graphStore, this.logger);
201
+ graphStateElement.Element.setAttribute('transform', translateX);
202
+ this.$element.append(graphStateElement.Element);
203
+ graphStateElement.switchToState(0);
204
+ }
205
+ let isUnderline = false;
206
+ let isBold = false;
207
+ let isItalic = false;
208
+ let fontFamily = 'Microsoft YaHei';
209
+ if (this.model.font) {
210
+ const fontStyle = this.model.font.split(' ');
211
+ isUnderline = this.model.isUnderline;
212
+ isBold = $.inArray('bold', fontStyle) >= 0;
213
+ isItalic = $.inArray('Italic', fontStyle) >= 0;
214
+ fontFamily = this.model.font.split(' ').pop();
215
+ }
216
+ const font = {
217
+ isUnderline: isUnderline,
218
+ isBold: isBold,
219
+ isItalic: isItalic,
220
+ fontSize: this.model.fontSize,
221
+ fontFamily: fontFamily,
222
+ color: this.model.stroke,
223
+ textAlign: this.model.textAlign
224
+ };
225
+ const textElement = new TextElementModal('', font, width, height);
226
+ textElement.Element.setAttribute('transform', translateX);
227
+ this.$element.append(textElement.Element);
228
+ }
229
+ doWriteValue() {
230
+ if (null == this.writeVariableName) {
231
+ return;
232
+ }
233
+ // 获取数值操作配置,上下限变量类型已在 reportValueChanged 中实时更新到缓存
234
+ const numericalOperation = this.numericalOperationService.getNumericalOperations(this.model);
235
+ // 用缓存的实时值替换变量类型上下限
236
+ if (typeof numericalOperation.numericalUpperLimit === 'object' && numericalOperation.numericalUpperLimit.type === 1) {
237
+ numericalOperation.numericalUpperLimit = this._resolvedUpperLimitValue != null
238
+ ? this._resolvedUpperLimitValue
239
+ : (this.dataTypeService.getMaxValue(this.model.version || 0, this.model.dataType || 0, this.model.fBoxDataType || 0) || 0);
240
+ }
241
+ if (typeof numericalOperation.numericalLowerLimit === 'object' && numericalOperation.numericalLowerLimit.type === 1) {
242
+ numericalOperation.numericalLowerLimit = this._resolvedLowerLimitValue != null
243
+ ? this._resolvedLowerLimitValue
244
+ : (this.dataTypeService.getMinValue(this.model.version || 0, this.model.dataType || 0, this.model.fBoxDataType || 0) || 0);
245
+ }
246
+ const args = new WriteValueModalArgs(this.writeVariableName, this.model.dataType, this.model.fBoxDataType, this.model.integerDigits, this.model.fractionDigits, numericalOperation, this.model.version, this.enableDataParsed, this.releasedVariableService, this.guiContext);
247
+ this.writeValueMmodalRef = this.modalService.show(WriteValueModalComponent, {
248
+ initialState: { args: args }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
249
+ });
250
+ this.writeValueMmodalRef.content.onClosed = (result) => {
251
+ if (result) {
252
+ if (this.restorationTimer) {
253
+ clearTimeout(this.restorationTimer);
254
+ this.restorationTimer = undefined;
255
+ }
256
+ this.recordValue = result.value;
257
+ const writeValue = this.dataTypeService.formatToDecimal(this.model.version, result.value, this.model.dataType);
258
+ this.showValue = result.showValue;
259
+ // 如果是系统变量"当前语种ID",只更新显示,不执行变量写入和操作记录
260
+ if (this.writeVariableName === '当前语种ID') {
261
+ // 直接更新显示值
262
+ this.displayText = this.showValue;
263
+ this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
264
+ this.writeValueMmodalRef.hide();
265
+ return;
266
+ }
267
+ if (this.displayText !== this.showValue || result.variableRwType === variableRwTypeEnum.witer) {
268
+ if (this.numericalOperation || result.enableNumericalOperation || result.isNumericalOperation || result.variableRwType === variableRwTypeEnum.witer) {
269
+ this.recordOperation(result.value);
270
+ this.writeValueMmodalRef.hide();
271
+ }
272
+ else {
273
+ this.restorationTimer = setTimeout(() => {
274
+ const isEquation = this.model.fractionDigits ?
275
+ parseFloat(this.displayText) === parseFloat(this.showValue) :
276
+ parseInt(this.displayText, 16) === parseInt(this.showValue, 16);
277
+ if (!isEquation) {
278
+ this.writeValueMmodalRef.content.isSubmitting = false;
279
+ this.writeValueMmodalRef.content.showValidationErrorInfo(this.localization.writeValueTimeout);
280
+ }
281
+ }, 30000);
282
+ }
283
+ this.variableCommunicator.write(this.writeVariableName, writeValue).subscribe();
284
+ }
285
+ else {
286
+ this.writeValueMmodalRef.hide();
287
+ }
288
+ }
289
+ };
290
+ }
291
+ recordOperation(newValue) {
292
+ if (this.model.isRecordOperation || this.model.isRecordOperation === undefined) {
293
+ this.operationRecordService.record({
294
+ variableOptionModel: {
295
+ variableName: this.writeVariableName,
296
+ originValue: this.formatDisplayTextUnit(this.displayText),
297
+ newValue: this.formatDisplayTextUnit(this.formatNumericalDisplayText(this.model.dataType, this.model.fractionDigits, newValue))
298
+ },
299
+ operationDescription: this.model.operationDescription
300
+ });
301
+ }
302
+ }
303
+ changeStates() {
304
+ super.changeStates();
305
+ if (this.state === State.Normal || this.state === State.Disable) {
306
+ this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
307
+ }
308
+ else {
309
+ if (this.preState !== this.state) {
310
+ this.updateDisplayText('');
311
+ }
312
+ }
313
+ }
314
+ updateVariableValue(value) {
315
+ var _a;
316
+ const displayText = this.formatNumericalDisplayText(this.model.dataType, this.model.fractionDigits, value);
317
+ const isEquation = this.model.fractionDigits ?
318
+ parseFloat(displayText) === parseFloat(this.showValue) :
319
+ parseInt(displayText, 16) === parseInt(this.showValue, 16);
320
+ if (((_a = this.writeValueMmodalRef) === null || _a === void 0 ? void 0 : _a.content) && isEquation) {
321
+ if (this.restorationTimer) {
322
+ clearTimeout(this.restorationTimer);
323
+ this.restorationTimer = undefined;
324
+ this.recordOperation(this.recordValue);
325
+ }
326
+ this.writeValueMmodalRef.hide();
327
+ this.writeValueMmodalRef.content.hideValidationErrorInfo();
328
+ }
329
+ this.displayText = displayText;
330
+ this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
331
+ }
332
+ updateDisplayText(text) {
333
+ if (!this.displayForeignObject) {
334
+ if (this.model.showVariableText) {
335
+ this.displayForeignObject = this.$element.find('foreignObject').eq(1);
336
+ }
337
+ else {
338
+ this.displayForeignObject = this.$element.find('foreignObject').eq(0);
339
+ }
340
+ }
341
+ if (isNil(text)) {
342
+ this.displayForeignObject.remove();
343
+ }
344
+ else {
345
+ const textList = this.displayForeignObject.find('.text-list');
346
+ const textArray = text.toString().split('\n');
347
+ if (textList.length === textArray.length) {
348
+ for (let index = 0; index < textList.length; index++) {
349
+ textList[index].innerText = textArray[index];
350
+ }
351
+ }
352
+ else {
353
+ this.displayForeignObject.remove();
354
+ const width = this.displayForeignObject.attr('width');
355
+ const height = this.displayForeignObject.attr('height');
356
+ const transform = this.displayForeignObject.attr('transform');
357
+ this.displayForeignObject = $(this.rebuildTextElement(width, height, transform, text));
358
+ }
359
+ }
360
+ }
361
+ rebuildTextElement(width, height, transform, text) {
362
+ let isUnderline = false;
363
+ let isBold = false;
364
+ let isItalic = false;
365
+ let fontFamily = 'Microsoft YaHei';
366
+ if (this.model.font) {
367
+ const fontStyle = this.model.font.split(' ');
368
+ isUnderline = this.model.isUnderline;
369
+ isBold = $.inArray('bold', fontStyle) >= 0;
370
+ isItalic = $.inArray('Italic', fontStyle) >= 0;
371
+ fontFamily = this.model.font.split(' ').pop();
372
+ }
373
+ const font = {
374
+ isUnderline: isUnderline,
375
+ isBold: isBold,
376
+ isItalic: isItalic,
377
+ fontSize: this.model.fontSize,
378
+ fontFamily: fontFamily,
379
+ color: this.model.stroke,
380
+ textAlign: this.model.textAlign
381
+ };
382
+ const textElement = new TextElementModal(text, font, Number(width), Number(height));
383
+ textElement.Element.setAttribute('transform', transform);
384
+ this.$element.append(textElement.Element);
385
+ return textElement.Element;
386
+ }
387
+ formatNumericalDisplayText(dataType, fractionDigits, value) {
388
+ if (null == value || value.toString().trim().length <= 0) {
389
+ return '';
390
+ }
391
+ value = +value;
392
+ // 16进制数
393
+ if (this.dataTypeService.isHexType(this.model.version, dataType)) {
394
+ // eslint-disable-next-line no-bitwise
395
+ return (value >>> 0).toString(16).toUpperCase();
396
+ }
397
+ // 2进制
398
+ if (this.dataTypeService.isBinaryType(this.model.version, dataType)) {
399
+ // eslint-disable-next-line no-bitwise
400
+ const formatValue = (value >>> 0).toString(2);
401
+ if (formatValue.length < 17) {
402
+ return formatValue;
403
+ }
404
+ const constOne = '1111111111111111';
405
+ if (formatValue.indexOf(constOne) === 0) {
406
+ return formatValue.replace(constOne, '');
407
+ }
408
+ const constZero = '0000000000000000';
409
+ if (formatValue.indexOf(constZero) === 0) {
410
+ return formatValue.replace(constZero, '');
411
+ }
412
+ return formatValue;
413
+ }
414
+ if (!this.isNumeric(value) || null == fractionDigits || fractionDigits < 0) {
415
+ return value;
416
+ }
417
+ // 数据解析
418
+ if (!this.enableDataParsed) {
419
+ return value;
420
+ }
421
+ const supportFractionDigits = this.dataTypeService.isSupportFractionDigit(this.model.version, dataType);
422
+ if (!supportFractionDigits) {
423
+ return value;
424
+ }
425
+ // 数值运算
426
+ if (this.dataTypeService.isSupportNumericalOperation(this.model.version, dataType)) {
427
+ if (this.model.enableNumericalOperation && this.isNumeric(value)) {
428
+ return this.numericalOperationService.getNumericalOperationedValue(this.model, value, fractionDigits);
429
+ }
430
+ }
431
+ // 浮点数
432
+ if (this.dataTypeService.isFloat(this.model.version, dataType)) {
433
+ return this.formatFloatDisplayText(fractionDigits, value);
434
+ }
435
+ // 有符号数及无符号数
436
+ if (fractionDigits === 0) {
437
+ return value;
438
+ }
439
+ let displayText = Number(value).toFixed(0).toString();
440
+ const isNegative = +displayText < 0;
441
+ if (isNegative) {
442
+ displayText = displayText.slice(1, displayText.length);
443
+ }
444
+ if (displayText.length > fractionDigits) {
445
+ const dotPosition = displayText.length - fractionDigits;
446
+ displayText = displayText.substr(0, dotPosition) + '.' + displayText.substr(dotPosition);
447
+ }
448
+ else {
449
+ const fillZeroCount = fractionDigits - displayText.length;
450
+ for (let i = 0; i < fillZeroCount; i++) {
451
+ displayText = `0${displayText}`;
452
+ }
453
+ displayText = `0.${displayText}`;
454
+ }
455
+ return isNegative ? `-${displayText}` : displayText;
456
+ }
457
+ formatFloatDisplayText(fractionDigits, text) {
458
+ let value = Number(text);
459
+ if (!isNil(fractionDigits)) {
460
+ value = +value.toFixed(fractionDigits + 2);
461
+ }
462
+ else {
463
+ return value.toFixed(0);
464
+ }
465
+ return this.fractionDigitService.roundingToFixedFractionDigits(value, fractionDigits);
466
+ }
467
+ isNumeric(num) {
468
+ return !isNaN(num);
469
+ }
470
+ formatDisplayTextUnit(displayText) {
471
+ if (this.model.showUnit !== false && this.model.unit) {
472
+ return `${displayText || 0} ${this.model.unit}`;
473
+ }
474
+ return displayText;
475
+ }
476
+ }