@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
|
@@ -21897,6 +21897,7 @@ var VariableStateEnum;
|
|
|
21897
21897
|
VariableStateEnum[VariableStateEnum["Offline"] = 1] = "Offline";
|
|
21898
21898
|
VariableStateEnum[VariableStateEnum["Unbind"] = 3] = "Unbind";
|
|
21899
21899
|
VariableStateEnum[VariableStateEnum["DataNormal"] = 9] = "DataNormal";
|
|
21900
|
+
VariableStateEnum[VariableStateEnum["InvalidMonitor"] = 10] = "InvalidMonitor";
|
|
21900
21901
|
VariableStateEnum[VariableStateEnum["Abnormal"] = 99] = "Abnormal";
|
|
21901
21902
|
})(VariableStateEnum || (VariableStateEnum = {}));
|
|
21902
21903
|
|
|
@@ -22343,6 +22344,7 @@ const Localization_zh_CN = {
|
|
|
22343
22344
|
offline: '离线',
|
|
22344
22345
|
abnormal: '数据异常',
|
|
22345
22346
|
disable: '禁用',
|
|
22347
|
+
invalidMonitor: '元件绑定的监控点无效',
|
|
22346
22348
|
permissiontip: '您无权限执行此操作',
|
|
22347
22349
|
conditionIsNotMetTip: '操作条件不满足或逻辑控制变量异常',
|
|
22348
22350
|
chartNoData: '无数据',
|
|
@@ -32538,6 +32540,7 @@ const DefaultLocalization = {
|
|
|
32538
32540
|
offline: 'Offline',
|
|
32539
32541
|
abnormal: 'Data abnormal',
|
|
32540
32542
|
disable: 'Disable',
|
|
32543
|
+
invalidMonitor: 'Element binding monitor point is invalid',
|
|
32541
32544
|
permissiontip: 'You have no permission to operate.',
|
|
32542
32545
|
conditionIsNotMetTip: 'Operation conditions not met or variable anomalies.',
|
|
32543
32546
|
chartNoData: 'No Data Available',
|
|
@@ -35087,26 +35090,34 @@ class state_control_element_StateControlElement extends conditional_dynamic_disp
|
|
|
35087
35090
|
case communication["d" /* VariableStateEnum */].Abnormal:
|
|
35088
35091
|
currentState = _tmp_model["State"].Abnormal;
|
|
35089
35092
|
break;
|
|
35093
|
+
case communication["d" /* VariableStateEnum */].InvalidMonitor:
|
|
35094
|
+
currentState = _tmp_model["State"].InvalidMonitor;
|
|
35095
|
+
break;
|
|
35090
35096
|
}
|
|
35091
35097
|
return currentState;
|
|
35092
35098
|
}
|
|
35093
35099
|
changeState(state) {
|
|
35094
35100
|
switch (state) {
|
|
35101
|
+
case _tmp_model["State"].InvalidMonitor:
|
|
35102
|
+
this.state = _tmp_model["State"].InvalidMonitor;
|
|
35103
|
+
break;
|
|
35095
35104
|
case _tmp_model["State"].Unbind:
|
|
35096
|
-
this.state
|
|
35105
|
+
if (this.state !== _tmp_model["State"].InvalidMonitor) {
|
|
35106
|
+
this.state = _tmp_model["State"].Unbind;
|
|
35107
|
+
}
|
|
35097
35108
|
break;
|
|
35098
35109
|
case _tmp_model["State"].Offline:
|
|
35099
|
-
if (this.state !== _tmp_model["State"].Unbind) {
|
|
35110
|
+
if (this.state !== _tmp_model["State"].Unbind && this.state !== _tmp_model["State"].InvalidMonitor) {
|
|
35100
35111
|
this.state = _tmp_model["State"].Offline;
|
|
35101
35112
|
}
|
|
35102
35113
|
break;
|
|
35103
35114
|
case _tmp_model["State"].Loading:
|
|
35104
|
-
if (this.state !== _tmp_model["State"].Unbind && this.state !== _tmp_model["State"].Offline) {
|
|
35115
|
+
if (this.state !== _tmp_model["State"].Unbind && this.state !== _tmp_model["State"].Offline && this.state !== _tmp_model["State"].InvalidMonitor) {
|
|
35105
35116
|
this.state = _tmp_model["State"].Loading;
|
|
35106
35117
|
}
|
|
35107
35118
|
break;
|
|
35108
35119
|
case _tmp_model["State"].Abnormal:
|
|
35109
|
-
if (this.state !== _tmp_model["State"].Unbind && this.state !== _tmp_model["State"].Offline && this.state !== _tmp_model["State"].Loading) {
|
|
35120
|
+
if (this.state !== _tmp_model["State"].Unbind && this.state !== _tmp_model["State"].Offline && this.state !== _tmp_model["State"].Loading && this.state !== _tmp_model["State"].InvalidMonitor) {
|
|
35110
35121
|
this.state = _tmp_model["State"].Abnormal;
|
|
35111
35122
|
}
|
|
35112
35123
|
break;
|
|
@@ -35145,6 +35156,11 @@ class state_control_element_StateControlElement extends conditional_dynamic_disp
|
|
|
35145
35156
|
title = this.localization.disable;
|
|
35146
35157
|
stroke = '#ff4444';
|
|
35147
35158
|
break;
|
|
35159
|
+
case _tmp_model["State"].InvalidMonitor:
|
|
35160
|
+
url = 'assets/img/loading.svg';
|
|
35161
|
+
title = this.localization.invalidMonitor;
|
|
35162
|
+
stroke = '#226abc';
|
|
35163
|
+
break;
|
|
35148
35164
|
default:
|
|
35149
35165
|
url = 'assets/img/loading.svg';
|
|
35150
35166
|
title = this.localization.loading;
|
|
@@ -40156,11 +40172,18 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
|
|
|
40156
40172
|
}
|
|
40157
40173
|
}
|
|
40158
40174
|
initIndictorLightOperator() {
|
|
40175
|
+
var _a, _b, _c, _d;
|
|
40159
40176
|
const settings = this.model.indicatorLightSettings;
|
|
40160
40177
|
if (settings.settings.variableName) {
|
|
40161
40178
|
const variable = new variable_definition["a" /* VariableDefinition */](settings.settings.variableName, settings.settings.variableGroupName, settings.settings.dataSourceCode, settings.settings.variableVersion);
|
|
40162
|
-
|
|
40179
|
+
const convertedName = variable_util["a" /* VariableUtil */].getConvertedVariableName(this.variableStore, variable);
|
|
40180
|
+
this.addElementState(new communication["c" /* VariableState */](convertedName, undefined));
|
|
40163
40181
|
this.initState();
|
|
40182
|
+
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);
|
|
40183
|
+
if (validNames && !validNames.includes(convertedName)) {
|
|
40184
|
+
this.updateElementStates([new communication["c" /* VariableState */](convertedName, communication["d" /* VariableStateEnum */].InvalidMonitor)]);
|
|
40185
|
+
return;
|
|
40186
|
+
}
|
|
40164
40187
|
}
|
|
40165
40188
|
switch (settings.type) {
|
|
40166
40189
|
case _tmp_model["IndicatorLightType"].Bit:
|
|
@@ -43675,6 +43698,7 @@ class gui_view_GuiView {
|
|
|
43675
43698
|
this.logger.debug('[GUI] View loaded.');
|
|
43676
43699
|
}
|
|
43677
43700
|
loadElementState() {
|
|
43701
|
+
var _a, _b;
|
|
43678
43702
|
if (!this.mainElement) {
|
|
43679
43703
|
return;
|
|
43680
43704
|
}
|
|
@@ -43719,6 +43743,20 @@ class gui_view_GuiView {
|
|
|
43719
43743
|
});
|
|
43720
43744
|
normalVariablesForState.splice(normalVariablesForState.indexOf('设备状态'), 1);
|
|
43721
43745
|
}
|
|
43746
|
+
const validVariableNames = (_b = (_a = this.context.configStore.variableStore).getAllVariableNames) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
43747
|
+
if (validVariableNames) {
|
|
43748
|
+
const invalidVariables = normalVariablesForState.filter(name => !validVariableNames.includes(name));
|
|
43749
|
+
if (invalidVariables.length > 0) {
|
|
43750
|
+
const unbindStates = invalidVariables.map(name => new communication["c" /* VariableState */](name, communication["d" /* VariableStateEnum */].InvalidMonitor));
|
|
43751
|
+
this.mainElement.reportVariableStates(unbindStates);
|
|
43752
|
+
invalidVariables.forEach(name => {
|
|
43753
|
+
const idx = normalVariablesForState.indexOf(name);
|
|
43754
|
+
if (idx !== -1) {
|
|
43755
|
+
normalVariablesForState.splice(idx, 1);
|
|
43756
|
+
}
|
|
43757
|
+
});
|
|
43758
|
+
}
|
|
43759
|
+
}
|
|
43722
43760
|
if (normalVariablesForState.length === 0) {
|
|
43723
43761
|
return;
|
|
43724
43762
|
}
|
|
@@ -67137,6 +67175,7 @@ var State;
|
|
|
67137
67175
|
State[State["Unbind"] = 2] = "Unbind";
|
|
67138
67176
|
State[State["Abnormal"] = 3] = "Abnormal";
|
|
67139
67177
|
State[State["Loading"] = 4] = "Loading";
|
|
67178
|
+
State[State["InvalidMonitor"] = 5] = "InvalidMonitor";
|
|
67140
67179
|
State[State["Disable"] = 9] = "Disable";
|
|
67141
67180
|
})(State || (State = {}));
|
|
67142
67181
|
|