@flexem/fc-gui 3.0.0-alpha.3 → 3.0.0-alpha.30
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/CHANGELOG.md +131 -0
- package/bundles/@flexem/fc-gui.umd.js +2230 -1278
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +5 -5
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/communication/variable/variable-communicator.d.ts +2 -2
- package/elements/air-quality/air-quality-element.d.ts +31 -0
- package/elements/air-quality/air-quality-element.js +195 -0
- package/elements/air-quality/air-quality-element.metadata.json +1 -0
- package/elements/bar-graph-element.d.ts +8 -2
- package/elements/bar-graph-element.js +72 -6
- package/elements/bar-graph-element.metadata.json +1 -1
- package/elements/base/base-element.d.ts +2 -1
- package/elements/base/base-element.js +2 -1
- package/elements/base/base-element.metadata.json +1 -1
- package/elements/base/conditional-control-element.d.ts +1 -1
- package/elements/base/conditional-control-element.js +3 -3
- package/elements/base/conditional-control-element.metadata.json +1 -1
- package/elements/base/conditional-display-element.d.ts +1 -1
- package/elements/base/conditional-display-element.js +4 -4
- package/elements/base/conditional-display-element.metadata.json +1 -1
- package/elements/base/conditional-dynamic-display-element.d.ts +1 -1
- package/elements/base/conditional-dynamic-display-element.js +3 -3
- package/elements/base/conditional-dynamic-display-element.metadata.json +1 -1
- package/elements/base/conditional-enable-element.d.ts +1 -1
- package/elements/base/conditional-enable-element.js +4 -4
- package/elements/base/conditional-enable-element.metadata.json +1 -1
- package/elements/base/readable-element.d.ts +7 -2
- package/elements/base/readable-element.js +33 -4
- package/elements/base/readable-element.metadata.json +1 -1
- package/elements/base/state-control-element.d.ts +1 -1
- package/elements/base/state-control-element.js +2 -2
- package/elements/base/state-control-element.metadata.json +1 -1
- package/elements/character-display/character-display-element.d.ts +1 -1
- package/elements/character-display/character-display-element.js +2 -2
- package/elements/character-display/character-display-element.metadata.json +1 -1
- package/elements/datetime-display/datetime-display-element.d.ts +1 -1
- package/elements/datetime-display/datetime-display-element.js +2 -2
- package/elements/datetime-display/datetime-display-element.metadata.json +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +1 -1
- package/elements/historical-curve/historical-curve.element.js +10 -10
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/main-element.d.ts +2 -1
- package/elements/main-element.js +44 -26
- package/elements/main-element.metadata.json +1 -1
- package/elements/meter-element.d.ts +8 -2
- package/elements/meter-element.js +78 -9
- package/elements/meter-element.metadata.json +1 -1
- package/elements/numerical-display/numerical-display-element.d.ts +2 -1
- package/elements/numerical-display/numerical-display-element.js +14 -5
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/elements/per-view-variable-communicator.d.ts +2 -2
- package/elements/per-view-variable-communicator.js +4 -4
- package/elements/pipe/pipe-element.d.ts +1 -1
- package/elements/pipe/pipe-element.js +2 -2
- package/elements/pipe/pipe-element.metadata.json +1 -1
- package/elements/ring-graph/ring-graph-element.d.ts +11 -2
- package/elements/ring-graph/ring-graph-element.js +99 -5
- package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
- package/elements/shared/graph/graph-state-element.js +0 -3
- package/elements/shared/text/text-element.js +13 -2
- package/elements/shared/text/text-state-element.js +1 -1
- package/elements/static-elements/hyperlink-element.d.ts +1 -1
- package/elements/static-elements/hyperlink-element.js +2 -2
- package/elements/static-elements/hyperlink-element.metadata.json +1 -1
- package/elements/static-elements/image-element.d.ts +1 -1
- package/elements/static-elements/image-element.js +2 -2
- package/elements/static-elements/image-element.metadata.json +1 -1
- package/elements/static-elements/text-element.d.ts +1 -1
- package/elements/static-elements/text-element.js +2 -2
- package/elements/static-elements/text-element.metadata.json +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/bit-indicator-light-operator.js +4 -4
- package/elements/switch-indicator-light/bit-switch-operator.d.ts +3 -1
- package/elements/switch-indicator-light/bit-switch-operator.js +22 -2
- package/elements/switch-indicator-light/bit-switch-operator.metadata.json +1 -1
- package/elements/switch-indicator-light/indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.d.ts +9 -1
- package/elements/switch-indicator-light/switch-indicator-light-element.js +97 -28
- package/elements/switch-indicator-light/switch-indicator-light-element.metadata.json +1 -1
- package/elements/switch-indicator-light/switch-operator.d.ts +1 -0
- package/elements/switch-indicator-light/word-indicator-light-operator.d.ts +1 -1
- package/elements/switch-indicator-light/word-indicator-light-operator.js +5 -5
- package/elements/switch-indicator-light/word-switch-operator.d.ts +3 -1
- package/elements/switch-indicator-light/word-switch-operator.js +9 -2
- package/elements/switch-indicator-light/word-switch-operator.metadata.json +1 -1
- package/elements/table/table-element.d.ts +1 -1
- package/elements/table/table-element.js +2 -2
- package/elements/table/table-element.metadata.json +1 -1
- package/elements/vector-graphics/ellipse-element.d.ts +1 -1
- package/elements/vector-graphics/ellipse-element.js +2 -2
- package/elements/vector-graphics/ellipse-element.metadata.json +1 -1
- package/elements/vector-graphics/poly-line-element.d.ts +1 -1
- package/elements/vector-graphics/poly-line-element.js +2 -2
- package/elements/vector-graphics/poly-line-element.metadata.json +1 -1
- package/elements/vector-graphics/polygon-element.d.ts +1 -1
- package/elements/vector-graphics/polygon-element.js +2 -2
- package/elements/vector-graphics/polygon-element.metadata.json +1 -1
- package/elements/vector-graphics/rectangle-element.d.ts +1 -1
- package/elements/vector-graphics/rectangle-element.js +2 -2
- package/elements/vector-graphics/rectangle-element.metadata.json +1 -1
- package/elements/vector-graphics/sector-element.d.ts +1 -1
- package/elements/vector-graphics/sector-element.js +2 -2
- package/elements/vector-graphics/sector-element.metadata.json +1 -1
- package/elements/vector-graphics/straight-line-element.d.ts +1 -1
- package/elements/vector-graphics/straight-line-element.js +2 -2
- package/elements/vector-graphics/straight-line-element.metadata.json +1 -1
- package/elements/video/video-element.d.ts +1 -1
- package/elements/video/video-element.js +2 -2
- package/elements/video/video-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.d.ts +1 -1
- package/elements/view-operation/view-operation.element.js +2 -2
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/elements/weather/weater-element.d.ts +1 -1
- package/elements/weather/weater-element.js +2 -2
- package/elements/weather/weater-element.metadata.json +1 -1
- package/gui/gui-host.js +1 -1
- package/gui/gui-view.d.ts +1 -0
- package/gui/gui-view.js +3 -2
- package/gui/gui-view.metadata.json +1 -1
- package/localization/localization.service.d.ts +5 -0
- package/localization/localization.service.js +6 -1
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +6 -1
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/modal/write-value/write-value-modal-args.d.ts +3 -1
- package/modal/write-value/write-value-modal-args.js +3 -1
- package/modal/write-value/write-value-modal-args.metadata.json +1 -1
- package/modal/write-value/write-value-modal.component.d.ts +2 -0
- package/modal/write-value/write-value-modal.component.js +24 -12
- package/modal/write-value/write-value-modal.component.metadata.json +1 -1
- package/model/air-quality/air-quality-info.d.ts +23 -0
- package/model/air-quality/air-quality-info.js +4 -0
- package/model/air-quality/air-quality-info.metadata.json +1 -0
- package/model/air-quality/air-quality.model.d.ts +7 -0
- package/model/air-quality/air-quality.model.js +0 -0
- package/model/air-quality/air-quality.model.metadata.json +1 -0
- package/model/bar-graph/bar-graph.d.ts +4 -0
- package/model/base/readable-model.d.ts +4 -0
- package/model/meter/meter.d.ts +4 -0
- package/model/numerical-display/numerical-display.d.ts +2 -0
- package/model/ring-graph/ring-graph.model.d.ts +8 -0
- package/model/shared/condition/bit-condition-item-observer.d.ts +1 -1
- package/model/shared/condition/bit-condition-item-observer.js +4 -4
- package/model/shared/condition/condition-items-result-observer.d.ts +1 -1
- package/model/shared/condition/condition-items-result-observer.js +22 -12
- package/model/shared/condition/condition-items-result-observer.metadata.json +1 -1
- package/model/shared/condition/convert-condition-model.d.ts +5 -0
- package/model/shared/condition/convert-condition-model.js +0 -0
- package/model/shared/condition/convert-condition-model.metadata.json +1 -0
- package/model/shared/condition/relation-condition-result.d.ts +2 -1
- package/model/shared/condition/relation-condition-result.js +2 -1
- package/model/shared/condition/relation-condition-result.metadata.json +1 -1
- package/model/shared/condition/word-condition-item-observer.d.ts +1 -1
- package/model/shared/condition/word-condition-item-observer.js +11 -11
- package/model/shared/dynamic-display/dynamic-display.d.ts +1 -1
- package/model/shared/dynamic-display/dynamic-display.js +4 -4
- package/model/shared/dynamic-display/dynamic-display.metadata.json +1 -1
- package/model/shared/rotation/rotation-behavior.d.ts +1 -1
- package/model/shared/rotation/rotation-behavior.js +2 -2
- package/model/shared/rotation/rotation-behavior.metadata.json +1 -1
- package/model/shared/rotation/rotation-observer.d.ts +2 -1
- package/model/shared/rotation/rotation-observer.js +3 -2
- package/model/shared/rotation/rotation-observer.metadata.json +1 -1
- package/model/shared/translation/translation-behavior.d.ts +1 -1
- package/model/shared/translation/translation-behavior.js +3 -3
- package/model/shared/translation/translation-behavior.metadata.json +1 -1
- package/model/shared/translation/translation-observer.d.ts +1 -1
- package/model/shared/translation/translation-observer.js +2 -2
- package/model/shared/translation/translation-observer.metadata.json +1 -1
- package/model/switch-indicator-light/bit-switch-operation.d.ts +2 -1
- package/model/switch-indicator-light/bit-switch-operation.js +1 -0
- package/model/switch-indicator-light/bit-switch-operation.metadata.json +1 -1
- package/package.json +1 -1
- package/remote/communication/variable/remote-variable-communicator.d.ts +3 -2
- package/remote/communication/variable/remote-variable-communicator.js +16 -9
- package/remote/communication/variable/remote-variable-communicator.metadata.json +1 -1
- package/remote/communication/variable/remote-variable-protocol.d.ts +2 -2
- package/service/weather.service.d.ts +1 -0
- package/shared/gui-consts.d.ts +1 -0
- package/shared/gui-consts.js +1 -0
- package/shared/gui-consts.metadata.json +1 -1
- package/utils/data-type/data-type.service.d.ts +4 -7
- package/utils/data-type/data-type.service.js +29 -17
- package/utils/numerical-operation.service.js +2 -2
- package/gui/scripts/config.js +0 -6
- package/gui/scripts/require.js +0 -2145
- package/libs/nvd3/build/nv.d3.min.js +0 -13
|
@@ -20,8 +20,9 @@ export declare class NumericalDisplayElement extends ReadableElement {
|
|
|
20
20
|
private displayText;
|
|
21
21
|
private readonly logger;
|
|
22
22
|
private displayForeignObject;
|
|
23
|
+
private enableDataParsed;
|
|
23
24
|
get writeVariableName(): string;
|
|
24
|
-
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization);
|
|
25
|
+
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
25
26
|
dispose(): void;
|
|
26
27
|
initElement(): any;
|
|
27
28
|
private checkElementPassword;
|
|
@@ -12,13 +12,14 @@ import { VerifyPasswordModalComponent } from '../../modal/verify-password/verify
|
|
|
12
12
|
import { isNil } from 'lodash';
|
|
13
13
|
import { FCloudDataType } from '../../model/shared/data-type/fcloud-data-Type';
|
|
14
14
|
export class NumericalDisplayElement extends ReadableElement {
|
|
15
|
-
constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, securityChecker, variableStore, localization) {
|
|
16
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
15
|
+
constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, securityChecker, variableStore, localization, signalRAppId) {
|
|
16
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
17
17
|
this.modalService = modalService;
|
|
18
18
|
this.graphStore = graphStore;
|
|
19
19
|
this.operationRecordService = operationRecordService;
|
|
20
20
|
this.securityChecker = securityChecker;
|
|
21
21
|
this.displayText = '';
|
|
22
|
+
this.enableDataParsed = false;
|
|
22
23
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
23
24
|
this.dataTypeService = injector.get(DataTypeService);
|
|
24
25
|
this.fractionDigitService = injector.get(FractionDigitService);
|
|
@@ -32,6 +33,10 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
32
33
|
this.model.dataType = FCloudDataType.Hex;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
// version小于6时是老版本,默认支持数据解析
|
|
37
|
+
if (this.model.version < 6 || this.model.enableDataParsed) {
|
|
38
|
+
this.enableDataParsed = true;
|
|
39
|
+
}
|
|
35
40
|
this.initElement();
|
|
36
41
|
}
|
|
37
42
|
get writeVariableName() {
|
|
@@ -168,7 +173,7 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
168
173
|
if (null == this.writeVariableName) {
|
|
169
174
|
return;
|
|
170
175
|
}
|
|
171
|
-
const args = new WriteValueModalArgs(this.writeVariableName, this.model.dataType, this.model.integerDigits, this.model.fractionDigits, this.numericalOperationService.getNumericalOperations(this.model), this.model.version);
|
|
176
|
+
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);
|
|
172
177
|
const modalRef = this.modalService.show(WriteValueModalComponent, {
|
|
173
178
|
initialState: { args: args }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
|
|
174
179
|
});
|
|
@@ -294,6 +299,10 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
294
299
|
if (!this.isNumeric(value) || null == fractionDigits || fractionDigits < 0) {
|
|
295
300
|
return value;
|
|
296
301
|
}
|
|
302
|
+
// 数据解析
|
|
303
|
+
if (!this.enableDataParsed) {
|
|
304
|
+
return value;
|
|
305
|
+
}
|
|
297
306
|
const supportFractionDigits = this.dataTypeService.isSupportFractionDigit(this.model.version, dataType);
|
|
298
307
|
if (!supportFractionDigits) {
|
|
299
308
|
return value;
|
|
@@ -312,7 +321,7 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
312
321
|
if (fractionDigits === 0) {
|
|
313
322
|
return value;
|
|
314
323
|
}
|
|
315
|
-
let displayText = Number(value).toString();
|
|
324
|
+
let displayText = Number(value).toFixed(0).toString();
|
|
316
325
|
const isNegative = +displayText < 0;
|
|
317
326
|
if (isNegative) {
|
|
318
327
|
displayText = displayText.slice(1, displayText.length);
|
|
@@ -345,7 +354,7 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
345
354
|
}
|
|
346
355
|
formatDisplayTextUnit(displayText) {
|
|
347
356
|
if (this.model.showUnit !== false && this.model.unit) {
|
|
348
|
-
return `${displayText} ${this.model.unit}`;
|
|
357
|
+
return `${displayText || 0} ${this.model.unit}`;
|
|
349
358
|
}
|
|
350
359
|
return displayText;
|
|
351
360
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":22,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"NumericalDisplayElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":22,"character":45},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":39,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":40,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":41,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":42,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":43,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":44,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":45,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":46,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":47,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":48,"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"}]}}}}]
|
|
@@ -7,8 +7,8 @@ export declare class PerViewVariableCommunicator implements VariableCommunicator
|
|
|
7
7
|
private variableValuesChangedSubscriptions;
|
|
8
8
|
private variableStatesChangedSubscription;
|
|
9
9
|
constructor(variableCommunicator: VariableCommunicator);
|
|
10
|
-
openVariable(variableName: string): Observable<VariableValue>;
|
|
11
|
-
openVariables(variableNames: Array<string
|
|
10
|
+
openVariable(variableName: string, appId: string): Observable<VariableValue>;
|
|
11
|
+
openVariables(variableNames: Array<string>, appId?: string): Observable<Array<VariableValue>>;
|
|
12
12
|
write(variableName: string, value: any): Observable<VariableValue>;
|
|
13
13
|
writeWordByBit(variableName: string, index: number, value: number): Observable<VariableValue>;
|
|
14
14
|
subscribeVariableState(variableName: string): Observable<VariableState>;
|
|
@@ -8,10 +8,10 @@ export class PerViewVariableCommunicator {
|
|
|
8
8
|
this.variableStatesChangedSubscription = new Array();
|
|
9
9
|
this._rawVariableCommunicator = variableCommunicator;
|
|
10
10
|
}
|
|
11
|
-
openVariable(variableName) {
|
|
12
|
-
return this.openVariables([variableName]).pipe(map(values => values[0]));
|
|
11
|
+
openVariable(variableName, appId) {
|
|
12
|
+
return this.openVariables([variableName], appId).pipe(map(values => values[0]));
|
|
13
13
|
}
|
|
14
|
-
openVariables(variableNames) {
|
|
14
|
+
openVariables(variableNames, appId = '') {
|
|
15
15
|
return new Observable(subscriber => {
|
|
16
16
|
each(variableNames, variableName => {
|
|
17
17
|
if (!this.observers.has(variableName)) {
|
|
@@ -19,7 +19,7 @@ export class PerViewVariableCommunicator {
|
|
|
19
19
|
}
|
|
20
20
|
this.observers.get(variableName).push(subscriber);
|
|
21
21
|
});
|
|
22
|
-
const subscription = this._rawVariableCommunicator.openVariables(variableNames).subscribe(values => subscriber.next(values), error => subscriber.error(error), () => subscriber.complete());
|
|
22
|
+
const subscription = this._rawVariableCommunicator.openVariables(variableNames, appId).subscribe(values => subscriber.next(values), error => subscriber.error(error), () => subscriber.complete());
|
|
23
23
|
this.variableValuesChangedSubscriptions.push(subscription);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -9,7 +9,7 @@ export declare class PipeElement extends ConditionalControlElement {
|
|
|
9
9
|
private readonly elePipeInnerwall;
|
|
10
10
|
private readonly elePipeFlowBlock;
|
|
11
11
|
private pathLength;
|
|
12
|
-
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization);
|
|
12
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
13
13
|
initDefaultData(model: any): void;
|
|
14
14
|
protected updateElement(result: ConditionControlResultValue): void;
|
|
15
15
|
private initFrameNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FlowDirectionType } from '../../model';
|
|
2
2
|
import { ConditionalControlElement } from '../base/conditional-control-element';
|
|
3
3
|
export class PipeElement extends ConditionalControlElement {
|
|
4
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
5
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
4
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
5
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
6
6
|
this.initDefaultData(this.model);
|
|
7
7
|
const children = this.$element.children();
|
|
8
8
|
if (!children || !children.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"PipeElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-control-element","name":"ConditionalControlElement","line":7,"character":33},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":15,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":16,"character":67},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":17,"character":22}]}],"initDefaultData":[{"__symbolic":"method"}],"updateElement":[{"__symbolic":"method"}],"initFrameNode":[{"__symbolic":"method"}],"startOrStopPipeFlow":[{"__symbolic":"method"}],"getAnimate":[{"__symbolic":"method"}],"getAnimateElement":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"PipeElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-control-element","name":"ConditionalControlElement","line":7,"character":33},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":15,"character":57},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":16,"character":67},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":17,"character":22},{"__symbolic":"reference","name":"string"}]}],"initDefaultData":[{"__symbolic":"method"}],"updateElement":[{"__symbolic":"method"}],"initFrameNode":[{"__symbolic":"method"}],"startOrStopPipeFlow":[{"__symbolic":"method"}],"getAnimate":[{"__symbolic":"method"}],"getAnimateElement":[{"__symbolic":"method"}]}}}}]
|
|
@@ -5,13 +5,22 @@ import { ReadableElement } from '../base/readable-element';
|
|
|
5
5
|
import { VariableStore } from '../../config';
|
|
6
6
|
import { PermissionChecker } from '../../service';
|
|
7
7
|
export declare class RingGraphElement extends ReadableElement {
|
|
8
|
+
private static DEFAULT_MIN_VALUE;
|
|
9
|
+
private static DEFAULT_MAX_VALUE;
|
|
8
10
|
protected readonly model: RingGraphModel;
|
|
9
11
|
private _barElement$;
|
|
10
12
|
private _textElement$;
|
|
13
|
+
private valueObj;
|
|
14
|
+
private isNeedUpdateScale;
|
|
11
15
|
get readVariableName(): string;
|
|
12
|
-
|
|
16
|
+
get minVariableName(): string;
|
|
17
|
+
get maxVariableName(): string;
|
|
18
|
+
constructor(element: HTMLElement, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
13
19
|
private initFrameNode;
|
|
14
|
-
|
|
20
|
+
init(variableName: string): void;
|
|
21
|
+
private updateValueObj;
|
|
22
|
+
private updateScale;
|
|
23
|
+
protected updateVariableValue(value: number, variableName: any): void;
|
|
15
24
|
private updateBar;
|
|
16
25
|
private getBarColor;
|
|
17
26
|
private drawClockWiseArc;
|
|
@@ -4,16 +4,27 @@ import { RotationDirectionType } from '../../model/shared/rotation/rotation-dire
|
|
|
4
4
|
import { calculatePercent, degreesToRadians } from '../shared/math-utils';
|
|
5
5
|
import { VariableUtil } from '../../utils/variable-util';
|
|
6
6
|
import { VariableDefinition } from '../../communication/variable/variable-definition';
|
|
7
|
+
import { forEach } from 'lodash';
|
|
8
|
+
import { VariableState } from '../../communication';
|
|
9
|
+
import { VariableValueType } from '../../model/shared/condition/variable-value-type';
|
|
7
10
|
export class RingGraphElement extends ReadableElement {
|
|
8
|
-
constructor(element, permissionChecker, variableCommunicator, variableStore, localization) {
|
|
9
|
-
super(element, permissionChecker, variableCommunicator, variableStore, localization);
|
|
11
|
+
constructor(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId) {
|
|
12
|
+
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
13
|
+
this.valueObj = {};
|
|
14
|
+
this.isNeedUpdateScale = false;
|
|
15
|
+
if ((this.model.minValueType === VariableValueType.Constant && this.model.maxValueType === VariableValueType.Variable)
|
|
16
|
+
|| this.model.maxValueType === VariableValueType.Constant && this.model.minValueType === VariableValueType.Variable) {
|
|
17
|
+
this.isNeedUpdateScale = true;
|
|
18
|
+
this.updateScale();
|
|
19
|
+
this.isNeedUpdateScale = false;
|
|
20
|
+
}
|
|
10
21
|
const el$ = $(element);
|
|
11
22
|
this._barElement$ = el$.find('path[data-id="barArc"]');
|
|
12
23
|
this._textElement$ = el$.find('text[data-id="pText"]');
|
|
13
24
|
setTimeout(() => {
|
|
14
25
|
this.initFrameNode();
|
|
15
26
|
this.changeStates();
|
|
16
|
-
}
|
|
27
|
+
});
|
|
17
28
|
}
|
|
18
29
|
get readVariableName() {
|
|
19
30
|
if (!this.model.variableId) {
|
|
@@ -22,13 +33,94 @@ export class RingGraphElement extends ReadableElement {
|
|
|
22
33
|
const variable = new VariableDefinition(this.model.variableId.variableName.name, this.model.variableId.variableName.groupName, this.model.variableId.dataSourceCode, this.model.variableId.variableName.variableVersion);
|
|
23
34
|
return VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
24
35
|
}
|
|
36
|
+
get minVariableName() {
|
|
37
|
+
if (!this.model.minValueType) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const variable = new VariableDefinition(this.model.minVariable.variableName.name, this.model.minVariable.variableName.groupName, this.model.minVariable.dataSourceCode, this.model.minVariable.variableName.variableVersion);
|
|
41
|
+
return VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
42
|
+
}
|
|
43
|
+
get maxVariableName() {
|
|
44
|
+
if (!this.model.maxValueType) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const variable = new VariableDefinition(this.model.maxVariable.variableName.name, this.model.maxVariable.variableName.groupName, this.model.maxVariable.dataSourceCode, this.model.maxVariable.variableName.variableVersion);
|
|
48
|
+
return VariableUtil.getConvertedVariableName(this.variableStore, variable);
|
|
49
|
+
}
|
|
25
50
|
initFrameNode() {
|
|
26
51
|
const arcPath = Snap(this.$element[0]);
|
|
27
52
|
const b = arcPath.getBBox(true);
|
|
28
53
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
|
|
29
54
|
}
|
|
30
|
-
|
|
31
|
-
|
|
55
|
+
init(variableName) {
|
|
56
|
+
if (variableName) {
|
|
57
|
+
let hasVariable = false;
|
|
58
|
+
forEach(this.elementStates, elementState => {
|
|
59
|
+
if (elementState.variableName === variableName) {
|
|
60
|
+
hasVariable = true;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
if (!hasVariable && variableName === this.readVariableName) {
|
|
64
|
+
this.elementStates.push(new VariableState(variableName, undefined));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
updateValueObj(value, variableName) {
|
|
69
|
+
var _a, _b, _c;
|
|
70
|
+
if (((_a = this.model.variableId) === null || _a === void 0 ? void 0 : _a.variableName.name) === variableName) {
|
|
71
|
+
this.isNeedUpdateScale = false;
|
|
72
|
+
this.valueObj.value = value;
|
|
73
|
+
}
|
|
74
|
+
if (((_b = this.model.minVariable) === null || _b === void 0 ? void 0 : _b.variableName.name) === variableName) {
|
|
75
|
+
this.isNeedUpdateScale = true;
|
|
76
|
+
this.valueObj.min = value;
|
|
77
|
+
}
|
|
78
|
+
if (((_c = this.model.maxVariable) === null || _c === void 0 ? void 0 : _c.variableName.name) === variableName) {
|
|
79
|
+
this.isNeedUpdateScale = true;
|
|
80
|
+
this.valueObj.max = value;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
updateScale() {
|
|
84
|
+
if (!this.isNeedUpdateScale) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const textElements = this.$element.find('g:first > text');
|
|
88
|
+
let min = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
89
|
+
let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
90
|
+
min = Number(min);
|
|
91
|
+
max = Number(max);
|
|
92
|
+
if (isNaN(min) || isNaN(max)) {
|
|
93
|
+
min = RingGraphElement.DEFAULT_MIN_VALUE;
|
|
94
|
+
max = RingGraphElement.DEFAULT_MAX_VALUE;
|
|
95
|
+
}
|
|
96
|
+
const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
|
|
97
|
+
for (let i = 0; i < textElements.length; i++) {
|
|
98
|
+
const text = textElements[i];
|
|
99
|
+
if (!text.innerHTML) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
let sacleValue = ((Number(avgSacle) * i) + min).toFixed(0);
|
|
103
|
+
// 整数位和小数位格式化;
|
|
104
|
+
if (this.model.fractionDigits > 0) {
|
|
105
|
+
sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
|
|
106
|
+
}
|
|
107
|
+
if (!isNaN(sacleValue)) {
|
|
108
|
+
text.innerHTML = sacleValue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
updateVariableValue(value, variableName) {
|
|
113
|
+
this.updateValueObj(value, variableName);
|
|
114
|
+
this.updateScale();
|
|
115
|
+
let min = this.model.minValueType ? this.valueObj.min : this.model.min;
|
|
116
|
+
let max = this.model.maxValueType ? this.valueObj.max : this.model.max;
|
|
117
|
+
min = Number(min);
|
|
118
|
+
max = Number(max);
|
|
119
|
+
if (isNaN(min) || isNaN(max)) {
|
|
120
|
+
min = RingGraphElement.DEFAULT_MIN_VALUE;
|
|
121
|
+
max = RingGraphElement.DEFAULT_MAX_VALUE;
|
|
122
|
+
}
|
|
123
|
+
const percent = calculatePercent(min, max, this.valueObj.value || 0);
|
|
32
124
|
this.updateBar(percent);
|
|
33
125
|
this._barElement$.attr('fill', this.getBarColor(value));
|
|
34
126
|
if (this.model.showPercentage) {
|
|
@@ -87,3 +179,5 @@ export class RingGraphElement extends ReadableElement {
|
|
|
87
179
|
arcPath.arc(outer, outer, inner, endRadians, startRadians);
|
|
88
180
|
}
|
|
89
181
|
}
|
|
182
|
+
RingGraphElement.DEFAULT_MIN_VALUE = 0;
|
|
183
|
+
RingGraphElement.DEFAULT_MAX_VALUE = 100;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"RingGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"RingGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":16,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":48,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":48,"character":57},{"__symbolic":"reference","module":"../../communication/variable/variable-communicator","name":"VariableCommunicator","line":49,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":50,"character":23},{"__symbolic":"reference","module":"../../localization/localization.service","name":"Localization","line":51,"character":22},{"__symbolic":"reference","name":"string"}]}],"initFrameNode":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"updateValueObj":[{"__symbolic":"method"}],"updateScale":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateBar":[{"__symbolic":"method"}],"getBarColor":[{"__symbolic":"method"}],"drawClockWiseArc":[{"__symbolic":"method"}],"drawAntiClockWiseArc":[{"__symbolic":"method"}]},"statics":{"DEFAULT_MIN_VALUE":0,"DEFAULT_MAX_VALUE":100}}}}]
|
|
@@ -62,9 +62,6 @@ export class GraphStateElement {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
getImageElement() {
|
|
65
|
-
if (this.imageElement && /iPhone|iPod/i.test(navigator.userAgent)) {
|
|
66
|
-
this.removeImageElement();
|
|
67
|
-
}
|
|
68
65
|
if (!this.imageElement) {
|
|
69
66
|
this.imageElement = document.createElementNS('http://www.w3.org/2000/svg', 'image');
|
|
70
67
|
this.imageElement.setAttribute('width', this.width + '');
|
|
@@ -19,7 +19,7 @@ export class TextElementModal {
|
|
|
19
19
|
return textElement;
|
|
20
20
|
}
|
|
21
21
|
createNewForeignObjectText(content, font, width, height, isVariableText) {
|
|
22
|
-
if (font) {
|
|
22
|
+
if (font && !font.fontFamily.includes(',msyh')) {
|
|
23
23
|
font.fontFamily += ',msyh';
|
|
24
24
|
}
|
|
25
25
|
const bodyDiv = document.createElement('div');
|
|
@@ -36,7 +36,7 @@ export class TextElementModal {
|
|
|
36
36
|
for (let index = 0; index < textArray.length; index++) {
|
|
37
37
|
const textDiv = document.createElement('div');
|
|
38
38
|
textDiv.className = 'text-list';
|
|
39
|
-
|
|
39
|
+
const innerHTML = textArray[index] ? textArray[index] : ' ';
|
|
40
40
|
let fontString = '';
|
|
41
41
|
if (font.isItalic) {
|
|
42
42
|
fontString += 'italic ';
|
|
@@ -45,12 +45,23 @@ export class TextElementModal {
|
|
|
45
45
|
fontString += 'bold ';
|
|
46
46
|
}
|
|
47
47
|
let lineHeight = 0;
|
|
48
|
+
// chrome支持可显示最小字体大小为12px, 更小字体通过缩放实现
|
|
49
|
+
const minFontSize = 12;
|
|
48
50
|
lineHeight = parseInt(font.fontSize, 10) + 5;
|
|
49
51
|
fontString += font.fontSize + '/' + lineHeight.toString() + 'px ' + font.fontFamily;
|
|
50
52
|
textDiv.style.cssText = `color: ${font.color};word-break: break-all;font: ${fontString};`;
|
|
51
53
|
if (font.isUnderline) {
|
|
52
54
|
textDiv.style.textDecoration = 'underline';
|
|
53
55
|
}
|
|
56
|
+
const spanText = document.createElement('span');
|
|
57
|
+
spanText.style.cssText = `
|
|
58
|
+
display: contents;
|
|
59
|
+
transform: scale(${parseInt(font.fontSize, 10) > minFontSize ? 1 : parseInt(font.fontSize, 10) / minFontSize});
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
`;
|
|
63
|
+
spanText.innerHTML = innerHTML;
|
|
64
|
+
textDiv.appendChild(spanText);
|
|
54
65
|
fragment.appendChild(textDiv);
|
|
55
66
|
}
|
|
56
67
|
bodyDiv.appendChild(fragment);
|
|
@@ -49,7 +49,7 @@ export class TextStateElement {
|
|
|
49
49
|
return this.textElement;
|
|
50
50
|
}
|
|
51
51
|
createNewForeignObjectText(content, font) {
|
|
52
|
-
if (font) {
|
|
52
|
+
if (font && !font.fontFamily.includes(',msyh')) {
|
|
53
53
|
font.fontFamily += ',msyh';
|
|
54
54
|
}
|
|
55
55
|
const bodyDiv = document.createElement('div');
|
|
@@ -9,6 +9,6 @@ export declare class HyperlinkElement extends ConditionalDynamicDisplayElement {
|
|
|
9
9
|
private readonly graphStore;
|
|
10
10
|
protected readonly model: HyperlinkModel;
|
|
11
11
|
protected readonly logger: LoggerService;
|
|
12
|
-
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore);
|
|
12
|
+
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore, signalRAppId: string);
|
|
13
13
|
private initGraphAndText;
|
|
14
14
|
}
|
|
@@ -3,8 +3,8 @@ import { GraphStateElement } from '../shared/graph/graph-state-element';
|
|
|
3
3
|
import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
4
4
|
import { TextElementModal } from '../shared/text/text-element';
|
|
5
5
|
export class HyperlinkElement extends ConditionalDynamicDisplayElement {
|
|
6
|
-
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore) {
|
|
7
|
-
super(element, permissionChecker, variableCommunicator, variableStore);
|
|
6
|
+
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId) {
|
|
7
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
8
8
|
this.graphStore = graphStore;
|
|
9
9
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
10
10
|
if (this.model.size) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"HyperlinkElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":12,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":17,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":17,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":17,"character":77},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":18,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":18,"character":67},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":18,"character":111}]}],"initGraphAndText":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"HyperlinkElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":12,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":17,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":17,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":17,"character":77},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":18,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":18,"character":67},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":18,"character":111},{"__symbolic":"reference","name":"string"}]}],"initGraphAndText":[{"__symbolic":"method"}]}}}}]
|
|
@@ -9,6 +9,6 @@ export declare class ImageElement extends ConditionalDynamicDisplayElement {
|
|
|
9
9
|
private readonly graphStore;
|
|
10
10
|
readonly model: Image;
|
|
11
11
|
protected readonly logger: LoggerService;
|
|
12
|
-
constructor(element: HTMLElement, injector: Injector, imageStore: ImageStore, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore);
|
|
12
|
+
constructor(element: HTMLElement, injector: Injector, imageStore: ImageStore, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore, signalRAppId: string);
|
|
13
13
|
private initGraph;
|
|
14
14
|
}
|
|
@@ -3,8 +3,8 @@ import { ImageFillType } from '../../model/image/image-fill-type';
|
|
|
3
3
|
import { GraphStateElement } from '../shared/graph/graph-state-element';
|
|
4
4
|
import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
5
5
|
export class ImageElement extends ConditionalDynamicDisplayElement {
|
|
6
|
-
constructor(element, injector, imageStore, permissionChecker, variableCommunicator, variableStore, graphStore) {
|
|
7
|
-
super(element, permissionChecker, variableCommunicator, variableStore);
|
|
6
|
+
constructor(element, injector, imageStore, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId) {
|
|
7
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
8
8
|
this.graphStore = graphStore;
|
|
9
9
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
10
10
|
if (!this.model.version || this.model.version < 4 || this.model.fillType !== ImageFillType.Graph) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ImageElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":10,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":16,"character":18},{"__symbolic":"reference","module":"../../config","name":"ImageStore","line":17,"character":20},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":18,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":19,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":20,"character":23},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":21,"character":37}]}],"initGraph":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ImageElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":10,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":16,"character":18},{"__symbolic":"reference","module":"../../config","name":"ImageStore","line":17,"character":20},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":18,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":19,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":20,"character":23},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":21,"character":37},{"__symbolic":"reference","name":"string"}]}],"initGraph":[{"__symbolic":"method"}]}}}}]
|
|
@@ -9,7 +9,7 @@ export declare class TextElement extends ConditionalDynamicDisplayElement {
|
|
|
9
9
|
private readonly graphStore;
|
|
10
10
|
protected readonly model: TextModel;
|
|
11
11
|
protected readonly logger: LoggerService;
|
|
12
|
-
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore);
|
|
12
|
+
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, graphStore: GraphStore, signalRAppId: string);
|
|
13
13
|
dispose(): void;
|
|
14
14
|
private handleTextValue;
|
|
15
15
|
private initGraph;
|
|
@@ -3,8 +3,8 @@ import { GraphStateElement } from '../shared/graph/graph-state-element';
|
|
|
3
3
|
import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
4
4
|
import { TextElementModal } from '../shared/text/text-element';
|
|
5
5
|
export class TextElement extends ConditionalDynamicDisplayElement {
|
|
6
|
-
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore) {
|
|
7
|
-
super(element, permissionChecker, variableCommunicator, variableStore);
|
|
6
|
+
constructor(element, injector, permissionChecker, variableCommunicator, variableStore, graphStore, signalRAppId) {
|
|
7
|
+
super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
|
|
8
8
|
this.graphStore = graphStore;
|
|
9
9
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
10
10
|
if (this.model.text && this.model.size) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"TextElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":10,"character":33},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":15,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":15,"character":77},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":16,"character":67},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":16,"character":111}]}],"dispose":[{"__symbolic":"method"}],"handleTextValue":[{"__symbolic":"method"}],"initGraph":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TextElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":10,"character":33},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":15,"character":48},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":15,"character":77},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":16,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":16,"character":67},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":16,"character":111},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"handleTextValue":[{"__symbolic":"method"}],"initGraph":[{"__symbolic":"method"}]}}}}]
|
|
@@ -15,6 +15,6 @@ export declare class BitIndicatorLightOperator implements IndicatorLightOperator
|
|
|
15
15
|
private onStateId?;
|
|
16
16
|
get variableName(): string;
|
|
17
17
|
constructor(settings: BitIndicatorLightSettings, states: SwitchIndicatorState[], variableCommunicator: VariableCommunicator, variableStore: VariableStore);
|
|
18
|
-
requestData(): void;
|
|
18
|
+
requestData(appId: string): void;
|
|
19
19
|
private requestCurrentSateIdValue;
|
|
20
20
|
}
|
|
@@ -42,11 +42,11 @@ export class BitIndicatorLightOperator {
|
|
|
42
42
|
const variableName = new VariableDefinition(this.settings.variableName, this.settings.variableGroupName, this.settings.dataSourceCode, this.settings.variableVersion);
|
|
43
43
|
return VariableUtil.getConvertedVariableName(this.variableStore, variableName);
|
|
44
44
|
}
|
|
45
|
-
requestData() {
|
|
45
|
+
requestData(appId) {
|
|
46
46
|
if (this.variableName) {
|
|
47
47
|
this.variableCommunicator.subscribeVariableState(this.variableName).subscribe(variableStete => {
|
|
48
48
|
if (variableStete.state === VariableStateEnum.Normal) {
|
|
49
|
-
this.requestCurrentSateIdValue(this.variableCommunicator);
|
|
49
|
+
this.requestCurrentSateIdValue(this.variableCommunicator, appId);
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
52
|
this.currentStateIdChanged.emit(new CurrentStateIdValue(new VariableState(this.variableName, variableStete.state)));
|
|
@@ -54,8 +54,8 @@ export class BitIndicatorLightOperator {
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
requestCurrentSateIdValue(variableCommunicator) {
|
|
58
|
-
variableCommunicator.openVariable(this.variableName).subscribe(value => {
|
|
57
|
+
requestCurrentSateIdValue(variableCommunicator, appId = '') {
|
|
58
|
+
variableCommunicator.openVariable(this.variableName, appId).subscribe(value => {
|
|
59
59
|
if (value.state === VariableStateEnum.DataNormal) {
|
|
60
60
|
if (this.settings.isBitwiseIndex) {
|
|
61
61
|
const maxBitIndex = 31;
|
|
@@ -7,11 +7,13 @@ export declare class BitSwitchOperator implements SwitchOperator {
|
|
|
7
7
|
private readonly settings;
|
|
8
8
|
private readonly variableCommunicator;
|
|
9
9
|
private readonly variableStore;
|
|
10
|
+
private readonly signalRAppId;
|
|
10
11
|
private currentValue;
|
|
11
12
|
private canExecuteInternal;
|
|
12
13
|
private binary;
|
|
13
14
|
get variableName(): string;
|
|
14
|
-
constructor(settings: BitSwitchSettings, variableCommunicator: VariableCommunicator, variableStore: VariableStore);
|
|
15
|
+
constructor(settings: BitSwitchSettings, variableCommunicator: VariableCommunicator, variableStore: VariableStore, signalRAppId: string);
|
|
15
16
|
canExecute(): boolean;
|
|
16
17
|
execute(): Promise<VariableOptionModel>;
|
|
18
|
+
writeValue(value: any): Promise<VariableOptionModel>;
|
|
17
19
|
}
|
|
@@ -4,10 +4,11 @@ import { Binary } from '../../model/shared/binary';
|
|
|
4
4
|
import { VariableUtil } from '../../utils/variable-util';
|
|
5
5
|
import { VariableDefinition } from '../../communication/variable/variable-definition';
|
|
6
6
|
export class BitSwitchOperator {
|
|
7
|
-
constructor(settings, variableCommunicator, variableStore) {
|
|
7
|
+
constructor(settings, variableCommunicator, variableStore, signalRAppId) {
|
|
8
8
|
this.settings = settings;
|
|
9
9
|
this.variableCommunicator = variableCommunicator;
|
|
10
10
|
this.variableStore = variableStore;
|
|
11
|
+
this.signalRAppId = signalRAppId;
|
|
11
12
|
if (!this.settings) {
|
|
12
13
|
throw new Error('settings cannot be null');
|
|
13
14
|
}
|
|
@@ -15,7 +16,7 @@ export class BitSwitchOperator {
|
|
|
15
16
|
this.canExecuteInternal = true;
|
|
16
17
|
}
|
|
17
18
|
else {
|
|
18
|
-
variableCommunicator.openVariable(this.variableName).subscribe(value => {
|
|
19
|
+
variableCommunicator.openVariable(this.variableName, this.signalRAppId).subscribe(value => {
|
|
19
20
|
this.currentValue = value;
|
|
20
21
|
this.canExecuteInternal = this.currentValue && this.currentValue.state === VariableStateEnum.DataNormal;
|
|
21
22
|
});
|
|
@@ -71,6 +72,8 @@ export class BitSwitchOperator {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
break;
|
|
75
|
+
case BitSwitchOperation.Restoration:
|
|
76
|
+
break;
|
|
74
77
|
default:
|
|
75
78
|
throw new Error(`Unknown BitSwitchOperation:${settings.operation}`);
|
|
76
79
|
}
|
|
@@ -84,4 +87,21 @@ export class BitSwitchOperator {
|
|
|
84
87
|
newValue: newValue
|
|
85
88
|
});
|
|
86
89
|
}
|
|
90
|
+
writeValue(value) {
|
|
91
|
+
if (this.settings.isBitwiseIndex) {
|
|
92
|
+
this.variableCommunicator.writeWordByBit(this.variableName, this.settings.bitIndex, value).subscribe();
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.variableCommunicator.write(this.variableName, value).subscribe();
|
|
96
|
+
}
|
|
97
|
+
let originValue;
|
|
98
|
+
if (this.currentValue && this.currentValue.value !== undefined) {
|
|
99
|
+
originValue = this.currentValue.value;
|
|
100
|
+
}
|
|
101
|
+
return Promise.resolve({
|
|
102
|
+
variableName: this.variableName,
|
|
103
|
+
originValue: originValue,
|
|
104
|
+
newValue: value
|
|
105
|
+
});
|
|
106
|
+
}
|
|
87
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"BitSwitchOperator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../model","name":"BitSwitchSettings","line":21,"character":43},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":21,"character":101},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":22,"character":40}]}],"canExecute":[{"__symbolic":"method"}],"execute":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"BitSwitchOperator":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../model","name":"BitSwitchSettings","line":21,"character":43},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":21,"character":101},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":22,"character":40},{"__symbolic":"reference","name":"string"}]}],"canExecute":[{"__symbolic":"method"}],"execute":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}]}}}}]
|