@flexem/fc-gui 3.0.0-alpha.157 → 3.0.0-alpha.158
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/bundles/@flexem/fc-gui.umd.js +44 -5
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +4 -4
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/communication/variable/variable-state-enum.d.ts +1 -0
- package/communication/variable/variable-state-enum.js +1 -0
- package/communication/variable/variable-state-enum.metadata.json +1 -1
- package/config/variable/variable-store.d.ts +1 -0
- package/elements/base/state-control-element.js +17 -4
- package/elements/switch-indicator-light/switch-indicator-light-element.js +9 -2
- package/gui/gui-view.js +16 -1
- package/localization/localization.service.d.ts +1 -0
- package/localization/localization.service.js +1 -0
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +1 -0
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/model/shared/state/state.d.ts +1 -0
- package/model/shared/state/state.js +1 -0
- package/model/shared/state/state.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -4,5 +4,6 @@ export var VariableStateEnum;
|
|
|
4
4
|
VariableStateEnum[VariableStateEnum["Offline"] = 1] = "Offline";
|
|
5
5
|
VariableStateEnum[VariableStateEnum["Unbind"] = 3] = "Unbind";
|
|
6
6
|
VariableStateEnum[VariableStateEnum["DataNormal"] = 9] = "DataNormal";
|
|
7
|
+
VariableStateEnum[VariableStateEnum["InvalidMonitor"] = 10] = "InvalidMonitor";
|
|
7
8
|
VariableStateEnum[VariableStateEnum["Abnormal"] = 99] = "Abnormal";
|
|
8
9
|
})(VariableStateEnum || (VariableStateEnum = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"VariableStateEnum":{"Normal":0,"Offline":1,"Unbind":3,"DataNormal":9,"Abnormal":99}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"VariableStateEnum":{"Normal":0,"Offline":1,"Unbind":3,"DataNormal":9,"InvalidMonitor":10,"Abnormal":99}}}]
|
|
@@ -65,26 +65,34 @@ export class StateControlElement extends ConditionalDynamicDisplayElement {
|
|
|
65
65
|
case VariableStateEnum.Abnormal:
|
|
66
66
|
currentState = State.Abnormal;
|
|
67
67
|
break;
|
|
68
|
+
case VariableStateEnum.InvalidMonitor:
|
|
69
|
+
currentState = State.InvalidMonitor;
|
|
70
|
+
break;
|
|
68
71
|
}
|
|
69
72
|
return currentState;
|
|
70
73
|
}
|
|
71
74
|
changeState(state) {
|
|
72
75
|
switch (state) {
|
|
76
|
+
case State.InvalidMonitor:
|
|
77
|
+
this.state = State.InvalidMonitor;
|
|
78
|
+
break;
|
|
73
79
|
case State.Unbind:
|
|
74
|
-
this.state
|
|
80
|
+
if (this.state !== State.InvalidMonitor) {
|
|
81
|
+
this.state = State.Unbind;
|
|
82
|
+
}
|
|
75
83
|
break;
|
|
76
84
|
case State.Offline:
|
|
77
|
-
if (this.state !== State.Unbind) {
|
|
85
|
+
if (this.state !== State.Unbind && this.state !== State.InvalidMonitor) {
|
|
78
86
|
this.state = State.Offline;
|
|
79
87
|
}
|
|
80
88
|
break;
|
|
81
89
|
case State.Loading:
|
|
82
|
-
if (this.state !== State.Unbind && this.state !== State.Offline) {
|
|
90
|
+
if (this.state !== State.Unbind && this.state !== State.Offline && this.state !== State.InvalidMonitor) {
|
|
83
91
|
this.state = State.Loading;
|
|
84
92
|
}
|
|
85
93
|
break;
|
|
86
94
|
case State.Abnormal:
|
|
87
|
-
if (this.state !== State.Unbind && this.state !== State.Offline && this.state !== State.Loading) {
|
|
95
|
+
if (this.state !== State.Unbind && this.state !== State.Offline && this.state !== State.Loading && this.state !== State.InvalidMonitor) {
|
|
88
96
|
this.state = State.Abnormal;
|
|
89
97
|
}
|
|
90
98
|
break;
|
|
@@ -123,6 +131,11 @@ export class StateControlElement extends ConditionalDynamicDisplayElement {
|
|
|
123
131
|
title = this.localization.disable;
|
|
124
132
|
stroke = '#ff4444';
|
|
125
133
|
break;
|
|
134
|
+
case State.InvalidMonitor:
|
|
135
|
+
url = 'assets/img/loading.svg';
|
|
136
|
+
title = this.localization.invalidMonitor;
|
|
137
|
+
stroke = '#226abc';
|
|
138
|
+
break;
|
|
126
139
|
default:
|
|
127
140
|
url = 'assets/img/loading.svg';
|
|
128
141
|
title = this.localization.loading;
|
|
@@ -2,7 +2,7 @@ import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
|
2
2
|
import * as d3 from 'd3-selection';
|
|
3
3
|
import { isUndefined } from 'lodash';
|
|
4
4
|
import { IndicatorLightType, SwitchType, State, BitSwitchOperation } from '../../model';
|
|
5
|
-
import { VariableState } from '../../communication';
|
|
5
|
+
import { VariableState, VariableStateEnum } from '../../communication';
|
|
6
6
|
import { ConditionalEnableElement } from '../base/conditional-enable-element';
|
|
7
7
|
import { GraphStateElement } from '../shared/graph/graph-state-element';
|
|
8
8
|
import { TextStateElement } from '../shared/text/text-state-element';
|
|
@@ -195,11 +195,18 @@ export class SwitchIndicatorLightElement extends ConditionalEnableElement {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
initIndictorLightOperator() {
|
|
198
|
+
var _a, _b, _c, _d;
|
|
198
199
|
const settings = this.model.indicatorLightSettings;
|
|
199
200
|
if (settings.settings.variableName) {
|
|
200
201
|
const variable = new VariableDefinition(settings.settings.variableName, settings.settings.variableGroupName, settings.settings.dataSourceCode, settings.settings.variableVersion);
|
|
201
|
-
|
|
202
|
+
const convertedName = VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
203
|
+
this.addElementState(new VariableState(convertedName, undefined));
|
|
202
204
|
this.initState();
|
|
205
|
+
const validNames = (_d = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.configStore) === null || _b === void 0 ? void 0 : _b.variableStore) === null || _c === void 0 ? void 0 : _c.getAllVariableNames) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
206
|
+
if (validNames && !validNames.includes(convertedName)) {
|
|
207
|
+
this.updateElementStates([new VariableState(convertedName, VariableStateEnum.InvalidMonitor)]);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
203
210
|
}
|
|
204
211
|
switch (settings.type) {
|
|
205
212
|
case IndicatorLightType.Bit:
|
package/gui/gui-view.js
CHANGED
|
@@ -2,7 +2,7 @@ import { LOGGER_SERVICE_TOKEN } from '../logger';
|
|
|
2
2
|
import * as d3 from 'd3-selection';
|
|
3
3
|
import { each, forEach } from 'lodash';
|
|
4
4
|
import { map } from 'rxjs/operators';
|
|
5
|
-
import { VariableStateEnum } from '../communication';
|
|
5
|
+
import { VariableStateEnum, VariableState } from '../communication';
|
|
6
6
|
import { MainElement } from '../elements/main-element';
|
|
7
7
|
import { PerViewVariableCommunicator } from '../elements/per-view-variable-communicator';
|
|
8
8
|
import { ViewPopupBackdropType, ViewPopupLocationType } from '../model';
|
|
@@ -64,6 +64,7 @@ export class GuiView {
|
|
|
64
64
|
this.logger.debug('[GUI] View loaded.');
|
|
65
65
|
}
|
|
66
66
|
loadElementState() {
|
|
67
|
+
var _a, _b;
|
|
67
68
|
if (!this.mainElement) {
|
|
68
69
|
return;
|
|
69
70
|
}
|
|
@@ -108,6 +109,20 @@ export class GuiView {
|
|
|
108
109
|
});
|
|
109
110
|
normalVariablesForState.splice(normalVariablesForState.indexOf('设备状态'), 1);
|
|
110
111
|
}
|
|
112
|
+
const validVariableNames = (_b = (_a = this.context.configStore.variableStore).getAllVariableNames) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
113
|
+
if (validVariableNames) {
|
|
114
|
+
const invalidVariables = normalVariablesForState.filter(name => !validVariableNames.includes(name));
|
|
115
|
+
if (invalidVariables.length > 0) {
|
|
116
|
+
const unbindStates = invalidVariables.map(name => new VariableState(name, VariableStateEnum.InvalidMonitor));
|
|
117
|
+
this.mainElement.reportVariableStates(unbindStates);
|
|
118
|
+
invalidVariables.forEach(name => {
|
|
119
|
+
const idx = normalVariablesForState.indexOf(name);
|
|
120
|
+
if (idx !== -1) {
|
|
121
|
+
normalVariablesForState.splice(idx, 1);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
111
126
|
if (normalVariablesForState.length === 0) {
|
|
112
127
|
return;
|
|
113
128
|
}
|
|
@@ -29,6 +29,7 @@ export const DefaultLocalization = {
|
|
|
29
29
|
offline: 'Offline',
|
|
30
30
|
abnormal: 'Data abnormal',
|
|
31
31
|
disable: 'Disable',
|
|
32
|
+
invalidMonitor: 'Element binding monitor point is invalid',
|
|
32
33
|
permissiontip: 'You have no permission to operate.',
|
|
33
34
|
conditionIsNotMetTip: 'Operation conditions not met or variable anomalies.',
|
|
34
35
|
chartNoData: 'No Data Available',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"LOCALIZATION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":32},"arguments":["fc.gui.loc"]},"Localization":{"__symbolic":"interface"},"DefaultLocalization":{"loadFailed":"Load failed.","setting":"Setting","submit":"Submit","submitting":"Submitting···","numericalValueRequired":"Numerical value can't be emtpy","invalidNumericalValue":"Numerical value is not valid","writeValueTimeout":"Write value error: Timeout","binaryType":"Binary","decimalType":"Decimal","hexadecimalType":"Hexadecimal","stringType":"String","numericalValueTooLong":"Numerical value too long","fractionDigitsMustLessThan":"Fraction digits must be less than ","canNotBeNegative":"Can not be negative","valueOutOfRange":"Numerical value is out of range","timeout":"timeout","confirmOperationPrompt":"Are you sure you want to perform this operation?","confirm":"Yes","cancel":"Cancel","characterInputRequired":"Character input can't be empty","character":"(Character)","characterOutofRange":"Character length is out of range","writeValueRange":"Write value range","loading":"Loading","unbind":"Unbind","offline":"Offline","abnormal":"Data abnormal","disable":"Disable","permissiontip":"You have no permission to operate.","conditionIsNotMetTip":"Operation conditions not met or variable anomalies.","chartNoData":"No Data Available","lastThirtyMinutes":"Last thirty minutes","lastOneHour":"Last one hour","lastEightHour":"Last eight hours","lastTwentyFourHours":"Last 24 hours","lastSevenDays":"Last 7 days","lastThirtyDays":"Last 30 days","lastOneYear":"Last 1 year","grouped":"Grouped","stacked":"Stacked","passwordVerify":"Password verifiers","passwordError":"Password error","password":"Password","passwordToolTip":"Password error, please re-enter","passwordRequired":"Password can't be empty","invalidVideoAddress":"Invalid video address","unconfiguredVideoAddress":"Unconfigured Video Address","weatherNotSupport":"Location not supported","weatherNotAddress":"Address not configured","weatherNotAvailable":"Address not yet available","airQualityNotSupport":"Location not supported","airQualityNotAddress":"Address not configured","airQualityNotAvailable":"Address not yet available"}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"LOCALIZATION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":32},"arguments":["fc.gui.loc"]},"Localization":{"__symbolic":"interface"},"DefaultLocalization":{"loadFailed":"Load failed.","setting":"Setting","submit":"Submit","submitting":"Submitting···","numericalValueRequired":"Numerical value can't be emtpy","invalidNumericalValue":"Numerical value is not valid","writeValueTimeout":"Write value error: Timeout","binaryType":"Binary","decimalType":"Decimal","hexadecimalType":"Hexadecimal","stringType":"String","numericalValueTooLong":"Numerical value too long","fractionDigitsMustLessThan":"Fraction digits must be less than ","canNotBeNegative":"Can not be negative","valueOutOfRange":"Numerical value is out of range","timeout":"timeout","confirmOperationPrompt":"Are you sure you want to perform this operation?","confirm":"Yes","cancel":"Cancel","characterInputRequired":"Character input can't be empty","character":"(Character)","characterOutofRange":"Character length is out of range","writeValueRange":"Write value range","loading":"Loading","unbind":"Unbind","offline":"Offline","abnormal":"Data abnormal","disable":"Disable","invalidMonitor":"Element binding monitor point is invalid","permissiontip":"You have no permission to operate.","conditionIsNotMetTip":"Operation conditions not met or variable anomalies.","chartNoData":"No Data Available","lastThirtyMinutes":"Last thirty minutes","lastOneHour":"Last one hour","lastEightHour":"Last eight hours","lastTwentyFourHours":"Last 24 hours","lastSevenDays":"Last 7 days","lastThirtyDays":"Last 30 days","lastOneYear":"Last 1 year","grouped":"Grouped","stacked":"Stacked","passwordVerify":"Password verifiers","passwordError":"Password error","password":"Password","passwordToolTip":"Password error, please re-enter","passwordRequired":"Password can't be empty","invalidVideoAddress":"Invalid video address","unconfiguredVideoAddress":"Unconfigured Video Address","weatherNotSupport":"Location not supported","weatherNotAddress":"Address not configured","weatherNotAvailable":"Address not yet available","airQualityNotSupport":"Location not supported","airQualityNotAddress":"Address not configured","airQualityNotAvailable":"Address not yet available"}}}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"Localization_zh_CN":{"loadFailed":"加载失败.","setting":"设置","submit":"提交","submitting":"提交中···","numericalValueRequired":"数值不能为空","invalidNumericalValue":"数值格式不正确","writeValueTimeout":"写值错误:超时","binaryType":"二进制","decimalType":"十进制","hexadecimalType":"十六进制","stringType":"字符串","numericalValueTooLong":"数值超长","fractionDigitsMustLessThan":"小数位不能超过","canNotBeNegative":"不能为负数","valueOutOfRange":"数值超出范围","timeout":"超时","confirmOperationPrompt":"是否确认要执行此操作?","confirm":"确定","cancel":"取消","characterInputRequired":"请输入至少一个字符","character":"(字符串)","characterOutofRange":"字符长度超限","writeValueRange":"写值范围","loading":"加载中","unbind":"未绑定","offline":"离线","abnormal":"数据异常","disable":"禁用","permissiontip":"您无权限执行此操作","conditionIsNotMetTip":"操作条件不满足或逻辑控制变量异常","chartNoData":"无数据","lastThirtyMinutes":"最近30分钟","lastOneHour":"最近1小时","lastEightHour":"最近8小时","lastTwentyFourHours":"最近24小时","lastSevenDays":"最近7天","lastThirtyDays":"最近30天","lastOneYear":"最近1年","grouped":"分组","stacked":"叠加","passwordVerify":"密码校验","passwordError":"密码错误","password":"密码","passwordToolTip":"密码错误,请重新输入","passwordRequired":"密码不能为空","invalidVideoAddress":"无效的视频地址","unconfiguredVideoAddress":"未配置视频地址","weatherNotSupport":"当前位置暂不支持","weatherNotAddress":"当前设备未设置地址","weatherNotAvailable":"暂未获取设备地址","airQualityNotSupport":"当前位置暂不支持","airQualityNotAddress":"当前设备未设置地址","airQualityNotAvailable":"暂未获取设备地址"}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"Localization_zh_CN":{"loadFailed":"加载失败.","setting":"设置","submit":"提交","submitting":"提交中···","numericalValueRequired":"数值不能为空","invalidNumericalValue":"数值格式不正确","writeValueTimeout":"写值错误:超时","binaryType":"二进制","decimalType":"十进制","hexadecimalType":"十六进制","stringType":"字符串","numericalValueTooLong":"数值超长","fractionDigitsMustLessThan":"小数位不能超过","canNotBeNegative":"不能为负数","valueOutOfRange":"数值超出范围","timeout":"超时","confirmOperationPrompt":"是否确认要执行此操作?","confirm":"确定","cancel":"取消","characterInputRequired":"请输入至少一个字符","character":"(字符串)","characterOutofRange":"字符长度超限","writeValueRange":"写值范围","loading":"加载中","unbind":"未绑定","offline":"离线","abnormal":"数据异常","disable":"禁用","invalidMonitor":"元件绑定的监控点无效","permissiontip":"您无权限执行此操作","conditionIsNotMetTip":"操作条件不满足或逻辑控制变量异常","chartNoData":"无数据","lastThirtyMinutes":"最近30分钟","lastOneHour":"最近1小时","lastEightHour":"最近8小时","lastTwentyFourHours":"最近24小时","lastSevenDays":"最近7天","lastThirtyDays":"最近30天","lastOneYear":"最近1年","grouped":"分组","stacked":"叠加","passwordVerify":"密码校验","passwordError":"密码错误","password":"密码","passwordToolTip":"密码错误,请重新输入","passwordRequired":"密码不能为空","invalidVideoAddress":"无效的视频地址","unconfiguredVideoAddress":"未配置视频地址","weatherNotSupport":"当前位置暂不支持","weatherNotAddress":"当前设备未设置地址","weatherNotAvailable":"暂未获取设备地址","airQualityNotSupport":"当前位置暂不支持","airQualityNotAddress":"当前设备未设置地址","airQualityNotAvailable":"暂未获取设备地址"}}}]
|
|
@@ -5,5 +5,6 @@ export var State;
|
|
|
5
5
|
State[State["Unbind"] = 2] = "Unbind";
|
|
6
6
|
State[State["Abnormal"] = 3] = "Abnormal";
|
|
7
7
|
State[State["Loading"] = 4] = "Loading";
|
|
8
|
+
State[State["InvalidMonitor"] = 5] = "InvalidMonitor";
|
|
8
9
|
State[State["Disable"] = 9] = "Disable";
|
|
9
10
|
})(State || (State = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"State":{"Normal":0,"Offline":1,"Unbind":2,"Abnormal":3,"Loading":4,"Disable":9}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"State":{"Normal":0,"Offline":1,"Unbind":2,"Abnormal":3,"Loading":4,"InvalidMonitor":5,"Disable":9}}}]
|