@flexem/fc-gui 3.0.0-alpha.169 → 3.0.0-alpha.170
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 +7 -6
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.js +5 -4
- package/gui/gui-context.d.ts +6 -0
- package/gui/gui-view.js +2 -2
- package/package.json +1 -1
|
@@ -40554,19 +40554,20 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
|
|
|
40554
40554
|
}
|
|
40555
40555
|
}
|
|
40556
40556
|
initIndictorLightOperator() {
|
|
40557
|
-
var _a, _b, _c, _d;
|
|
40557
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40558
40558
|
const settings = this.model.indicatorLightSettings;
|
|
40559
40559
|
if (settings.settings.variableName) {
|
|
40560
40560
|
const variable = new variable_definition["a" /* VariableDefinition */](settings.settings.variableName, settings.settings.variableGroupName, settings.settings.dataSourceCode, settings.settings.variableVersion);
|
|
40561
40561
|
const convertedName = variable_util["a" /* VariableUtil */].getConvertedVariableName(this.variableStore, variable);
|
|
40562
40562
|
this.addElementState(new communication["c" /* VariableState */](convertedName, undefined));
|
|
40563
40563
|
this.initState();
|
|
40564
|
-
|
|
40564
|
+
// 模拟模式下优先用后端 GetVariablesForDesigner 查出的有效变量(绑定了 manager);
|
|
40565
|
+
// 运行模式不填充 validVariableNames,回退到 variableStore.getAllVariableNames()
|
|
40566
|
+
const validNames = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.validVariableNames) !== null && _b !== void 0 ? _b : (_f = (_e = (_d = (_c = this.guiContext) === null || _c === void 0 ? void 0 : _c.configStore) === null || _d === void 0 ? void 0 : _d.variableStore) === null || _e === void 0 ? void 0 : _e.getAllVariableNames) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
40565
40567
|
if (validNames && !validNames.includes(convertedName)) {
|
|
40566
40568
|
this.updateElementStates([new communication["c" /* VariableState */](convertedName, communication["d" /* VariableStateEnum */].InvalidMonitor)]);
|
|
40567
|
-
// 无效变量时先显示第一个状态样式,避免空白;
|
|
40568
|
-
// 但仍继续初始化订阅,以便后续收到 Offline/Unbind 时能正确覆盖
|
|
40569
40569
|
this.switchToState(0);
|
|
40570
|
+
return;
|
|
40570
40571
|
}
|
|
40571
40572
|
}
|
|
40572
40573
|
switch (settings.type) {
|
|
@@ -44173,7 +44174,7 @@ class gui_view_GuiView {
|
|
|
44173
44174
|
this.logger.debug('[GUI] View loaded.');
|
|
44174
44175
|
}
|
|
44175
44176
|
loadElementState() {
|
|
44176
|
-
var _a, _b;
|
|
44177
|
+
var _a, _b, _c;
|
|
44177
44178
|
if (!this.mainElement) {
|
|
44178
44179
|
return;
|
|
44179
44180
|
}
|
|
@@ -44218,7 +44219,7 @@ class gui_view_GuiView {
|
|
|
44218
44219
|
});
|
|
44219
44220
|
normalVariablesForState.splice(normalVariablesForState.indexOf('设备状态'), 1);
|
|
44220
44221
|
}
|
|
44221
|
-
const validVariableNames = (
|
|
44222
|
+
const validVariableNames = (_a = this.context.validVariableNames) !== null && _a !== void 0 ? _a : (_c = (_b = this.context.configStore.variableStore).getAllVariableNames) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
44222
44223
|
if (validVariableNames) {
|
|
44223
44224
|
const invalidVariables = normalVariablesForState.filter(name => !validVariableNames.includes(name));
|
|
44224
44225
|
if (invalidVariables.length > 0) {
|