@flexem/fc-gui 3.0.0-alpha.156 → 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 +191 -27
- 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/shared/text/text-element.d.ts +5 -0
- package/elements/shared/text/text-element.js +7 -0
- package/elements/shared/text/text-element.metadata.json +1 -1
- package/elements/shared/text/text-state-element.d.ts +10 -1
- package/elements/shared/text/text-state-element.js +29 -2
- package/elements/shared/text/text-state-element.metadata.json +1 -1
- package/elements/static-elements/hyperlink-element.d.ts +4 -0
- package/elements/static-elements/hyperlink-element.js +35 -7
- package/elements/static-elements/hyperlink-element.metadata.json +1 -1
- package/elements/static-elements/text-element.d.ts +4 -0
- package/elements/static-elements/text-element.js +44 -11
- package/elements/static-elements/text-element.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.js +10 -3
- package/elements/view-operation/view-operation.element.d.ts +4 -0
- package/elements/view-operation/view-operation.element.js +31 -1
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- 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/base/font-setting-model.d.ts +10 -0
- package/model/base/font-setting-model.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;
|
|
@@ -35793,6 +35809,13 @@ class text_element_TextElementModal {
|
|
|
35793
35809
|
get Element() {
|
|
35794
35810
|
return this._element;
|
|
35795
35811
|
}
|
|
35812
|
+
/**
|
|
35813
|
+
* 更新字体样式
|
|
35814
|
+
* @param font 新的字体样式
|
|
35815
|
+
*/
|
|
35816
|
+
updateFont(font) {
|
|
35817
|
+
this.font = font;
|
|
35818
|
+
}
|
|
35796
35819
|
/**
|
|
35797
35820
|
* 更新文本内容
|
|
35798
35821
|
* @param content 新的文本内容
|
|
@@ -39119,15 +39142,7 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
|
|
|
39119
39142
|
graphStateElement.switchToState(0);
|
|
39120
39143
|
this.$element.prepend(graphStateElement.Element);
|
|
39121
39144
|
}
|
|
39122
|
-
const font =
|
|
39123
|
-
isUnderline: this.model.isUnderline,
|
|
39124
|
-
isBold: this.isBold(this.model.font),
|
|
39125
|
-
isItalic: this.isItalic(this.model.font),
|
|
39126
|
-
fontSize: this.model.fontSize,
|
|
39127
|
-
fontFamily: this.fontFamily(this.model.font),
|
|
39128
|
-
color: this.model.stroke,
|
|
39129
|
-
textAlign: this.model.textAlign
|
|
39130
|
-
};
|
|
39145
|
+
const font = this.getFontStyle();
|
|
39131
39146
|
// 获取显示文本(支持文本库)
|
|
39132
39147
|
const displayText = this.getDisplayText();
|
|
39133
39148
|
this.textElementModal = new text_element_TextElementModal(displayText, font, width, height);
|
|
@@ -39171,11 +39186,52 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
|
|
|
39171
39186
|
if (!this.textElementModal || !this.model.size) {
|
|
39172
39187
|
return;
|
|
39173
39188
|
}
|
|
39174
|
-
//
|
|
39189
|
+
// 获取新的显示文本和样式
|
|
39175
39190
|
const displayText = this.getDisplayText();
|
|
39176
|
-
|
|
39191
|
+
const font = this.getFontStyle();
|
|
39192
|
+
// 更新样式和文本内容
|
|
39193
|
+
this.textElementModal.updateFont(font);
|
|
39177
39194
|
this.textElementModal.updateText(displayText);
|
|
39178
39195
|
}
|
|
39196
|
+
/**
|
|
39197
|
+
* 获取当前语种的字体样式
|
|
39198
|
+
*/
|
|
39199
|
+
getFontStyle() {
|
|
39200
|
+
// 获取目标语种
|
|
39201
|
+
const getTargetLanguage = () => {
|
|
39202
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39203
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
39204
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
39205
|
+
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
39206
|
+
return defaultLanguage;
|
|
39207
|
+
}
|
|
39208
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
39209
|
+
};
|
|
39210
|
+
const targetLanguage = getTargetLanguage();
|
|
39211
|
+
// 如果有多语种样式配置,优先使用
|
|
39212
|
+
if (this.model.fontStyleCultures && this.model.fontStyleCultures[targetLanguage]) {
|
|
39213
|
+
const style = this.model.fontStyleCultures[targetLanguage];
|
|
39214
|
+
return {
|
|
39215
|
+
isUnderline: style.isUnderline,
|
|
39216
|
+
isBold: this.isBold(style.fontStyle),
|
|
39217
|
+
isItalic: this.isItalic(style.fontStyle),
|
|
39218
|
+
fontSize: style.fontSize,
|
|
39219
|
+
fontFamily: this.fontFamily(style.fontStyle),
|
|
39220
|
+
color: style.fontColor,
|
|
39221
|
+
textAlign: style.textAlign
|
|
39222
|
+
};
|
|
39223
|
+
}
|
|
39224
|
+
// 回退到全局样式
|
|
39225
|
+
return {
|
|
39226
|
+
isUnderline: this.model.isUnderline,
|
|
39227
|
+
isBold: this.isBold(this.model.font),
|
|
39228
|
+
isItalic: this.isItalic(this.model.font),
|
|
39229
|
+
fontSize: this.model.fontSize,
|
|
39230
|
+
fontFamily: this.fontFamily(this.model.font),
|
|
39231
|
+
color: this.model.stroke,
|
|
39232
|
+
textAlign: this.model.textAlign
|
|
39233
|
+
};
|
|
39234
|
+
}
|
|
39179
39235
|
/**
|
|
39180
39236
|
* 获取显示文本
|
|
39181
39237
|
* 如果配置了文本库,则从文本库中获取对应语种的文本
|
|
@@ -39273,7 +39329,7 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
|
|
|
39273
39329
|
// CONCATENATED MODULE: ./.tmp/elements/shared/text/text-state-element.ts
|
|
39274
39330
|
|
|
39275
39331
|
class text_state_element_TextStateElement {
|
|
39276
|
-
constructor(textStates, width, height, logger, version, faultFlickers, textLibrarySetting, textLibraryService, languageService, guiContext, allowEmpty = false) {
|
|
39332
|
+
constructor(textStates, width, height, logger, version, faultFlickers, textLibrarySetting, textLibraryService, languageService, guiContext, allowEmpty = false, fontStyleCultures) {
|
|
39277
39333
|
this.textStates = textStates;
|
|
39278
39334
|
this.width = width;
|
|
39279
39335
|
this.height = height;
|
|
@@ -39285,6 +39341,7 @@ class text_state_element_TextStateElement {
|
|
|
39285
39341
|
this.languageService = languageService;
|
|
39286
39342
|
this.guiContext = guiContext;
|
|
39287
39343
|
this.allowEmpty = allowEmpty;
|
|
39344
|
+
this.fontStyleCultures = fontStyleCultures;
|
|
39288
39345
|
this.faultFlickerStatus = false;
|
|
39289
39346
|
this.faultFlickerInterval = undefined;
|
|
39290
39347
|
this._element = document.createElementNS('http://www.w3.org/2000/svg', 'g');
|
|
@@ -39309,7 +39366,7 @@ class text_state_element_TextStateElement {
|
|
|
39309
39366
|
this.removeForeignObjectlement();
|
|
39310
39367
|
return;
|
|
39311
39368
|
}
|
|
39312
|
-
const font = textState.text.font;
|
|
39369
|
+
const font = this.getFontForState(stateId, textState.text.font);
|
|
39313
39370
|
if (!font) {
|
|
39314
39371
|
this.removeForeignObjectlement();
|
|
39315
39372
|
this.logger.debug('The font is undefined.');
|
|
@@ -39431,6 +39488,32 @@ class text_state_element_TextStateElement {
|
|
|
39431
39488
|
}
|
|
39432
39489
|
}
|
|
39433
39490
|
}
|
|
39491
|
+
/**
|
|
39492
|
+
* 获取指定状态在当前语种下的字体样式
|
|
39493
|
+
*/
|
|
39494
|
+
getFontForState(stateId, defaultFont) {
|
|
39495
|
+
if (!this.fontStyleCultures) {
|
|
39496
|
+
return defaultFont;
|
|
39497
|
+
}
|
|
39498
|
+
const stateKey = stateId.toString();
|
|
39499
|
+
if (!this.fontStyleCultures[stateKey]) {
|
|
39500
|
+
return defaultFont;
|
|
39501
|
+
}
|
|
39502
|
+
const getTargetLanguage = () => {
|
|
39503
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39504
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
39505
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
39506
|
+
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
39507
|
+
return defaultLanguage;
|
|
39508
|
+
}
|
|
39509
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
39510
|
+
};
|
|
39511
|
+
const targetLanguage = getTargetLanguage();
|
|
39512
|
+
if (this.fontStyleCultures[stateKey][targetLanguage]) {
|
|
39513
|
+
return this.fontStyleCultures[stateKey][targetLanguage];
|
|
39514
|
+
}
|
|
39515
|
+
return defaultFont;
|
|
39516
|
+
}
|
|
39434
39517
|
/**
|
|
39435
39518
|
* 获取显示文本
|
|
39436
39519
|
* 支持三种格式:
|
|
@@ -40089,11 +40172,18 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
|
|
|
40089
40172
|
}
|
|
40090
40173
|
}
|
|
40091
40174
|
initIndictorLightOperator() {
|
|
40175
|
+
var _a, _b, _c, _d;
|
|
40092
40176
|
const settings = this.model.indicatorLightSettings;
|
|
40093
40177
|
if (settings.settings.variableName) {
|
|
40094
40178
|
const variable = new variable_definition["a" /* VariableDefinition */](settings.settings.variableName, settings.settings.variableGroupName, settings.settings.dataSourceCode, settings.settings.variableVersion);
|
|
40095
|
-
|
|
40179
|
+
const convertedName = variable_util["a" /* VariableUtil */].getConvertedVariableName(this.variableStore, variable);
|
|
40180
|
+
this.addElementState(new communication["c" /* VariableState */](convertedName, undefined));
|
|
40096
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
|
+
}
|
|
40097
40187
|
}
|
|
40098
40188
|
switch (settings.type) {
|
|
40099
40189
|
case _tmp_model["IndicatorLightType"].Bit:
|
|
@@ -40140,7 +40230,7 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
|
|
|
40140
40230
|
this.graphStateElement = new graph_state_element_GraphStateElement(this.model.graphSetting, width, height, this.graphStore, this.logger, this.model.version, this.model.states);
|
|
40141
40231
|
this.$element.append(this.graphStateElement.Element);
|
|
40142
40232
|
}
|
|
40143
|
-
this.textStateElement = new text_state_element_TextStateElement(this.model.states, width, height, this.logger, this.model.version, this.model.states, this.model.textLibrary, this.textLibraryService, this.languageService, this.guiContext, true);
|
|
40233
|
+
this.textStateElement = new text_state_element_TextStateElement(this.model.states, width, height, this.logger, this.model.version, this.model.states, this.model.textLibrary, this.textLibraryService, this.languageService, this.guiContext, true, this.model.fontStyleCultures);
|
|
40144
40234
|
this.$element.append(this.textStateElement.Element);
|
|
40145
40235
|
}
|
|
40146
40236
|
/**
|
|
@@ -40585,7 +40675,7 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40585
40675
|
this.$element.find('text').remove();
|
|
40586
40676
|
this.initGraph(width, height);
|
|
40587
40677
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
|
|
40588
|
-
const font =
|
|
40678
|
+
const font = this.getFontStyle();
|
|
40589
40679
|
this.textElementModal = new text_element_TextElementModal(this.getDisplayText(), font, width, height);
|
|
40590
40680
|
this.$element.append(this.textElementModal.Element);
|
|
40591
40681
|
this.switchToState(0);
|
|
@@ -40765,11 +40855,41 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40765
40855
|
});
|
|
40766
40856
|
}
|
|
40767
40857
|
}
|
|
40858
|
+
/**
|
|
40859
|
+
* 获取当前语种的字体样式
|
|
40860
|
+
*/
|
|
40861
|
+
getFontStyle() {
|
|
40862
|
+
const getTargetLanguage = () => {
|
|
40863
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40864
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
40865
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
40866
|
+
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
40867
|
+
return defaultLanguage;
|
|
40868
|
+
}
|
|
40869
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
40870
|
+
};
|
|
40871
|
+
const targetLanguage = getTargetLanguage();
|
|
40872
|
+
if (this.model.fontStyleCultures && this.model.fontStyleCultures[targetLanguage]) {
|
|
40873
|
+
const style = this.model.fontStyleCultures[targetLanguage];
|
|
40874
|
+
return {
|
|
40875
|
+
isUnderline: style.isUnderline,
|
|
40876
|
+
isBold: style.isBold,
|
|
40877
|
+
isItalic: style.isItalic,
|
|
40878
|
+
fontSize: style.fontSize,
|
|
40879
|
+
fontFamily: style.fontFamily || 'msyh',
|
|
40880
|
+
color: style.color,
|
|
40881
|
+
textAlign: style.textAlign
|
|
40882
|
+
};
|
|
40883
|
+
}
|
|
40884
|
+
return Object.assign(Object.assign({}, this.model.label.font), { fontFamily: this.model.label.font.fontFamily || 'msyh' });
|
|
40885
|
+
}
|
|
40768
40886
|
/**
|
|
40769
40887
|
* 更新文本内容(支持文本库和语种切换)
|
|
40770
40888
|
*/
|
|
40771
40889
|
updateTextContent() {
|
|
40772
40890
|
if (this.textElementModal) {
|
|
40891
|
+
const font = this.getFontStyle();
|
|
40892
|
+
this.textElementModal.updateFont(font);
|
|
40773
40893
|
this.textElementModal.updateText(this.getDisplayText());
|
|
40774
40894
|
}
|
|
40775
40895
|
}
|
|
@@ -40987,9 +41107,9 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
40987
41107
|
if (!this.textElementModal || !this.model.size) {
|
|
40988
41108
|
return;
|
|
40989
41109
|
}
|
|
40990
|
-
// 获取新的显示文本
|
|
40991
41110
|
const displayText = this.getDisplayText();
|
|
40992
|
-
|
|
41111
|
+
const font = this.getFontStyle();
|
|
41112
|
+
this.textElementModal.updateFont(font);
|
|
40993
41113
|
this.textElementModal.updateText(displayText);
|
|
40994
41114
|
}
|
|
40995
41115
|
initGraphAndText() {
|
|
@@ -41003,7 +41123,39 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
41003
41123
|
graphStateElement.switchToState(0);
|
|
41004
41124
|
this.$element.prepend(graphStateElement.Element);
|
|
41005
41125
|
}
|
|
41006
|
-
const font =
|
|
41126
|
+
const font = this.getFontStyle();
|
|
41127
|
+
// 获取显示文本(支持文本库)
|
|
41128
|
+
const displayText = this.getDisplayText();
|
|
41129
|
+
this.textElementModal = new text_element_TextElementModal(displayText, font, width, height);
|
|
41130
|
+
this.$element.append(this.textElementModal.Element);
|
|
41131
|
+
}
|
|
41132
|
+
/**
|
|
41133
|
+
* 获取当前语种的字体样式
|
|
41134
|
+
*/
|
|
41135
|
+
getFontStyle() {
|
|
41136
|
+
const getTargetLanguage = () => {
|
|
41137
|
+
var _a, _b, _c, _d, _e, _f;
|
|
41138
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
41139
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
41140
|
+
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
41141
|
+
return defaultLanguage;
|
|
41142
|
+
}
|
|
41143
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
41144
|
+
};
|
|
41145
|
+
const targetLanguage = getTargetLanguage();
|
|
41146
|
+
if (this.model.fontStyleCultures && this.model.fontStyleCultures[targetLanguage]) {
|
|
41147
|
+
const style = this.model.fontStyleCultures[targetLanguage];
|
|
41148
|
+
return {
|
|
41149
|
+
isUnderline: style.isUnderline,
|
|
41150
|
+
isBold: this.isBold(style.fontStyle),
|
|
41151
|
+
isItalic: this.isItalic(style.fontStyle),
|
|
41152
|
+
fontSize: style.fontSize,
|
|
41153
|
+
fontFamily: this.fontFamily(style.fontStyle),
|
|
41154
|
+
color: style.fontColor,
|
|
41155
|
+
textAlign: style.textAlign
|
|
41156
|
+
};
|
|
41157
|
+
}
|
|
41158
|
+
return {
|
|
41007
41159
|
isUnderline: this.model.isUnderline,
|
|
41008
41160
|
isBold: this.isBold(this.model.font),
|
|
41009
41161
|
isItalic: this.isItalic(this.model.font),
|
|
@@ -41012,10 +41164,6 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
41012
41164
|
color: this.model.stroke,
|
|
41013
41165
|
textAlign: this.model.textAlign
|
|
41014
41166
|
};
|
|
41015
|
-
// 获取显示文本(支持文本库)
|
|
41016
|
-
const displayText = this.getDisplayText();
|
|
41017
|
-
this.textElementModal = new text_element_TextElementModal(displayText, font, width, height);
|
|
41018
|
-
this.$element.append(this.textElementModal.Element);
|
|
41019
41167
|
}
|
|
41020
41168
|
/**
|
|
41021
41169
|
* 获取显示文本
|
|
@@ -43550,6 +43698,7 @@ class gui_view_GuiView {
|
|
|
43550
43698
|
this.logger.debug('[GUI] View loaded.');
|
|
43551
43699
|
}
|
|
43552
43700
|
loadElementState() {
|
|
43701
|
+
var _a, _b;
|
|
43553
43702
|
if (!this.mainElement) {
|
|
43554
43703
|
return;
|
|
43555
43704
|
}
|
|
@@ -43594,6 +43743,20 @@ class gui_view_GuiView {
|
|
|
43594
43743
|
});
|
|
43595
43744
|
normalVariablesForState.splice(normalVariablesForState.indexOf('设备状态'), 1);
|
|
43596
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
|
+
}
|
|
43597
43760
|
if (normalVariablesForState.length === 0) {
|
|
43598
43761
|
return;
|
|
43599
43762
|
}
|
|
@@ -67012,6 +67175,7 @@ var State;
|
|
|
67012
67175
|
State[State["Unbind"] = 2] = "Unbind";
|
|
67013
67176
|
State[State["Abnormal"] = 3] = "Abnormal";
|
|
67014
67177
|
State[State["Loading"] = 4] = "Loading";
|
|
67178
|
+
State[State["InvalidMonitor"] = 5] = "InvalidMonitor";
|
|
67015
67179
|
State[State["Disable"] = 9] = "Disable";
|
|
67016
67180
|
})(State || (State = {}));
|
|
67017
67181
|
|