@flexem/fc-gui 3.0.0-alpha.3 → 3.0.0-alpha.30
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 +131 -0
- package/bundles/@flexem/fc-gui.umd.js +2230 -1278
- 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 +2 -2
- package/elements/air-quality/air-quality-element.d.ts +31 -0
- package/elements/air-quality/air-quality-element.js +195 -0
- package/elements/air-quality/air-quality-element.metadata.json +1 -0
- package/elements/bar-graph-element.d.ts +8 -2
- package/elements/bar-graph-element.js +72 -6
- package/elements/bar-graph-element.metadata.json +1 -1
- package/elements/base/base-element.d.ts +2 -1
- package/elements/base/base-element.js +2 -1
- package/elements/base/base-element.metadata.json +1 -1
- package/elements/base/conditional-control-element.d.ts +1 -1
- package/elements/base/conditional-control-element.js +3 -3
- package/elements/base/conditional-control-element.metadata.json +1 -1
- package/elements/base/conditional-display-element.d.ts +1 -1
- package/elements/base/conditional-display-element.js +4 -4
- package/elements/base/conditional-display-element.metadata.json +1 -1
- package/elements/base/conditional-dynamic-display-element.d.ts +1 -1
- package/elements/base/conditional-dynamic-display-element.js +3 -3
- package/elements/base/conditional-dynamic-display-element.metadata.json +1 -1
- package/elements/base/conditional-enable-element.d.ts +1 -1
- package/elements/base/conditional-enable-element.js +4 -4
- package/elements/base/conditional-enable-element.metadata.json +1 -1
- package/elements/base/readable-element.d.ts +7 -2
- package/elements/base/readable-element.js +33 -4
- package/elements/base/readable-element.metadata.json +1 -1
- package/elements/base/state-control-element.d.ts +1 -1
- package/elements/base/state-control-element.js +2 -2
- package/elements/base/state-control-element.metadata.json +1 -1
- package/elements/character-display/character-display-element.d.ts +1 -1
- package/elements/character-display/character-display-element.js +2 -2
- package/elements/character-display/character-display-element.metadata.json +1 -1
- package/elements/datetime-display/datetime-display-element.d.ts +1 -1
- package/elements/datetime-display/datetime-display-element.js +2 -2
- package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +1 -1
- package/elements/historical-curve/historical-curve.element.js +10 -10
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/main-element.d.ts +2 -1
- package/elements/main-element.js +44 -26
- package/elements/main-element.metadata.json +1 -1
- package/elements/meter-element.d.ts +8 -2
- package/elements/meter-element.js +78 -9
- package/elements/meter-element.metadata.json +1 -1
- package/elements/numerical-display/numerical-display-element.d.ts +2 -1
- package/elements/numerical-display/numerical-display-element.js +14 -5
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/elements/per-view-variable-communicator.d.ts +2 -2
- package/elements/per-view-variable-communicator.js +4 -4
- package/elements/pipe/pipe-element.d.ts +1 -1
- package/elements/pipe/pipe-element.js +2 -2
- package/elements/pipe/pipe-element.metadata.json +1 -1
- package/elements/ring-graph/ring-graph-element.d.ts +11 -2
- package/elements/ring-graph/ring-graph-element.js +99 -5
- package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
- package/elements/shared/graph/graph-state-element.js +0 -3
- package/elements/shared/text/text-element.js +13 -2
- package/elements/shared/text/text-state-element.js +1 -1
- package/elements/static-elements/hyperlink-element.d.ts +1 -1
- package/elements/static-elements/hyperlink-element.js +2 -2
- package/elements/static-elements/hyperlink-element.metadata.json +1 -1
- package/elements/static-elements/image-element.d.ts +1 -1
- package/elements/static-elements/image-element.js +2 -2
- package/elements/static-elements/image-element.metadata.json +1 -1
- package/elements/static-elements/text-element.d.ts +1 -1
- package/elements/static-elements/text-element.js +2 -2
- package/elements/static-elements/text-element.metadata.json +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.js +4 -4
- package/elements/switch-indicator-light/bit-switch-operator.d.ts +3 -1
- package/elements/switch-indicator-light/bit-switch-operator.js +22 -2
- package/elements/switch-indicator-light/bit-switch-operator.metadata.json +1 -1
- package/elements/switch-indicator-light/indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +9 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.js +97 -28
- package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-operator.d.ts +1 -0
- package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/word-indicator-light-operator.js +5 -5
- package/elements/switch-indicator-light/word-switch-operator.d.ts +3 -1
- package/elements/switch-indicator-light/word-switch-operator.js +9 -2
- package/elements/switch-indicator-light/word-switch-operator.metadata.json +1 -1
- package/elements/table/table-element.d.ts +1 -1
- package/elements/table/table-element.js +2 -2
- package/elements/table/table-element.metadata.json +1 -1
- package/elements/vector-graphics/ellipse-element.d.ts +1 -1
- package/elements/vector-graphics/ellipse-element.js +2 -2
- package/elements/vector-graphics/ellipse-element.metadata.json +1 -1
- package/elements/vector-graphics/poly-line-element.d.ts +1 -1
- package/elements/vector-graphics/poly-line-element.js +2 -2
- package/elements/vector-graphics/poly-line-element.metadata.json +1 -1
- package/elements/vector-graphics/polygon-element.d.ts +1 -1
- package/elements/vector-graphics/polygon-element.js +2 -2
- package/elements/vector-graphics/polygon-element.metadata.json +1 -1
- package/elements/vector-graphics/rectangle-element.d.ts +1 -1
- package/elements/vector-graphics/rectangle-element.js +2 -2
- package/elements/vector-graphics/rectangle-element.metadata.json +1 -1
- package/elements/vector-graphics/sector-element.d.ts +1 -1
- package/elements/vector-graphics/sector-element.js +2 -2
- package/elements/vector-graphics/sector-element.metadata.json +1 -1
- package/elements/vector-graphics/straight-line-element.d.ts +1 -1
- package/elements/vector-graphics/straight-line-element.js +2 -2
- package/elements/vector-graphics/straight-line-element.metadata.json +1 -1
- package/elements/video/video-element.d.ts +1 -1
- package/elements/video/video-element.js +2 -2
- package/elements/video/video-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.d.ts +1 -1
- package/elements/view-operation/view-operation.element.js +2 -2
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/elements/weather/weater-element.d.ts +1 -1
- package/elements/weather/weater-element.js +2 -2
- package/elements/weather/weater-element.metadata.json +1 -1
- package/gui/gui-host.js +1 -1
- package/gui/gui-view.d.ts +1 -0
- package/gui/gui-view.js +3 -2
- package/gui/gui-view.metadata.json +1 -1
- package/localization/localization.service.d.ts +5 -0
- package/localization/localization.service.js +6 -1
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +6 -1
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/modal/write-value/write-value-modal-args.d.ts +3 -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 +2 -0
- package/modal/write-value/write-value-modal.component.js +24 -12
- package/modal/write-value/write-value-modal.component.metadata.json +1 -1
- package/model/air-quality/air-quality-info.d.ts +23 -0
- package/model/air-quality/air-quality-info.js +4 -0
- package/model/air-quality/air-quality-info.metadata.json +1 -0
- package/model/air-quality/air-quality.model.d.ts +7 -0
- package/model/air-quality/air-quality.model.js +0 -0
- package/model/air-quality/air-quality.model.metadata.json +1 -0
- package/model/bar-graph/bar-graph.d.ts +4 -0
- package/model/base/readable-model.d.ts +4 -0
- package/model/meter/meter.d.ts +4 -0
- package/model/numerical-display/numerical-display.d.ts +2 -0
- package/model/ring-graph/ring-graph.model.d.ts +8 -0
- package/model/shared/condition/bit-condition-item-observer.d.ts +1 -1
- package/model/shared/condition/bit-condition-item-observer.js +4 -4
- package/model/shared/condition/condition-items-result-observer.d.ts +1 -1
- package/model/shared/condition/condition-items-result-observer.js +22 -12
- package/model/shared/condition/condition-items-result-observer.metadata.json +1 -1
- package/model/shared/condition/convert-condition-model.d.ts +5 -0
- package/model/shared/condition/convert-condition-model.js +0 -0
- package/model/shared/condition/convert-condition-model.metadata.json +1 -0
- package/model/shared/condition/relation-condition-result.d.ts +2 -1
- package/model/shared/condition/relation-condition-result.js +2 -1
- package/model/shared/condition/relation-condition-result.metadata.json +1 -1
- package/model/shared/condition/word-condition-item-observer.d.ts +1 -1
- package/model/shared/condition/word-condition-item-observer.js +11 -11
- package/model/shared/dynamic-display/dynamic-display.d.ts +1 -1
- package/model/shared/dynamic-display/dynamic-display.js +4 -4
- package/model/shared/dynamic-display/dynamic-display.metadata.json +1 -1
- package/model/shared/rotation/rotation-behavior.d.ts +1 -1
- package/model/shared/rotation/rotation-behavior.js +2 -2
- package/model/shared/rotation/rotation-behavior.metadata.json +1 -1
- package/model/shared/rotation/rotation-observer.d.ts +2 -1
- package/model/shared/rotation/rotation-observer.js +3 -2
- package/model/shared/rotation/rotation-observer.metadata.json +1 -1
- package/model/shared/translation/translation-behavior.d.ts +1 -1
- package/model/shared/translation/translation-behavior.js +3 -3
- package/model/shared/translation/translation-behavior.metadata.json +1 -1
- package/model/shared/translation/translation-observer.d.ts +1 -1
- package/model/shared/translation/translation-observer.js +2 -2
- package/model/shared/translation/translation-observer.metadata.json +1 -1
- package/model/switch-indicator-light/bit-switch-operation.d.ts +2 -1
- package/model/switch-indicator-light/bit-switch-operation.js +1 -0
- package/model/switch-indicator-light/bit-switch-operation.metadata.json +1 -1
- package/package.json +1 -1
- package/remote/communication/variable/remote-variable-communicator.d.ts +3 -2
- package/remote/communication/variable/remote-variable-communicator.js +16 -9
- package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
- package/remote/communication/variable/remote-variable-protocol.d.ts +2 -2
- package/service/weather.service.d.ts +1 -0
- package/shared/gui-consts.d.ts +1 -0
- package/shared/gui-consts.js +1 -0
- package/shared/gui-consts.metadata.json +1 -1
- package/utils/data-type/data-type.service.d.ts +4 -7
- package/utils/data-type/data-type.service.js +29 -17
- package/utils/numerical-operation.service.js +2 -2
- package/gui/scripts/config.js +0 -6
- package/gui/scripts/require.js +0 -2145
- package/libs/nvd3/build/nv.d3.min.js +0 -13
|
@@ -4,8 +4,8 @@ import { ConditionalEnableElement } from './conditional-enable-element';
|
|
|
4
4
|
import { forEach } from 'lodash';
|
|
5
5
|
import { VariableUtil } from '../../utils/variable-util';
|
|
6
6
|
export class ReadableElement extends ConditionalEnableElement {
|
|
7
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
8
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
7
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
8
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
9
9
|
}
|
|
10
10
|
init(variableName) {
|
|
11
11
|
if (variableName) {
|
|
@@ -36,6 +36,33 @@ export class ReadableElement extends ConditionalEnableElement {
|
|
|
36
36
|
return VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
get minVariableName() {
|
|
40
|
+
if (!this.model.minValueType) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return this.getVariableName(this.model.minVariable);
|
|
44
|
+
}
|
|
45
|
+
get minValueType() {
|
|
46
|
+
return this.model.minValueType;
|
|
47
|
+
}
|
|
48
|
+
get maxVariableName() {
|
|
49
|
+
if (!this.model.maxValueType) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
return this.getVariableName(this.model.maxVariable);
|
|
53
|
+
}
|
|
54
|
+
get maxValueType() {
|
|
55
|
+
return this.model.maxValueType;
|
|
56
|
+
}
|
|
57
|
+
getVariableName(variable) {
|
|
58
|
+
if (!this.model) {
|
|
59
|
+
throw new Error('Model cannot be null');
|
|
60
|
+
}
|
|
61
|
+
if (!variable) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
return VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
65
|
+
}
|
|
39
66
|
reportStateChanged(variableState) {
|
|
40
67
|
forEach(this.elementStates, elementState => {
|
|
41
68
|
if (elementState.variableName === variableState.variableName) {
|
|
@@ -51,8 +78,10 @@ export class ReadableElement extends ConditionalEnableElement {
|
|
|
51
78
|
this.changeStates();
|
|
52
79
|
}
|
|
53
80
|
});
|
|
54
|
-
if (this.state === State.Normal || this.state === State.Disable
|
|
55
|
-
this.
|
|
81
|
+
if (this.state === State.Normal || this.state === State.Disable
|
|
82
|
+
|| value.variableName === this.minVariableName
|
|
83
|
+
|| value.variableName === this.maxVariableName) {
|
|
84
|
+
this.updateVariableValue(value.value, value.variableName);
|
|
56
85
|
}
|
|
57
86
|
}
|
|
58
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ReadableElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-enable-element","name":"ConditionalEnableElement","line":9,"character":46},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":13,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":13,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":13,"character":98},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":14,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":14,"character":52}]}],"init":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"reportStateChanged":[{"__symbolic":"method"}],"reportValueChanged":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ReadableElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-enable-element","name":"ConditionalEnableElement","line":9,"character":46},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":13,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":13,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":13,"character":98},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":14,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":14,"character":52},{"__symbolic":"reference","name":"string"}]}],"init":[{"__symbolic":"method"}],"getVariableName":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"reportStateChanged":[{"__symbolic":"method"}],"reportValueChanged":[{"__symbolic":"method"}]}}}}]
|
|
@@ -11,7 +11,7 @@ export declare abstract class StateControlElement extends ConditionalDynamicDisp
|
|
|
11
11
|
state: State;
|
|
12
12
|
private currentRect;
|
|
13
13
|
preState: State;
|
|
14
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
14
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
15
15
|
initState(): void;
|
|
16
16
|
updateElementStates(newElementStates: VariableState[]): void;
|
|
17
17
|
addElementState(newElementState: VariableState): void;
|
|
@@ -3,8 +3,8 @@ import { VariableStateEnum } from '../../communication';
|
|
|
3
3
|
import { ConditionalDynamicDisplayElement } from './conditional-dynamic-display-element';
|
|
4
4
|
import { State } from '../../model';
|
|
5
5
|
export class StateControlElement extends ConditionalDynamicDisplayElement {
|
|
6
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
7
|
-
super(element, permissionChecker, variableCommunicator, variableStore);
|
|
6
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
7
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
8
8
|
this.localization = localization;
|
|
9
9
|
this.isEnable = true;
|
|
10
10
|
this.elementStates = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"StateControlElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":8,"character":50},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":16,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":16,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":98},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":17,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":17,"character":71}]}],"initState":[{"__symbolic":"method"}],"updateElementStates":[{"__symbolic":"method"}],"addElementState":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"getState":[{"__symbolic":"method"}],"changeState":[{"__symbolic":"method"}],"loadStateData":[{"__symbolic":"method"}],"setState":[{"__symbolic":"method"}],"clearTip":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"StateControlElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":8,"character":50},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":16,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":16,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":98},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":17,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":17,"character":71},{"__symbolic":"reference","name":"string"}]}],"initState":[{"__symbolic":"method"}],"updateElementStates":[{"__symbolic":"method"}],"addElementState":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"getState":[{"__symbolic":"method"}],"changeState":[{"__symbolic":"method"}],"loadStateData":[{"__symbolic":"method"}],"setState":[{"__symbolic":"method"}],"clearTip":[{"__symbolic":"method"}]}}}}]
|
|
@@ -17,7 +17,7 @@ export declare class CharacterDisplayElement extends ReadableElement {
|
|
|
17
17
|
private displayValue;
|
|
18
18
|
private graphs;
|
|
19
19
|
private readonly logger;
|
|
20
|
-
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, variableCommunicator: VariableCommunicator, graphStore: GraphStore, permissionChecker: PermissionChecker, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization);
|
|
20
|
+
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, variableCommunicator: VariableCommunicator, graphStore: GraphStore, permissionChecker: PermissionChecker, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
21
21
|
get readVariableName(): string;
|
|
22
22
|
get writeVariableName(): string;
|
|
23
23
|
protected updateVariableValue(value: string): void;
|
|
@@ -11,8 +11,8 @@ import { VerifyPasswordModalComponent } from '../../modal/verify-password/verify
|
|
|
11
11
|
import { VariableUtil } from '../../utils/variable-util';
|
|
12
12
|
import { TextElementModal } from '../shared/text/text-element';
|
|
13
13
|
export class CharacterDisplayElement extends ReadableElement {
|
|
14
|
-
constructor(element, injector, modalService, variableCommunicator, graphStore, permissionChecker, operationRecordService, securityChecker, variableStore, localization) {
|
|
15
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
14
|
+
constructor(element, injector, modalService, variableCommunicator, graphStore, permissionChecker, operationRecordService, securityChecker, variableStore, localization, signalRAppId) {
|
|
15
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
16
16
|
this.modalService = modalService;
|
|
17
17
|
this.graphStore = graphStore;
|
|
18
18
|
this.operationRecordService = operationRecordService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"CharacterDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":19,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":28,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":28,"character":48},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":29,"character":39},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":30,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":31,"character":37},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":32,"character":27},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":33,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":34,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":35,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":36,"character":22}]}],"updateVariableValue":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateDisplayValue":[{"__symbolic":"method"}],"getVariableValueText":[{"__symbolic":"method"}],"characterDisplayText":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initClickEvent":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"doWriteCharacterValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeGraph":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"CharacterDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":19,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":28,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":28,"character":48},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":29,"character":39},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":30,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":31,"character":37},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":32,"character":27},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":33,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":34,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":35,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":36,"character":22},{"__symbolic":"reference","name":"string"}]}],"updateVariableValue":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateDisplayValue":[{"__symbolic":"method"}],"getVariableValueText":[{"__symbolic":"method"}],"characterDisplayText":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initClickEvent":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"doWriteCharacterValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeGraph":[{"__symbolic":"method"}]}}}}]
|
|
@@ -13,7 +13,7 @@ export declare class DatetimeDisplayElement extends ConditionalDisplayElement {
|
|
|
13
13
|
protected readonly model: DatetimeDisplay;
|
|
14
14
|
protected readonly logger: LoggerService;
|
|
15
15
|
private readonly $dateTimeText;
|
|
16
|
-
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore);
|
|
16
|
+
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore, signalRAppId: string);
|
|
17
17
|
private getAndSetCurrentTime;
|
|
18
18
|
private getDatetimeFormat;
|
|
19
19
|
private initGraph;
|
|
@@ -6,8 +6,8 @@ import { ConditionalDisplayElement } from '../base/conditional-display-element';
|
|
|
6
6
|
import { GraphStateElement } from '../shared/graph/graph-state-element';
|
|
7
7
|
import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
8
8
|
export class DatetimeDisplayElement extends ConditionalDisplayElement {
|
|
9
|
-
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore) {
|
|
10
|
-
super(element, permissionChecker, variableCommunicator, variableStore);
|
|
9
|
+
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId) {
|
|
10
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
11
11
|
this.permissionChecker = permissionChecker;
|
|
12
12
|
this.variableCommunicator = variableCommunicator;
|
|
13
13
|
this.variableStore = variableStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"DatetimeDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":14,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":21,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":21,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":22,"character":46},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":23,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":24,"character":42},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":25,"character":37}]}],"getAndSetCurrentTime":[{"__symbolic":"method"}],"getDatetimeFormat":[{"__symbolic":"method"}],"initGraph":[{"__symbolic":"method"}],"getFormat":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"DatetimeDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":14,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":21,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":21,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":22,"character":46},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":23,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":24,"character":42},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":25,"character":37},{"__symbolic":"reference","name":"string"}]}],"getAndSetCurrentTime":[{"__symbolic":"method"}],"getDatetimeFormat":[{"__symbolic":"method"}],"initGraph":[{"__symbolic":"method"}],"getFormat":[{"__symbolic":"method"}]}}}}]
|
|
@@ -32,7 +32,7 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
32
32
|
private elementStatus;
|
|
33
33
|
private chartElement;
|
|
34
34
|
private isMobileMode;
|
|
35
|
-
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore);
|
|
35
|
+
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore, signalRAppId: string);
|
|
36
36
|
dispose(): void;
|
|
37
37
|
private getValidTimePeriods;
|
|
38
38
|
private updateTimeRange;
|
|
@@ -11,8 +11,8 @@ import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
|
11
11
|
import { GlobalSettings, DisplayMode } from '../../settings';
|
|
12
12
|
import { CurveType } from '../../model/historical-curve/curve-type';
|
|
13
13
|
export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
14
|
-
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, historyDataStore) {
|
|
15
|
-
super(element, permissionChecker, variableCommunicator, variableStore);
|
|
14
|
+
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, historyDataStore, signalRAppId) {
|
|
15
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
16
16
|
this.historyDataStore = historyDataStore;
|
|
17
17
|
this.displayOption = {
|
|
18
18
|
dataLimit: 500,
|
|
@@ -58,7 +58,9 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
58
58
|
}
|
|
59
59
|
getValidTimePeriods() {
|
|
60
60
|
const timePeriods = new Array();
|
|
61
|
+
timePeriods.push({ key: 6, name: this.localization.lastThirtyMinutes });
|
|
61
62
|
timePeriods.push({ key: 1, name: this.localization.lastOneHour });
|
|
63
|
+
timePeriods.push({ key: 7, name: this.localization.lastEightHour });
|
|
62
64
|
timePeriods.push({ key: 2, name: this.localization.lastTwentyFourHours });
|
|
63
65
|
timePeriods.push({ key: 3, name: this.localization.lastSevenDays });
|
|
64
66
|
timePeriods.push({ key: 4, name: this.localization.lastThirtyDays });
|
|
@@ -84,6 +86,12 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
84
86
|
case 5:
|
|
85
87
|
this.startTime = moment().subtract(1, 'years');
|
|
86
88
|
break;
|
|
89
|
+
case 6:
|
|
90
|
+
this.startTime = moment().subtract(30, 'minutes');
|
|
91
|
+
break;
|
|
92
|
+
case 7:
|
|
93
|
+
this.startTime = moment().subtract(8, 'hours');
|
|
94
|
+
break;
|
|
87
95
|
default:
|
|
88
96
|
this.startTime = moment().subtract(1, 'days');
|
|
89
97
|
}
|
|
@@ -151,10 +159,6 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
151
159
|
chart.focus.showXAxis(false);
|
|
152
160
|
}
|
|
153
161
|
this.renderCommonProperty(chart, chartWidth, chartHeight, data);
|
|
154
|
-
// if in Mobile mode and width is less than the min width, then hide operation area
|
|
155
|
-
if (this.isMobileMode && this.model.displaySetting.size.width < this.displayOption.mobileMinWidth) {
|
|
156
|
-
return chart;
|
|
157
|
-
}
|
|
158
162
|
this.renderOperationArea(chartWidth, chartHeight);
|
|
159
163
|
return chart;
|
|
160
164
|
}
|
|
@@ -178,10 +182,6 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
178
182
|
}
|
|
179
183
|
chart.xAxis.tickFormat(d => this.timeFormat(d, '%x %X'));
|
|
180
184
|
this.renderCommonProperty(chart, chartWidth, chartHeight, data);
|
|
181
|
-
// if in Mobile mode and width is less than the min width, then hide operation area
|
|
182
|
-
if (this.isMobileMode && this.model.displaySetting.size.width < this.displayOption.mobileMinWidth) {
|
|
183
|
-
return chart;
|
|
184
|
-
}
|
|
185
185
|
this.renderOperationArea(chartWidth, chartHeight);
|
|
186
186
|
const focusContext = this.rootElement.select('.nv-context');
|
|
187
187
|
focusContext.select('.nv-barsWrap.nvd3-svg').attr('transform', 'translate(0,30)');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":20,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":62,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":63,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":64,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":65,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":66,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":67,"character":43}]}],"dispose":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__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"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":20,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":62,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":63,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":64,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":65,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":66,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":67,"character":43},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__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"}]}}}}]
|
|
@@ -11,6 +11,7 @@ export declare class MainElement {
|
|
|
11
11
|
private readonly context;
|
|
12
12
|
private readonly variableCommunicator;
|
|
13
13
|
private readonly popupViewService;
|
|
14
|
+
private readonly signalRAppId;
|
|
14
15
|
private readonly elements;
|
|
15
16
|
private root;
|
|
16
17
|
private isLoaded;
|
|
@@ -20,7 +21,7 @@ export declare class MainElement {
|
|
|
20
21
|
oldSize: Size;
|
|
21
22
|
private hostContainerId;
|
|
22
23
|
get rootElement(): HTMLElement;
|
|
23
|
-
constructor(injector: Injector, bsModalService: BsModalService, context: GuiContext, variableCommunicator: VariableCommunicator, popupViewService: PopupViewService);
|
|
24
|
+
constructor(injector: Injector, bsModalService: BsModalService, context: GuiContext, variableCommunicator: VariableCommunicator, popupViewService: PopupViewService, signalRAppId: any);
|
|
24
25
|
load(data: string, overflowVisible: boolean, guiOptions: GuiOptions): void;
|
|
25
26
|
/**
|
|
26
27
|
* 保证在显示区域内显示画面所有内容,等比缩放画面大小以铺满整个显示区域
|
package/elements/main-element.js
CHANGED
|
@@ -27,13 +27,15 @@ import { PolygonElement } from './vector-graphics/polygon-element';
|
|
|
27
27
|
import { HyperlinkElement } from './static-elements/hyperlink-element';
|
|
28
28
|
import { VideoElement } from './video/video-element';
|
|
29
29
|
import { WeatherElement } from './weather/weater-element';
|
|
30
|
+
import { AirQualityElement } from './air-quality/air-quality-element';
|
|
30
31
|
export class MainElement {
|
|
31
|
-
constructor(injector, bsModalService, context, variableCommunicator, popupViewService) {
|
|
32
|
+
constructor(injector, bsModalService, context, variableCommunicator, popupViewService, signalRAppId) {
|
|
32
33
|
this.injector = injector;
|
|
33
34
|
this.bsModalService = bsModalService;
|
|
34
35
|
this.context = context;
|
|
35
36
|
this.variableCommunicator = variableCommunicator;
|
|
36
37
|
this.popupViewService = popupViewService;
|
|
38
|
+
this.signalRAppId = signalRAppId;
|
|
37
39
|
this.elements = new Array();
|
|
38
40
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
39
41
|
}
|
|
@@ -57,72 +59,75 @@ export class MainElement {
|
|
|
57
59
|
const category = $(element).data('model').category;
|
|
58
60
|
switch (category) {
|
|
59
61
|
case GuiConsts.components.numericalDisplayKey:
|
|
60
|
-
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));
|
|
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);
|
|
61
63
|
this.elements.push(numericalDisplayElement);
|
|
62
64
|
break;
|
|
63
65
|
case GuiConsts.components.imageKey:
|
|
64
|
-
this.elements.push(new ImageElement(element, this.injector, this.context.configStore.imageStore, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore));
|
|
66
|
+
this.elements.push(new ImageElement(element, this.injector, this.context.configStore.imageStore, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
|
|
65
67
|
break;
|
|
66
68
|
case GuiConsts.components.meterKey:
|
|
67
|
-
this.elements.push(new MeterElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION)));
|
|
69
|
+
this.elements.push(new MeterElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
68
70
|
break;
|
|
69
71
|
case GuiConsts.components.pipeKey:
|
|
70
|
-
this.elements.push(new PipeElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION)));
|
|
72
|
+
this.elements.push(new PipeElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
71
73
|
break;
|
|
72
74
|
case GuiConsts.components.switchIndicatorLightKey:
|
|
73
|
-
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)));
|
|
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));
|
|
74
76
|
break;
|
|
75
77
|
case GuiConsts.components.barGraphKey:
|
|
76
|
-
this.elements.push(new BarGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION)));
|
|
78
|
+
this.elements.push(new BarGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
77
79
|
break;
|
|
78
80
|
case GuiConsts.components.toggleViewKey:
|
|
79
81
|
case GuiConsts.components.viewOperationElement:
|
|
80
|
-
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));
|
|
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));
|
|
81
83
|
break;
|
|
82
84
|
case GuiConsts.components.characterKey:
|
|
83
|
-
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)));
|
|
85
|
+
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));
|
|
84
86
|
break;
|
|
85
87
|
case GuiConsts.components.textKey:
|
|
86
|
-
this.elements.push(new TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore));
|
|
88
|
+
this.elements.push(new TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
|
|
87
89
|
break;
|
|
88
90
|
case GuiConsts.components.hyperlinkKey:
|
|
89
|
-
this.elements.push(new HyperlinkElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore));
|
|
91
|
+
this.elements.push(new HyperlinkElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
|
|
90
92
|
break;
|
|
91
93
|
case GuiConsts.components.straightLineKey:
|
|
92
|
-
this.elements.push(new StraightLineElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore));
|
|
94
|
+
this.elements.push(new StraightLineElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
93
95
|
break;
|
|
94
96
|
case GuiConsts.components.polyLineKey:
|
|
95
|
-
this.elements.push(new PolyLineElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore));
|
|
97
|
+
this.elements.push(new PolyLineElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
96
98
|
break;
|
|
97
99
|
case GuiConsts.components.ellipseKey:
|
|
98
|
-
this.elements.push(new EllipseElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore));
|
|
100
|
+
this.elements.push(new EllipseElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
99
101
|
break;
|
|
100
102
|
case GuiConsts.components.rectangleKey:
|
|
101
|
-
this.elements.push(new RectangleElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore));
|
|
103
|
+
this.elements.push(new RectangleElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
102
104
|
break;
|
|
103
105
|
case GuiConsts.components.sectorkey:
|
|
104
|
-
this.elements.push(new SectorElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore));
|
|
106
|
+
this.elements.push(new SectorElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
105
107
|
break;
|
|
106
108
|
case GuiConsts.components.datetimeDisplayKey:
|
|
107
|
-
this.elements.push(new DatetimeDisplayElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore));
|
|
109
|
+
this.elements.push(new DatetimeDisplayElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
|
|
108
110
|
break;
|
|
109
111
|
case GuiConsts.components.historicalCurveKey:
|
|
110
|
-
this.elements.push(new HistoricalCurveElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.historyDataStore));
|
|
112
|
+
this.elements.push(new HistoricalCurveElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.historyDataStore, this.signalRAppId));
|
|
111
113
|
break;
|
|
112
114
|
case GuiConsts.components.ringGraphKey:
|
|
113
|
-
this.elements.push(new RingGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION)));
|
|
115
|
+
this.elements.push(new RingGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
|
|
114
116
|
break;
|
|
115
117
|
case GuiConsts.components.polygonKey:
|
|
116
|
-
this.elements.push(new PolygonElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore));
|
|
118
|
+
this.elements.push(new PolygonElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
117
119
|
break;
|
|
118
120
|
case GuiConsts.components.videokey:
|
|
119
|
-
this.elements.push(new VideoElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.videoService, new Size(this.rawWidth, this.rawHeight), guiOptions.svgRootClass));
|
|
121
|
+
this.elements.push(new VideoElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.videoService, new Size(this.rawWidth, this.rawHeight), guiOptions.svgRootClass, this.signalRAppId));
|
|
120
122
|
break;
|
|
121
123
|
case GuiConsts.components.tableKey:
|
|
122
|
-
this.elements.push(new PolygonElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore));
|
|
124
|
+
this.elements.push(new PolygonElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
|
|
123
125
|
break;
|
|
124
126
|
case GuiConsts.components.weatherKey:
|
|
125
|
-
this.elements.push(new WeatherElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.weatherService));
|
|
127
|
+
this.elements.push(new WeatherElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.weatherService, this.signalRAppId));
|
|
128
|
+
break;
|
|
129
|
+
case GuiConsts.components.airQualityKey:
|
|
130
|
+
this.elements.push(new AirQualityElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.weatherService, this.signalRAppId));
|
|
126
131
|
break;
|
|
127
132
|
}
|
|
128
133
|
});
|
|
@@ -203,7 +208,7 @@ export class MainElement {
|
|
|
203
208
|
initElementState() {
|
|
204
209
|
forEach(this.elements, element => {
|
|
205
210
|
if (element instanceof ReadableElement) {
|
|
206
|
-
element.init(element.readVariableName);
|
|
211
|
+
element.init(element.readVariableName || element.maxVariableName || element.minVariableName);
|
|
207
212
|
}
|
|
208
213
|
else if (element instanceof HistoricalCurveElement) {
|
|
209
214
|
element.initElementStatus();
|
|
@@ -214,8 +219,20 @@ export class MainElement {
|
|
|
214
219
|
getVariableNames() {
|
|
215
220
|
const variableNames = new Array();
|
|
216
221
|
forEach(this.elements, element => {
|
|
222
|
+
var _a, _b;
|
|
217
223
|
if (element instanceof ReadableElement) {
|
|
224
|
+
const maxVariableName = (_a = element) === null || _a === void 0 ? void 0 : _a.maxVariableName;
|
|
225
|
+
const maxValueType = element.maxValueType;
|
|
226
|
+
const minVariableName = (_b = element) === null || _b === void 0 ? void 0 : _b.minVariableName;
|
|
227
|
+
const minValueType = element.minValueType;
|
|
218
228
|
const variableName = element.readVariableName;
|
|
229
|
+
// 最大最小值选择变量类型时,其中一个未绑定变量不进行开点操作 - FLEXCLOUD-1817
|
|
230
|
+
if (maxValueType && maxVariableName && !variableNames.find(v => isEqual(maxVariableName, v))) {
|
|
231
|
+
variableNames.push(maxVariableName);
|
|
232
|
+
}
|
|
233
|
+
if (minValueType && minVariableName && !variableNames.find(v => isEqual(minVariableName, v))) {
|
|
234
|
+
variableNames.push(minVariableName);
|
|
235
|
+
}
|
|
219
236
|
if (variableName && !variableNames.find(v => isEqual(variableName, v))) {
|
|
220
237
|
variableNames.push(element.readVariableName);
|
|
221
238
|
}
|
|
@@ -241,7 +258,7 @@ export class MainElement {
|
|
|
241
258
|
each(values, value => {
|
|
242
259
|
each(this.elements, e => {
|
|
243
260
|
if (e instanceof ReadableElement) {
|
|
244
|
-
if (e.readVariableName === value.variableName) {
|
|
261
|
+
if (e.readVariableName === value.variableName || e.minVariableName === value.variableName || e.maxVariableName === value.variableName) {
|
|
245
262
|
e.reportValueChanged(value);
|
|
246
263
|
}
|
|
247
264
|
}
|
|
@@ -251,7 +268,8 @@ export class MainElement {
|
|
|
251
268
|
dispose() {
|
|
252
269
|
each(this.elements, e => {
|
|
253
270
|
if (e instanceof HistoricalCurveElement || e instanceof VideoElement
|
|
254
|
-
|| e instanceof WeatherElement || e instanceof NumericalDisplayElement || e instanceof TextElement
|
|
271
|
+
|| e instanceof WeatherElement || e instanceof NumericalDisplayElement || e instanceof TextElement
|
|
272
|
+
|| e instanceof AirQualityElement) {
|
|
255
273
|
e.dispose();
|
|
256
274
|
}
|
|
257
275
|
});
|
|
@@ -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":54,"character":43},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":55,"character":41},{"__symbolic":"reference","module":"../gui/gui-context","name":"GuiContext","line":56,"character":34},{"__symbolic":"reference","module":"../communication","name":"VariableCommunicator","line":57,"character":47},{"__symbolic":"reference","module":"../view/popup-view.service","name":"PopupViewService","line":58,"character":43},null]}],"load":[{"__symbolic":"method"}],"uniformStretch":[{"__symbolic":"method"}],"changeVideoStyle":[{"__symbolic":"method"}],"horizontalStretch":[{"__symbolic":"method"}],"initElementState":[{"__symbolic":"method"}],"getVariableNames":[{"__symbolic":"method"}],"reportVariableStates":[{"__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
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
16
|
-
|
|
19
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
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
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
4
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
5
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
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}}}}]
|