@flexem/fc-gui 3.0.0-alpha.42 → 3.0.0-alpha.43
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 +6 -1
- package/bundles/@flexem/fc-gui.umd.js +9 -6
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/numerical-display/numerical-display-element.d.ts +1 -0
- package/elements/numerical-display/numerical-display-element.js +7 -5
- package/elements/numerical-display/numerical-display-element.metadata.json +1 -1
- package/modal/write-value/write-value-modal.component.js +2 -1
- package/package.json +1 -1
|
@@ -23,6 +23,7 @@ export declare class NumericalDisplayElement extends ReadableElement {
|
|
|
23
23
|
private enableDataParsed;
|
|
24
24
|
private writeValueMmodalRef;
|
|
25
25
|
private writeValue;
|
|
26
|
+
private originalValue;
|
|
26
27
|
get writeVariableName(): string;
|
|
27
28
|
constructor(element: HTMLElement, injector: Injector, modalService: BsModalService, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, graphStore: GraphStore, operationRecordService: OperationRecordService, securityChecker: SecurityChecker, variableStore: VariableStore, localization: Localization, signalRAppId: string);
|
|
28
29
|
dispose(): void;
|
|
@@ -179,11 +179,13 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
179
179
|
});
|
|
180
180
|
this.writeValueMmodalRef.content.onClosed = (result) => {
|
|
181
181
|
if (result) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
const writeValue = this.dataTypeService.formatToDecimal(this.model.version, result.value, this.model.dataType);
|
|
183
|
+
this.writeValue = writeValue;
|
|
184
|
+
this.originalValue = result.originalValue;
|
|
185
|
+
if (this.displayText.toString() !== this.originalValue) {
|
|
186
|
+
this.variableCommunicator.write(this.writeVariableName, writeValue).subscribe();
|
|
185
187
|
setTimeout(() => {
|
|
186
|
-
if (this.displayText.toString() !== this.
|
|
188
|
+
if (this.displayText.toString() !== this.originalValue) {
|
|
187
189
|
this.writeValueMmodalRef.content.isSubmitting = false;
|
|
188
190
|
this.writeValueMmodalRef.content.showValidationErrorInfo(this.localization.writeValueTimeout);
|
|
189
191
|
}
|
|
@@ -222,7 +224,7 @@ export class NumericalDisplayElement extends ReadableElement {
|
|
|
222
224
|
var _a;
|
|
223
225
|
this.displayText = this.formatNumericalDisplayText(this.model.dataType, this.model.fractionDigits, value);
|
|
224
226
|
this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
|
|
225
|
-
if (((_a = this.writeValueMmodalRef) === null || _a === void 0 ? void 0 : _a.content) && this.displayText.toString() === this.
|
|
227
|
+
if (((_a = this.writeValueMmodalRef) === null || _a === void 0 ? void 0 : _a.content) && this.displayText.toString() === this.originalValue) {
|
|
226
228
|
this.writeValueMmodalRef.hide();
|
|
227
229
|
this.writeValueMmodalRef.content.hideValidationErrorInfo();
|
|
228
230
|
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":42,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":43,"character":18},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":44,"character":39},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":45,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":46,"character":30},{"__symbolic":"reference","module":"../../config","name":"GraphStore","line":47,"character":37},{"__symbolic":"reference","module":"../../service","name":"OperationRecordService","line":48,"character":49},{"__symbolic":"reference","module":"../../security","name":"SecurityChecker","line":49,"character":42},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":50,"character":23},{"__symbolic":"reference","module":"../../localization","name":"Localization","line":51,"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"}]}}}}]
|
|
@@ -100,6 +100,7 @@ let WriteValueModalComponent = class WriteValueModalComponent {
|
|
|
100
100
|
}
|
|
101
101
|
save() {
|
|
102
102
|
this.isSubmitting = true;
|
|
103
|
+
const originalValue = this.value;
|
|
103
104
|
if (this.args.enableDataParsed) {
|
|
104
105
|
if (this.enableNumericalOperation) {
|
|
105
106
|
this.value = this.numericalOperationService.getWriteValue(this.args.version, this.value, this.numericalOperation, this.dataType, this.fractionDigits);
|
|
@@ -108,7 +109,7 @@ let WriteValueModalComponent = class WriteValueModalComponent {
|
|
|
108
109
|
this.value = this.formatWriteValue();
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
|
-
this.onClosed({ value: this.value });
|
|
112
|
+
this.onClosed({ value: this.value, originalValue });
|
|
112
113
|
}
|
|
113
114
|
close() {
|
|
114
115
|
this.bsModalRef.hide();
|