@flexem/fc-gui 3.0.0-alpha.124 → 3.0.0-alpha.125

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.
Files changed (48) hide show
  1. package/bundles/@flexem/fc-gui.umd.js +899 -316
  2. package/bundles/@flexem/fc-gui.umd.js.map +1 -1
  3. package/bundles/@flexem/fc-gui.umd.min.js +4 -4
  4. package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
  5. package/communication/variable/variable-communicator.d.ts +2 -0
  6. package/elements/alarm/alarm-element.d.ts +17 -2
  7. package/elements/alarm/alarm-element.js +74 -6
  8. package/elements/alarm/alarm-element.metadata.json +1 -1
  9. package/elements/base/readable-element.js +14 -5
  10. package/elements/base/state-control-element.js +2 -2
  11. package/elements/historical-curve/historical-curve.element.d.ts +17 -2
  12. package/elements/historical-curve/historical-curve.element.js +64 -4
  13. package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
  14. package/elements/main-element.js +7 -7
  15. package/elements/numerical-display/numerical-display-element.d.ts +9 -2
  16. package/elements/numerical-display/numerical-display-element.js +22 -2
  17. package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
  18. package/elements/shared/text/text-element.d.ts +9 -0
  19. package/elements/shared/text/text-element.js +20 -0
  20. package/elements/shared/text/text-element.metadata.json +1 -1
  21. package/elements/shared/text/text-state-element.d.ts +15 -2
  22. package/elements/shared/text/text-state-element.js +70 -10
  23. package/elements/shared/text/text-state-element.metadata.json +1 -1
  24. package/elements/static-elements/hyperlink-element.d.ts +15 -1
  25. package/elements/static-elements/hyperlink-element.js +69 -10
  26. package/elements/static-elements/hyperlink-element.metadata.json +1 -1
  27. package/elements/static-elements/text-element.d.ts +14 -1
  28. package/elements/static-elements/text-element.js +64 -10
  29. package/elements/static-elements/text-element.metadata.json +1 -1
  30. package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +7 -1
  31. package/elements/switch-indicator-light/switch-indicator-light-element.js +25 -2
  32. package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
  33. package/elements/view-operation/view-operation.element.d.ts +23 -2
  34. package/elements/view-operation/view-operation.element.js +95 -1
  35. package/elements/view-operation/view-operation.element.metadata.json +1 -1
  36. package/gui/gui-context.d.ts +7 -1
  37. package/gui/gui-view.js +20 -4
  38. package/modal/write-value/write-value-modal-args.d.ts +3 -1
  39. package/modal/write-value/write-value-modal-args.js +2 -1
  40. package/modal/write-value/write-value-modal-args.metadata.json +1 -1
  41. package/modal/write-value/write-value-modal.component.d.ts +4 -0
  42. package/modal/write-value/write-value-modal.component.js +25 -0
  43. package/modal/write-value/write-value-modal.component.metadata.json +1 -1
  44. package/model/view-operation/view-operation-element.model.d.ts +7 -1
  45. package/package.json +1 -1
  46. package/remote/communication/variable/remote-variable-communicator.d.ts +15 -0
  47. package/remote/communication/variable/remote-variable-communicator.js +76 -2
  48. package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
@@ -10,5 +10,7 @@ export interface VariableCommunicator {
10
10
  subscribeVariableState(variableName: string): Observable<VariableState>;
11
11
  subscribeVariableStates(variableNames: Array<string>): Observable<Array<VariableState>>;
12
12
  subscribeUserDeviceAlarms(appId: string): any;
13
+ registerSystemVariableHandler?(variableName: string, getValue: () => Promise<any>, setValue: (value: any) => Promise<void>): void;
14
+ notifySystemVariableChange?(variableName: string, value: any): void;
13
15
  dispose(): any;
14
16
  }
@@ -4,14 +4,17 @@ import { VariableCommunicator } from '../../communication';
4
4
  import { ConditionalDisplayElement } from '../base/conditional-display-element';
5
5
  import { AlarmModel } from '../../model/alarm/alarm.model';
6
6
  import { AlarmsStore, VariableStore } from '../../config';
7
+ import { GuiContext } from '../../gui/gui-context';
7
8
  export declare class AlarmElement extends ConditionalDisplayElement {
8
9
  private readonly alarmsStore;
9
10
  private readonly systemTextLibraryService?;
10
11
  private readonly languageService?;
12
+ private readonly guiContext?;
11
13
  readonly model: AlarmModel;
12
14
  private readonly logger;
13
15
  readonly variableCommunicator: VariableCommunicator;
14
16
  private readonly timePeriods;
17
+ private languageChangeSubscription?;
15
18
  private elementStatus;
16
19
  private element;
17
20
  private refreshIntervalId;
@@ -26,8 +29,20 @@ export declare class AlarmElement extends ConditionalDisplayElement {
26
29
  private totalCount;
27
30
  private pageSize;
28
31
  private getAlarmDataId;
29
- constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, alarmsStore: AlarmsStore, signalRAppId: string, systemTextLibraryService?: SystemTextLibraryService, languageService?: LanguageService);
32
+ constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, alarmsStore: AlarmsStore, signalRAppId: string, systemTextLibraryService?: SystemTextLibraryService, languageService?: LanguageService, guiContext?: GuiContext);
30
33
  dispose(): void;
34
+ /**
35
+ * 订阅语种变化事件
36
+ */
37
+ private subscribeLanguageChange;
38
+ /**
39
+ * 更新语种相关的文案(表头和时间段选择器)
40
+ */
41
+ private updateLanguageTexts;
42
+ /**
43
+ * 获取当前语种的 culture 代码
44
+ */
45
+ private getCurrentCulture;
31
46
  /**
32
47
  * 根据列索引获取表头翻译(从系统文本库获取多语种翻译)
33
48
  * 固定4项表头,按列索引顺序:告警名称、告警内容、告警等级、时间
@@ -35,7 +50,7 @@ export declare class AlarmElement extends ConditionalDisplayElement {
35
50
  private getHeaderTextByColumn;
36
51
  private getValidTimePeriods;
37
52
  /**
38
- * 获取时间段文案(从系统文本库获取多语种翻译,fallback 使用 localization)
53
+ * 获取时间段文案(从系统文本库获取多语种翻译)
39
54
  */
40
55
  private getTimePeriodText;
41
56
  private getAlarmData;
@@ -10,12 +10,13 @@ var AlaertElementStatus;
10
10
  AlaertElementStatus[AlaertElementStatus["Loading"] = 1] = "Loading"; // 加载中
11
11
  })(AlaertElementStatus || (AlaertElementStatus = {}));
12
12
  export class AlarmElement extends ConditionalDisplayElement {
13
- constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId, systemTextLibraryService, languageService) {
13
+ constructor(element, injector, permissionChecker, variableCommunicator, variableStore, alarmsStore, signalRAppId, systemTextLibraryService, languageService, guiContext) {
14
14
  var _a;
15
15
  super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
16
16
  this.alarmsStore = alarmsStore;
17
17
  this.systemTextLibraryService = systemTextLibraryService;
18
18
  this.languageService = languageService;
19
+ this.guiContext = guiContext;
19
20
  this.elementStatus = AlaertElementStatus.Loading;
20
21
  this.displayOption = {
21
22
  dataLimit: 500,
@@ -43,6 +44,8 @@ export class AlarmElement extends ConditionalDisplayElement {
43
44
  this.timePeriods = this.getValidTimePeriods();
44
45
  this.pageSize = this.model.generalSetting.pageSize;
45
46
  localStorage.setItem('simulate-time', moment().valueOf() + '');
47
+ // 订阅语种变化事件
48
+ this.subscribeLanguageChange();
46
49
  if (this.model.filterSetting) {
47
50
  this.alarmNames = this.model.filterSetting.detailsData.map(item => item.name);
48
51
  this.currentTimePeriod = (_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.displayPeriod;
@@ -76,18 +79,84 @@ export class AlarmElement extends ConditionalDisplayElement {
76
79
  if (this.element) {
77
80
  this.element.tooltip.hidden(true);
78
81
  }
82
+ // 取消语种变化订阅
83
+ if (this.languageChangeSubscription) {
84
+ this.languageChangeSubscription.unsubscribe();
85
+ this.languageChangeSubscription = undefined;
86
+ }
79
87
  this.logger.debug(`[GUI]Dispose Alarm Table Refresh Interval:${d3.time.format('%x %X')(new Date())}`);
80
88
  }
89
+ /**
90
+ * 订阅语种变化事件
91
+ */
92
+ subscribeLanguageChange() {
93
+ if (this.guiContext && this.guiContext.languageChanged$) {
94
+ this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
95
+ // 只更新文案,不重新查询数据
96
+ this.updateLanguageTexts();
97
+ });
98
+ }
99
+ }
100
+ /**
101
+ * 更新语种相关的文案(表头和时间段选择器)
102
+ */
103
+ updateLanguageTexts() {
104
+ var _a;
105
+ // 更新表头文本
106
+ const headerCells = this.$element.find('table th');
107
+ for (let col = 0; col < 4 && col < headerCells.length; col++) {
108
+ headerCells.eq(col).text(this.getHeaderTextByColumn(col));
109
+ }
110
+ // 更新时间段选择器选项
111
+ if ((_a = this.model.filterSetting) === null || _a === void 0 ? void 0 : _a.alarmType) {
112
+ const selectElement = this.rootElement.select('select');
113
+ if (!selectElement.empty()) {
114
+ // 重新生成时间段数据
115
+ const updatedTimePeriods = this.getValidTimePeriods();
116
+ // 更新选项文本
117
+ const options = selectElement.selectAll('option');
118
+ options.each(function (_d, i) {
119
+ if (i < updatedTimePeriods.length) {
120
+ d3.select(this).text(updatedTimePeriods[i].name);
121
+ }
122
+ });
123
+ }
124
+ }
125
+ }
126
+ /**
127
+ * 获取当前语种的 culture 代码
128
+ */
129
+ getCurrentCulture() {
130
+ var _a, _b, _c, _e, _f, _g;
131
+ // 获取当前语种ID
132
+ 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;
133
+ // 确定要使用的语种代码(culture)
134
+ const defaultLanguage = ((_e = this.languageService) === null || _e === void 0 ? void 0 : _e.getDefaultLanguage()) || 'zh-CN';
135
+ if (currentLanguageId === null || currentLanguageId === undefined) {
136
+ // 设备未设置当前语种,使用默认语种
137
+ return defaultLanguage;
138
+ }
139
+ else {
140
+ // 设备已设置当前语种,获取对应的语种代码
141
+ const currentLanguage = (_g = (_f = this.guiContext) === null || _f === void 0 ? void 0 : _f.getLanguageCultureById) === null || _g === void 0 ? void 0 : _g.call(_f, currentLanguageId);
142
+ if (currentLanguage) {
143
+ return currentLanguage;
144
+ }
145
+ else {
146
+ // 无法获取语种代码,使用默认语种
147
+ return defaultLanguage;
148
+ }
149
+ }
150
+ }
81
151
  /**
82
152
  * 根据列索引获取表头翻译(从系统文本库获取多语种翻译)
83
153
  * 固定4项表头,按列索引顺序:告警名称、告警内容、告警等级、时间
84
154
  */
85
155
  getHeaderTextByColumn(columnIndex) {
86
- var _a;
87
156
  if (columnIndex < 0 || columnIndex > 3) {
88
157
  return '';
89
158
  }
90
- const currentCulture = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
159
+ const currentCulture = this.getCurrentCulture();
91
160
  const systemType = SYSTEM_TEXT_LIBRARY_TYPES.COMPONENT_BUILTIN;
92
161
  const headerKeys = [
93
162
  ALARM_TABLE_HEADER_KEYS.ALARM_NAME,
@@ -116,11 +185,10 @@ export class AlarmElement extends ConditionalDisplayElement {
116
185
  return timePeriods;
117
186
  }
118
187
  /**
119
- * 获取时间段文案(从系统文本库获取多语种翻译,fallback 使用 localization)
188
+ * 获取时间段文案(从系统文本库获取多语种翻译)
120
189
  */
121
190
  getTimePeriodText(textKey) {
122
- var _a;
123
- const currentCulture = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
191
+ const currentCulture = this.getCurrentCulture();
124
192
  const systemType = SYSTEM_TEXT_LIBRARY_TYPES.COMPONENT_BUILTIN;
125
193
  if (this.systemTextLibraryService) {
126
194
  const translation = this.systemTextLibraryService.getSystemTextValue(systemType, textKey, currentCulture);
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"AlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":19,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":52,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":53,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":54,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":55,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":56,"character":23},{"__symbolic":"reference","module":"../../config","name":"AlarmsStore","line":57,"character":38},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":59,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":60,"character":43}]}],"dispose":[{"__symbolic":"method"}],"getHeaderTextByColumn":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"getAlarmData":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"setStatusAsNormal":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"AlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":21,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":55,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":56,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":57,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":58,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":59,"character":23},{"__symbolic":"reference","module":"../../config","name":"AlarmsStore","line":60,"character":38},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":62,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":63,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":64,"character":38}]}],"dispose":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getHeaderTextByColumn":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"getAlarmData":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"setStatusAsNormal":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
@@ -79,11 +79,7 @@ export class ReadableElement extends ConditionalEnableElement {
79
79
  this.changeStates();
80
80
  }
81
81
  });
82
- if (value.systemName !== '设备状态' && (this.state === State.Normal || this.state === State.Disable
83
- || value.variableName === this.minVariableName
84
- || value.variableName === this.maxVariableName)) {
85
- this.updateVariableValue(value.value, value.variableName);
86
- }
82
+ // 处理系统变量"设备状态"
87
83
  if (value.systemName === '设备状态') {
88
84
  let name = value.customStatus;
89
85
  const language = ((_b = (_a = window.abp.localization) === null || _a === void 0 ? void 0 : _a.currentLanguage) === null || _b === void 0 ? void 0 : _b.name) || ((_d = (_c = this.localization.localizationService) === null || _c === void 0 ? void 0 : _c.translate) === null || _d === void 0 ? void 0 : _d.currentLang);
@@ -106,6 +102,19 @@ export class ReadableElement extends ConditionalEnableElement {
106
102
  }
107
103
  }
108
104
  this.updateVariableValue(name, '设备状态');
105
+ return; // 处理完"设备状态"后直接返回
106
+ }
107
+ // 处理系统变量"当前语种ID"
108
+ if (value.variableName === '当前语种ID') {
109
+ // 直接使用变量值(数字或null)
110
+ this.updateVariableValue(value.value, value.variableName);
111
+ return;
112
+ }
113
+ // 处理普通变量
114
+ if (this.state === State.Normal || this.state === State.Disable
115
+ || value.variableName === this.minVariableName
116
+ || value.variableName === this.maxVariableName) {
117
+ this.updateVariableValue(value.value, value.variableName);
109
118
  }
110
119
  }
111
120
  }
@@ -139,8 +139,8 @@ export class StateControlElement extends ConditionalDynamicDisplayElement {
139
139
  if (!this.currentRect.length) {
140
140
  return;
141
141
  }
142
- // 元件绑定设备状态时不需要在右上角显示状态
143
- if (this.$element[0].dataset.model.includes('设备状态'))
142
+ // 元件绑定设备状态或当前语种ID时不需要在右上角显示状态
143
+ if (this.$element[0].dataset.model.includes('设备状态') || this.$element[0].dataset.model.includes('当前语种ID'))
144
144
  return;
145
145
  const document = this.$element[0].ownerDocument;
146
146
  const imgObj = document.createElementNS('http://www.w3.org/2000/svg', 'image');
@@ -4,14 +4,17 @@ import { HistoricalCurveModel } from '../../model/historical-curve/historical-cu
4
4
  import { PermissionChecker, SystemTextLibraryService, LanguageService } from '../../service';
5
5
  import { ConditionalDisplayElement } from '../base/conditional-display-element';
6
6
  import { Injector } from '@angular/core';
7
+ import { GuiContext } from '../../gui/gui-context';
7
8
  export declare class HistoricalCurveElement extends ConditionalDisplayElement {
8
9
  private readonly historyDataStore;
9
10
  private readonly systemTextLibraryService?;
10
11
  private readonly languageService?;
12
+ private readonly guiContext?;
11
13
  readonly model: HistoricalCurveModel;
12
14
  private readonly logger;
13
15
  private readonly localization;
14
16
  private readonly timePeriods;
17
+ private languageChangeSubscription?;
15
18
  private readonly displayOption;
16
19
  /**
17
20
  * 当前时间段的开始时间
@@ -39,13 +42,25 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
39
42
  private resizeEventListener;
40
43
  private isAndroid;
41
44
  private needResize;
42
- constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore, signalRAppId: string, systemTextLibraryService?: SystemTextLibraryService, languageService?: LanguageService);
45
+ constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore, signalRAppId: string, systemTextLibraryService?: SystemTextLibraryService, languageService?: LanguageService, guiContext?: GuiContext);
43
46
  dispose(): void;
44
47
  private initKeyboardListener;
45
48
  private setNeedResize;
49
+ /**
50
+ * 订阅语种变化事件
51
+ */
52
+ private subscribeLanguageChange;
53
+ /**
54
+ * 更新语种相关的文案(时间段选择器)
55
+ */
56
+ private updateLanguageTexts;
57
+ /**
58
+ * 获取当前语种的 culture 代码
59
+ */
60
+ private getCurrentCulture;
46
61
  private getValidTimePeriods;
47
62
  /**
48
- * 获取时间段文案(从系统文本库获取多语种翻译,fallback 使用 localization)
63
+ * 获取时间段文案(从系统文本库获取多语种翻译)
49
64
  */
50
65
  private getTimePeriodText;
51
66
  private updateTimeRange;
@@ -13,11 +13,12 @@ import { GlobalSettings, DisplayMode } from '../../settings';
13
13
  import { CurveType } from '../../model/historical-curve/curve-type';
14
14
  import { AxisRangeType } from '../../model/historical-curve/historical-curve-axis-settings';
15
15
  export class HistoricalCurveElement extends ConditionalDisplayElement {
16
- constructor(element, injector, permissionChecker, variableCommunicator, variableStore, historyDataStore, signalRAppId, systemTextLibraryService, languageService) {
16
+ constructor(element, injector, permissionChecker, variableCommunicator, variableStore, historyDataStore, signalRAppId, systemTextLibraryService, languageService, guiContext) {
17
17
  super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
18
18
  this.historyDataStore = historyDataStore;
19
19
  this.systemTextLibraryService = systemTextLibraryService;
20
20
  this.languageService = languageService;
21
+ this.guiContext = guiContext;
21
22
  this.displayOption = {
22
23
  dataLimit: 500,
23
24
  dataZoomHeight: 32,
@@ -59,6 +60,8 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
59
60
  }
60
61
  this.loadFirstPage();
61
62
  this.initKeyboardListener();
63
+ // 订阅语种变化事件
64
+ this.subscribeLanguageChange();
62
65
  }
63
66
  dispose() {
64
67
  clearInterval(this.refreshIntervalId);
@@ -72,6 +75,11 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
72
75
  window.removeEventListener('native.keyboardshow', this.setNeedResize);
73
76
  window.removeEventListener('native.keyboardhide', this.setNeedResize);
74
77
  }
78
+ // 取消语种变化订阅
79
+ if (this.languageChangeSubscription) {
80
+ this.languageChangeSubscription.unsubscribe();
81
+ this.languageChangeSubscription = undefined;
82
+ }
75
83
  this.logger.debug(`[GUI]Dispose Histoical Curve Refresh Interval:${d3.time.format('%x %X')(new Date())}`);
76
84
  }
77
85
  initKeyboardListener() {
@@ -81,6 +89,59 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
81
89
  window.addEventListener('native.keyboardhide', this.setNeedResize);
82
90
  }
83
91
  }
92
+ /**
93
+ * 订阅语种变化事件
94
+ */
95
+ subscribeLanguageChange() {
96
+ if (this.guiContext && this.guiContext.languageChanged$) {
97
+ this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
98
+ // 只更新时间段选择器的文案,不重新查询数据
99
+ this.updateLanguageTexts();
100
+ });
101
+ }
102
+ }
103
+ /**
104
+ * 更新语种相关的文案(时间段选择器)
105
+ */
106
+ updateLanguageTexts() {
107
+ const selectElement = this.rootElement.select('select');
108
+ if (!selectElement.empty()) {
109
+ // 重新生成时间段数据
110
+ const updatedTimePeriods = this.getValidTimePeriods();
111
+ // 更新选项文本
112
+ const options = selectElement.selectAll('option');
113
+ options.each(function (_d, i) {
114
+ if (i < updatedTimePeriods.length) {
115
+ d3.select(this).text(updatedTimePeriods[i].name);
116
+ }
117
+ });
118
+ }
119
+ }
120
+ /**
121
+ * 获取当前语种的 culture 代码
122
+ */
123
+ getCurrentCulture() {
124
+ var _a, _b, _c, _e, _f, _g;
125
+ // 获取当前语种ID
126
+ 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;
127
+ // 确定要使用的语种代码(culture)
128
+ const defaultLanguage = ((_e = this.languageService) === null || _e === void 0 ? void 0 : _e.getDefaultLanguage()) || 'zh-CN';
129
+ if (currentLanguageId === null || currentLanguageId === undefined) {
130
+ // 设备未设置当前语种,使用默认语种
131
+ return defaultLanguage;
132
+ }
133
+ else {
134
+ // 设备已设置当前语种,获取对应的语种代码
135
+ const currentLanguage = (_g = (_f = this.guiContext) === null || _f === void 0 ? void 0 : _f.getLanguageCultureById) === null || _g === void 0 ? void 0 : _g.call(_f, currentLanguageId);
136
+ if (currentLanguage) {
137
+ return currentLanguage;
138
+ }
139
+ else {
140
+ // 无法获取语种代码,使用默认语种
141
+ return defaultLanguage;
142
+ }
143
+ }
144
+ }
84
145
  getValidTimePeriods() {
85
146
  const timePeriods = new Array();
86
147
  timePeriods.push({ key: 6, name: this.getTimePeriodText(TIME_PERIOD_KEYS.LAST_THIRTY_MINUTES) });
@@ -93,11 +154,10 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
93
154
  return timePeriods;
94
155
  }
95
156
  /**
96
- * 获取时间段文案(从系统文本库获取多语种翻译,fallback 使用 localization)
157
+ * 获取时间段文案(从系统文本库获取多语种翻译)
97
158
  */
98
159
  getTimePeriodText(textKey) {
99
- var _a;
100
- const currentCulture = ((_a = this.languageService) === null || _a === void 0 ? void 0 : _a.getDefaultLanguage()) || 'zh-CN';
160
+ const currentCulture = this.getCurrentCulture();
101
161
  const systemType = SYSTEM_TEXT_LIBRARY_TYPES.COMPONENT_BUILTIN;
102
162
  if (this.systemTextLibraryService) {
103
163
  const translation = this.systemTextLibraryService.getSystemTextValue(systemType, textKey, currentCulture);
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":21,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":68,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":69,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":70,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":71,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":72,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":73,"character":43},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":75,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":76,"character":43}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"handleQueryResult":[{"__symbolic":"method"}],"setupTooltipAutoHide":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":23,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":71,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":72,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":73,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":74,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":75,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":76,"character":43},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":78,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":79,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":80,"character":38}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"handleQueryResult":[{"__symbolic":"method"}],"setupTooltipAutoHide":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
@@ -61,7 +61,7 @@ export class MainElement {
61
61
  const category = $(element).data('model').category;
62
62
  switch (category) {
63
63
  case GuiConsts.components.numericalDisplayKey:
64
- const numericalDisplayElement = new NumericalDisplayElement(element, this.injector, this.bsModalService, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.graphStore, this.context.operationRecordService, this.context.releasedVariableService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId);
64
+ const numericalDisplayElement = new NumericalDisplayElement(element, this.injector, this.bsModalService, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.graphStore, this.context.operationRecordService, this.context.releasedVariableService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId, this.context);
65
65
  this.elements.push(numericalDisplayElement);
66
66
  break;
67
67
  case GuiConsts.components.imageKey:
@@ -74,23 +74,23 @@ export class MainElement {
74
74
  this.elements.push(new PipeElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
75
75
  break;
76
76
  case GuiConsts.components.switchIndicatorLightKey:
77
- this.elements.push(new SwitchIndicatorLightElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId, this.context.textLibraryService, this.context.languageService));
77
+ this.elements.push(new SwitchIndicatorLightElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
78
78
  break;
79
79
  case GuiConsts.components.barGraphKey:
80
80
  this.elements.push(new BarGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
81
81
  break;
82
82
  case GuiConsts.components.toggleViewKey:
83
83
  case GuiConsts.components.viewOperationElement:
84
- this.elements.push(new ViewOperationElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.injector.get(LOCALIZATION), this.popupViewService, guiOptions.hostContainerId, guiOptions.el, this.signalRAppId));
84
+ this.elements.push(new ViewOperationElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.injector.get(LOCALIZATION), this.popupViewService, guiOptions.hostContainerId, guiOptions.el, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
85
85
  break;
86
86
  case GuiConsts.components.characterKey:
87
87
  this.elements.push(new CharacterDisplayElement(element, this.injector, this.bsModalService, this.variableCommunicator, this.context.configStore.graphStore, this.context.permissionChecker, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
88
88
  break;
89
89
  case GuiConsts.components.textKey:
90
- this.elements.push(new TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService));
90
+ this.elements.push(new TextElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
91
91
  break;
92
92
  case GuiConsts.components.hyperlinkKey:
93
- this.elements.push(new HyperlinkElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService));
93
+ this.elements.push(new HyperlinkElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId, this.context.textLibraryService, this.context.languageService, this.context));
94
94
  break;
95
95
  case GuiConsts.components.straightLineKey:
96
96
  this.elements.push(new StraightLineElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.signalRAppId));
@@ -111,7 +111,7 @@ export class MainElement {
111
111
  this.elements.push(new DatetimeDisplayElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.graphStore, this.signalRAppId));
112
112
  break;
113
113
  case GuiConsts.components.historicalCurveKey:
114
- this.elements.push(new HistoricalCurveElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.historyDataStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService));
114
+ this.elements.push(new HistoricalCurveElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.historyDataStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService, this.context));
115
115
  break;
116
116
  case GuiConsts.components.ringGraphKey:
117
117
  this.elements.push(new RingGraphElement(element, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId));
@@ -132,7 +132,7 @@ export class MainElement {
132
132
  this.elements.push(new AirQualityElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.weatherService, this.signalRAppId));
133
133
  break;
134
134
  case GuiConsts.components.alarmKey:
135
- this.elements.push(new AlarmElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.alarmsStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService));
135
+ this.elements.push(new AlarmElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.alarmsStore, this.signalRAppId, this.context.systemTextLibraryService, this.context.languageService, this.context));
136
136
  break;
137
137
  case GuiConsts.components.scrollAlarmKey:
138
138
  this.elements.push(new ScrollAlarmElement(element, this.injector, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.variableStore, this.context.configStore.alarmsStore, this.signalRAppId));
@@ -4,15 +4,17 @@ import { GraphStore, VariableStore } from '../../config';
4
4
  import { Localization } from '../../localization';
5
5
  import { NumericalDisplay } from '../../model';
6
6
  import { PermissionChecker, OperationRecordService, ReleasedVariableService } from '../../service';
7
- import { VariableCommunicator } from '../../communication';
7
+ import { VariableCommunicator, VariableValue } from '../../communication';
8
8
  import { ReadableElement } from '../base/readable-element';
9
9
  import { SecurityChecker } from '../../security';
10
+ import { GuiContext } from '../../gui/gui-context';
10
11
  export declare class NumericalDisplayElement extends ReadableElement {
11
12
  private readonly modalService;
12
13
  private readonly graphStore;
13
14
  private readonly operationRecordService;
14
15
  private readonly releasedVariableService;
15
16
  private readonly securityChecker;
17
+ private readonly guiContext?;
16
18
  private readonly dataTypeService;
17
19
  private readonly fractionDigitService;
18
20
  private readonly accessPermissionService;
@@ -28,8 +30,13 @@ export declare class NumericalDisplayElement extends ReadableElement {
28
30
  private numericalOperation;
29
31
  private restorationTimer;
30
32
  get writeVariableName(): string;
31
- constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, releasedVariableService: ReleasedVariableService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
33
+ constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, releasedVariableService: ReleasedVariableService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string, guiContext?: GuiContext);
32
34
  dispose(): void;
35
+ /**
36
+ * 重写父类方法,处理"当前语种ID"系统变量
37
+ * 当值为null时,显示默认语种ID
38
+ */
39
+ reportValueChanged(value: VariableValue): void;
33
40
  initElement(): any;
34
41
  private checkElementPassword;
35
42
  private initVariableText;
@@ -18,13 +18,14 @@ var variableRwTypeEnum;
18
18
  variableRwTypeEnum[variableRwTypeEnum["readWiter"] = 6] = "readWiter";
19
19
  })(variableRwTypeEnum || (variableRwTypeEnum = {}));
20
20
  export class NumericalDisplayElement extends ReadableElement {
21
- constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, releasedVariableService, securityChecker, variableStore, localization, signalRAppId) {
21
+ constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, releasedVariableService, securityChecker, variableStore, localization, signalRAppId, guiContext) {
22
22
  super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
23
23
  this.modalService = modalService;
24
24
  this.graphStore = graphStore;
25
25
  this.operationRecordService = operationRecordService;
26
26
  this.releasedVariableService = releasedVariableService;
27
27
  this.securityChecker = securityChecker;
28
+ this.guiContext = guiContext;
28
29
  this.displayText = '';
29
30
  this.enableDataParsed = false;
30
31
  this.logger = injector.get(LOGGER_SERVICE_TOKEN);
@@ -57,6 +58,25 @@ export class NumericalDisplayElement extends ReadableElement {
57
58
  this.$element.remove();
58
59
  }
59
60
  }
61
+ /**
62
+ * 重写父类方法,处理"当前语种ID"系统变量
63
+ * 当值为null时,显示默认语种ID
64
+ */
65
+ reportValueChanged(value) {
66
+ var _a, _b, _c;
67
+ // 处理系统变量"当前语种ID"
68
+ if (value.variableName === '当前语种ID') {
69
+ let displayValue = value.value;
70
+ // 如果值为null,使用默认语种ID
71
+ if (displayValue === null || displayValue === undefined) {
72
+ displayValue = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getDefaultLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : 0;
73
+ }
74
+ this.updateVariableValue(displayValue);
75
+ return;
76
+ }
77
+ // 其他变量调用父类方法
78
+ super.reportValueChanged(value);
79
+ }
60
80
  initElement() {
61
81
  const { rootElement } = this;
62
82
  rootElement.selectAll('*').remove();
@@ -180,7 +200,7 @@ export class NumericalDisplayElement extends ReadableElement {
180
200
  if (null == this.writeVariableName) {
181
201
  return;
182
202
  }
183
- const args = new WriteValueModalArgs(this.writeVariableName, this.model.dataType, this.model.fBoxDataType, this.model.integerDigits, this.model.fractionDigits, this.numericalOperationService.getNumericalOperations(this.model), this.model.version, this.enableDataParsed, this.releasedVariableService);
203
+ const args = new WriteValueModalArgs(this.writeVariableName, this.model.dataType, this.model.fBoxDataType, this.model.integerDigits, this.model.fractionDigits, this.numericalOperationService.getNumericalOperations(this.model), this.model.version, this.enableDataParsed, this.releasedVariableService, this.guiContext);
184
204
  this.writeValueMmodalRef = this.modalService.show(WriteValueModalComponent, {
185
205
  initialState: { args: args }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
186
206
  });
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":28,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":50,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":51,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":52,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":53,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":54,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":55,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":56,"character":49},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":57,"character":50},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":58,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":59,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":60,"character":22},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"doWriteValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateDisplayText":[{"__symbolic":"method"}],"rebuildTextElement":[{"__symbolic":"method"}],"formatNumericalDisplayText":[{"__symbolic":"method"}],"formatFloatDisplayText":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"formatDisplayTextUnit":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":29,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":51,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":52,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":53,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":54,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":55,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":56,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":57,"character":49},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":58,"character":50},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":59,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":60,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":61,"character":22},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":63,"character":38}]}],"dispose":[{"__symbolic":"method"}],"reportValueChanged":[{"__symbolic":"method"}],"initElement":[{"__symbolic":"method"}],"checkElementPassword":[{"__symbolic":"method"}],"initVariableText":[{"__symbolic":"method"}],"initGraphAndText":[{"__symbolic":"method"}],"doWriteValue":[{"__symbolic":"method"}],"recordOperation":[{"__symbolic":"method"}],"changeStates":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateDisplayText":[{"__symbolic":"method"}],"rebuildTextElement":[{"__symbolic":"method"}],"formatNumericalDisplayText":[{"__symbolic":"method"}],"formatFloatDisplayText":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"formatDisplayTextUnit":[{"__symbolic":"method"}]}}}}]
@@ -1,8 +1,17 @@
1
1
  import { Font } from '../../../model';
2
2
  export declare class TextElementModal {
3
3
  private _element;
4
+ private font;
5
+ private width;
6
+ private height;
7
+ private isVariableText?;
4
8
  get Element(): SVGElement;
5
9
  constructor(content: string, font: Font, width: number, height: number, isVariableText?: boolean);
10
+ /**
11
+ * 更新文本内容
12
+ * @param content 新的文本内容
13
+ */
14
+ updateText(content: string): void;
6
15
  private getforeignObjectElement;
7
16
  private createNewForeignObjectText;
8
17
  }