@flexem/fc-gui 3.0.0-alpha.6 → 3.0.0-alpha.61
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 +238 -1
- package/bundles/@flexem/fc-gui.umd.js +2732 -1614
- 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 +104 -15
- 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 +8 -2
- package/elements/numerical-display/numerical-display-element.js +48 -12
- 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 +108 -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 -2
- package/elements/video/video-element.js +53 -54
- 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-context.d.ts +2 -1
- package/gui/gui-host.d.ts +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/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 +7 -0
- package/localization/localization.service.js +8 -1
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +8 -1
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/modal/write-value/write-value-modal-args.d.ts +4 -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 +9 -7
- package/modal/write-value/write-value-modal.component.html +5 -2
- package/modal/write-value/write-value-modal.component.js +39 -22
- 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/historical-curve/historical-curve-axis-settings.d.ts +7 -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/meter/meter.d.ts +4 -0
- package/model/numerical-display/numerical-display.d.ts +1 -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/index.d.ts +1 -0
- package/service/index.metadata.json +1 -1
- 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/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
|
@@ -2,8 +2,8 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { VariableValue } from './variable-value';
|
|
3
3
|
import { VariableState } from './variable-state';
|
|
4
4
|
export interface VariableCommunicator {
|
|
5
|
-
openVariable(variableName: string): Observable<VariableValue>;
|
|
6
|
-
openVariables(variableNames: Array<string
|
|
5
|
+
openVariable(variableName: string, appId: string): Observable<VariableValue>;
|
|
6
|
+
openVariables(variableNames: Array<string>, appId: string): Observable<Array<VariableValue>>;
|
|
7
7
|
write(variableName: string, value: any): Observable<VariableValue>;
|
|
8
8
|
writeWordByBit(variableName: string, index: number, value: number): Observable<VariableValue>;
|
|
9
9
|
subscribeVariableState(variableName: string): Observable<VariableState>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { AirQualityModel } from '../../model/air-quality/air-quality.model';
|
|
3
|
+
import { ConditionalDisplayElement } from '../base/conditional-display-element';
|
|
4
|
+
import { PermissionChecker } from '../../service';
|
|
5
|
+
import { VariableCommunicator } from '../../communication/variable';
|
|
6
|
+
import { VariableStore } from '../../config/variable';
|
|
7
|
+
import { WeatherService } from '../../service';
|
|
8
|
+
export declare class AirQualityElement extends ConditionalDisplayElement {
|
|
9
|
+
private readonly weatherService;
|
|
10
|
+
model: AirQualityModel;
|
|
11
|
+
timer: any;
|
|
12
|
+
private readonly localization;
|
|
13
|
+
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, weatherService: WeatherService, signalRAppId: string);
|
|
14
|
+
dispose(): void;
|
|
15
|
+
initAirQualityInfo(): void;
|
|
16
|
+
private handleData;
|
|
17
|
+
private handleNotSupported;
|
|
18
|
+
private handleGettingAddress;
|
|
19
|
+
private handleNoAddress;
|
|
20
|
+
private handleUnusualCommon;
|
|
21
|
+
private buildBackgroudRect;
|
|
22
|
+
private buildRectBackgroundForAqi;
|
|
23
|
+
private buildUnusualTipIcon;
|
|
24
|
+
getUnusualIconPath(): string;
|
|
25
|
+
private buildUnusualTipText;
|
|
26
|
+
private buildAirQualityText;
|
|
27
|
+
private buildLocGroup;
|
|
28
|
+
getLocPath(): string;
|
|
29
|
+
private appendAirQualitySvg;
|
|
30
|
+
clear(): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ConditionalDisplayElement } from '../base/conditional-display-element';
|
|
2
|
+
import * as d3 from 'd3-selection';
|
|
3
|
+
import { LOCALIZATION } from '../../localization';
|
|
4
|
+
export class AirQualityElement extends ConditionalDisplayElement {
|
|
5
|
+
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, weatherService, signalRAppId) {
|
|
6
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
7
|
+
this.weatherService = weatherService;
|
|
8
|
+
this.localization = injector.get(LOCALIZATION);
|
|
9
|
+
this.initAirQualityInfo();
|
|
10
|
+
this.timer = setInterval(() => this.initAirQualityInfo(), 1000 * 60 * 60);
|
|
11
|
+
}
|
|
12
|
+
dispose() {
|
|
13
|
+
clearInterval(this.timer);
|
|
14
|
+
}
|
|
15
|
+
initAirQualityInfo() {
|
|
16
|
+
this.clear();
|
|
17
|
+
this.weatherService.getAirQualityInfo().then(airQuality => {
|
|
18
|
+
const airQualityDto = airQuality;
|
|
19
|
+
if (!airQualityDto.supported) {
|
|
20
|
+
this.handleNotSupported();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (airQualityDto.gettingAddress) {
|
|
24
|
+
this.handleGettingAddress();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (!airQualityDto.hasAddress) {
|
|
28
|
+
this.handleNoAddress();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.handleData(airQualityDto.airQuality);
|
|
32
|
+
}).catch(() => {
|
|
33
|
+
this.handleNotSupported();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
handleData(airQuality) {
|
|
37
|
+
const fontColor = this.model.stroke ? this.model.stroke : '#FFFFFF';
|
|
38
|
+
const backgroundColor = this.model.fill && this.model.fill || '#86A7C5';
|
|
39
|
+
const airQualitySvg = d3.create('svg');
|
|
40
|
+
this.buildBackgroudRect(airQualitySvg, backgroundColor);
|
|
41
|
+
this.buildLocGroup(airQualitySvg, airQuality.city, fontColor);
|
|
42
|
+
this.buildAirQualityText(airQualitySvg, 130, 55, airQuality.aqi, fontColor, 53);
|
|
43
|
+
this.buildAirQualityText(airQualitySvg, 220, 28, '空气质量', fontColor);
|
|
44
|
+
this.buildRectBackgroundForAqi(airQualitySvg, airQuality.level);
|
|
45
|
+
this.buildAirQualityText(airQualitySvg, 220, 49, airQuality.category, fontColor);
|
|
46
|
+
this.buildAirQualityText(airQualitySvg, 30, 75, 'PM2.5', fontColor, 12, 0.8);
|
|
47
|
+
this.buildAirQualityText(airQualitySvg, 30, 95, airQuality.pm25, fontColor, 15);
|
|
48
|
+
this.buildAirQualityText(airQualitySvg, 80, 75, 'PM10', fontColor, 12, 0.8);
|
|
49
|
+
this.buildAirQualityText(airQualitySvg, 80, 95, airQuality.pm10, fontColor, 15);
|
|
50
|
+
this.buildAirQualityText(airQualitySvg, 130, 75, 'NO2', fontColor, 12, 0.8);
|
|
51
|
+
this.buildAirQualityText(airQualitySvg, 130, 95, airQuality.no2, fontColor, 15);
|
|
52
|
+
this.buildAirQualityText(airQualitySvg, 175, 75, 'SO2', fontColor, 12, 0.8);
|
|
53
|
+
this.buildAirQualityText(airQualitySvg, 175, 95, airQuality.so2, fontColor, 15);
|
|
54
|
+
this.buildAirQualityText(airQualitySvg, 215, 75, 'CO', fontColor, 12, 0.8);
|
|
55
|
+
this.buildAirQualityText(airQualitySvg, 215, 95, airQuality.co, fontColor, 15);
|
|
56
|
+
this.buildAirQualityText(airQualitySvg, 250, 75, 'O3', fontColor, 12, 0.8);
|
|
57
|
+
this.buildAirQualityText(airQualitySvg, 250, 95, airQuality.o3, fontColor, 15);
|
|
58
|
+
this.appendAirQualitySvg(airQualitySvg);
|
|
59
|
+
}
|
|
60
|
+
handleNotSupported() {
|
|
61
|
+
this.handleUnusualCommon(this.localization.airQualityNotSupport);
|
|
62
|
+
}
|
|
63
|
+
handleGettingAddress() {
|
|
64
|
+
this.handleUnusualCommon(this.localization.airQualityNotAvailable);
|
|
65
|
+
setTimeout(() => this.initAirQualityInfo(), 1000 * 60);
|
|
66
|
+
}
|
|
67
|
+
handleNoAddress() {
|
|
68
|
+
this.handleUnusualCommon(this.localization.airQualityNotAddress);
|
|
69
|
+
}
|
|
70
|
+
handleUnusualCommon(text) {
|
|
71
|
+
const airQualitySvg = d3.create('svg');
|
|
72
|
+
this.buildBackgroudRect(airQualitySvg, '#081625', '0.5');
|
|
73
|
+
this.buildUnusualTipIcon(airQualitySvg, text.length);
|
|
74
|
+
this.buildUnusualTipText(airQualitySvg, text);
|
|
75
|
+
this.appendAirQualitySvg(airQualitySvg);
|
|
76
|
+
}
|
|
77
|
+
buildBackgroudRect(airQualitySvg, backgroundColor, opacity = '1') {
|
|
78
|
+
airQualitySvg.append('rect')
|
|
79
|
+
.attr('x', '0')
|
|
80
|
+
.attr('y', '0')
|
|
81
|
+
.attr('rx', '2')
|
|
82
|
+
.attr('width', '280')
|
|
83
|
+
.attr('height', '105')
|
|
84
|
+
.attr('fill', backgroundColor)
|
|
85
|
+
.attr('fill-opacity', opacity);
|
|
86
|
+
}
|
|
87
|
+
buildRectBackgroundForAqi(airQualitySvg, level, opacity = '1') {
|
|
88
|
+
let backgroundColor;
|
|
89
|
+
if (level >= 0 && level <= 50) {
|
|
90
|
+
backgroundColor = '#50DF56';
|
|
91
|
+
}
|
|
92
|
+
else if (level >= 51 && level <= 100) {
|
|
93
|
+
backgroundColor = '#FBCD1C';
|
|
94
|
+
}
|
|
95
|
+
else if (level >= 101 && level <= 150) {
|
|
96
|
+
backgroundColor = '#FF9900';
|
|
97
|
+
}
|
|
98
|
+
else if (level >= 151 && level <= 200) {
|
|
99
|
+
backgroundColor = '#FF3232';
|
|
100
|
+
}
|
|
101
|
+
else if (level >= 201 && level <= 300) {
|
|
102
|
+
backgroundColor = '#F403B5';
|
|
103
|
+
}
|
|
104
|
+
else if (level > 300) {
|
|
105
|
+
backgroundColor = '#A10E0E';
|
|
106
|
+
}
|
|
107
|
+
airQualitySvg.append('rect')
|
|
108
|
+
.attr('x', '195')
|
|
109
|
+
.attr('y', '35')
|
|
110
|
+
.attr('rx', '5')
|
|
111
|
+
.attr('width', '50')
|
|
112
|
+
.attr('height', '20')
|
|
113
|
+
.attr('fill', backgroundColor)
|
|
114
|
+
.attr('fill-opacity', opacity);
|
|
115
|
+
}
|
|
116
|
+
buildUnusualTipIcon(airQualitySvg, length) {
|
|
117
|
+
airQualitySvg.append('svg')
|
|
118
|
+
.attr('x', length > 9 ? (268 - 7 * length - 8 - 42) / 2 : '44')
|
|
119
|
+
.attr('y', '23')
|
|
120
|
+
.attr('width', '42')
|
|
121
|
+
.attr('height', '34')
|
|
122
|
+
.attr('viewBox', '0 0 200 160')
|
|
123
|
+
.html(this.getUnusualIconPath);
|
|
124
|
+
}
|
|
125
|
+
getUnusualIconPath() {
|
|
126
|
+
return `<g>
|
|
127
|
+
<ellipse class="st2" cx="74.6" cy="72.3" rx="36.4" ry="36.3" fill="#EFCA30"/>
|
|
128
|
+
<path class="st2" fill="#EFCA30" d="M74.5,24.5C74.6,24.5,74.6,24.5,74.5,24.5c3.7,0,5.7-2,5.7-5.5V5.5C80.2,2,78,0,74.6,0C71,0,69,2.1,69,5.5V19
|
|
129
|
+
C69,22.3,71,24.4,74.5,24.5L74.5,24.5z"/>
|
|
130
|
+
<path class="st2" fill="#EFCA30" d="M37.2,28.5l-6.9-6.7c-1.3-1.3-2.7-1.9-4.1-1.9s-2.8,0.6-4.1,1.9c-1.3,1.3-1.9,2.6-1.9,4s0.6,2.7,1.9,4
|
|
131
|
+
l6.4,6.1c0.5,0.5,1.2,1.1,1.9,1.4c1.2,0.5,2,0.7,2.8,0.7c0.6,0,1.3-0.2,2-0.4c1.4-0.5,2.7-1.5,3.3-2.8c0.3-0.7,0.5-1.5,0.5-2.2
|
|
132
|
+
C39.1,31.2,38.5,29.8,37.2,28.5L37.2,28.5z"/>
|
|
133
|
+
<path class="st2" fill="#EFCA30" d="M112.5,36.9c1.6,0.7,2.7,1.2,3.7,1.2s2-0.4,3.6-1.2c0.2-0.1,0.4-0.2,0.5-0.4l6.9-6.7c1.3-1.3,1.9-2.6,1.9-4
|
|
134
|
+
s-0.6-2.7-1.9-4c-1.3-1.3-2.7-1.9-4.1-1.9s-2.8,0.6-4.1,1.9l-6.9,6.7c-1.3,1.3-1.9,2.6-1.9,4c0,1.4,0.6,2.7,1.9,4
|
|
135
|
+
C112.1,36.6,112.3,36.8,112.5,36.9L112.5,36.9z"/>
|
|
136
|
+
<path class="st2" fill="#EFCA30" d="M25.1,73.2C25.1,73.1,25.1,73.1,25.1,73.2c0-3.6-2-5.6-5.6-5.6H5.6C2,67.6,0,69.7,0,73.1
|
|
137
|
+
c0,3.4,2.2,5.5,5.6,5.5h13.8C22.7,78.6,24.9,76.6,25.1,73.2L25.1,73.2z"/>
|
|
138
|
+
<path class="st2" fill="#EFCA30" d="M33.2,107.6c-1.4,0-2.8,0.6-4.1,1.9l-6.9,6.7c-1.3,1.3-1.9,2.6-1.9,4s0.6,2.7,1.9,4c0.2,0.2,0.3,0.3,0.5,0.4
|
|
139
|
+
c1.6,0.7,2.7,1.2,3.7,1.2c0.5,0,1.5-0.1,3.6-1.2c0.2-0.1,0.4-0.2,0.5-0.4l6.9-6.7c2.6-2.5,2.6-5.6,0-8.1
|
|
140
|
+
C36,108.3,34.6,107.6,33.2,107.6L33.2,107.6z"/>
|
|
141
|
+
</g>
|
|
142
|
+
<path class="st3" fill="#FFFFFF" d="M68.8,160h99.3c17.9-2,31.9-17.1,31.9-35.5c0-18.3-13.8-33.3-31.5-35.4c-8-17-25.2-28.9-45.3-28.9
|
|
143
|
+
c-22.4,0-41.4,14.7-47.7,35c-1.1-0.1-2.2-0.2-3.4-0.2c-18,0-32.6,14.6-32.6,32.6C39.5,144.5,52.3,158.3,68.8,160z"/>`;
|
|
144
|
+
}
|
|
145
|
+
buildUnusualTipText(airQualitySvg, text) {
|
|
146
|
+
const length = text.length;
|
|
147
|
+
airQualitySvg.append('text')
|
|
148
|
+
.attr('x', length > 9 ? (268 - 7 * length - 8 - 42) / 2 + 42 + 8 : '94')
|
|
149
|
+
.attr('y', '46')
|
|
150
|
+
.attr('font-size', 14)
|
|
151
|
+
.attr('font-anchor', 'middle')
|
|
152
|
+
.attr('fill', '#FFFFFF')
|
|
153
|
+
.attr('dominant-baseline', 'central')
|
|
154
|
+
.text(text);
|
|
155
|
+
}
|
|
156
|
+
buildAirQualityText(airQualitySvg, x, y, text, fontColor, size = 12, opacity = 1) {
|
|
157
|
+
airQualitySvg.append('text')
|
|
158
|
+
.attr('x', x)
|
|
159
|
+
.attr('y', y)
|
|
160
|
+
.attr('font-size', size)
|
|
161
|
+
.attr('text-anchor', 'middle')
|
|
162
|
+
.attr('fill', fontColor)
|
|
163
|
+
.attr('opacity', opacity)
|
|
164
|
+
.text(text);
|
|
165
|
+
}
|
|
166
|
+
buildLocGroup(airQualitySvg, location, fontColor) {
|
|
167
|
+
airQualitySvg.append('svg')
|
|
168
|
+
.attr('x', '14')
|
|
169
|
+
.attr('y', '10')
|
|
170
|
+
.attr('width', '11')
|
|
171
|
+
.attr('height', '15')
|
|
172
|
+
.attr('viewBox', '0 0 156 200')
|
|
173
|
+
.append('path')
|
|
174
|
+
.attr('fill', fontColor)
|
|
175
|
+
.attr('d', this.getLocPath);
|
|
176
|
+
airQualitySvg.append('text')
|
|
177
|
+
.attr('x', '30')
|
|
178
|
+
.attr('y', '22')
|
|
179
|
+
.attr('font-size', '12')
|
|
180
|
+
.attr('fill', fontColor)
|
|
181
|
+
.text(location);
|
|
182
|
+
}
|
|
183
|
+
getLocPath() {
|
|
184
|
+
return `M78,0C35,0,0,33.3,0,74.3c0,50.8,55.5,105.4,72.6,120.9l5.3,4.8l5.3-4.7c0.7-0.6,72.5-64.6,72.8-121v0
|
|
185
|
+
C156,33.3,121,0,78,0z M78,178.6c-17.8-17.1-62.1-63.9-62.1-104.4C15.8,42,43.7,15.7,78,15.7c34.3,0,62.2,26.3,62.2,58.5
|
|
186
|
+
C140,111.8,99.2,158.4,78,178.6z M78,40.4c-17.8,0-32.4,14.4-32.4,32.2s14.5,32.2,32.4,32.2s32.4-14.4,32.4-32.2S95.8,
|
|
187
|
+
40.4,78,40.4z M78,89.1c-9.1,0-16.5-7.4-16.5-16.5S68.9,56.2,78,56.2s16.5,7.4,16.5,16.5S87.1,89.1,78,89.1z`;
|
|
188
|
+
}
|
|
189
|
+
appendAirQualitySvg(airQualitySvg) {
|
|
190
|
+
this.rootElement.append(() => airQualitySvg.node());
|
|
191
|
+
}
|
|
192
|
+
clear() {
|
|
193
|
+
this.rootElement.selectAll('*').remove();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AirQualityElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":11,"character":39},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":18,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":19,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":20,"character":27},{"__symbolic":"reference","module":"../../communication/variable","name":"VariableCommunicator","line":21,"character":30},{"__symbolic":"reference","module":"../../config/variable","name":"VariableStore","line":22,"character":23},{"__symbolic":"reference","module":"../../service","name":"WeatherService","line":23,"character":41},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"initAirQualityInfo":[{"__symbolic":"method"}],"handleData":[{"__symbolic":"method"}],"handleNotSupported":[{"__symbolic":"method"}],"handleGettingAddress":[{"__symbolic":"method"}],"handleNoAddress":[{"__symbolic":"method"}],"handleUnusualCommon":[{"__symbolic":"method"}],"buildBackgroudRect":[{"__symbolic":"method"}],"buildRectBackgroundForAqi":[{"__symbolic":"method"}],"buildUnusualTipIcon":[{"__symbolic":"method"}],"getUnusualIconPath":[{"__symbolic":"method"}],"buildUnusualTipText":[{"__symbolic":"method"}],"buildAirQualityText":[{"__symbolic":"method"}],"buildLocGroup":[{"__symbolic":"method"}],"getLocPath":[{"__symbolic":"method"}],"appendAirQualitySvg":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}]}}}}]
|
|
@@ -5,6 +5,8 @@ import { ReadableElement } from './base/readable-element';
|
|
|
5
5
|
import { VariableStore } from '../config';
|
|
6
6
|
import { PermissionChecker } from '../service';
|
|
7
7
|
export declare class BarGraphElement extends ReadableElement {
|
|
8
|
+
private static DEFAULT_MIN_VALUE;
|
|
9
|
+
private static DEFAULT_MAX_VALUE;
|
|
8
10
|
readonly model: BarGraph;
|
|
9
11
|
private readonly $barRect;
|
|
10
12
|
private readonly barElement;
|
|
@@ -14,8 +16,12 @@ export declare class BarGraphElement extends ReadableElement {
|
|
|
14
16
|
private defaultUpperLimitColor;
|
|
15
17
|
private defaultLowerLimitColor;
|
|
16
18
|
private barText;
|
|
19
|
+
private valueObj;
|
|
20
|
+
private isNeedUpdateScale;
|
|
17
21
|
get readVariableName(): string;
|
|
18
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
22
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
19
23
|
private initFrameNode;
|
|
20
|
-
|
|
24
|
+
private updateValueObj;
|
|
25
|
+
private updateScale;
|
|
26
|
+
updateVariableValue(value: number, variableName: any): void;
|
|
21
27
|
}
|
|
@@ -2,13 +2,22 @@ import { BarGraphDirection } from '../model';
|
|
|
2
2
|
import { ReadableElement } from './base/readable-element';
|
|
3
3
|
import { calculatePercent } from './shared/math-utils';
|
|
4
4
|
import { VariableUtil } from '../utils/variable-util';
|
|
5
|
+
import { VariableValueType } from '../model/shared/condition/variable-value-type';
|
|
5
6
|
export class BarGraphElement extends ReadableElement {
|
|
6
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
7
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
7
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
8
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
8
9
|
this.defaultBarColor = '#6fd149';
|
|
9
10
|
this.defaultUpperLimitColor = '#ff4448';
|
|
10
11
|
this.defaultLowerLimitColor = '#0f60e8';
|
|
11
12
|
this.barText = '';
|
|
13
|
+
this.valueObj = {};
|
|
14
|
+
this.isNeedUpdateScale = false;
|
|
15
|
+
if ((this.model.minValueType === VariableValueType.Constant && this.model.maxValueType === VariableValueType.Variable)
|
|
16
|
+
|| this.model.maxValueType === VariableValueType.Constant && this.model.minValueType === VariableValueType.Variable) {
|
|
17
|
+
this.isNeedUpdateScale = true;
|
|
18
|
+
this.updateScale();
|
|
19
|
+
this.isNeedUpdateScale = false;
|
|
20
|
+
}
|
|
12
21
|
this.$barRect = this.$element.find('rect');
|
|
13
22
|
this.$barText = this.$element.find('text[id="text"]').last();
|
|
14
23
|
if (this.model.version && this.model.version >= 1) {
|
|
@@ -41,10 +50,65 @@ export class BarGraphElement extends ReadableElement {
|
|
|
41
50
|
const b = arcPath.getBBox(true);
|
|
42
51
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
|
|
43
52
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
updateValueObj(value, variableName) {
|
|
54
|
+
var _a, _b, _c;
|
|
55
|
+
if (((_a = this.model.readVariable) === null || _a === void 0 ? void 0 : _a.name) === variableName) {
|
|
56
|
+
this.isNeedUpdateScale = false;
|
|
57
|
+
this.valueObj.value = value;
|
|
58
|
+
}
|
|
59
|
+
if (((_b = this.model.minVariable) === null || _b === void 0 ? void 0 : _b.name) === variableName) {
|
|
60
|
+
this.isNeedUpdateScale = true;
|
|
61
|
+
this.valueObj.min = value;
|
|
62
|
+
}
|
|
63
|
+
if (((_c = this.model.maxVariable) === null || _c === void 0 ? void 0 : _c.name) === variableName) {
|
|
64
|
+
this.isNeedUpdateScale = true;
|
|
65
|
+
this.valueObj.max = value;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
updateScale() {
|
|
69
|
+
if (!this.isNeedUpdateScale) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const textElements = this.$element.find('g:first > text');
|
|
73
|
+
let min = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
74
|
+
let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
75
|
+
min = Number(min);
|
|
76
|
+
max = Number(max);
|
|
77
|
+
if (isNaN(min) || isNaN(max)) {
|
|
78
|
+
min = BarGraphElement.DEFAULT_MIN_VALUE;
|
|
79
|
+
max = BarGraphElement.DEFAULT_MAX_VALUE;
|
|
80
|
+
}
|
|
81
|
+
const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
|
|
82
|
+
for (let i = 0; i < textElements.length; i++) {
|
|
83
|
+
const text = textElements[i];
|
|
84
|
+
if (!text.innerHTML) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
let sacleValue = ((Number(avgSacle) * i) + min).toFixed(0);
|
|
88
|
+
// 整数位和小数位格式化;
|
|
89
|
+
if (this.model.fractionDigits > 0) {
|
|
90
|
+
sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
|
|
91
|
+
}
|
|
92
|
+
if (!isNaN(sacleValue)) {
|
|
93
|
+
text.innerHTML = sacleValue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
updateVariableValue(value, variableName) {
|
|
98
|
+
this.updateValueObj(value, variableName);
|
|
99
|
+
this.updateScale();
|
|
100
|
+
const variableValue = Number(this.valueObj.value);
|
|
101
|
+
let maxValue = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
102
|
+
let minValue = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
103
|
+
minValue = Number(minValue);
|
|
104
|
+
maxValue = Number(maxValue);
|
|
105
|
+
if (isNaN(minValue) || isNaN(maxValue)) {
|
|
106
|
+
minValue = BarGraphElement.DEFAULT_MIN_VALUE;
|
|
107
|
+
maxValue = BarGraphElement.DEFAULT_MAX_VALUE;
|
|
108
|
+
}
|
|
109
|
+
if (isNaN(variableValue)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
48
112
|
const useAlarmLimit = this.model.useAlarmLimit;
|
|
49
113
|
const useAlarmUpperLimit = null != this.model.upperLimit;
|
|
50
114
|
const useAlarmLowerLimit = null != this.model.lowerLimit;
|
|
@@ -112,3 +176,5 @@ export class BarGraphElement extends ReadableElement {
|
|
|
112
176
|
}
|
|
113
177
|
}
|
|
114
178
|
}
|
|
179
|
+
BarGraphElement.DEFAULT_MIN_VALUE = 0;
|
|
180
|
+
BarGraphElement.DEFAULT_MAX_VALUE = 100;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"BarGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base/readable-element","name":"ReadableElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"BarGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base/readable-element","name":"ReadableElement","line":10,"character":37},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":38,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../service","name":"PermissionChecker","line":38,"character":57},{"__symbolic":"reference","module":"../communication","name":"VariableCommunicator","line":39,"character":30},{"__symbolic":"reference","module":"../config","name":"VariableStore","line":40,"character":23},{"__symbolic":"reference","module":"../localization","name":"Localization","line":41,"character":22},{"__symbolic":"reference","name":"string"}]}],"initFrameNode":[{"__symbolic":"method"}],"updateValueObj":[{"__symbolic":"method"}],"updateScale":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}]},"statics":{"DEFAULT_MIN_VALUE":0,"DEFAULT_MAX_VALUE":100}}}}]
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import * as d3 from 'd3-selection';
|
|
4
4
|
import { BaseElementModel } from '../../model';
|
|
5
5
|
export declare abstract class BaseElement {
|
|
6
|
+
protected readonly signalRAppId: string;
|
|
6
7
|
protected readonly $element: JQuery;
|
|
7
8
|
protected readonly rootElement: d3.Selection<any, {}, null, undefined>;
|
|
8
9
|
protected model: BaseElementModel;
|
|
9
|
-
constructor(element: HTMLElement);
|
|
10
|
+
constructor(element: HTMLElement, signalRAppId?: string);
|
|
10
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as d3 from 'd3-selection';
|
|
2
2
|
export class BaseElement {
|
|
3
|
-
constructor(element) {
|
|
3
|
+
constructor(element, signalRAppId = '') {
|
|
4
|
+
this.signalRAppId = signalRAppId;
|
|
4
5
|
this.$element = $(element);
|
|
5
6
|
this.rootElement = d3.select(element);
|
|
6
7
|
this.model = JSON.parse(this.rootElement.attr('data-model'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"BaseElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":9,"character":25,"context":{"typeName":"HTMLElement"}}]}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"BaseElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":9,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","name":"string"}]}]}}}}]
|
|
@@ -9,7 +9,7 @@ export declare abstract class ConditionalControlElement extends StateControlElem
|
|
|
9
9
|
protected readonly variableCommunicator: VariableCommunicator;
|
|
10
10
|
protected readonly variableStore: VariableStore;
|
|
11
11
|
protected abstract readonly model: ConditionalControlModel;
|
|
12
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
12
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
13
13
|
protected abstract updateElement(value: ConditionControlResultValue): void;
|
|
14
14
|
private initConditionalControl;
|
|
15
15
|
private recoverData;
|
|
@@ -7,8 +7,8 @@ import { StateControlElement } from './state-control-element';
|
|
|
7
7
|
import { VariableUtil } from '../../utils/variable-util';
|
|
8
8
|
import { VariableDefinition } from '../../communication/variable/variable-definition';
|
|
9
9
|
export class ConditionalControlElement extends StateControlElement {
|
|
10
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
11
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
10
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
11
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
12
12
|
this.variableCommunicator = variableCommunicator;
|
|
13
13
|
this.variableStore = variableStore;
|
|
14
14
|
this.recoverData();
|
|
@@ -27,7 +27,7 @@ export class ConditionalControlElement extends StateControlElement {
|
|
|
27
27
|
controlConditionResult.conditionResultChanged.subscribe(result => {
|
|
28
28
|
this.updateElement(result);
|
|
29
29
|
});
|
|
30
|
-
controlConditionResult.requestData();
|
|
30
|
+
controlConditionResult.requestData(this.signalRAppId);
|
|
31
31
|
}
|
|
32
32
|
recoverData() {
|
|
33
33
|
if (!this.model) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ConditionalControlElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./state-control-element","name":"StateControlElement","line":15,"character":56},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":19,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":20,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":21,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":21,"character":105},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":21,"character":134}]}],"updateElement":[{"__symbolic":"method"}],"initConditionalControl":[{"__symbolic":"method"}],"recoverData":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ConditionalControlElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./state-control-element","name":"StateControlElement","line":15,"character":56},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":19,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":20,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":21,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":21,"character":105},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":21,"character":134},{"__symbolic":"reference","name":"string"}]}],"updateElement":[{"__symbolic":"method"}],"initConditionalControl":[{"__symbolic":"method"}],"recoverData":[{"__symbolic":"method"}]}}}}]
|
|
@@ -8,7 +8,7 @@ export declare abstract class ConditionalDisplayElement extends BaseElement {
|
|
|
8
8
|
protected readonly variableCommunicator: VariableCommunicator;
|
|
9
9
|
protected readonly variableStore: VariableStore;
|
|
10
10
|
protected abstract readonly model: ConditionalDisplayModel;
|
|
11
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore);
|
|
11
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, signalRAppId: string);
|
|
12
12
|
private initDisplay;
|
|
13
13
|
private checkDisplayConditionAndPermission;
|
|
14
14
|
private updateVisibilityByCondition;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConditionItemsResultObserver } from '../../model';
|
|
2
2
|
import { BaseElement } from './base-element';
|
|
3
3
|
export class ConditionalDisplayElement extends BaseElement {
|
|
4
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore) {
|
|
5
|
-
super(element);
|
|
4
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, signalRAppId) {
|
|
5
|
+
super(element, signalRAppId);
|
|
6
6
|
this.permissionChecker = permissionChecker;
|
|
7
7
|
this.variableCommunicator = variableCommunicator;
|
|
8
8
|
this.variableStore = variableStore;
|
|
@@ -43,7 +43,7 @@ export class ConditionalDisplayElement extends BaseElement {
|
|
|
43
43
|
this.hide();
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
conditionResult.requestData();
|
|
46
|
+
conditionResult.requestData(this.signalRAppId);
|
|
47
47
|
}
|
|
48
48
|
updateVisibilityByCondition() {
|
|
49
49
|
if (null == this.model.conditionItems || !this.model.conditionItems.length) {
|
|
@@ -58,7 +58,7 @@ export class ConditionalDisplayElement extends BaseElement {
|
|
|
58
58
|
this.hide();
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
conditionResult.requestData();
|
|
61
|
+
conditionResult.requestData(this.signalRAppId);
|
|
62
62
|
}
|
|
63
63
|
updateVisibilityByPermission() {
|
|
64
64
|
if (!this.model.displayPermissionCodes || !this.model.displayPermissionCodes.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ConditionalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base-element","name":"BaseElement","line":6,"character":56},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":10,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service/permission-checker","name":"PermissionChecker","line":11,"character":46},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":12,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":13,"character":42}]}],"initDisplay":[{"__symbolic":"method"}],"checkDisplayConditionAndPermission":[{"__symbolic":"method"}],"updateVisibilityByCondition":[{"__symbolic":"method"}],"updateVisibilityByPermission":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ConditionalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./base-element","name":"BaseElement","line":6,"character":56},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":10,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service/permission-checker","name":"PermissionChecker","line":11,"character":46},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":12,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":13,"character":42},{"__symbolic":"reference","name":"string"}]}],"initDisplay":[{"__symbolic":"method"}],"checkDisplayConditionAndPermission":[{"__symbolic":"method"}],"updateVisibilityByCondition":[{"__symbolic":"method"}],"updateVisibilityByPermission":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}]}}}}]
|
|
@@ -16,7 +16,7 @@ export declare abstract class ConditionalDynamicDisplayElement extends Condition
|
|
|
16
16
|
protected rotatedHor: number;
|
|
17
17
|
protected rotatedVer: number;
|
|
18
18
|
protected transform: string;
|
|
19
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore);
|
|
19
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, signalRAppId: string);
|
|
20
20
|
protected initDynamicBehavior(): void;
|
|
21
21
|
protected getActualSize(): Size;
|
|
22
22
|
protected getActualLocation(): Point;
|
|
@@ -3,8 +3,8 @@ import { DynamicDisplay } from '../../model/shared/dynamic-display/dynamic-displ
|
|
|
3
3
|
import { ConditionalDisplayElement } from './conditional-display-element';
|
|
4
4
|
import { GuiConsts } from '../../shared';
|
|
5
5
|
export class ConditionalDynamicDisplayElement extends ConditionalDisplayElement {
|
|
6
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore) {
|
|
7
|
-
super(element, permissionChecker, variableCommunicator, variableStore);
|
|
6
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, signalRAppId) {
|
|
7
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
8
8
|
this.variableCommunicator = variableCommunicator;
|
|
9
9
|
this.variableStore = variableStore;
|
|
10
10
|
this.initDynamicBehavior();
|
|
@@ -16,7 +16,7 @@ export class ConditionalDynamicDisplayElement extends ConditionalDisplayElement
|
|
|
16
16
|
const strokeWidth = this.model.strokeWidth ? this.model.strokeWidth : 0;
|
|
17
17
|
this.hor = location.x - Number(strokeWidth) / 2;
|
|
18
18
|
this.ver = location.y - Number(strokeWidth) / 2;
|
|
19
|
-
const behavior = new DynamicDisplay(this.model.dynamicSetting, this.variableCommunicator, this.variableStore, location);
|
|
19
|
+
const behavior = new DynamicDisplay(this.model.dynamicSetting, this.variableCommunicator, this.variableStore, location, this.signalRAppId);
|
|
20
20
|
behavior.doBehavior.subscribe(result => {
|
|
21
21
|
if (this.model.angle) {
|
|
22
22
|
this.ang = Number(this.model.angle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ConditionalDynamicDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-display-element","name":"ConditionalDisplayElement","line":10,"character":63},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service/permission-checker","name":"PermissionChecker","line":23,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":24,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":25,"character":42}]}],"initDynamicBehavior":[{"__symbolic":"method"}],"getActualSize":[{"__symbolic":"method"}],"getActualLocation":[{"__symbolic":"method"}],"isBold":[{"__symbolic":"method"}],"isItalic":[{"__symbolic":"method"}],"fontFamily":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ConditionalDynamicDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./conditional-display-element","name":"ConditionalDisplayElement","line":10,"character":63},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service/permission-checker","name":"PermissionChecker","line":23,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":24,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":25,"character":42},{"__symbolic":"reference","name":"string"}]}],"initDynamicBehavior":[{"__symbolic":"method"}],"getActualSize":[{"__symbolic":"method"}],"getActualLocation":[{"__symbolic":"method"}],"isBold":[{"__symbolic":"method"}],"isItalic":[{"__symbolic":"method"}],"fontFamily":[{"__symbolic":"method"}]}}}}]
|
|
@@ -12,7 +12,7 @@ export declare abstract class ConditionalEnableElement extends StateControlEleme
|
|
|
12
12
|
protected abstract readonly model: ConditionalEnableModel;
|
|
13
13
|
isGrantedPermission: boolean;
|
|
14
14
|
isInitialized: boolean;
|
|
15
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
15
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
16
16
|
private initialize;
|
|
17
17
|
private updateEnableStateByConditionAndPermission;
|
|
18
18
|
private updateEnableStateByCondition;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConditionItemsResultObserver } from '../../model';
|
|
2
2
|
import { StateControlElement } from './state-control-element';
|
|
3
3
|
export class ConditionalEnableElement extends StateControlElement {
|
|
4
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
5
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
4
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
5
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
6
6
|
this.permissionChecker = permissionChecker;
|
|
7
7
|
this.variableCommunicator = variableCommunicator;
|
|
8
8
|
this.variableStore = variableStore;
|
|
@@ -68,7 +68,7 @@ export class ConditionalEnableElement extends StateControlElement {
|
|
|
68
68
|
this.isInitialized = true;
|
|
69
69
|
this.changeStates();
|
|
70
70
|
});
|
|
71
|
-
enableConditionResult.requestData();
|
|
71
|
+
enableConditionResult.requestData(this.signalRAppId);
|
|
72
72
|
}
|
|
73
73
|
updateEnableStateByCondition() {
|
|
74
74
|
if (null == this.model.enableItems || !this.model.enableItems.length) {
|
|
@@ -81,7 +81,7 @@ export class ConditionalEnableElement extends StateControlElement {
|
|
|
81
81
|
this.isInitialized = true;
|
|
82
82
|
this.changeStates();
|
|
83
83
|
});
|
|
84
|
-
enableConditionResult.requestData();
|
|
84
|
+
enableConditionResult.requestData(this.signalRAppId);
|
|
85
85
|
}
|
|
86
86
|
updateEnableStateByPermission() {
|
|
87
87
|
let isEnable = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ConditionalEnableElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./state-control-element","name":"StateControlElement","line":7,"character":55},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":15,"character":46},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":17,"character":42},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":18,"character":41}]}],"initialize":[{"__symbolic":"method"}],"updateEnableStateByConditionAndPermission":[{"__symbolic":"method"}],"updateEnableStateByCondition":[{"__symbolic":"method"}],"updateEnableStateByPermission":[{"__symbolic":"method"}],"setEnableByConditionOrPermission":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ConditionalEnableElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./state-control-element","name":"StateControlElement","line":7,"character":55},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":14,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":15,"character":46},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":49},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":17,"character":42},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":18,"character":41},{"__symbolic":"reference","name":"string"}]}],"initialize":[{"__symbolic":"method"}],"updateEnableStateByConditionAndPermission":[{"__symbolic":"method"}],"updateEnableStateByCondition":[{"__symbolic":"method"}],"updateEnableStateByPermission":[{"__symbolic":"method"}],"setEnableByConditionOrPermission":[{"__symbolic":"method"}]}}}}]
|
|
@@ -6,10 +6,15 @@ import { Localization } from '../../localization';
|
|
|
6
6
|
import { VariableStore } from '../../config';
|
|
7
7
|
export declare abstract class ReadableElement extends ConditionalEnableElement {
|
|
8
8
|
protected abstract model: ReadableModel;
|
|
9
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
9
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
10
10
|
init(variableName: string): void;
|
|
11
11
|
get readVariableName(): string;
|
|
12
|
-
|
|
12
|
+
get minVariableName(): string;
|
|
13
|
+
get minValueType(): any;
|
|
14
|
+
get maxVariableName(): string;
|
|
15
|
+
get maxValueType(): any;
|
|
16
|
+
private getVariableName;
|
|
17
|
+
protected abstract updateVariableValue(value: any, variableName: any): void;
|
|
13
18
|
reportStateChanged(variableState: VariableState): void;
|
|
14
19
|
reportValueChanged(value: VariableValue): void;
|
|
15
20
|
}
|