@flexem/fc-gui 3.0.0-alpha.7 → 3.0.0-alpha.71

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 (227) hide show
  1. package/CHANGELOG.md +301 -0
  2. package/bundles/@flexem/fc-gui.umd.js +18503 -17019
  3. package/bundles/@flexem/fc-gui.umd.js.map +1 -1
  4. package/bundles/@flexem/fc-gui.umd.min.js +5 -5
  5. package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
  6. package/communication/variable/variable-communicator.d.ts +3 -2
  7. package/config/alarm/alarm.store.d.ts +6 -0
  8. package/config/alarm/alarm.store.js +0 -0
  9. package/config/alarm/alarm.store.metadata.json +1 -0
  10. package/config/alarm/get-alarms-args.d.ts +9 -0
  11. package/config/alarm/get-alarms-args.js +9 -0
  12. package/config/alarm/get-alarms-args.metadata.json +1 -0
  13. package/config/alarm/index.d.ts +2 -0
  14. package/config/alarm/index.js +1 -0
  15. package/config/alarm/index.metadata.json +1 -0
  16. package/config/config-store.d.ts +2 -0
  17. package/config/index.d.ts +1 -0
  18. package/config/index.js +1 -0
  19. package/config/index.metadata.json +1 -1
  20. package/elements/air-quality/air-quality-element.d.ts +31 -0
  21. package/elements/air-quality/air-quality-element.js +194 -0
  22. package/elements/air-quality/air-quality-element.metadata.json +1 -0
  23. package/elements/alarm/alarm-element.d.ts +39 -0
  24. package/elements/alarm/alarm-element.js +300 -0
  25. package/elements/alarm/alarm-element.metadata.json +1 -0
  26. package/elements/alarm/alarm-state-enum.d.ts +4 -0
  27. package/elements/alarm/alarm-state-enum.js +5 -0
  28. package/elements/alarm/alarm-state-enum.metadata.json +1 -0
  29. package/elements/bar-graph-element.d.ts +8 -2
  30. package/elements/bar-graph-element.js +72 -6
  31. package/elements/bar-graph-element.metadata.json +1 -1
  32. package/elements/base/base-element.d.ts +2 -1
  33. package/elements/base/base-element.js +2 -1
  34. package/elements/base/base-element.metadata.json +1 -1
  35. package/elements/base/conditional-control-element.d.ts +1 -1
  36. package/elements/base/conditional-control-element.js +3 -3
  37. package/elements/base/conditional-control-element.metadata.json +1 -1
  38. package/elements/base/conditional-display-element.d.ts +1 -1
  39. package/elements/base/conditional-display-element.js +4 -4
  40. package/elements/base/conditional-display-element.metadata.json +1 -1
  41. package/elements/base/conditional-dynamic-display-element.d.ts +1 -1
  42. package/elements/base/conditional-dynamic-display-element.js +3 -3
  43. package/elements/base/conditional-dynamic-display-element.metadata.json +1 -1
  44. package/elements/base/conditional-enable-element.d.ts +1 -1
  45. package/elements/base/conditional-enable-element.js +4 -4
  46. package/elements/base/conditional-enable-element.metadata.json +1 -1
  47. package/elements/base/readable-element.d.ts +7 -2
  48. package/elements/base/readable-element.js +33 -4
  49. package/elements/base/readable-element.metadata.json +1 -1
  50. package/elements/base/state-control-element.d.ts +1 -1
  51. package/elements/base/state-control-element.js +2 -2
  52. package/elements/base/state-control-element.metadata.json +1 -1
  53. package/elements/character-display/character-display-element.d.ts +1 -1
  54. package/elements/character-display/character-display-element.js +2 -2
  55. package/elements/character-display/character-display-element.metadata.json +1 -1
  56. package/elements/datetime-display/datetime-display-element.d.ts +1 -1
  57. package/elements/datetime-display/datetime-display-element.js +2 -2
  58. package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
  59. package/elements/historical-curve/historical-curve.element.d.ts +1 -1
  60. package/elements/historical-curve/historical-curve.element.js +104 -15
  61. package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
  62. package/elements/main-element.d.ts +2 -1
  63. package/elements/main-element.js +48 -26
  64. package/elements/main-element.metadata.json +1 -1
  65. package/elements/meter-element.d.ts +8 -2
  66. package/elements/meter-element.js +78 -9
  67. package/elements/meter-element.metadata.json +1 -1
  68. package/elements/numerical-display/numerical-display-element.d.ts +8 -2
  69. package/elements/numerical-display/numerical-display-element.js +47 -11
  70. package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
  71. package/elements/per-view-variable-communicator.d.ts +4 -2
  72. package/elements/per-view-variable-communicator.js +12 -4
  73. package/elements/per-view-variable-communicator.metadata.json +1 -1
  74. package/elements/pipe/pipe-element.d.ts +1 -1
  75. package/elements/pipe/pipe-element.js +2 -2
  76. package/elements/pipe/pipe-element.metadata.json +1 -1
  77. package/elements/ring-graph/ring-graph-element.d.ts +11 -2
  78. package/elements/ring-graph/ring-graph-element.js +108 -5
  79. package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
  80. package/elements/shared/graph/graph-state-element.js +0 -3
  81. package/elements/shared/text/text-element.js +13 -2
  82. package/elements/shared/text/text-state-element.js +1 -1
  83. package/elements/static-elements/hyperlink-element.d.ts +1 -1
  84. package/elements/static-elements/hyperlink-element.js +2 -2
  85. package/elements/static-elements/hyperlink-element.metadata.json +1 -1
  86. package/elements/static-elements/image-element.d.ts +1 -1
  87. package/elements/static-elements/image-element.js +2 -2
  88. package/elements/static-elements/image-element.metadata.json +1 -1
  89. package/elements/static-elements/text-element.d.ts +1 -1
  90. package/elements/static-elements/text-element.js +2 -2
  91. package/elements/static-elements/text-element.metadata.json +1 -1
  92. package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +1 -1
  93. package/elements/switch-indicator-light/bit-indicator-light-operator.js +4 -4
  94. package/elements/switch-indicator-light/bit-switch-operator.d.ts +3 -1
  95. package/elements/switch-indicator-light/bit-switch-operator.js +22 -2
  96. package/elements/switch-indicator-light/bit-switch-operator.metadata.json +1 -1
  97. package/elements/switch-indicator-light/indicator-light-operator.d.ts +1 -1
  98. package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +9 -1
  99. package/elements/switch-indicator-light/switch-indicator-light-element.js +97 -28
  100. package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
  101. package/elements/switch-indicator-light/switch-operator.d.ts +1 -0
  102. package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +1 -1
  103. package/elements/switch-indicator-light/word-indicator-light-operator.js +5 -5
  104. package/elements/switch-indicator-light/word-switch-operator.d.ts +3 -1
  105. package/elements/switch-indicator-light/word-switch-operator.js +9 -2
  106. package/elements/switch-indicator-light/word-switch-operator.metadata.json +1 -1
  107. package/elements/table/table-element.d.ts +1 -1
  108. package/elements/table/table-element.js +2 -2
  109. package/elements/table/table-element.metadata.json +1 -1
  110. package/elements/vector-graphics/ellipse-element.d.ts +1 -1
  111. package/elements/vector-graphics/ellipse-element.js +2 -2
  112. package/elements/vector-graphics/ellipse-element.metadata.json +1 -1
  113. package/elements/vector-graphics/poly-line-element.d.ts +1 -1
  114. package/elements/vector-graphics/poly-line-element.js +2 -2
  115. package/elements/vector-graphics/poly-line-element.metadata.json +1 -1
  116. package/elements/vector-graphics/polygon-element.d.ts +1 -1
  117. package/elements/vector-graphics/polygon-element.js +2 -2
  118. package/elements/vector-graphics/polygon-element.metadata.json +1 -1
  119. package/elements/vector-graphics/rectangle-element.d.ts +1 -1
  120. package/elements/vector-graphics/rectangle-element.js +2 -2
  121. package/elements/vector-graphics/rectangle-element.metadata.json +1 -1
  122. package/elements/vector-graphics/sector-element.d.ts +1 -1
  123. package/elements/vector-graphics/sector-element.js +2 -2
  124. package/elements/vector-graphics/sector-element.metadata.json +1 -1
  125. package/elements/vector-graphics/straight-line-element.d.ts +1 -1
  126. package/elements/vector-graphics/straight-line-element.js +2 -2
  127. package/elements/vector-graphics/straight-line-element.metadata.json +1 -1
  128. package/elements/video/video-element.d.ts +1 -2
  129. package/elements/video/video-element.js +53 -54
  130. package/elements/video/video-element.metadata.json +1 -1
  131. package/elements/view-operation/view-operation.element.d.ts +1 -1
  132. package/elements/view-operation/view-operation.element.js +2 -2
  133. package/elements/view-operation/view-operation.element.metadata.json +1 -1
  134. package/elements/weather/weater-element.d.ts +1 -1
  135. package/elements/weather/weater-element.js +2 -3
  136. package/elements/weather/weater-element.metadata.json +1 -1
  137. package/gui/gui-context.d.ts +2 -1
  138. package/gui/gui-host.d.ts +1 -1
  139. package/gui/gui-view.d.ts +1 -0
  140. package/gui/gui-view.js +3 -2
  141. package/gui/gui-view.metadata.json +1 -1
  142. package/gui/gui.component.d.ts +3 -0
  143. package/gui/gui.component.js +15 -2
  144. package/gui/gui.component.metadata.json +1 -1
  145. package/localization/localization.service.d.ts +7 -0
  146. package/localization/localization.service.js +8 -1
  147. package/localization/localization.service.metadata.json +1 -1
  148. package/localization/localization.service.zh_CN.js +8 -1
  149. package/localization/localization.service.zh_CN.metadata.json +1 -1
  150. package/modal/write-value/write-value-modal-args.d.ts +4 -1
  151. package/modal/write-value/write-value-modal-args.js +3 -1
  152. package/modal/write-value/write-value-modal-args.metadata.json +1 -1
  153. package/modal/write-value/write-value-modal.component.d.ts +9 -7
  154. package/modal/write-value/write-value-modal.component.html +5 -2
  155. package/modal/write-value/write-value-modal.component.js +39 -22
  156. package/modal/write-value/write-value-modal.component.metadata.json +1 -1
  157. package/model/air-quality/air-quality-info.d.ts +23 -0
  158. package/model/air-quality/air-quality-info.js +4 -0
  159. package/model/air-quality/air-quality-info.metadata.json +1 -0
  160. package/model/air-quality/air-quality.model.d.ts +7 -0
  161. package/model/air-quality/air-quality.model.js +0 -0
  162. package/model/air-quality/air-quality.model.metadata.json +1 -0
  163. package/model/alarm/alarm.model.d.ts +13 -0
  164. package/model/alarm/alarm.model.js +0 -0
  165. package/model/alarm/alarm.model.metadata.json +1 -0
  166. package/model/bar-graph/bar-graph.d.ts +4 -0
  167. package/model/base/readable-model.d.ts +4 -0
  168. package/model/historical-curve/historical-curve-axis-settings.d.ts +7 -0
  169. package/model/historical-curve/historical-curve-axis-settings.js +5 -0
  170. package/model/historical-curve/historical-curve-axis-settings.metadata.json +1 -1
  171. package/model/meter/meter.d.ts +4 -0
  172. package/model/numerical-display/numerical-display.d.ts +1 -0
  173. package/model/ring-graph/ring-graph.model.d.ts +8 -0
  174. package/model/shared/condition/bit-condition-item-observer.d.ts +1 -1
  175. package/model/shared/condition/bit-condition-item-observer.js +4 -4
  176. package/model/shared/condition/condition-items-result-observer.d.ts +1 -1
  177. package/model/shared/condition/condition-items-result-observer.js +22 -12
  178. package/model/shared/condition/condition-items-result-observer.metadata.json +1 -1
  179. package/model/shared/condition/convert-condition-model.d.ts +5 -0
  180. package/model/shared/condition/convert-condition-model.js +0 -0
  181. package/model/shared/condition/convert-condition-model.metadata.json +1 -0
  182. package/model/shared/condition/relation-condition-result.d.ts +2 -1
  183. package/model/shared/condition/relation-condition-result.js +2 -1
  184. package/model/shared/condition/relation-condition-result.metadata.json +1 -1
  185. package/model/shared/condition/word-condition-item-observer.d.ts +1 -1
  186. package/model/shared/condition/word-condition-item-observer.js +11 -11
  187. package/model/shared/dynamic-display/dynamic-display.d.ts +1 -1
  188. package/model/shared/dynamic-display/dynamic-display.js +4 -4
  189. package/model/shared/dynamic-display/dynamic-display.metadata.json +1 -1
  190. package/model/shared/rotation/rotation-behavior.d.ts +1 -1
  191. package/model/shared/rotation/rotation-behavior.js +2 -2
  192. package/model/shared/rotation/rotation-behavior.metadata.json +1 -1
  193. package/model/shared/rotation/rotation-observer.d.ts +2 -1
  194. package/model/shared/rotation/rotation-observer.js +3 -2
  195. package/model/shared/rotation/rotation-observer.metadata.json +1 -1
  196. package/model/shared/translation/translation-behavior.d.ts +1 -1
  197. package/model/shared/translation/translation-behavior.js +3 -3
  198. package/model/shared/translation/translation-behavior.metadata.json +1 -1
  199. package/model/shared/translation/translation-observer.d.ts +1 -1
  200. package/model/shared/translation/translation-observer.js +2 -2
  201. package/model/shared/translation/translation-observer.metadata.json +1 -1
  202. package/model/switch-indicator-light/bit-switch-operation.d.ts +2 -1
  203. package/model/switch-indicator-light/bit-switch-operation.js +1 -0
  204. package/model/switch-indicator-light/bit-switch-operation.metadata.json +1 -1
  205. package/package.json +1 -1
  206. package/remote/communication/variable/remote-variable-communicator.d.ts +7 -2
  207. package/remote/communication/variable/remote-variable-communicator.js +38 -9
  208. package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
  209. package/remote/communication/variable/remote-variable-protocol.d.ts +5 -2
  210. package/service/index.d.ts +1 -0
  211. package/service/index.metadata.json +1 -1
  212. package/service/released-variable/index.d.ts +1 -0
  213. package/service/released-variable/index.js +0 -0
  214. package/service/released-variable/index.metadata.json +1 -0
  215. package/service/released-variable/released-variable.service.d.ts +4 -0
  216. package/service/released-variable/released-variable.service.js +0 -0
  217. package/service/released-variable/released-variable.service.metadata.json +1 -0
  218. package/service/weather.service.d.ts +1 -0
  219. package/shared/gui-consts.d.ts +2 -0
  220. package/shared/gui-consts.js +2 -0
  221. package/shared/gui-consts.metadata.json +1 -1
  222. package/utils/data-type/data-type.service.d.ts +4 -7
  223. package/utils/data-type/data-type.service.js +29 -17
  224. package/utils/numerical-operation.service.js +2 -2
  225. package/gui/scripts/config.js +0 -6
  226. package/gui/scripts/require.js +0 -2145
  227. package/libs/nvd3/build/nv.d3.min.js +0 -13
@@ -4,31 +4,132 @@ import { RotationDirectionType } from '../../model/shared/rotation/rotation-dire
4
4
  import { calculatePercent, degreesToRadians } from '../shared/math-utils';
5
5
  import { VariableUtil } from '../../utils/variable-util';
6
6
  import { VariableDefinition } from '../../communication/variable/variable-definition';
7
+ import { forEach } from 'lodash';
8
+ import { VariableState } from '../../communication';
9
+ import { VariableValueType } from '../../model/shared/condition/variable-value-type';
7
10
  export class RingGraphElement extends ReadableElement {
8
- constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
9
- super(element, permissionChecker, variableCommunicator, variableStore, localization);
11
+ constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
12
+ super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
13
+ this.valueObj = {};
14
+ this.isNeedUpdateScale = false;
15
+ if ((this.model.minValueType === VariableValueType.Constant && this.model.maxValueType === VariableValueType.Variable)
16
+ || this.model.maxValueType === VariableValueType.Constant && this.model.minValueType === VariableValueType.Variable) {
17
+ this.isNeedUpdateScale = true;
18
+ this.updateScale();
19
+ this.isNeedUpdateScale = false;
20
+ }
10
21
  const el$ = $(element);
11
22
  this._barElement$ = el$.find('path[data-id="barArc"]');
12
23
  this._textElement$ = el$.find('text[data-id="pText"]');
13
24
  setTimeout(() => {
14
25
  this.initFrameNode();
15
26
  this.changeStates();
16
- }, 0);
27
+ });
17
28
  }
18
29
  get readVariableName() {
19
30
  if (!this.model.variableId) {
20
31
  return '';
21
32
  }
33
+ if (!this.model.variableId.variableName || !this.model.variableId.variableName.name) {
34
+ return undefined;
35
+ }
22
36
  const variable = new VariableDefinition(this.model.variableId.variableName.name, this.model.variableId.variableName.groupName, this.model.variableId.dataSourceCode, this.model.variableId.variableName.variableVersion);
23
37
  return VariableUtil.getConvertedVariableName(this.variableStore, variable);
24
38
  }
39
+ get minVariableName() {
40
+ if (!this.model.minValueType) {
41
+ return undefined;
42
+ }
43
+ if (!this.model.minVariable || !this.model.minVariable.name) {
44
+ return undefined;
45
+ }
46
+ const variable = new VariableDefinition(this.model.minVariable.name, this.model.minVariable.groupName, this.model.minVariable.dataSourceCode, this.model.minVariable.variableVersion);
47
+ return VariableUtil.getConvertedVariableName(this.variableStore, variable);
48
+ }
49
+ get maxVariableName() {
50
+ if (!this.model.maxValueType) {
51
+ return undefined;
52
+ }
53
+ if (!this.model.maxVariable || !this.model.maxVariable.name) {
54
+ return undefined;
55
+ }
56
+ const variable = new VariableDefinition(this.model.maxVariable.name, this.model.maxVariable.groupName, this.model.maxVariable.dataSourceCode, this.model.maxVariable.variableVersion);
57
+ return VariableUtil.getConvertedVariableName(this.variableStore, variable);
58
+ }
25
59
  initFrameNode() {
26
60
  const arcPath = Snap(this.$element[0]);
27
61
  const b = arcPath.getBBox(true);
28
62
  this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
29
63
  }
30
- updateVariableValue(value) {
31
- const percent = calculatePercent(this.model.min, this.model.max, value);
64
+ init(variableName) {
65
+ if (variableName) {
66
+ let hasVariable = false;
67
+ forEach(this.elementStates, elementState => {
68
+ if (elementState.variableName === variableName) {
69
+ hasVariable = true;
70
+ }
71
+ });
72
+ if (!hasVariable && variableName === this.readVariableName) {
73
+ this.elementStates.push(new VariableState(variableName, undefined));
74
+ }
75
+ }
76
+ }
77
+ updateValueObj(value, variableName) {
78
+ var _a, _b, _c;
79
+ if (((_a = this.model.variableId) === null || _a === void 0 ? void 0 : _a.variableName.name) === variableName) {
80
+ this.isNeedUpdateScale = false;
81
+ this.valueObj.value = value;
82
+ }
83
+ if (((_b = this.model.minVariable) === null || _b === void 0 ? void 0 : _b.name) === variableName) {
84
+ this.isNeedUpdateScale = true;
85
+ this.valueObj.min = value;
86
+ }
87
+ if (((_c = this.model.maxVariable) === null || _c === void 0 ? void 0 : _c.name) === variableName) {
88
+ this.isNeedUpdateScale = true;
89
+ this.valueObj.max = value;
90
+ }
91
+ }
92
+ updateScale() {
93
+ if (!this.isNeedUpdateScale) {
94
+ return;
95
+ }
96
+ const textElements = this.$element.find('g:first > text');
97
+ let min = this.model.minValueType ? this.valueObj.min : this.model.min;
98
+ let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
99
+ min = Number(min);
100
+ max = Number(max);
101
+ if (isNaN(min) || isNaN(max)) {
102
+ min = RingGraphElement.DEFAULT_MIN_VALUE;
103
+ max = RingGraphElement.DEFAULT_MAX_VALUE;
104
+ }
105
+ const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
106
+ for (let i = 0; i < textElements.length; i++) {
107
+ const text = textElements[i];
108
+ if (!text.innerHTML) {
109
+ continue;
110
+ }
111
+ let sacleValue = ((Number(avgSacle) * i) + min).toFixed(0);
112
+ // 整数位和小数位格式化;
113
+ if (this.model.fractionDigits > 0) {
114
+ sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
115
+ }
116
+ if (!isNaN(sacleValue)) {
117
+ text.innerHTML = sacleValue;
118
+ }
119
+ }
120
+ }
121
+ updateVariableValue(value, variableName) {
122
+ this.updateValueObj(value, variableName);
123
+ this.updateScale();
124
+ let min = this.model.minValueType ? this.valueObj.min : this.model.min;
125
+ let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
126
+ min = Number(min);
127
+ max = Number(max);
128
+ if (isNaN(min) || isNaN(max)) {
129
+ min = RingGraphElement.DEFAULT_MIN_VALUE;
130
+ max = RingGraphElement.DEFAULT_MAX_VALUE;
131
+ }
132
+ const percent = calculatePercent(min, max, this.valueObj.value || 0);
32
133
  this.updateBar(percent);
33
134
  this._barElement$.attr('fill', this.getBarColor(value));
34
135
  if (this.model.showPercentage) {
@@ -87,3 +188,5 @@ export class RingGraphElement extends ReadableElement {
87
188
  arcPath.arc(outer, outer, inner, endRadians, startRadians);
88
189
  }
89
190
  }
191
+ RingGraphElement.DEFAULT_MIN_VALUE = 0;
192
+ RingGraphElement.DEFAULT_MAX_VALUE = 100;
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"RingGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":13,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":27,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":27,"character":57},{"__symbolic":"reference","module":"../../communication/variable/variable-communicator","name":"VariableCommunicator","line":28,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":29,"character":23},{"__symbolic":"reference","module":"../../localization/localization.service","name":"Localization","line":30,"character":22}]}],"initFrameNode":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateBar":[{"__symbolic":"method"}],"getBarColor":[{"__symbolic":"method"}],"drawClockWiseArc":[{"__symbolic":"method"}],"drawAntiClockWiseArc":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"RingGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":16,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":60,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":60,"character":57},{"__symbolic":"reference","module":"../../communication/variable/variable-communicator","name":"VariableCommunicator","line":61,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":62,"character":23},{"__symbolic":"reference","module":"../../localization/localization.service","name":"Localization","line":63,"character":22},{"__symbolic":"reference","name":"string"}]}],"initFrameNode":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"updateValueObj":[{"__symbolic":"method"}],"updateScale":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateBar":[{"__symbolic":"method"}],"getBarColor":[{"__symbolic":"method"}],"drawClockWiseArc":[{"__symbolic":"method"}],"drawAntiClockWiseArc":[{"__symbolic":"method"}]},"statics":{"DEFAULT_MIN_VALUE":0,"DEFAULT_MAX_VALUE":100}}}}]
@@ -62,9 +62,6 @@ export class GraphStateElement {
62
62
  }
63
63
  }
64
64
  getImageElement() {
65
- if (this.imageElement && /iPhone|iPod/i.test(navigator.userAgent)) {
66
- this.removeImageElement();
67
- }
68
65
  if (!this.imageElement) {
69
66
  this.imageElement = document.createElementNS('http://www.w3.org/2000/svg', 'image');
70
67
  this.imageElement.setAttribute('width', this.width + '');
@@ -19,7 +19,7 @@ export class TextElementModal {
19
19
  return textElement;
20
20
  }
21
21
  createNewForeignObjectText(content, font, width, height, isVariableText) {
22
- if (font) {
22
+ if (font && !font.fontFamily.includes(',msyh')) {
23
23
  font.fontFamily += ',msyh';
24
24
  }
25
25
  const bodyDiv = document.createElement('div');
@@ -36,7 +36,7 @@ export class TextElementModal {
36
36
  for (let index = 0; index < textArray.length; index++) {
37
37
  const textDiv = document.createElement('div');
38
38
  textDiv.className = 'text-list';
39
- textDiv.innerHTML = textArray[index] ? textArray[index] : '&nbsp;';
39
+ const innerHTML = textArray[index] ? textArray[index] : '&nbsp;';
40
40
  let fontString = '';
41
41
  if (font.isItalic) {
42
42
  fontString += 'italic ';
@@ -45,12 +45,23 @@ export class TextElementModal {
45
45
  fontString += 'bold ';
46
46
  }
47
47
  let lineHeight = 0;
48
+ // chrome支持可显示最小字体大小为12px, 更小字体通过缩放实现
49
+ const minFontSize = 12;
48
50
  lineHeight = parseInt(font.fontSize, 10) + 5;
49
51
  fontString += font.fontSize + '/' + lineHeight.toString() + 'px ' + font.fontFamily;
50
52
  textDiv.style.cssText = `color: ${font.color};word-break: break-all;font: ${fontString};`;
51
53
  if (font.isUnderline) {
52
54
  textDiv.style.textDecoration = 'underline';
53
55
  }
56
+ const spanText = document.createElement('span');
57
+ spanText.style.cssText = `
58
+ display: contents;
59
+ transform: scale(${parseInt(font.fontSize, 10) > minFontSize ? 1 : parseInt(font.fontSize, 10) / minFontSize});
60
+ width: 100%;
61
+ height: 100%;
62
+ `;
63
+ spanText.innerHTML = innerHTML;
64
+ textDiv.appendChild(spanText);
54
65
  fragment.appendChild(textDiv);
55
66
  }
56
67
  bodyDiv.appendChild(fragment);
@@ -49,7 +49,7 @@ export class TextStateElement {
49
49
  return this.textElement;
50
50
  }
51
51
  createNewForeignObjectText(content, font) {
52
- if (font) {
52
+ if (font && !font.fontFamily.includes(',msyh')) {
53
53
  font.fontFamily += ',msyh';
54
54
  }
55
55
  const bodyDiv = document.createElement('div');
@@ -9,6 +9,6 @@ export declare class HyperlinkElement extends ConditionalDynamicDisplayElement {
9
9
  private readonly graphStore;
10
10
  protected readonly model: HyperlinkModel;
11
11
  protected readonly logger: LoggerService;
12
- constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore);
12
+ constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore, signalRAppId: string);
13
13
  private initGraphAndText;
14
14
  }
@@ -3,8 +3,8 @@ import { GraphStateElement } from '../shared/graph/graph-state-element';
3
3
  import { LOGGER_SERVICE_TOKEN } from '../../logger';
4
4
  import { TextElementModal } from '../shared/text/text-element';
5
5
  export class HyperlinkElement extends ConditionalDynamicDisplayElement {
6
- constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore) {
7
- super(element, permissionChecker, variableCommunicator, variableStore);
6
+ constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId) {
7
+ super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
8
8
  this.graphStore = graphStore;
9
9
  this.logger = injector.get(LOGGER_SERVICE_TOKEN);
10
10
  if (this.model.size) {
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"HyperlinkElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":12,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":17,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":17,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":17,"character":77},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":18,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":18,"character":67},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":18,"character":111}]}],"initGraphAndText":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"HyperlinkElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":12,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":17,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":17,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":17,"character":77},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":18,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":18,"character":67},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":18,"character":111},{"__symbolic":"reference","name":"string"}]}],"initGraphAndText":[{"__symbolic":"method"}]}}}}]
@@ -9,6 +9,6 @@ export declare class ImageElement extends ConditionalDynamicDisplayElement {
9
9
  private readonly graphStore;
10
10
  readonly model: Image;
11
11
  protected readonly logger: LoggerService;
12
- constructor(element: HTMLElement, injector: Injector, imageStore: ImageStore, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore);
12
+ constructor(element: HTMLElement, injector: Injector, imageStore: ImageStore, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore, signalRAppId: string);
13
13
  private initGraph;
14
14
  }
@@ -3,8 +3,8 @@ import { ImageFillType } from '../../model/image/image-fill-type';
3
3
  import { GraphStateElement } from '../shared/graph/graph-state-element';
4
4
  import { LOGGER_SERVICE_TOKEN } from '../../logger';
5
5
  export class ImageElement extends ConditionalDynamicDisplayElement {
6
- constructor(element, injector, imageStore, permissionChecker, variableCommunicator, variableStore, graphStore) {
7
- super(element, permissionChecker, variableCommunicator, variableStore);
6
+ constructor(element, injector, imageStore, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId) {
7
+ super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
8
8
  this.graphStore = graphStore;
9
9
  this.logger = injector.get(LOGGER_SERVICE_TOKEN);
10
10
  if (!this.model.version || this.model.version < 4 || this.model.fillType !== ImageFillType.Graph) {
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ImageElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":10,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":16,"character":18},{"__symbolic":"reference","module":"../../config","name":"ImageStore","line":17,"character":20},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":18,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":19,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":20,"character":23},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":21,"character":37}]}],"initGraph":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ImageElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":10,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":16,"character":18},{"__symbolic":"reference","module":"../../config","name":"ImageStore","line":17,"character":20},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":18,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":19,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":20,"character":23},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":21,"character":37},{"__symbolic":"reference","name":"string"}]}],"initGraph":[{"__symbolic":"method"}]}}}}]
@@ -9,7 +9,7 @@ export declare class TextElement extends ConditionalDynamicDisplayElement {
9
9
  private readonly graphStore;
10
10
  protected readonly model: TextModel;
11
11
  protected readonly logger: LoggerService;
12
- constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore);
12
+ constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore, signalRAppId: string);
13
13
  dispose(): void;
14
14
  private handleTextValue;
15
15
  private initGraph;
@@ -3,8 +3,8 @@ import { GraphStateElement } from '../shared/graph/graph-state-element';
3
3
  import { LOGGER_SERVICE_TOKEN } from '../../logger';
4
4
  import { TextElementModal } from '../shared/text/text-element';
5
5
  export class TextElement extends ConditionalDynamicDisplayElement {
6
- constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore) {
7
- super(element, permissionChecker, variableCommunicator, variableStore);
6
+ constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId) {
7
+ super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
8
8
  this.graphStore = graphStore;
9
9
  this.logger = injector.get(LOGGER_SERVICE_TOKEN);
10
10
  if (this.model.text && this.model.size) {
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TextElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":10,"character":33},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":15,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":15,"character":77},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":16,"character":67},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":16,"character":111}]}],"dispose":[{"__symbolic":"method"}],"handleTextValue":[{"__symbolic":"method"}],"initGraph":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TextElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":10,"character":33},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":15,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":15,"character":77},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":16,"character":67},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":16,"character":111},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"handleTextValue":[{"__symbolic":"method"}],"initGraph":[{"__symbolic":"method"}]}}}}]
@@ -15,6 +15,6 @@ export declare class BitIndicatorLightOperator implements IndicatorLightOperator
15
15
  private onStateId?;
16
16
  get variableName(): string;
17
17
  constructor(settings: BitIndicatorLightSettings, states: SwitchIndicatorState[], variableCommunicator: VariableCommunicator, variableStore: VariableStore);
18
- requestData(): void;
18
+ requestData(appId: string): void;
19
19
  private requestCurrentSateIdValue;
20
20
  }
@@ -42,11 +42,11 @@ export class BitIndicatorLightOperator {
42
42
  const variableName = new VariableDefinition(this.settings.variableName, this.settings.variableGroupName, this.settings.dataSourceCode, this.settings.variableVersion);
43
43
  return VariableUtil.getConvertedVariableName(this.variableStore, variableName);
44
44
  }
45
- requestData() {
45
+ requestData(appId) {
46
46
  if (this.variableName) {
47
47
  this.variableCommunicator.subscribeVariableState(this.variableName).subscribe(variableStete => {
48
48
  if (variableStete.state === VariableStateEnum.Normal) {
49
- this.requestCurrentSateIdValue(this.variableCommunicator);
49
+ this.requestCurrentSateIdValue(this.variableCommunicator, appId);
50
50
  }
51
51
  else {
52
52
  this.currentStateIdChanged.emit(new CurrentStateIdValue(new VariableState(this.variableName, variableStete.state)));
@@ -54,8 +54,8 @@ export class BitIndicatorLightOperator {
54
54
  });
55
55
  }
56
56
  }
57
- requestCurrentSateIdValue(variableCommunicator) {
58
- variableCommunicator.openVariable(this.variableName).subscribe(value => {
57
+ requestCurrentSateIdValue(variableCommunicator, appId = '') {
58
+ variableCommunicator.openVariable(this.variableName, appId).subscribe(value => {
59
59
  if (value.state === VariableStateEnum.DataNormal) {
60
60
  if (this.settings.isBitwiseIndex) {
61
61
  const maxBitIndex = 31;
@@ -7,11 +7,13 @@ export declare class BitSwitchOperator implements SwitchOperator {
7
7
  private readonly settings;
8
8
  private readonly variableCommunicator;
9
9
  private readonly variableStore;
10
+ private readonly signalRAppId;
10
11
  private currentValue;
11
12
  private canExecuteInternal;
12
13
  private binary;
13
14
  get variableName(): string;
14
- constructor(settings: BitSwitchSettings, variableCommunicator: VariableCommunicator, variableStore: VariableStore);
15
+ constructor(settings: BitSwitchSettings, variableCommunicator: VariableCommunicator, variableStore: VariableStore, signalRAppId: string);
15
16
  canExecute(): boolean;
16
17
  execute(): Promise<VariableOptionModel>;
18
+ writeValue(value: any): Promise<VariableOptionModel>;
17
19
  }
@@ -4,10 +4,11 @@ import { Binary } from '../../model/shared/binary';
4
4
  import { VariableUtil } from '../../utils/variable-util';
5
5
  import { VariableDefinition } from '../../communication/variable/variable-definition';
6
6
  export class BitSwitchOperator {
7
- constructor(settings, variableCommunicator, variableStore) {
7
+ constructor(settings, variableCommunicator, variableStore, signalRAppId) {
8
8
  this.settings = settings;
9
9
  this.variableCommunicator = variableCommunicator;
10
10
  this.variableStore = variableStore;
11
+ this.signalRAppId = signalRAppId;
11
12
  if (!this.settings) {
12
13
  throw new Error('settings cannot be null');
13
14
  }
@@ -15,7 +16,7 @@ export class BitSwitchOperator {
15
16
  this.canExecuteInternal = true;
16
17
  }
17
18
  else {
18
- variableCommunicator.openVariable(this.variableName).subscribe(value => {
19
+ variableCommunicator.openVariable(this.variableName, this.signalRAppId).subscribe(value => {
19
20
  this.currentValue = value;
20
21
  this.canExecuteInternal = this.currentValue && this.currentValue.state === VariableStateEnum.DataNormal;
21
22
  });
@@ -71,6 +72,8 @@ export class BitSwitchOperator {
71
72
  }
72
73
  }
73
74
  break;
75
+ case BitSwitchOperation.Restoration:
76
+ break;
74
77
  default:
75
78
  throw new Error(`Unknown BitSwitchOperation:${settings.operation}`);
76
79
  }
@@ -84,4 +87,21 @@ export class BitSwitchOperator {
84
87
  newValue: newValue
85
88
  });
86
89
  }
90
+ writeValue(value) {
91
+ if (this.settings.isBitwiseIndex) {
92
+ this.variableCommunicator.writeWordByBit(this.variableName, this.settings.bitIndex, value).subscribe();
93
+ }
94
+ else {
95
+ this.variableCommunicator.write(this.variableName, value).subscribe();
96
+ }
97
+ let originValue;
98
+ if (this.currentValue && this.currentValue.value !== undefined) {
99
+ originValue = this.currentValue.value;
100
+ }
101
+ return Promise.resolve({
102
+ variableName: this.variableName,
103
+ originValue: originValue,
104
+ newValue: value
105
+ });
106
+ }
87
107
  }
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"BitSwitchOperator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../model","name":"BitSwitchSettings","line":21,"character":43},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":21,"character":101},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":22,"character":40}]}],"canExecute":[{"__symbolic":"method"}],"execute":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"BitSwitchOperator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../model","name":"BitSwitchSettings","line":21,"character":43},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":21,"character":101},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":22,"character":40},{"__symbolic":"reference","name":"string"}]}],"canExecute":[{"__symbolic":"method"}],"execute":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}]}}}}]
@@ -4,5 +4,5 @@ export interface IndicatorLightOperator {
4
4
  readonly variableName: string;
5
5
  currentStateId?: number;
6
6
  currentStateIdChanged: EventEmitter<CurrentStateIdValue>;
7
- requestData: () => void;
7
+ requestData: (appId: string) => void;
8
8
  }
@@ -19,9 +19,17 @@ export declare class SwitchIndicatorLightElement extends ConditionalEnableElemen
19
19
  private graphStateElement?;
20
20
  private textStateElement;
21
21
  private isMobileMode;
22
- constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, variableCommunicator: VariableCommunicator, graphStore: GraphStore, permissionChecker: PermissionChecker, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization);
22
+ private isBitRestoration;
23
+ private isVerifiedForRestoration;
24
+ private restorationTimer;
25
+ private isWriteRestorationDownValue;
26
+ private onDocMouseUp;
27
+ constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, variableCommunicator: VariableCommunicator, graphStore: GraphStore, permissionChecker: PermissionChecker, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
28
+ handleMouseUp(): void;
29
+ private initOnDocMouseUpEvent;
23
30
  private checkElementPassword;
24
31
  private doSwitchOperator;
32
+ private writeValue;
25
33
  private initSwitchOperator;
26
34
  private initIndictorLightOperator;
27
35
  private currentStateIdChange;