@flexem/fc-gui 3.0.0-alpha.15 → 3.0.0-alpha.151
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 +429 -1
- package/assets/img/black_first_page.png +0 -0
- package/assets/img/black_last_page.png +0 -0
- package/assets/img/black_next_page.png +0 -0
- package/assets/img/black_previous_page.png +0 -0
- package/bundles/@flexem/fc-gui.umd.js +24059 -19951
- 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 +4 -0
- package/communication/variable/variable-value.d.ts +4 -1
- package/communication/variable/variable-value.js +4 -1
- package/communication/variable/variable-value.metadata.json +1 -1
- package/config/alarm/alarm.store.d.ts +6 -0
- package/config/alarm/alarm.store.js +0 -0
- package/config/alarm/alarm.store.metadata.json +1 -0
- package/config/alarm/get-alarms-args.d.ts +12 -0
- package/config/alarm/get-alarms-args.js +13 -0
- package/config/alarm/get-alarms-args.metadata.json +1 -0
- package/config/alarm/index.d.ts +2 -0
- package/config/alarm/index.js +1 -0
- package/config/alarm/index.metadata.json +1 -0
- package/config/config-store.d.ts +2 -0
- package/config/index.d.ts +1 -0
- package/config/index.js +1 -0
- package/config/index.metadata.json +1 -1
- package/elements/air-quality/air-quality-element.d.ts +31 -0
- package/elements/air-quality/air-quality-element.js +194 -0
- package/elements/air-quality/air-quality-element.metadata.json +1 -0
- package/elements/alarm/alarm-element.d.ts +69 -0
- package/elements/alarm/alarm-element.js +497 -0
- package/elements/alarm/alarm-element.metadata.json +1 -0
- package/elements/bar-graph-element.d.ts +10 -2
- package/elements/bar-graph-element.js +135 -5
- package/elements/bar-graph-element.metadata.json +1 -1
- package/elements/base/readable-element.d.ts +6 -1
- package/elements/base/readable-element.js +65 -2
- package/elements/base/readable-element.metadata.json +1 -1
- package/elements/base/state-control-element.d.ts +3 -1
- package/elements/base/state-control-element.js +3 -0
- package/elements/datetime-display/datetime-display-element.d.ts +1 -0
- package/elements/datetime-display/datetime-display-element.js +10 -2
- package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
- package/elements/datetime-display/time-zone-select-json.d.ts +8 -0
- package/elements/datetime-display/time-zone-select-json.js +558 -0
- package/elements/historical-curve/historical-curve.element.d.ts +33 -3
- package/elements/historical-curve/historical-curve.element.js +368 -26
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/main-element.d.ts +1 -0
- package/elements/main-element.js +59 -9
- package/elements/main-element.metadata.json +1 -1
- package/elements/meter-element.d.ts +7 -1
- package/elements/meter-element.js +76 -7
- package/elements/meter-element.metadata.json +1 -1
- package/elements/numerical-display/numerical-display-element.d.ts +16 -3
- package/elements/numerical-display/numerical-display-element.js +83 -11
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/elements/per-view-variable-communicator.d.ts +3 -0
- package/elements/per-view-variable-communicator.js +15 -1
- package/elements/per-view-variable-communicator.metadata.json +1 -1
- package/elements/ring-graph/ring-graph-element.d.ts +13 -1
- package/elements/ring-graph/ring-graph-element.js +164 -3
- package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
- package/elements/scroll-alarm/scroll-alarm-element.d.ts +74 -0
- package/elements/scroll-alarm/scroll-alarm-element.js +761 -0
- package/elements/scroll-alarm/scroll-alarm-element.metadata.json +1 -0
- package/elements/shared/graph/graph-state-element.d.ts +1 -0
- package/elements/shared/graph/graph-state-element.js +30 -4
- package/elements/shared/graph/graph-state-element.metadata.json +1 -1
- package/elements/shared/text/text-element.d.ts +9 -0
- package/elements/shared/text/text-element.js +34 -3
- package/elements/shared/text/text-element.metadata.json +1 -1
- package/elements/shared/text/text-state-element.d.ts +28 -2
- package/elements/shared/text/text-state-element.js +188 -65
- package/elements/shared/text/text-state-element.metadata.json +1 -1
- package/elements/static-elements/hyperlink-element.d.ts +24 -2
- package/elements/static-elements/hyperlink-element.js +124 -3
- package/elements/static-elements/hyperlink-element.metadata.json +1 -1
- package/elements/static-elements/text-element.d.ts +24 -2
- package/elements/static-elements/text-element.js +120 -3
- package/elements/static-elements/text-element.metadata.json +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +1 -0
- package/elements/switch-indicator-light/bit-indicator-light-operator.js +5 -2
- package/elements/switch-indicator-light/bit-indicator-light-operator.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +11 -2
- package/elements/switch-indicator-light/switch-indicator-light-element.js +55 -11
- package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
- package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +1 -0
- package/elements/switch-indicator-light/word-indicator-light-operator.js +5 -2
- package/elements/switch-indicator-light/word-indicator-light-operator.metadata.json +1 -1
- package/elements/video/video-element.d.ts +10 -0
- package/elements/video/video-element.js +119 -21
- package/elements/video/video-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.d.ts +24 -2
- package/elements/view-operation/view-operation.element.js +128 -4
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/elements/weather/weater-element.js +0 -1
- package/gui/gui-context.d.ts +12 -2
- package/gui/gui-host.d.ts +1 -1
- package/gui/gui-view.d.ts +4 -1
- package/gui/gui-view.js +51 -7
- 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 +10 -3
- 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 +5 -1
- package/modal/write-value/write-value-modal-args.js +3 -1
- package/modal/write-value/write-value-modal-args.metadata.json +1 -1
- package/modal/write-value/write-value-modal.component.d.ts +13 -7
- package/modal/write-value/write-value-modal.component.html +10 -5
- package/modal/write-value/write-value-modal.component.js +87 -15
- 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/alarm/alarm.model.d.ts +13 -0
- package/model/alarm/alarm.model.js +0 -0
- package/model/alarm/alarm.model.metadata.json +1 -0
- package/model/bar-graph/bar-graph.d.ts +4 -0
- package/model/base/font-setting-model.d.ts +12 -1
- package/model/base/font-setting-model.metadata.json +1 -1
- package/model/base/readable-model.d.ts +4 -0
- package/model/datetime-display/datetime-display.d.ts +1 -0
- package/model/historical-curve/historical-curve-axis-settings.d.ts +11 -0
- package/model/historical-curve/historical-curve-axis-settings.js +5 -0
- package/model/historical-curve/historical-curve-axis-settings.metadata.json +1 -1
- package/model/historical-curve/historical-curve-chanel.model.d.ts +8 -0
- package/model/meter/meter.d.ts +4 -0
- package/model/ring-graph/ring-graph.model.d.ts +8 -0
- package/model/scroll-alarm/scroll-alarm.model.d.ts +21 -0
- package/model/scroll-alarm/scroll-alarm.model.js +0 -0
- package/model/scroll-alarm/scroll-alarm.model.metadata.json +1 -0
- package/model/shared/text/text.d.ts +3 -0
- package/model/switch-indicator-light/switch-indicator-light.d.ts +2 -0
- package/model/view-operation/view-operation-element.model.d.ts +7 -1
- package/package.json +1 -1
- package/public_api.js +1 -0
- package/remote/communication/variable/remote-variable-communicator.d.ts +27 -0
- package/remote/communication/variable/remote-variable-communicator.js +148 -3
- package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
- package/remote/communication/variable/remote-variable-protocol.d.ts +5 -0
- package/service/index.d.ts +4 -0
- package/service/index.js +1 -0
- package/service/index.metadata.json +1 -1
- package/service/language.service.d.ts +37 -0
- package/service/language.service.js +0 -0
- package/service/language.service.metadata.json +1 -0
- package/service/released-variable/index.d.ts +1 -0
- package/service/released-variable/index.js +0 -0
- package/service/released-variable/index.metadata.json +1 -0
- package/service/released-variable/released-variable.service.d.ts +4 -0
- package/service/released-variable/released-variable.service.js +0 -0
- package/service/released-variable/released-variable.service.metadata.json +1 -0
- package/service/system-text-library.service.d.ts +76 -0
- package/service/system-text-library.service.js +28 -0
- package/service/system-text-library.service.metadata.json +1 -0
- package/service/text-library.service.d.ts +49 -0
- package/service/text-library.service.js +0 -0
- package/service/text-library.service.metadata.json +1 -0
- package/service/weather.service.d.ts +1 -0
- package/shared/gui-consts.d.ts +3 -0
- package/shared/gui-consts.js +3 -0
- package/shared/gui-consts.metadata.json +1 -1
- package/utils/data-type/fbox-data-type.service.js +40 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"WriteValueModalComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"WriteValueModalComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"writeValueModal","template":"<form #writeValueForm=\"ngForm\" novalidate (ngSubmit)=\"save()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.setting}}</span> <span>{{displayVariableName}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">×</span> </button> </div> <div class=\"modal-body\"> <span class=\"write-value-range\">{{localization.writeValueRange}}:</span> <div class=\"write-value-range\"> {{writeValueRangeText}} <span *ngIf=\"valueType\">({{valueType}})</span> </div> <input type=\"text\" name=\"valueInput\" autoFocus class=\"form-control write-value\" [(ngModel)]=\"value\" (keyup)=\"validate($event)\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!validationError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"submit\" class=\"btn md-skip btn-primary btn-block\" [disabled]=\"validationError || isSubmitting\"> <ng-container *ngIf=\"!isSubmitting\">{{localization.submit}}</ng-container> <ng-container *ngIf=\"isSubmitting\">{{localization.submitting}}</ng-container> </button> </div> </form> ","styles":[".modal-header { padding: 10px; border-color: transparent; } .modal-body { position: relative; padding: 0px 5px !important; padding-top: 10px !important; } .modal-title { display: unset; margin-left: -6px; font-size: 16px !important; } .form-control { margin: 0 5%; float: none; width: 90%; } .modal-footer { padding: 10px 4px 20px 5px !important; text-align: right; border-color: transparent; } .text-danger { display: block; color: #ed6b75; font-size: 14px; margin: 5px 0px 0px 15px; } .btn-primary { background-color: #3B97FC; border-color: #3B97FC; padding: 5px 30px; width: 90%; margin: 0 5%; height: 32px; } .write-value-range { color: #7f939e; font-size: 14px; margin-left: 15px; } .write-value { padding-left: 8px; margin-left: 16px; height: 32px; } "]}]}],"members":{"invalidErrorText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":45,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":51,"character":9},"arguments":[{"__symbolic":"reference","module":"../../localization","name":"LOCALIZATION","line":51,"character":16}]}],null,null,null,null],"parameters":[{"__symbolic":"reference","module":"../../localization","name":"Localization","line":51,"character":51},{"__symbolic":"reference","module":"../../utils/data-type/data-type.service","name":"DataTypeService","line":52,"character":42},{"__symbolic":"reference","module":"../../utils/fraction-digit.service","name":"FractionDigitService","line":53,"character":47},{"__symbolic":"reference","module":"../../utils/numerical-operation.service","name":"NumericalOperationService","line":54,"character":52},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalRef","line":55,"character":37}]}],"ngOnInit":[{"__symbolic":"method"}],"initData":[{"__symbolic":"method"}],"setValueRangeAccordToDataParsed":[{"__symbolic":"method"}],"getWriteValueRangeText":[{"__symbolic":"method"}],"save":[{"__symbolic":"method"}],"handleCurrentLanguageIdSave":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"validate":[{"__symbolic":"method"}],"showValidationErrorInfo":[{"__symbolic":"method"}],"hideValidationErrorInfo":[{"__symbolic":"method"}],"getFractionDigits":[{"__symbolic":"method"}],"formatWriteValue":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as moment from 'moment';
|
|
2
|
+
export declare class AirQualityInfo {
|
|
3
|
+
/** 有无地址 */
|
|
4
|
+
hasAddress: boolean | undefined;
|
|
5
|
+
/** 是否获取地址中 */
|
|
6
|
+
gettingAddress: boolean | undefined;
|
|
7
|
+
/** 是否支持 */
|
|
8
|
+
supported: boolean | undefined;
|
|
9
|
+
airQuality: AirQuality | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare class AirQuality {
|
|
12
|
+
city: string | undefined;
|
|
13
|
+
aqi: string | undefined;
|
|
14
|
+
level: number | undefined;
|
|
15
|
+
category: string | undefined;
|
|
16
|
+
pm10: string | undefined;
|
|
17
|
+
pm25: string | undefined;
|
|
18
|
+
no2: string | undefined;
|
|
19
|
+
so2: string | undefined;
|
|
20
|
+
co: string | undefined;
|
|
21
|
+
o3: string | undefined;
|
|
22
|
+
reportTime: moment.Moment | undefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AirQualityInfo":{"__symbolic":"class"},"AirQuality":{"__symbolic":"class"}}}]
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AirQualityModel":{"__symbolic":"interface"}}}]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ConditionalDisplayModel } from '../base/conditional-display-model';
|
|
2
|
+
import { Point, Size } from '../shared';
|
|
3
|
+
export interface AlarmModel extends ConditionalDisplayModel {
|
|
4
|
+
readonly version: number;
|
|
5
|
+
readonly size: Size;
|
|
6
|
+
readonly location: Point;
|
|
7
|
+
readonly generalSetting?: any;
|
|
8
|
+
readonly filterSetting?: any;
|
|
9
|
+
readonly widths: number[];
|
|
10
|
+
readonly heights: number[];
|
|
11
|
+
readonly columLabels: string[];
|
|
12
|
+
readonly levelText: string[];
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AlarmModel":{"__symbolic":"interface"}}}]
|
|
@@ -19,4 +19,8 @@ export interface BarGraph extends ReadableModel {
|
|
|
19
19
|
readonly upperLimitColor?: string;
|
|
20
20
|
readonly lowerLimitColor?: string;
|
|
21
21
|
readonly percentageFont?: FontStyleData;
|
|
22
|
+
readonly masterDivisionNumber: number;
|
|
23
|
+
readonly subDivisionNumber: number;
|
|
24
|
+
readonly integerDigits: number;
|
|
25
|
+
readonly fractionDigits: number;
|
|
22
26
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
export interface TextLibrarySetting {
|
|
2
|
+
readonly labelType: 'text' | 'textLibrary';
|
|
3
|
+
readonly selectedTextLibraryItem?: string | number;
|
|
4
|
+
readonly selectedTextItem?: string | number;
|
|
5
|
+
}
|
|
6
|
+
export interface TextCultures {
|
|
7
|
+
readonly cultures: {
|
|
8
|
+
[languageCode: string]: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
1
11
|
export interface FontSettingModel {
|
|
2
|
-
readonly text: string;
|
|
12
|
+
readonly text: string | TextCultures;
|
|
3
13
|
readonly stroke: string;
|
|
4
14
|
readonly font: string;
|
|
5
15
|
readonly fontSize: string;
|
|
6
16
|
readonly isUnderline: boolean;
|
|
7
17
|
readonly textAlign: string;
|
|
18
|
+
readonly textLibrary?: TextLibrarySetting;
|
|
8
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"FontSettingModel":{"__symbolic":"interface"}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TextLibrarySetting":{"__symbolic":"interface"},"TextCultures":{"__symbolic":"interface"},"FontSettingModel":{"__symbolic":"interface"}}}]
|
|
@@ -7,4 +7,8 @@ export interface ReadableModel extends ConditionalEnableModel {
|
|
|
7
7
|
readonly version?: number;
|
|
8
8
|
readonly variableName?: string;
|
|
9
9
|
readonly readVariable?: VariableDefinition;
|
|
10
|
+
readonly minVariable?: any;
|
|
11
|
+
readonly maxVariable?: any;
|
|
12
|
+
readonly minValueType?: any;
|
|
13
|
+
readonly maxValueType?: any;
|
|
10
14
|
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { Font } from '../shared/text/font';
|
|
2
2
|
export interface HistoricalCurveAxisSettings {
|
|
3
|
+
readonly yAxisRangeType: AxisRangeType;
|
|
4
|
+
readonly yAxisMax?: number;
|
|
5
|
+
readonly yAxisMin?: number;
|
|
3
6
|
readonly axisColor: string;
|
|
4
7
|
readonly showAxisLabel: boolean;
|
|
5
8
|
readonly axisLabelFont: Font;
|
|
9
|
+
readonly showTick?: boolean;
|
|
10
|
+
readonly xAxisTickColor?: string;
|
|
11
|
+
readonly yAxisTickColor?: string;
|
|
12
|
+
readonly filterBackgroudColor?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare enum AxisRangeType {
|
|
15
|
+
Auto = 0,
|
|
16
|
+
Custom = 1
|
|
6
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveAxisSettings":{"__symbolic":"interface"}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveAxisSettings":{"__symbolic":"interface"},"AxisRangeType":{"Auto":0,"Custom":1}}}]
|
package/model/meter/meter.d.ts
CHANGED
|
@@ -10,4 +10,8 @@ export interface Meter extends ReadableModel {
|
|
|
10
10
|
readonly radius: number;
|
|
11
11
|
readonly min: number;
|
|
12
12
|
readonly max: number;
|
|
13
|
+
readonly masterDivisionNumber: number;
|
|
14
|
+
readonly subDivisionNumber: number;
|
|
15
|
+
readonly integerDigits: number;
|
|
16
|
+
readonly fractionDigits: number;
|
|
13
17
|
}
|
|
@@ -22,4 +22,12 @@ export interface RingGraphModel extends ConditionalDisplayModel {
|
|
|
22
22
|
readonly alarmRange?: AlarmRangeModel;
|
|
23
23
|
readonly showPercentage: boolean;
|
|
24
24
|
readonly percentageFont?: Font;
|
|
25
|
+
readonly minVariable?: any;
|
|
26
|
+
readonly maxVariable?: any;
|
|
27
|
+
readonly minValueType?: any;
|
|
28
|
+
readonly maxValueType?: any;
|
|
29
|
+
readonly masterDivisionNumber: number;
|
|
30
|
+
readonly subDivisionNumber: number;
|
|
31
|
+
readonly integerDigits: number;
|
|
32
|
+
readonly fractionDigits: number;
|
|
25
33
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ConditionalDynamicDisplayModel } from '../base/conditional-dynamic-display-model';
|
|
2
|
+
import { Point, Size } from '../shared';
|
|
3
|
+
import { DynamicDisplayModel } from '../shared/dynamic-display/dynamic-display-model';
|
|
4
|
+
export interface ScrollAlarmModel extends ConditionalDynamicDisplayModel {
|
|
5
|
+
readonly version: number;
|
|
6
|
+
readonly size: Size;
|
|
7
|
+
readonly location: Point;
|
|
8
|
+
readonly generalSetting?: any;
|
|
9
|
+
readonly filterSetting?: any;
|
|
10
|
+
readonly widths: number[];
|
|
11
|
+
readonly heights: number[];
|
|
12
|
+
readonly columLabels: string[];
|
|
13
|
+
readonly levelText: string[];
|
|
14
|
+
readonly scrollSetting?: {
|
|
15
|
+
readonly scrollInterval?: number;
|
|
16
|
+
readonly scrollDirection?: 'vertical' | 'horizontal';
|
|
17
|
+
readonly pauseOnHover?: boolean;
|
|
18
|
+
readonly autoPlay?: boolean;
|
|
19
|
+
};
|
|
20
|
+
readonly dynamicSetting?: DynamicDisplayModel;
|
|
21
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ScrollAlarmModel":{"__symbolic":"interface"}}}]
|
|
@@ -5,6 +5,7 @@ import { ConditionalEnableModel } from '../base/conditional-enable-model';
|
|
|
5
5
|
import { ConditionItemModel, GraphSetting, Point, Size } from '../shared';
|
|
6
6
|
import { DynamicDisplayModel } from '../shared/dynamic-display/dynamic-display-model';
|
|
7
7
|
import { SecurityModel } from '../base/security-model';
|
|
8
|
+
import { TextLibrarySetting } from '../base/font-setting-model';
|
|
8
9
|
export interface SwitchIndicatorLight extends ConditionalEnableModel, SecurityModel {
|
|
9
10
|
/**
|
|
10
11
|
* @type {(number)}
|
|
@@ -30,4 +31,5 @@ export interface SwitchIndicatorLight extends ConditionalEnableModel, SecurityMo
|
|
|
30
31
|
readonly isAwaysEnable?: boolean;
|
|
31
32
|
readonly enableItems?: ConditionItemModel[];
|
|
32
33
|
readonly fixedPositionType?: number;
|
|
34
|
+
readonly textLibrary?: TextLibrarySetting;
|
|
33
35
|
}
|
|
@@ -2,12 +2,14 @@ import { Size, Text, GraphSetting } from '../shared';
|
|
|
2
2
|
import { ConditionalEnableModel } from '../base/conditional-enable-model';
|
|
3
3
|
import { SecurityModel } from '../base';
|
|
4
4
|
import { ViewOperationType } from './view-operation-type';
|
|
5
|
+
import { TextLibrarySetting } from '../base/font-setting-model';
|
|
5
6
|
export interface ViewOperationElementModel extends ConditionalEnableModel, SecurityModel {
|
|
6
7
|
/**
|
|
7
8
|
* 版本 2 : 动态行为调整
|
|
8
9
|
* 版本 3 :使能控制调整
|
|
9
10
|
* 版本 4 :新增操作记录
|
|
10
|
-
* 版本 5
|
|
11
|
+
* 版本 5 :新增页面操作类型,之前类型都为"切换页面"
|
|
12
|
+
* 版本 6 :新增文本库支持
|
|
11
13
|
*/
|
|
12
14
|
readonly version?: number;
|
|
13
15
|
readonly viewIndex?: number;
|
|
@@ -16,4 +18,8 @@ export interface ViewOperationElementModel extends ConditionalEnableModel, Secur
|
|
|
16
18
|
readonly useGraph: boolean;
|
|
17
19
|
readonly graphSetting: GraphSetting;
|
|
18
20
|
readonly operationType: ViewOperationType;
|
|
21
|
+
/**
|
|
22
|
+
* 文本库配置(版本6新增)
|
|
23
|
+
*/
|
|
24
|
+
readonly textLibrary?: TextLibrarySetting;
|
|
19
25
|
}
|
package/package.json
CHANGED
package/public_api.js
CHANGED
|
@@ -9,6 +9,7 @@ export declare class RemoteVariableCommunicator implements VariableCommunicator
|
|
|
9
9
|
private appIdVariablesMap;
|
|
10
10
|
private connectedSubscription;
|
|
11
11
|
private variableValuesChangedSubscription;
|
|
12
|
+
private virtualDeviceStatesChangedSubscription;
|
|
12
13
|
private variablesToBeOpened;
|
|
13
14
|
private variablesToBeClosed;
|
|
14
15
|
private variableValueCache;
|
|
@@ -17,14 +18,40 @@ export declare class RemoteVariableCommunicator implements VariableCommunicator
|
|
|
17
18
|
private variableStateCache;
|
|
18
19
|
private variableStatesToBeOpened;
|
|
19
20
|
private variableStatesToBeClosed;
|
|
21
|
+
private alarmObservers;
|
|
22
|
+
private alarmChangedSubscription;
|
|
23
|
+
private systemVariableHandlers;
|
|
24
|
+
private offlineValueCache;
|
|
20
25
|
constructor(remoteVariableProtocol: RemoteVariableProtocol, logger: LoggerService);
|
|
26
|
+
private doAlarmChanged;
|
|
21
27
|
private doVariableValuesChanged;
|
|
28
|
+
private doVirtualDeviceStatesChanged;
|
|
22
29
|
private doVariableStatesChanged;
|
|
30
|
+
/**
|
|
31
|
+
* 预填充离线变量值缓存,由 GuiContext 在组态加载时一次性调用
|
|
32
|
+
*/
|
|
33
|
+
setOfflineValueCache(variableName: string, value: any): void;
|
|
23
34
|
subscribeVariableStates(variableNames: string[]): Observable<VariableState[]>;
|
|
24
35
|
subscribeVariableState(variableName: string): Observable<VariableState>;
|
|
36
|
+
requestVirtualDeviceState(): Observable<void>;
|
|
25
37
|
openVariables(variableNames: string[], appId?: string): Observable<VariableValue[]>;
|
|
26
38
|
openVariable(variableName: string, appId?: string): Observable<VariableValue>;
|
|
27
39
|
write(variableName: string, value: any): Observable<VariableValue>;
|
|
28
40
|
writeWordByBit(variableName: string, index: number, value: number): Observable<VariableValue>;
|
|
41
|
+
subscribeUserDeviceAlarms(appId?: string): Observable<any[]>;
|
|
42
|
+
/**
|
|
43
|
+
* 注册系统变量处理器
|
|
44
|
+
* @param variableName 变量名(如"当前语种ID")
|
|
45
|
+
* @param getValue 获取值的函数
|
|
46
|
+
* @param setValue 设置值的函数
|
|
47
|
+
*/
|
|
48
|
+
registerSystemVariableHandler(variableName: string, getValue: () => Promise<any>, setValue: (value: any) => Promise<void>): void;
|
|
49
|
+
/**
|
|
50
|
+
* 通知系统变量值变化
|
|
51
|
+
* 用于在系统变量值改变时通知所有订阅者
|
|
52
|
+
* @param variableName 变量名
|
|
53
|
+
* @param value 新值
|
|
54
|
+
*/
|
|
55
|
+
notifySystemVariableChange(variableName: string, value: any): void;
|
|
29
56
|
dispose(): void;
|
|
30
57
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { each, remove, uniq } from 'lodash';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { map } from 'rxjs/operators';
|
|
4
|
+
import { VariableStateEnum } from '../../../communication';
|
|
4
5
|
import { StringifyingMap } from '../../../core';
|
|
5
6
|
export class RemoteVariableCommunicator {
|
|
6
7
|
constructor(remoteVariableProtocol, logger) {
|
|
@@ -10,6 +11,11 @@ export class RemoteVariableCommunicator {
|
|
|
10
11
|
this.appIdVariablesMap = new Map();
|
|
11
12
|
this.variableStateObservers = new Map();
|
|
12
13
|
this.variableStateCache = new Map();
|
|
14
|
+
this.alarmObservers = [];
|
|
15
|
+
// 系统变量处理器
|
|
16
|
+
this.systemVariableHandlers = new Map();
|
|
17
|
+
// 预加载的离线变量最新值缓存(组态加载时一次性填充,推送后即删除)
|
|
18
|
+
this.offlineValueCache = new Map();
|
|
13
19
|
this.variableValueCache = new StringifyingMap(k => JSON.stringify(k));
|
|
14
20
|
this.connectedSubscription = this.remoteVariableProtocol.connected.subscribe(() => {
|
|
15
21
|
const variableNamesToStart = [];
|
|
@@ -23,6 +29,18 @@ export class RemoteVariableCommunicator {
|
|
|
23
29
|
});
|
|
24
30
|
this.doVariableStatesChanged();
|
|
25
31
|
this.doVariableValuesChanged();
|
|
32
|
+
this.doVirtualDeviceStatesChanged();
|
|
33
|
+
this.doAlarmChanged();
|
|
34
|
+
}
|
|
35
|
+
doAlarmChanged() {
|
|
36
|
+
if (this.alarmChangedSubscription !== undefined) {
|
|
37
|
+
this.alarmChangedSubscription.unsubscribe();
|
|
38
|
+
}
|
|
39
|
+
this.alarmChangedSubscription = this.remoteVariableProtocol.virtualDeviceAlarmsChanged.subscribe((alarms) => {
|
|
40
|
+
each(this.alarmObservers, ob => {
|
|
41
|
+
ob.next(alarms);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
26
44
|
}
|
|
27
45
|
doVariableValuesChanged() {
|
|
28
46
|
if (this.variableValuesChangedSubscription !== undefined) {
|
|
@@ -42,6 +60,25 @@ export class RemoteVariableCommunicator {
|
|
|
42
60
|
});
|
|
43
61
|
});
|
|
44
62
|
}
|
|
63
|
+
doVirtualDeviceStatesChanged() {
|
|
64
|
+
if (this.virtualDeviceStatesChangedSubscription !== undefined) {
|
|
65
|
+
this.virtualDeviceStatesChangedSubscription.unsubscribe();
|
|
66
|
+
}
|
|
67
|
+
this.virtualDeviceStatesChangedSubscription =
|
|
68
|
+
this.remoteVariableProtocol.virtualDeviceStatesChanged.subscribe((deviceStates) => {
|
|
69
|
+
each(deviceStates, deviceState => {
|
|
70
|
+
const variableName = '设备状态';
|
|
71
|
+
this.variableValueCache.set(variableName, deviceState);
|
|
72
|
+
const data = Object.assign(Object.assign({}, deviceState), { systemName: '设备状态' });
|
|
73
|
+
if (this.observers.has(variableName)) {
|
|
74
|
+
each(this.observers.get(variableName), ob => {
|
|
75
|
+
// TODO 同一个ob监听多个变量的情况,组合成数组一次推送。
|
|
76
|
+
ob.next([data]);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
45
82
|
doVariableStatesChanged() {
|
|
46
83
|
if (this.variableStatesChangedSubscription !== undefined) {
|
|
47
84
|
this.variableStatesChangedSubscription.unsubscribe();
|
|
@@ -53,13 +90,35 @@ export class RemoteVariableCommunicator {
|
|
|
53
90
|
this.variableStateCache.set(variableName, state);
|
|
54
91
|
if (this.variableStateObservers.has(variableName)) {
|
|
55
92
|
each(this.variableStateObservers.get(variableName), ob => {
|
|
56
|
-
// TODO 同一个ob监听多个变量的情况,组合成数组一次推送。
|
|
57
93
|
ob.next([state]);
|
|
58
94
|
});
|
|
59
95
|
}
|
|
96
|
+
// 离线时从预加载缓存取值推送给值订阅者
|
|
97
|
+
if (state.state === VariableStateEnum.Offline && this.offlineValueCache.has(variableName)) {
|
|
98
|
+
const cachedValue = this.offlineValueCache.get(variableName);
|
|
99
|
+
const variableValue = {
|
|
100
|
+
variableName,
|
|
101
|
+
value: cachedValue,
|
|
102
|
+
state: VariableStateEnum.Offline
|
|
103
|
+
};
|
|
104
|
+
this.variableValueCache.set(variableName, variableValue);
|
|
105
|
+
if (this.observers.has(variableName)) {
|
|
106
|
+
each(this.observers.get(variableName), ob => {
|
|
107
|
+
ob.next([variableValue]);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// 无论什么状态,推送后清除缓存,防止后续再次离线时用旧值
|
|
112
|
+
this.offlineValueCache.delete(variableName);
|
|
60
113
|
});
|
|
61
114
|
});
|
|
62
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* 预填充离线变量值缓存,由 GuiContext 在组态加载时一次性调用
|
|
118
|
+
*/
|
|
119
|
+
setOfflineValueCache(variableName, value) {
|
|
120
|
+
this.offlineValueCache.set(variableName, value);
|
|
121
|
+
}
|
|
63
122
|
subscribeVariableStates(variableNames) {
|
|
64
123
|
return new Observable(observer => {
|
|
65
124
|
let variableNamesToStart = [];
|
|
@@ -115,6 +174,9 @@ export class RemoteVariableCommunicator {
|
|
|
115
174
|
subscribeVariableState(variableName) {
|
|
116
175
|
return this.subscribeVariableStates([variableName]).pipe(map(values => values[0]));
|
|
117
176
|
}
|
|
177
|
+
requestVirtualDeviceState() {
|
|
178
|
+
return this.remoteVariableProtocol.requestVirtualDeviceState();
|
|
179
|
+
}
|
|
118
180
|
openVariables(variableNames, appId = '') {
|
|
119
181
|
return new Observable(observer => {
|
|
120
182
|
let variablesToStart = [];
|
|
@@ -140,7 +202,33 @@ export class RemoteVariableCommunicator {
|
|
|
140
202
|
}
|
|
141
203
|
}
|
|
142
204
|
});
|
|
143
|
-
|
|
205
|
+
// 过滤掉系统变量,它们不需要通过SignalR订阅
|
|
206
|
+
const normalVariables = variablesToStart.filter(v => !this.systemVariableHandlers.has(v));
|
|
207
|
+
const systemVariables = variablesToStart.filter(v => this.systemVariableHandlers.has(v));
|
|
208
|
+
// 处理系统变量的初始值
|
|
209
|
+
systemVariables.forEach(variableName => {
|
|
210
|
+
const handler = this.systemVariableHandlers.get(variableName);
|
|
211
|
+
if (handler && handler.getValue) {
|
|
212
|
+
void handler.getValue().then(value => {
|
|
213
|
+
const variableValue = {
|
|
214
|
+
variableName: variableName,
|
|
215
|
+
value: value,
|
|
216
|
+
state: 1 // Normal state
|
|
217
|
+
};
|
|
218
|
+
this.variableValueCache.set(variableName, variableValue);
|
|
219
|
+
if (this.observers.has(variableName)) {
|
|
220
|
+
each(this.observers.get(variableName), ob => {
|
|
221
|
+
ob.next([variableValue]);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}).catch(error => {
|
|
225
|
+
if (this.logger) {
|
|
226
|
+
this.logger.error(`[RemoteVariableCommunicator] Failed to get system variable "${variableName}" value:`, error);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
variablesToStart = uniq(normalVariables);
|
|
144
232
|
if (variablesToStart && variablesToStart.length > 0) {
|
|
145
233
|
if (!this.variablesToBeOpened) {
|
|
146
234
|
this.variablesToBeOpened = [];
|
|
@@ -185,8 +273,24 @@ export class RemoteVariableCommunicator {
|
|
|
185
273
|
}
|
|
186
274
|
write(variableName, value) {
|
|
187
275
|
if (!variableName) {
|
|
188
|
-
return
|
|
276
|
+
return new Observable(observer => {
|
|
277
|
+
observer.complete();
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// 检查是否为系统变量
|
|
281
|
+
if (this.systemVariableHandlers.has(variableName)) {
|
|
282
|
+
const handler = this.systemVariableHandlers.get(variableName);
|
|
283
|
+
// 调用系统变量的setValue处理器
|
|
284
|
+
void handler.setValue(value).catch(error => {
|
|
285
|
+
if (this.logger) {
|
|
286
|
+
this.logger.error('[RemoteVariableCommunicator] Failed to set system variable value:', error);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
return new Observable(__ => {
|
|
290
|
+
/* 系统变量通过自己的机制通知变化 */
|
|
291
|
+
});
|
|
189
292
|
}
|
|
293
|
+
// 普通变量通过SignalR写入
|
|
190
294
|
this.remoteVariableProtocol.writeVariable(variableName, value);
|
|
191
295
|
return new Observable(__ => {
|
|
192
296
|
/* do nothing right now, if want value change immediately, can use this code below:
|
|
@@ -203,11 +307,52 @@ export class RemoteVariableCommunicator {
|
|
|
203
307
|
observer.next(new VariableValue(variable, VariableStateEnum.DataNormal, value))*/
|
|
204
308
|
});
|
|
205
309
|
}
|
|
310
|
+
subscribeUserDeviceAlarms(appId = '') {
|
|
311
|
+
return new Observable(observer => {
|
|
312
|
+
this.alarmObservers.push(observer);
|
|
313
|
+
this.remoteVariableProtocol.subscribeVirtualDeviceAlarms(appId);
|
|
314
|
+
return () => {
|
|
315
|
+
this.remoteVariableProtocol.unsubscribeVirtualDeviceAlarms(appId);
|
|
316
|
+
};
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* 注册系统变量处理器
|
|
321
|
+
* @param variableName 变量名(如"当前语种ID")
|
|
322
|
+
* @param getValue 获取值的函数
|
|
323
|
+
* @param setValue 设置值的函数
|
|
324
|
+
*/
|
|
325
|
+
registerSystemVariableHandler(variableName, getValue, setValue) {
|
|
326
|
+
this.systemVariableHandlers.set(variableName, { getValue, setValue });
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* 通知系统变量值变化
|
|
330
|
+
* 用于在系统变量值改变时通知所有订阅者
|
|
331
|
+
* @param variableName 变量名
|
|
332
|
+
* @param value 新值
|
|
333
|
+
*/
|
|
334
|
+
notifySystemVariableChange(variableName, value) {
|
|
335
|
+
const variableValue = {
|
|
336
|
+
variableName: variableName,
|
|
337
|
+
value: value,
|
|
338
|
+
state: 1 // Normal state
|
|
339
|
+
};
|
|
340
|
+
// 更新缓存
|
|
341
|
+
this.variableValueCache.set(variableName, variableValue);
|
|
342
|
+
// 通知所有订阅者
|
|
343
|
+
if (this.observers.has(variableName)) {
|
|
344
|
+
each(this.observers.get(variableName), ob => {
|
|
345
|
+
ob.next([variableValue]);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}
|
|
206
349
|
dispose() {
|
|
207
350
|
// TODO调用所有的ob.complete()。
|
|
208
351
|
this.connectedSubscription.unsubscribe();
|
|
209
352
|
this.variableStatesChangedSubscription.unsubscribe();
|
|
210
353
|
this.variableValuesChangedSubscription.unsubscribe();
|
|
354
|
+
this.virtualDeviceStatesChangedSubscription.unsubscribe();
|
|
355
|
+
this.alarmChangedSubscription.unsubscribe();
|
|
211
356
|
if (this.logger && this.logger.isDebugEnabled()) {
|
|
212
357
|
this.logger.debug('[VariableCommunicator] RemoteVariableCommunicator disposed.');
|
|
213
358
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"RemoteVariableCommunicator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./remote-variable-protocol","name":"RemoteVariableProtocol","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"RemoteVariableCommunicator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./remote-variable-protocol","name":"RemoteVariableProtocol","line":37,"character":57},{"__symbolic":"reference","module":"../../../logger","name":"LoggerService","line":37,"character":106}]}],"doAlarmChanged":[{"__symbolic":"method"}],"doVariableValuesChanged":[{"__symbolic":"method"}],"doVirtualDeviceStatesChanged":[{"__symbolic":"method"}],"doVariableStatesChanged":[{"__symbolic":"method"}],"setOfflineValueCache":[{"__symbolic":"method"}],"subscribeVariableStates":[{"__symbolic":"method"}],"subscribeVariableState":[{"__symbolic":"method"}],"requestVirtualDeviceState":[{"__symbolic":"method"}],"openVariables":[{"__symbolic":"method"}],"openVariable":[{"__symbolic":"method"}],"write":[{"__symbolic":"method"}],"writeWordByBit":[{"__symbolic":"method"}],"subscribeUserDeviceAlarms":[{"__symbolic":"method"}],"registerSystemVariableHandler":[{"__symbolic":"method"}],"notifySystemVariableChange":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}]}}}}]
|
|
@@ -4,10 +4,15 @@ export interface RemoteVariableProtocol {
|
|
|
4
4
|
connected: Observable<void>;
|
|
5
5
|
variableStatesChanged: Observable<VariableValue[]>;
|
|
6
6
|
variableValuesChanged: Observable<VariableValue[]>;
|
|
7
|
+
virtualDeviceAlarmsChanged: Observable<any>;
|
|
7
8
|
tryOpenVariables(variableNames: string[], appId: string): Observable<void>;
|
|
8
9
|
tryStopVariables(variableNames: string[], appId: string): Observable<void>;
|
|
9
10
|
writeVariable(variableName: string, value: any): Observable<void>;
|
|
10
11
|
writeVariableWordByBit(variableName: string, index: number, value: number): Observable<void>;
|
|
12
|
+
requestVirtualDeviceState(): Observable<void>;
|
|
13
|
+
virtualDeviceStatesChanged: Observable<any>;
|
|
11
14
|
subscribeVariableStates(variableNames: string[]): Observable<void>;
|
|
12
15
|
unsubscribeVariableStates(variableNames: string[]): Observable<void>;
|
|
16
|
+
subscribeVirtualDeviceAlarms(appId: string): any;
|
|
17
|
+
unsubscribeVirtualDeviceAlarms(appId: string): any;
|
|
13
18
|
}
|
package/service/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export { WeatherService } from './weather.service';
|
|
2
2
|
export { PermissionChecker } from './permission-checker';
|
|
3
|
+
export { ReleasedVariableService } from './released-variable';
|
|
3
4
|
export * from './operation-record';
|
|
4
5
|
export * from './video';
|
|
6
|
+
export * from './text-library.service';
|
|
7
|
+
export * from './language.service';
|
|
8
|
+
export * from './system-text-library.service';
|
package/service/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './system-text-library.service';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./weather.service","export":["WeatherService"]},{"from":"./permission-checker","export":["PermissionChecker"]},{"from":"./operation-record"},{"from":"./video"}]}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./weather.service","export":["WeatherService"]},{"from":"./permission-checker","export":["PermissionChecker"]},{"from":"./released-variable","export":["ReleasedVariableService"]},{"from":"./operation-record"},{"from":"./video"},{"from":"./text-library.service"},{"from":"./language.service"},{"from":"./system-text-library.service"}]}]
|