@flexem/fc-gui 3.0.0-alpha.43 → 3.0.0-alpha.45
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 +7 -2
- package/bundles/@flexem/fc-gui.umd.js +521 -498
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +4 -4
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/main-element.js +1 -1
- package/elements/numerical-display/numerical-display-element.d.ts +5 -3
- package/elements/numerical-display/numerical-display-element.js +12 -5
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/gui/gui-context.d.ts +2 -1
- package/modal/write-value/write-value-modal.component.js +2 -2
- package/package.json +1 -1
- package/service/index.d.ts +1 -0
- package/service/index.metadata.json +1 -1
- package/service/released-variable/index.d.ts +1 -0
- package/service/released-variable/index.js +0 -0
- package/service/released-variable/index.metadata.json +1 -0
- package/service/released-variable/released-variable.service.d.ts +4 -0
- package/service/released-variable/released-variable.service.js +0 -0
- package/service/released-variable/released-variable.service.metadata.json +1 -0
package/elements/main-element.js
CHANGED
|
@@ -59,7 +59,7 @@ export class MainElement {
|
|
|
59
59
|
const category = $(element).data('model').category;
|
|
60
60
|
switch (category) {
|
|
61
61
|
case GuiConsts.components.numericalDisplayKey:
|
|
62
|
-
const numericalDisplayElement = new NumericalDisplayElement(element, this.injector, this.bsModalService, this.context.permissionChecker, this.variableCommunicator, this.context.configStore.graphStore, this.context.operationRecordService, this.context.securityChecker, this.context.configStore.variableStore, this.injector.get(LOCALIZATION), this.signalRAppId);
|
|
62
|
+
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);
|
|
63
63
|
this.elements.push(numericalDisplayElement);
|
|
64
64
|
break;
|
|
65
65
|
case GuiConsts.components.imageKey:
|
|
@@ -3,7 +3,7 @@ import { BsModalService } from 'ngx-bootstrap/modal';
|
|
|
3
3
|
import { GraphStore, VariableStore } from '../../config';
|
|
4
4
|
import { Localization } from '../../localization';
|
|
5
5
|
import { NumericalDisplay } from '../../model';
|
|
6
|
-
import { PermissionChecker, OperationRecordService } from '../../service';
|
|
6
|
+
import { PermissionChecker, OperationRecordService, ReleasedVariableService } from '../../service';
|
|
7
7
|
import { VariableCommunicator } from '../../communication';
|
|
8
8
|
import { ReadableElement } from '../base/readable-element';
|
|
9
9
|
import { SecurityChecker } from '../../security';
|
|
@@ -11,6 +11,7 @@ export declare class NumericalDisplayElement extends ReadableElement {
|
|
|
11
11
|
private readonly modalService;
|
|
12
12
|
private readonly graphStore;
|
|
13
13
|
private readonly operationRecordService;
|
|
14
|
+
private readonly releasedVariableService;
|
|
14
15
|
private readonly securityChecker;
|
|
15
16
|
private readonly dataTypeService;
|
|
16
17
|
private readonly fractionDigitService;
|
|
@@ -23,9 +24,10 @@ export declare class NumericalDisplayElement extends ReadableElement {
|
|
|
23
24
|
private enableDataParsed;
|
|
24
25
|
private writeValueMmodalRef;
|
|
25
26
|
private writeValue;
|
|
26
|
-
private
|
|
27
|
+
private showValue;
|
|
28
|
+
private numericalOperation;
|
|
27
29
|
get writeVariableName(): string;
|
|
28
|
-
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
30
|
+
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);
|
|
29
31
|
dispose(): void;
|
|
30
32
|
initElement(): any;
|
|
31
33
|
private checkElementPassword;
|
|
@@ -12,11 +12,12 @@ 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, signalRAppId) {
|
|
15
|
+
constructor(element, injector, modalService, permissionChecker, variableCommunicator, graphStore, operationRecordService, releasedVariableService, securityChecker, variableStore, localization, signalRAppId) {
|
|
16
16
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
17
17
|
this.modalService = modalService;
|
|
18
18
|
this.graphStore = graphStore;
|
|
19
19
|
this.operationRecordService = operationRecordService;
|
|
20
|
+
this.releasedVariableService = releasedVariableService;
|
|
20
21
|
this.securityChecker = securityChecker;
|
|
21
22
|
this.displayText = '';
|
|
22
23
|
this.enableDataParsed = false;
|
|
@@ -51,6 +52,12 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
initElement() {
|
|
55
|
+
this.releasedVariableService.getVariablesWithValueTransform().subscribe(result => {
|
|
56
|
+
const variablesTransform = result.filter(item => item.name === this.writeVariableName);
|
|
57
|
+
if (variablesTransform && variablesTransform.length && JSON.parse(variablesTransform[0].valueTransform).Type !== 0) {
|
|
58
|
+
this.numericalOperation = true;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
54
61
|
const { rootElement } = this;
|
|
55
62
|
rootElement.selectAll('*').remove();
|
|
56
63
|
let width = null, height = null;
|
|
@@ -181,11 +188,11 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
181
188
|
if (result) {
|
|
182
189
|
const writeValue = this.dataTypeService.formatToDecimal(this.model.version, result.value, this.model.dataType);
|
|
183
190
|
this.writeValue = writeValue;
|
|
184
|
-
this.
|
|
185
|
-
if (this.displayText
|
|
191
|
+
this.showValue = result.showValue;
|
|
192
|
+
if (!this.numericalOperation && +this.displayText !== +this.showValue) {
|
|
186
193
|
this.variableCommunicator.write(this.writeVariableName, writeValue).subscribe();
|
|
187
194
|
setTimeout(() => {
|
|
188
|
-
if (this.displayText
|
|
195
|
+
if (+this.displayText !== +this.showValue) {
|
|
189
196
|
this.writeValueMmodalRef.content.isSubmitting = false;
|
|
190
197
|
this.writeValueMmodalRef.content.showValidationErrorInfo(this.localization.writeValueTimeout);
|
|
191
198
|
}
|
|
@@ -224,7 +231,7 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
224
231
|
var _a;
|
|
225
232
|
this.displayText = this.formatNumericalDisplayText(this.model.dataType, this.model.fractionDigits, value);
|
|
226
233
|
this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
|
|
227
|
-
if (((_a = this.writeValueMmodalRef) === null || _a === void 0 ? void 0 : _a.content) && this.displayText
|
|
234
|
+
if (((_a = this.writeValueMmodalRef) === null || _a === void 0 ? void 0 : _a.content) && +this.displayText !== +this.showValue) {
|
|
228
235
|
this.writeValueMmodalRef.hide();
|
|
229
236
|
this.writeValueMmodalRef.content.hideValidationErrorInfo();
|
|
230
237
|
this.recordOperation(this.writeValue);
|
|
@@ -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":43,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":44,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":45,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":46,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":47,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":48,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":49,"character":49},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":50,"character":50},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":51,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":52,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":53,"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"}]}}}}]
|
package/gui/gui-context.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ConfigStore } from '../config';
|
|
2
2
|
import { VariableCommunicator } from '../communication';
|
|
3
3
|
import { SecurityChecker } from '../security';
|
|
4
|
-
import { VideoService, WeatherService, PermissionChecker, OperationRecordService } from '../service';
|
|
4
|
+
import { VideoService, WeatherService, PermissionChecker, OperationRecordService, ReleasedVariableService } from '../service';
|
|
5
5
|
export interface GuiContext {
|
|
6
6
|
readonly configStore: ConfigStore;
|
|
7
7
|
readonly variableCommunicator: VariableCommunicator;
|
|
8
8
|
readonly permissionChecker: PermissionChecker;
|
|
9
9
|
readonly operationRecordService: OperationRecordService;
|
|
10
|
+
readonly releasedVariableService: ReleasedVariableService;
|
|
10
11
|
readonly securityChecker: SecurityChecker;
|
|
11
12
|
readonly videoService: VideoService;
|
|
12
13
|
readonly weatherService: WeatherService;
|
|
@@ -100,7 +100,7 @@ let WriteValueModalComponent = class WriteValueModalComponent {
|
|
|
100
100
|
}
|
|
101
101
|
save() {
|
|
102
102
|
this.isSubmitting = true;
|
|
103
|
-
const
|
|
103
|
+
const showValue = this.value;
|
|
104
104
|
if (this.args.enableDataParsed) {
|
|
105
105
|
if (this.enableNumericalOperation) {
|
|
106
106
|
this.value = this.numericalOperationService.getWriteValue(this.args.version, this.value, this.numericalOperation, this.dataType, this.fractionDigits);
|
|
@@ -109,7 +109,7 @@ let WriteValueModalComponent = class WriteValueModalComponent {
|
|
|
109
109
|
this.value = this.formatWriteValue();
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
this.onClosed({ value: this.value,
|
|
112
|
+
this.onClosed({ value: this.value, showValue });
|
|
113
113
|
}
|
|
114
114
|
close() {
|
|
115
115
|
this.bsModalRef.hide();
|
package/package.json
CHANGED
package/service/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./weather.service","export":["WeatherService"]},{"from":"./permission-checker","export":["PermissionChecker"]},{"from":"./operation-record"},{"from":"./video"}]}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./weather.service","export":["WeatherService"]},{"from":"./permission-checker","export":["PermissionChecker"]},{"from":"./released-variable","export":["ReleasedVariableService"]},{"from":"./operation-record"},{"from":"./video"}]}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReleasedVariableService } from './released-variable.service';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./released-variable.service","export":["ReleasedVariableService"]}]}]
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ReleasedVariableService":{"__symbolic":"interface"}}}]
|