@flexem/fc-gui 3.0.0-alpha.18 → 3.0.0-alpha.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +419 -1
- package/assets/img/black_first_page.png +0 -0
- package/assets/img/black_last_page.png +0 -0
- package/assets/img/black_next_page.png +0 -0
- package/assets/img/black_previous_page.png +0 -0
- package/assets/img/exclamation-outline-circle.png +0 -0
- package/bundles/@flexem/fc-gui.umd.js +39377 -34650
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +5 -5
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/communication/variable/variable-communicator.d.ts +5 -0
- package/communication/variable/variable-state-enum.d.ts +1 -0
- package/communication/variable/variable-state-enum.js +1 -0
- package/communication/variable/variable-state-enum.metadata.json +1 -1
- package/communication/variable/variable-value.d.ts +4 -1
- package/communication/variable/variable-value.js +4 -1
- package/communication/variable/variable-value.metadata.json +1 -1
- package/config/alarm/alarm.store.d.ts +6 -0
- package/config/alarm/alarm.store.js +0 -0
- package/config/alarm/alarm.store.metadata.json +1 -0
- package/config/alarm/get-alarms-args.d.ts +12 -0
- package/config/alarm/get-alarms-args.js +13 -0
- package/config/alarm/get-alarms-args.metadata.json +1 -0
- package/config/alarm/index.d.ts +2 -0
- package/config/alarm/index.js +1 -0
- package/config/alarm/index.metadata.json +1 -0
- package/config/config-store.d.ts +2 -0
- package/config/gui-feature-config.d.ts +3 -0
- package/config/gui-feature-config.js +3 -0
- package/config/gui-feature-config.metadata.json +1 -0
- package/config/index.d.ts +2 -0
- package/config/index.js +2 -0
- package/config/index.metadata.json +1 -1
- package/config/variable/variable-store.d.ts +1 -0
- package/elements/air-quality/air-quality-element.js +3 -4
- package/elements/alarm/alarm-element.d.ts +69 -0
- package/elements/alarm/alarm-element.js +497 -0
- package/elements/alarm/alarm-element.metadata.json +1 -0
- package/elements/bar-graph-element.d.ts +10 -2
- package/elements/bar-graph-element.js +135 -5
- package/elements/bar-graph-element.metadata.json +1 -1
- package/elements/base/readable-element.d.ts +6 -1
- package/elements/base/readable-element.js +69 -2
- package/elements/base/readable-element.metadata.json +1 -1
- package/elements/base/state-control-element.d.ts +3 -1
- package/elements/base/state-control-element.js +21 -5
- package/elements/character-display/character-display-element.js +3 -2
- package/elements/character-display/character-display-element.metadata.json +1 -1
- package/elements/datetime-display/datetime-display-element.d.ts +1 -0
- package/elements/datetime-display/datetime-display-element.js +10 -2
- package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
- package/elements/datetime-display/time-zone-select-json.d.ts +8 -0
- package/elements/datetime-display/time-zone-select-json.js +558 -0
- package/elements/historical-curve/historical-curve.element.d.ts +44 -3
- package/elements/historical-curve/historical-curve.element.js +696 -32
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/main-element.d.ts +1 -0
- package/elements/main-element.js +70 -9
- package/elements/main-element.metadata.json +1 -1
- package/elements/meter-element.d.ts +7 -1
- package/elements/meter-element.js +76 -7
- package/elements/meter-element.metadata.json +1 -1
- package/elements/numerical-display/numerical-display-element.d.ts +22 -3
- package/elements/numerical-display/numerical-display-element.js +145 -12
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/elements/per-view-variable-communicator.d.ts +4 -0
- package/elements/per-view-variable-communicator.js +21 -1
- package/elements/per-view-variable-communicator.metadata.json +1 -1
- package/elements/ring-graph/ring-graph-element.d.ts +13 -1
- package/elements/ring-graph/ring-graph-element.js +164 -3
- package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
- package/elements/scroll-alarm/scroll-alarm-element.d.ts +79 -0
- package/elements/scroll-alarm/scroll-alarm-element.js +845 -0
- package/elements/scroll-alarm/scroll-alarm-element.metadata.json +1 -0
- package/elements/shared/graph/graph-state-element.d.ts +1 -0
- package/elements/shared/graph/graph-state-element.js +30 -1
- package/elements/shared/graph/graph-state-element.metadata.json +1 -1
- package/elements/shared/text/text-element.d.ts +14 -0
- package/elements/shared/text/text-element.js +42 -4
- package/elements/shared/text/text-element.metadata.json +1 -1
- package/elements/shared/text/text-state-element.d.ts +39 -2
- package/elements/shared/text/text-state-element.js +242 -67
- package/elements/shared/text/text-state-element.metadata.json +1 -1
- package/elements/static-elements/hyperlink-element.d.ts +28 -2
- package/elements/static-elements/hyperlink-element.js +153 -4
- package/elements/static-elements/hyperlink-element.metadata.json +1 -1
- package/elements/static-elements/text-element.d.ts +28 -2
- package/elements/static-elements/text-element.js +162 -12
- package/elements/static-elements/text-element.metadata.json +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +1 -0
- package/elements/switch-indicator-light/bit-indicator-light-operator.js +10 -3
- package/elements/switch-indicator-light/bit-indicator-light-operator.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +11 -2
- package/elements/switch-indicator-light/switch-indicator-light-element.js +70 -12
- package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
- package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +1 -0
- package/elements/switch-indicator-light/word-indicator-light-operator.js +10 -3
- package/elements/switch-indicator-light/word-indicator-light-operator.metadata.json +1 -1
- package/elements/video/video-element.d.ts +10 -0
- package/elements/video/video-element.js +139 -21
- package/elements/video/video-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.d.ts +28 -2
- package/elements/view-operation/view-operation.element.js +163 -4
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/elements/weather/weater-element.js +0 -1
- package/gui/gui-context.d.ts +25 -2
- package/gui/gui-host.d.ts +1 -1
- package/gui/gui-view.d.ts +4 -1
- package/gui/gui-view.js +69 -8
- package/gui/gui-view.metadata.json +1 -1
- package/gui/gui.component.d.ts +3 -0
- package/gui/gui.component.js +15 -2
- package/gui/gui.component.metadata.json +1 -1
- package/localization/localization.service.d.ts +11 -0
- package/localization/localization.service.js +16 -5
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +12 -1
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/modal/write-character/write-character-modal.component.d.ts +3 -2
- package/modal/write-character/write-character-modal.component.html +4 -4
- package/modal/write-character/write-character-modal.component.js +7 -5
- package/modal/write-character/write-character-modal.component.less +15 -0
- package/modal/write-character/write-character-modal.component.metadata.json +1 -1
- package/modal/write-value/write-value-modal-args.d.ts +5 -1
- package/modal/write-value/write-value-modal-args.js +3 -1
- package/modal/write-value/write-value-modal-args.metadata.json +1 -1
- package/modal/write-value/write-value-modal.component.d.ts +15 -8
- package/modal/write-value/write-value-modal.component.html +10 -5
- package/modal/write-value/write-value-modal.component.js +99 -21
- package/modal/write-value/write-value-modal.component.less +16 -1
- package/modal/write-value/write-value-modal.component.metadata.json +1 -1
- package/model/alarm/alarm.model.d.ts +13 -0
- package/model/alarm/alarm.model.js +0 -0
- package/model/alarm/alarm.model.metadata.json +1 -0
- package/model/bar-graph/bar-graph.d.ts +4 -0
- package/model/base/font-setting-model.d.ts +22 -1
- package/model/base/font-setting-model.metadata.json +1 -1
- package/model/base/readable-model.d.ts +4 -0
- package/model/datetime-display/datetime-display.d.ts +1 -0
- package/model/historical-curve/historical-curve-axis-settings.d.ts +11 -0
- package/model/historical-curve/historical-curve-axis-settings.js +5 -0
- package/model/historical-curve/historical-curve-axis-settings.metadata.json +1 -1
- package/model/historical-curve/historical-curve-chanel.model.d.ts +8 -0
- package/model/meter/meter.d.ts +4 -0
- package/model/numerical-display/numerical-operation.d.ts +10 -2
- package/model/ring-graph/ring-graph.model.d.ts +8 -0
- package/model/scroll-alarm/scroll-alarm.model.d.ts +21 -0
- package/model/scroll-alarm/scroll-alarm.model.js +0 -0
- package/model/scroll-alarm/scroll-alarm.model.metadata.json +1 -0
- package/model/shared/state/state.d.ts +1 -0
- package/model/shared/state/state.js +1 -0
- package/model/shared/state/state.metadata.json +1 -1
- package/model/shared/text/font.d.ts +1 -1
- package/model/shared/text/text.d.ts +3 -0
- package/model/switch-indicator-light/switch-indicator-light.d.ts +2 -0
- package/model/view-operation/view-operation-element.model.d.ts +7 -1
- package/package.json +1 -1
- package/public_api.js +1 -0
- package/remote/communication/variable/remote-variable-communicator.d.ts +30 -0
- package/remote/communication/variable/remote-variable-communicator.js +193 -3
- package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
- package/remote/communication/variable/remote-variable-protocol.d.ts +8 -0
- package/service/index.d.ts +4 -0
- package/service/index.js +1 -0
- package/service/index.metadata.json +1 -1
- package/service/language.service.d.ts +37 -0
- package/service/language.service.js +0 -0
- package/service/language.service.metadata.json +1 -0
- package/service/released-variable/index.d.ts +1 -0
- package/service/released-variable/index.js +0 -0
- package/service/released-variable/index.metadata.json +1 -0
- package/service/released-variable/released-variable.service.d.ts +4 -0
- package/service/released-variable/released-variable.service.js +0 -0
- package/service/released-variable/released-variable.service.metadata.json +1 -0
- package/service/system-text-library.service.d.ts +77 -0
- package/service/system-text-library.service.js +29 -0
- package/service/system-text-library.service.metadata.json +1 -0
- package/service/text-library.service.d.ts +49 -0
- package/service/text-library.service.js +0 -0
- package/service/text-library.service.metadata.json +1 -0
- package/shared/gui-consts.d.ts +2 -0
- package/shared/gui-consts.js +3 -1
- package/shared/gui-consts.metadata.json +1 -1
- package/utils/data-type/fbox-data-type.service.js +40 -0
- package/utils/numerical-operation.service.js +28 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":23,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":77,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":78,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":79,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":80,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":81,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":82,"character":43},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":84,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":85,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":86,"character":38},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":87,"character":51}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"setupTooltipAutoHide":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"fmtDatetimeLocal":[{"__symbolic":"method"}],"showCustomTimeRangeModal":[{"__symbolic":"method"}],"showCustomTimeRangeModalFallback":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
|
|
@@ -37,6 +37,7 @@ export declare class MainElement {
|
|
|
37
37
|
initElementState(): void;
|
|
38
38
|
getVariableNames(): Array<string>;
|
|
39
39
|
reportVariableStates(states: VariableState[]): void;
|
|
40
|
+
getVirtualDeviceIdFromRect(rectElement: any): any;
|
|
40
41
|
reportVariableValues(values: VariableValue[]): void;
|
|
41
42
|
dispose(): void;
|
|
42
43
|
private checkIsLoaded;
|
package/elements/main-element.js
CHANGED
|
@@ -28,6 +28,8 @@ import { HyperlinkElement } from './static-elements/hyperlink-element';
|
|
|
28
28
|
import { VideoElement } from './video/video-element';
|
|
29
29
|
import { WeatherElement } from './weather/weater-element';
|
|
30
30
|
import { AirQualityElement } from './air-quality/air-quality-element';
|
|
31
|
+
import { AlarmElement } from './alarm/alarm-element';
|
|
32
|
+
import { ScrollAlarmElement } from './scroll-alarm/scroll-alarm-element';
|
|
31
33
|
export class MainElement {
|
|
32
34
|
constructor(injector, bsModalService, context, variableCommunicator, popupViewService, signalRAppId) {
|
|
33
35
|
this.injector = injector;
|
|
@@ -59,7 +61,7 @@ export class MainElement {
|
|
|
59
61
|
const category = $(element).data('model').category;
|
|
60
62
|
switch (category) {
|
|
61
63
|
case GuiConsts.components.numericalDisplayKey:
|
|
62
|
-
const numericalDisplayElement = new NumericalDisplayElement(element, this.injector, this.bsModalService, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.graphStore, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId);
|
|
64
|
+
const numericalDisplayElement = new NumericalDisplayElement(element, this.injector, this.bsModalService, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.graphStore, this.context.operationRecordService, this.context.releasedVariableService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId, this.context);
|
|
63
65
|
this.elements.push(numericalDisplayElement);
|
|
64
66
|
break;
|
|
65
67
|
case GuiConsts.components.imageKey:
|
|
@@ -72,23 +74,23 @@ export class MainElement {
|
|
|
72
74
|
this.elements.push(new PipeElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
73
75
|
break;
|
|
74
76
|
case GuiConsts.components.switchIndicatorLightKey:
|
|
75
|
-
this.elements.push(new SwitchIndicatorLightElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
77
|
+
this.elements.push(new SwitchIndicatorLightElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
|
|
76
78
|
break;
|
|
77
79
|
case GuiConsts.components.barGraphKey:
|
|
78
80
|
this.elements.push(new BarGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
79
81
|
break;
|
|
80
82
|
case GuiConsts.components.toggleViewKey:
|
|
81
83
|
case GuiConsts.components.viewOperationElement:
|
|
82
|
-
this.elements.push(new ViewOperationElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.injector.get(LOCALIZATION), this.popupViewService, guiOptions.hostContainerId, guiOptions.el, this.signalRAppId));
|
|
84
|
+
this.elements.push(new ViewOperationElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.injector.get(LOCALIZATION), this.popupViewService, guiOptions.hostContainerId, guiOptions.el, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
|
|
83
85
|
break;
|
|
84
86
|
case GuiConsts.components.characterKey:
|
|
85
87
|
this.elements.push(new CharacterDisplayElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
86
88
|
break;
|
|
87
89
|
case GuiConsts.components.textKey:
|
|
88
|
-
this.elements.push(new TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
|
|
90
|
+
this.elements.push(new TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
|
|
89
91
|
break;
|
|
90
92
|
case GuiConsts.components.hyperlinkKey:
|
|
91
|
-
this.elements.push(new HyperlinkElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
|
|
93
|
+
this.elements.push(new HyperlinkElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
|
|
92
94
|
break;
|
|
93
95
|
case GuiConsts.components.straightLineKey:
|
|
94
96
|
this.elements.push(new StraightLineElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
@@ -109,7 +111,7 @@ export class MainElement {
|
|
|
109
111
|
this.elements.push(new DatetimeDisplayElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
|
|
110
112
|
break;
|
|
111
113
|
case GuiConsts.components.historicalCurveKey:
|
|
112
|
-
this.elements.push(new HistoricalCurveElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.historyDataStore, this.signalRAppId));
|
|
114
|
+
this.elements.push(new HistoricalCurveElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.historyDataStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService, this.context, this.context.releasedVariableService));
|
|
113
115
|
break;
|
|
114
116
|
case GuiConsts.components.ringGraphKey:
|
|
115
117
|
this.elements.push(new RingGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
@@ -129,6 +131,12 @@ export class MainElement {
|
|
|
129
131
|
case GuiConsts.components.airQualityKey:
|
|
130
132
|
this.elements.push(new AirQualityElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.weatherService, this.signalRAppId));
|
|
131
133
|
break;
|
|
134
|
+
case GuiConsts.components.alarmKey:
|
|
135
|
+
this.elements.push(new AlarmElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.alarmsStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService, this.context));
|
|
136
|
+
break;
|
|
137
|
+
case GuiConsts.components.scrollAlarmKey:
|
|
138
|
+
this.elements.push(new ScrollAlarmElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.alarmsStore, this.signalRAppId));
|
|
139
|
+
break;
|
|
132
140
|
}
|
|
133
141
|
});
|
|
134
142
|
this.initBackground();
|
|
@@ -208,7 +216,7 @@ export class MainElement {
|
|
|
208
216
|
initElementState() {
|
|
209
217
|
forEach(this.elements, element => {
|
|
210
218
|
if (element instanceof ReadableElement) {
|
|
211
|
-
element.init(element.readVariableName);
|
|
219
|
+
element.init(element.readVariableName || element.maxVariableName || element.minVariableName);
|
|
212
220
|
}
|
|
213
221
|
else if (element instanceof HistoricalCurveElement) {
|
|
214
222
|
element.initElementStatus();
|
|
@@ -219,11 +227,34 @@ export class MainElement {
|
|
|
219
227
|
getVariableNames() {
|
|
220
228
|
const variableNames = new Array();
|
|
221
229
|
forEach(this.elements, element => {
|
|
230
|
+
var _a, _b;
|
|
222
231
|
if (element instanceof ReadableElement) {
|
|
232
|
+
const maxVariableName = (_a = element) === null || _a === void 0 ? void 0 : _a.maxVariableName;
|
|
233
|
+
const maxValueType = element.maxValueType;
|
|
234
|
+
const minVariableName = (_b = element) === null || _b === void 0 ? void 0 : _b.minVariableName;
|
|
235
|
+
const minValueType = element.minValueType;
|
|
223
236
|
const variableName = element.readVariableName;
|
|
237
|
+
// 最大最小值选择变量类型时,其中一个未绑定变量不进行开点操作 - FLEXCLOUD-1817
|
|
238
|
+
if (maxValueType && maxVariableName && !variableNames.find(v => isEqual(maxVariableName, v))) {
|
|
239
|
+
variableNames.push(maxVariableName);
|
|
240
|
+
}
|
|
241
|
+
if (minValueType && minVariableName && !variableNames.find(v => isEqual(minVariableName, v))) {
|
|
242
|
+
variableNames.push(minVariableName);
|
|
243
|
+
}
|
|
224
244
|
if (variableName && !variableNames.find(v => isEqual(variableName, v))) {
|
|
225
245
|
variableNames.push(element.readVariableName);
|
|
226
246
|
}
|
|
247
|
+
// 数值显示元件:上下限变量类型时,将上下限变量名也加入订阅
|
|
248
|
+
if (element instanceof NumericalDisplayElement) {
|
|
249
|
+
const upperLimitVarName = element.upperLimitVariableName;
|
|
250
|
+
if (upperLimitVarName && !variableNames.find(v => isEqual(upperLimitVarName, v))) {
|
|
251
|
+
variableNames.push(upperLimitVarName);
|
|
252
|
+
}
|
|
253
|
+
const lowerLimitVarName = element.lowerLimitVariableName;
|
|
254
|
+
if (lowerLimitVarName && !variableNames.find(v => isEqual(lowerLimitVarName, v))) {
|
|
255
|
+
variableNames.push(lowerLimitVarName);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
227
258
|
}
|
|
228
259
|
});
|
|
229
260
|
return variableNames;
|
|
@@ -241,14 +272,44 @@ export class MainElement {
|
|
|
241
272
|
});
|
|
242
273
|
});
|
|
243
274
|
}
|
|
275
|
+
getVirtualDeviceIdFromRect(rectElement) {
|
|
276
|
+
let current = rectElement;
|
|
277
|
+
while (current) {
|
|
278
|
+
if (current.tagName === 'FC-GUI') {
|
|
279
|
+
const virtualDeviceId = current.getAttribute('data-virtual-device-id');
|
|
280
|
+
return virtualDeviceId || null;
|
|
281
|
+
}
|
|
282
|
+
current = current.parentElement;
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
244
286
|
reportVariableValues(values) {
|
|
245
287
|
this.checkIsLoaded();
|
|
246
288
|
each(values, value => {
|
|
247
289
|
each(this.elements, e => {
|
|
290
|
+
var _a;
|
|
248
291
|
if (e instanceof ReadableElement) {
|
|
249
|
-
if (e.readVariableName === value.variableName
|
|
292
|
+
if ((value.variableName && (e.readVariableName === value.variableName ||
|
|
293
|
+
e.minVariableName === value.variableName || e.maxVariableName === value.variableName))) {
|
|
250
294
|
e.reportValueChanged(value);
|
|
251
295
|
}
|
|
296
|
+
// 数值显示元件:上下限变量推送分发
|
|
297
|
+
if (e instanceof NumericalDisplayElement && value.variableName && (e.upperLimitVariableName === value.variableName ||
|
|
298
|
+
e.lowerLimitVariableName === value.variableName)) {
|
|
299
|
+
e.reportValueChanged(value);
|
|
300
|
+
}
|
|
301
|
+
if (e.readVariableName === value.systemName) {
|
|
302
|
+
const rect = (_a = e.currentRect) === null || _a === void 0 ? void 0 : _a[0];
|
|
303
|
+
const deviceId = this.getVirtualDeviceIdFromRect(rect);
|
|
304
|
+
if (deviceId) {
|
|
305
|
+
if (+deviceId === value.virtualDeviceId) {
|
|
306
|
+
e.reportValueChanged(value);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
e.reportValueChanged(value);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
252
313
|
}
|
|
253
314
|
});
|
|
254
315
|
});
|
|
@@ -257,7 +318,7 @@ export class MainElement {
|
|
|
257
318
|
each(this.elements, e => {
|
|
258
319
|
if (e instanceof HistoricalCurveElement || e instanceof VideoElement
|
|
259
320
|
|| e instanceof WeatherElement || e instanceof NumericalDisplayElement || e instanceof TextElement
|
|
260
|
-
|| e instanceof AirQualityElement) {
|
|
321
|
+
|| e instanceof AirQualityElement || e instanceof SwitchIndicatorLightElement || e instanceof ScrollAlarmElement) {
|
|
261
322
|
e.dispose();
|
|
262
323
|
}
|
|
263
324
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"MainElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"MainElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":56,"character":43},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":57,"character":41},{"__symbolic":"reference","module":"../gui/gui-context","name":"GuiContext","line":58,"character":34},{"__symbolic":"reference","module":"../communication","name":"VariableCommunicator","line":59,"character":47},{"__symbolic":"reference","module":"../view/popup-view.service","name":"PopupViewService","line":60,"character":43},null]}],"load":[{"__symbolic":"method"}],"uniformStretch":[{"__symbolic":"method"}],"changeVideoStyle":[{"__symbolic":"method"}],"horizontalStretch":[{"__symbolic":"method"}],"initElementState":[{"__symbolic":"method"}],"getVariableNames":[{"__symbolic":"method"}],"reportVariableStates":[{"__symbolic":"method"}],"getVirtualDeviceIdFromRect":[{"__symbolic":"method"}],"reportVariableValues":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"checkIsLoaded":[{"__symbolic":"method"}],"initBackground":[{"__symbolic":"method"}],"getImageEl":[{"__symbolic":"method"}]}}}}]
|
|
@@ -5,16 +5,22 @@ import { ReadableElement } from './base';
|
|
|
5
5
|
import { VariableStore } from '../config';
|
|
6
6
|
import { PermissionChecker } from '../service';
|
|
7
7
|
export declare class MeterElement extends ReadableElement {
|
|
8
|
+
private static DEFAULT_MIN_VALUE;
|
|
9
|
+
private static DEFAULT_MAX_VALUE;
|
|
8
10
|
private readonly $handEl;
|
|
9
11
|
private readonly arcPath$;
|
|
10
12
|
private cx;
|
|
11
13
|
private cy;
|
|
12
14
|
private offsetY;
|
|
13
15
|
private mainElementTransform;
|
|
16
|
+
private valueObj;
|
|
17
|
+
private isNeedUpdateScale;
|
|
14
18
|
readonly model: Meter;
|
|
15
19
|
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
16
|
-
|
|
20
|
+
private updateValueObj;
|
|
21
|
+
updateVariableValue(value: number, variableName: any): void;
|
|
17
22
|
private initFrameNode;
|
|
23
|
+
private updateScale;
|
|
18
24
|
private getAngle;
|
|
19
25
|
private directionPoint;
|
|
20
26
|
}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { ReadableElement } from './base';
|
|
2
|
+
import { isNumber } from 'lodash';
|
|
3
|
+
import { VariableValueType } from '../model/shared/condition/variable-value-type';
|
|
2
4
|
export class MeterElement extends ReadableElement {
|
|
3
5
|
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
4
6
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
5
7
|
this.cx = 0;
|
|
6
8
|
this.cy = 0;
|
|
7
9
|
this.offsetY = 0;
|
|
10
|
+
this.valueObj = {};
|
|
11
|
+
this.isNeedUpdateScale = false;
|
|
12
|
+
if ((this.model.minValueType === VariableValueType.Constant && this.model.maxValueType === VariableValueType.Variable)
|
|
13
|
+
|| this.model.maxValueType === VariableValueType.Constant && this.model.minValueType === VariableValueType.Variable) {
|
|
14
|
+
this.isNeedUpdateScale = true;
|
|
15
|
+
this.updateScale();
|
|
16
|
+
this.isNeedUpdateScale = false;
|
|
17
|
+
}
|
|
8
18
|
let mainEl$;
|
|
9
19
|
if (this.model.version && this.model.version > 3) {
|
|
10
20
|
mainEl$ = this.$element.find('[data-id="main"]');
|
|
@@ -31,18 +41,75 @@ export class MeterElement extends ReadableElement {
|
|
|
31
41
|
this.changeStates();
|
|
32
42
|
});
|
|
33
43
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
updateValueObj(value, variableName) {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
if (((_a = this.model.readVariable) === null || _a === void 0 ? void 0 : _a.name) === variableName) {
|
|
47
|
+
this.isNeedUpdateScale = false;
|
|
48
|
+
this.valueObj.value = value;
|
|
49
|
+
}
|
|
50
|
+
if (((_b = this.model.minVariable) === null || _b === void 0 ? void 0 : _b.name) === variableName) {
|
|
51
|
+
this.isNeedUpdateScale = true;
|
|
52
|
+
this.valueObj.min = value;
|
|
53
|
+
}
|
|
54
|
+
if (((_c = this.model.maxVariable) === null || _c === void 0 ? void 0 : _c.name) === variableName) {
|
|
55
|
+
this.isNeedUpdateScale = true;
|
|
56
|
+
this.valueObj.max = value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
updateVariableValue(value, variableName) {
|
|
60
|
+
this.updateValueObj(value, variableName);
|
|
61
|
+
this.updateScale();
|
|
62
|
+
const angle = this.getAngle();
|
|
63
|
+
if (isNumber(angle)) {
|
|
64
|
+
this.$handEl.attr('transform', this.mainElementTransform + ` translate(0,${this.offsetY}) rotate(${angle}, ${this.cx}, ${this.cy})`);
|
|
65
|
+
}
|
|
37
66
|
}
|
|
38
67
|
initFrameNode() {
|
|
39
68
|
const b = Snap(this.$element[0]).getBBox();
|
|
40
69
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
|
|
41
70
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
updateScale() {
|
|
72
|
+
if (!this.isNeedUpdateScale) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
let min = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
76
|
+
let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
77
|
+
min = Number(min);
|
|
78
|
+
max = Number(max);
|
|
79
|
+
if (isNaN(min) || isNaN(max)) {
|
|
80
|
+
min = MeterElement.DEFAULT_MIN_VALUE;
|
|
81
|
+
max = MeterElement.DEFAULT_MAX_VALUE;
|
|
82
|
+
}
|
|
83
|
+
const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
|
|
84
|
+
const textElements = this.$element.find('g:first > text');
|
|
85
|
+
for (let i = 0; i < textElements.length; i++) {
|
|
86
|
+
const text = textElements[i];
|
|
87
|
+
if (!text.innerHTML) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
let sacleValue = ((Number(avgSacle) * i) + min).toFixed(0);
|
|
91
|
+
// 整数位和小数位格式化;
|
|
92
|
+
if (this.model.fractionDigits > 0) {
|
|
93
|
+
sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
|
|
94
|
+
}
|
|
95
|
+
if (!isNaN(sacleValue)) {
|
|
96
|
+
text.innerHTML = sacleValue;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
getAngle() {
|
|
101
|
+
let min = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
102
|
+
let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
103
|
+
min = Number(min);
|
|
104
|
+
max = Number(max);
|
|
105
|
+
if (isNaN(min) || isNaN(max)) {
|
|
106
|
+
min = MeterElement.DEFAULT_MIN_VALUE;
|
|
107
|
+
max = MeterElement.DEFAULT_MAX_VALUE;
|
|
108
|
+
}
|
|
109
|
+
if (!this.valueObj.value && isNaN(Number(this.valueObj.value))) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const value = Math.min(Math.max(this.valueObj.value || 0, min), max);
|
|
46
113
|
const len = (value - min) / (max - min);
|
|
47
114
|
const arcPath = Snap(this.arcPath$[0]);
|
|
48
115
|
const b = arcPath.getBBox(true);
|
|
@@ -68,3 +135,5 @@ export class MeterElement extends ReadableElement {
|
|
|
68
135
|
return c;
|
|
69
136
|
}
|
|
70
137
|
}
|
|
138
|
+
MeterElement.DEFAULT_MIN_VALUE = 0;
|
|
139
|
+
MeterElement.DEFAULT_MAX_VALUE = 100;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"MeterElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base","name":"ReadableElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"MeterElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base","name":"ReadableElement","line":9,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":25,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../service","name":"PermissionChecker","line":25,"character":57},{"__symbolic":"reference","module":"../communication","name":"VariableCommunicator","line":26,"character":30},{"__symbolic":"reference","module":"../config","name":"VariableStore","line":26,"character":67},{"__symbolic":"reference","module":"../localization","name":"Localization","line":26,"character":96},{"__symbolic":"reference","name":"string"}]}],"updateValueObj":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"initFrameNode":[{"__symbolic":"method"}],"updateScale":[{"__symbolic":"method"}],"getAngle":[{"__symbolic":"method"}],"directionPoint":[{"__symbolic":"method"}]},"statics":{"DEFAULT_MIN_VALUE":0,"DEFAULT_MAX_VALUE":100}}}}]
|
|
@@ -3,15 +3,18 @@ import { BsModalService } from 'ngx-bootstrap/modal';
|
|
|
3
3
|
import { GraphStore, VariableStore } from '../../config';
|
|
4
4
|
import { Localization } from '../../localization';
|
|
5
5
|
import { NumericalDisplay } from '../../model';
|
|
6
|
-
import { PermissionChecker, OperationRecordService } from '../../service';
|
|
7
|
-
import { VariableCommunicator } from '../../communication';
|
|
6
|
+
import { PermissionChecker, OperationRecordService, ReleasedVariableService } from '../../service';
|
|
7
|
+
import { VariableCommunicator, VariableValue } from '../../communication';
|
|
8
8
|
import { ReadableElement } from '../base/readable-element';
|
|
9
9
|
import { SecurityChecker } from '../../security';
|
|
10
|
+
import { GuiContext } from '../../gui/gui-context';
|
|
10
11
|
export declare class NumericalDisplayElement extends ReadableElement {
|
|
11
12
|
private readonly modalService;
|
|
12
13
|
private readonly graphStore;
|
|
13
14
|
private readonly operationRecordService;
|
|
15
|
+
private readonly releasedVariableService;
|
|
14
16
|
private readonly securityChecker;
|
|
17
|
+
private readonly guiContext?;
|
|
15
18
|
private readonly dataTypeService;
|
|
16
19
|
private readonly fractionDigitService;
|
|
17
20
|
private readonly accessPermissionService;
|
|
@@ -21,9 +24,25 @@ export declare class NumericalDisplayElement extends ReadableElement {
|
|
|
21
24
|
private readonly logger;
|
|
22
25
|
private displayForeignObject;
|
|
23
26
|
private enableDataParsed;
|
|
27
|
+
private writeValueMmodalRef;
|
|
28
|
+
private recordValue;
|
|
29
|
+
private showValue;
|
|
30
|
+
private numericalOperation;
|
|
31
|
+
private restorationTimer;
|
|
32
|
+
private _resolvedUpperLimitValue;
|
|
33
|
+
private _resolvedLowerLimitValue;
|
|
34
|
+
/** 当数值上限配置为变量类型时,返回变量名;否则返回 undefined */
|
|
35
|
+
get upperLimitVariableName(): string | undefined;
|
|
36
|
+
/** 当数值下限配置为变量类型时,返回变量名;否则返回 undefined */
|
|
37
|
+
get lowerLimitVariableName(): string | undefined;
|
|
24
38
|
get writeVariableName(): string;
|
|
25
|
-
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
39
|
+
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, releasedVariableService: ReleasedVariableService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string, guiContext?: GuiContext);
|
|
26
40
|
dispose(): void;
|
|
41
|
+
/**
|
|
42
|
+
* 重写父类方法,处理"当前语种ID"系统变量
|
|
43
|
+
* 当值为null时,显示默认语种ID
|
|
44
|
+
*/
|
|
45
|
+
reportValueChanged(value: VariableValue): void;
|
|
27
46
|
initElement(): any;
|
|
28
47
|
private checkElementPassword;
|
|
29
48
|
private initVariableText;
|
|
@@ -11,15 +11,26 @@ import { ConfirmOperationModalComponent } from '../../modal/confirm-operation/co
|
|
|
11
11
|
import { VerifyPasswordModalComponent } from '../../modal/verify-password/verify-password-modal.component';
|
|
12
12
|
import { isNil } from 'lodash';
|
|
13
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 = {}));
|
|
14
20
|
export class NumericalDisplayElement extends ReadableElement {
|
|
15
|
-
constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, securityChecker, variableStore, localization, signalRAppId) {
|
|
21
|
+
constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, releasedVariableService, securityChecker, variableStore, localization, signalRAppId, guiContext) {
|
|
16
22
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
17
23
|
this.modalService = modalService;
|
|
18
24
|
this.graphStore = graphStore;
|
|
19
25
|
this.operationRecordService = operationRecordService;
|
|
26
|
+
this.releasedVariableService = releasedVariableService;
|
|
20
27
|
this.securityChecker = securityChecker;
|
|
28
|
+
this.guiContext = guiContext;
|
|
21
29
|
this.displayText = '';
|
|
22
30
|
this.enableDataParsed = false;
|
|
31
|
+
// 上下限变量的实时缓存值(仅当上下限配置为变量类型时使用)
|
|
32
|
+
this._resolvedUpperLimitValue = undefined;
|
|
33
|
+
this._resolvedLowerLimitValue = undefined;
|
|
23
34
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
24
35
|
this.dataTypeService = injector.get(DataTypeService);
|
|
25
36
|
this.fractionDigitService = injector.get(FractionDigitService);
|
|
@@ -39,6 +50,22 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
39
50
|
}
|
|
40
51
|
this.initElement();
|
|
41
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
|
+
}
|
|
42
69
|
get writeVariableName() {
|
|
43
70
|
return this.readVariableName;
|
|
44
71
|
}
|
|
@@ -50,6 +77,42 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
50
77
|
this.$element.remove();
|
|
51
78
|
}
|
|
52
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
|
+
// 如果上限变量不是主显示变量,直接返回
|
|
91
|
+
if (value.variableName !== this.readVariableName) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (this.lowerLimitVariableName && value.variableName === this.lowerLimitVariableName) {
|
|
96
|
+
const num = Number(value.value);
|
|
97
|
+
this._resolvedLowerLimitValue = (value.value != null && !isNaN(num)) ? num : undefined;
|
|
98
|
+
// 如果下限变量不是主显示变量,直接返回
|
|
99
|
+
if (value.variableName !== this.readVariableName) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// 处理系统变量"当前语种ID"
|
|
104
|
+
if (value.variableName === '当前语种ID') {
|
|
105
|
+
let displayValue = value.value;
|
|
106
|
+
// 如果值为null,使用默认语种ID
|
|
107
|
+
if (displayValue === null || displayValue === undefined) {
|
|
108
|
+
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;
|
|
109
|
+
}
|
|
110
|
+
this.updateVariableValue(displayValue);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
// 其他变量调用父类方法
|
|
114
|
+
super.reportValueChanged(value);
|
|
115
|
+
}
|
|
53
116
|
initElement() {
|
|
54
117
|
const { rootElement } = this;
|
|
55
118
|
rootElement.selectAll('*').remove();
|
|
@@ -173,19 +236,75 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
173
236
|
if (null == this.writeVariableName) {
|
|
174
237
|
return;
|
|
175
238
|
}
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
|
|
239
|
+
// 获取数值操作配置,上下限变量类型已在 reportValueChanged 中实时更新到缓存
|
|
240
|
+
const numericalOperation = this.numericalOperationService.getNumericalOperations(this.model);
|
|
241
|
+
// 用缓存的实时值替换变量类型上下限
|
|
242
|
+
// 模拟模式下(releasedVariableService 为空)变量无实时值,直接使用数据类型默认范围
|
|
243
|
+
const isSimulation = !this.releasedVariableService;
|
|
244
|
+
if (typeof numericalOperation.numericalUpperLimit === 'object' && numericalOperation.numericalUpperLimit.type === 1) {
|
|
245
|
+
if (isSimulation) {
|
|
246
|
+
numericalOperation.numericalUpperLimit = this.dataTypeService.getMaxValue(this.model.version || 0, this.model.dataType || 0, this.model.fBoxDataType || 0, this.model.integerDigits || undefined, this.model.fractionDigits || undefined);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
numericalOperation.numericalUpperLimit = this._resolvedUpperLimitValue != null
|
|
250
|
+
? this._resolvedUpperLimitValue
|
|
251
|
+
: (this.dataTypeService.getMaxValue(this.model.version || 0, this.model.dataType || 0, this.model.fBoxDataType || 0) || 0);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (typeof numericalOperation.numericalLowerLimit === 'object' && numericalOperation.numericalLowerLimit.type === 1) {
|
|
255
|
+
if (isSimulation) {
|
|
256
|
+
numericalOperation.numericalLowerLimit = this.dataTypeService.getMinValue(this.model.version || 0, this.model.dataType || 0, this.model.fBoxDataType || 0, this.model.integerDigits || undefined, this.model.fractionDigits || undefined);
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
numericalOperation.numericalLowerLimit = this._resolvedLowerLimitValue != null
|
|
260
|
+
? this._resolvedLowerLimitValue
|
|
261
|
+
: (this.dataTypeService.getMinValue(this.model.version || 0, this.model.dataType || 0, this.model.fBoxDataType || 0) || 0);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
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);
|
|
265
|
+
this.writeValueMmodalRef = this.modalService.show(WriteValueModalComponent, {
|
|
266
|
+
initialState: { args: args }, backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-write', animated: false
|
|
179
267
|
});
|
|
180
|
-
|
|
181
|
-
modalRef.hide();
|
|
182
|
-
onClosedSub.unsubscribe();
|
|
268
|
+
this.writeValueMmodalRef.content.onClosed = (result) => {
|
|
183
269
|
if (result) {
|
|
270
|
+
if (this.restorationTimer) {
|
|
271
|
+
clearTimeout(this.restorationTimer);
|
|
272
|
+
this.restorationTimer = undefined;
|
|
273
|
+
}
|
|
274
|
+
this.recordValue = result.value;
|
|
184
275
|
const writeValue = this.dataTypeService.formatToDecimal(this.model.version, result.value, this.model.dataType);
|
|
185
|
-
this.
|
|
186
|
-
|
|
276
|
+
this.showValue = result.showValue;
|
|
277
|
+
// 如果是系统变量"当前语种ID",只更新显示,不执行变量写入和操作记录
|
|
278
|
+
if (this.writeVariableName === '当前语种ID') {
|
|
279
|
+
// 直接更新显示值
|
|
280
|
+
this.displayText = this.showValue;
|
|
281
|
+
this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
|
|
282
|
+
this.writeValueMmodalRef.hide();
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (this.displayText !== this.showValue || result.variableRwType === variableRwTypeEnum.witer) {
|
|
286
|
+
if (this.numericalOperation || result.enableNumericalOperation || result.isNumericalOperation || result.variableRwType === variableRwTypeEnum.witer) {
|
|
287
|
+
this.recordOperation(result.value);
|
|
288
|
+
this.writeValueMmodalRef.hide();
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
this.restorationTimer = setTimeout(() => {
|
|
292
|
+
const isEquation = this.model.fractionDigits ?
|
|
293
|
+
parseFloat(this.displayText) === parseFloat(this.showValue) :
|
|
294
|
+
parseInt(this.displayText, 16) === parseInt(this.showValue, 16);
|
|
295
|
+
if (!isEquation) {
|
|
296
|
+
this.writeValueMmodalRef.content.isSubmitting = false;
|
|
297
|
+
this.writeValueMmodalRef.content.showValidationErrorInfo(this.localization.writeValueTimeout);
|
|
298
|
+
}
|
|
299
|
+
}, 30000);
|
|
300
|
+
}
|
|
301
|
+
this.variableCommunicator.write(this.writeVariableName, writeValue).subscribe();
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
this.writeValueMmodalRef.hide();
|
|
305
|
+
}
|
|
187
306
|
}
|
|
188
|
-
}
|
|
307
|
+
};
|
|
189
308
|
}
|
|
190
309
|
recordOperation(newValue) {
|
|
191
310
|
if (this.model.isRecordOperation || this.model.isRecordOperation === undefined) {
|
|
@@ -211,7 +330,21 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
211
330
|
}
|
|
212
331
|
}
|
|
213
332
|
updateVariableValue(value) {
|
|
214
|
-
|
|
333
|
+
var _a;
|
|
334
|
+
const displayText = this.formatNumericalDisplayText(this.model.dataType, this.model.fractionDigits, value);
|
|
335
|
+
const isEquation = this.model.fractionDigits ?
|
|
336
|
+
parseFloat(displayText) === parseFloat(this.showValue) :
|
|
337
|
+
parseInt(displayText, 16) === parseInt(this.showValue, 16);
|
|
338
|
+
if (((_a = this.writeValueMmodalRef) === null || _a === void 0 ? void 0 : _a.content) && isEquation) {
|
|
339
|
+
if (this.restorationTimer) {
|
|
340
|
+
clearTimeout(this.restorationTimer);
|
|
341
|
+
this.restorationTimer = undefined;
|
|
342
|
+
this.recordOperation(this.recordValue);
|
|
343
|
+
}
|
|
344
|
+
this.writeValueMmodalRef.hide();
|
|
345
|
+
this.writeValueMmodalRef.content.hideValidationErrorInfo();
|
|
346
|
+
}
|
|
347
|
+
this.displayText = displayText;
|
|
215
348
|
this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
|
|
216
349
|
}
|
|
217
350
|
updateDisplayText(text) {
|
|
@@ -354,7 +487,7 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
354
487
|
}
|
|
355
488
|
formatDisplayTextUnit(displayText) {
|
|
356
489
|
if (this.model.showUnit !== false && this.model.unit) {
|
|
357
|
-
return `${displayText} ${this.model.unit}`;
|
|
490
|
+
return `${displayText || 0} ${this.model.unit}`;
|
|
358
491
|
}
|
|
359
492
|
return displayText;
|
|
360
493
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":29,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":73,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":74,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":75,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":76,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":77,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":78,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":79,"character":49},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":80,"character":50},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":81,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":82,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":83,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":85,"character":38}]}],"dispose":[{"__symbolic":"method"}],"reportValueChanged":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"doWriteValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateDisplayText":[{"__symbolic":"method"}],"rebuildTextElement":[{"__symbolic":"method"}],"formatNumericalDisplayText":[{"__symbolic":"method"}],"formatFloatDisplayText":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"formatDisplayTextUnit":[{"__symbolic":"method"}]}}}}]
|