@flexem/fc-gui 3.0.0-alpha.118 → 3.0.0-alpha.119

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.
@@ -6,5 +6,6 @@ export declare class VariableValue {
6
6
  readonly timeStamp?: string;
7
7
  systemName?: string;
8
8
  customStatus?: string;
9
- constructor(variableName: string, state: VariableStateEnum, value?: any, timeStamp?: string, systemName?: string, customStatus?: string);
9
+ virtualDeviceId?: number;
10
+ constructor(variableName: string, state: VariableStateEnum, value?: any, timeStamp?: string, systemName?: string, customStatus?: string, virtualDeviceId?: number);
10
11
  }
@@ -1,10 +1,11 @@
1
1
  export class VariableValue {
2
- constructor(variableName, state, value, timeStamp, systemName, customStatus) {
2
+ constructor(variableName, state, value, timeStamp, systemName, customStatus, virtualDeviceId) {
3
3
  this.variableName = variableName;
4
4
  this.state = state;
5
5
  this.value = value;
6
6
  this.timeStamp = timeStamp;
7
7
  this.systemName = systemName;
8
8
  this.customStatus = customStatus;
9
+ this.virtualDeviceId = virtualDeviceId;
9
10
  }
10
11
  }
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"VariableValue":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"./variable-state-enum","name":"VariableStateEnum","line":3,"character":68},{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"VariableValue":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"./variable-state-enum","name":"VariableStateEnum","line":3,"character":68},{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"number"}]}]}}}}]
@@ -74,14 +74,14 @@ export class ReadableElement extends ConditionalEnableElement {
74
74
  reportValueChanged(value) {
75
75
  var _a, _b, _c, _d;
76
76
  forEach(this.elementStates, elementState => {
77
- if (elementState.variableName === value.variableName || elementState.variableName === value.systemName) {
77
+ if (elementState.variableName === value.variableName) {
78
78
  elementState.state = value.state;
79
79
  this.changeStates();
80
80
  }
81
81
  });
82
- if (this.state === State.Normal || this.state === State.Disable
82
+ if (value.systemName !== '设备状态' && (this.state === State.Normal || this.state === State.Disable
83
83
  || value.variableName === this.minVariableName
84
- || value.variableName === this.maxVariableName) {
84
+ || value.variableName === this.maxVariableName)) {
85
85
  this.updateVariableValue(value.value, value.variableName);
86
86
  }
87
87
  if (value.systemName === '设备状态') {
@@ -1,3 +1,5 @@
1
+ /// <reference types="jquery" />
2
+ /// <reference types="jqueryui" />
1
3
  import { PermissionChecker } from '../../service';
2
4
  import { Localization } from '../../localization';
3
5
  import { VariableCommunicator, VariableState } from '../../communication';
@@ -9,7 +11,7 @@ export declare abstract class StateControlElement extends ConditionalDynamicDisp
9
11
  isEnable: boolean;
10
12
  elementStates: VariableState[];
11
13
  state: State;
12
- private currentRect;
14
+ currentRect: JQuery;
13
15
  preState: State;
14
16
  constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
15
17
  initState(): void;
@@ -37,6 +37,7 @@ export declare class MainElement {
37
37
  initElementState(): void;
38
38
  getVariableNames(): Array<string>;
39
39
  reportVariableStates(states: VariableState[]): void;
40
+ getVirtualDeviceIdFromRect(rectElement: any): any;
40
41
  reportVariableValues(values: VariableValue[]): void;
41
42
  dispose(): void;
42
43
  private checkIsLoaded;
@@ -257,15 +257,39 @@ export class MainElement {
257
257
  });
258
258
  });
259
259
  }
260
+ getVirtualDeviceIdFromRect(rectElement) {
261
+ let current = rectElement;
262
+ while (current) {
263
+ if (current.tagName === 'FC-GUI') {
264
+ const virtualDeviceId = current.getAttribute('data-virtual-device-id');
265
+ return virtualDeviceId || null;
266
+ }
267
+ current = current.parentElement;
268
+ }
269
+ return null;
270
+ }
260
271
  reportVariableValues(values) {
261
272
  this.checkIsLoaded();
262
273
  each(values, value => {
263
274
  each(this.elements, e => {
275
+ var _a;
264
276
  if (e instanceof ReadableElement) {
265
277
  if ((value.variableName && (e.readVariableName === value.variableName ||
266
- e.minVariableName === value.variableName || e.maxVariableName === value.variableName)) || e.readVariableName === value.systemName) {
278
+ e.minVariableName === value.variableName || e.maxVariableName === value.variableName))) {
267
279
  e.reportValueChanged(value);
268
280
  }
281
+ if (e.readVariableName === value.systemName) {
282
+ const rect = (_a = e.currentRect) === null || _a === void 0 ? void 0 : _a[0];
283
+ const deviceId = this.getVirtualDeviceIdFromRect(rect);
284
+ if (deviceId) {
285
+ if (+deviceId === value.virtualDeviceId) {
286
+ e.reportValueChanged(value);
287
+ }
288
+ }
289
+ else {
290
+ e.reportValueChanged(value);
291
+ }
292
+ }
269
293
  }
270
294
  });
271
295
  });
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"MainElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":55,"character":43},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":56,"character":41},{"__symbolic":"reference","module":"../gui/gui-context","name":"GuiContext","line":57,"character":34},{"__symbolic":"reference","module":"../communication","name":"VariableCommunicator","line":58,"character":47},{"__symbolic":"reference","module":"../view/popup-view.service","name":"PopupViewService","line":59,"character":43},null]}],"load":[{"__symbolic":"method"}],"uniformStretch":[{"__symbolic":"method"}],"changeVideoStyle":[{"__symbolic":"method"}],"horizontalStretch":[{"__symbolic":"method"}],"initElementState":[{"__symbolic":"method"}],"getVariableNames":[{"__symbolic":"method"}],"reportVariableStates":[{"__symbolic":"method"}],"reportVariableValues":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"checkIsLoaded":[{"__symbolic":"method"}],"initBackground":[{"__symbolic":"method"}],"getImageEl":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"MainElement":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":55,"character":43},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":56,"character":41},{"__symbolic":"reference","module":"../gui/gui-context","name":"GuiContext","line":57,"character":34},{"__symbolic":"reference","module":"../communication","name":"VariableCommunicator","line":58,"character":47},{"__symbolic":"reference","module":"../view/popup-view.service","name":"PopupViewService","line":59,"character":43},null]}],"load":[{"__symbolic":"method"}],"uniformStretch":[{"__symbolic":"method"}],"changeVideoStyle":[{"__symbolic":"method"}],"horizontalStretch":[{"__symbolic":"method"}],"initElementState":[{"__symbolic":"method"}],"getVariableNames":[{"__symbolic":"method"}],"reportVariableStates":[{"__symbolic":"method"}],"getVirtualDeviceIdFromRect":[{"__symbolic":"method"}],"reportVariableValues":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"checkIsLoaded":[{"__symbolic":"method"}],"initBackground":[{"__symbolic":"method"}],"getImageEl":[{"__symbolic":"method"}]}}}}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.118",
3
+ "version": "3.0.0-alpha.119",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",