From 3f9b2a8c8e5121e2013a9addb6bb223530512e73 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 15 Sep 2020 14:24:07 +0200 Subject: [PATCH 1/9] modali m155 m156 --- .../wwwroot/src/app.business-logic.ts | 2 +- .../machine/components/m155-dialog.ts | 64 +++++++++++++++++++ .../machine/components/m155-dialog.vue | 33 ++++++++++ .../wwwroot/src/app_modules/machine/index.ts | 1 + .../src/components/modals/ModalHelper.ts | 35 ++++++++++ 5 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.ts create mode 100644 Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.vue diff --git a/Thermo.Active/wwwroot/src/app.business-logic.ts b/Thermo.Active/wwwroot/src/app.business-logic.ts index 82791cec..e4d86b91 100644 --- a/Thermo.Active/wwwroot/src/app.business-logic.ts +++ b/Thermo.Active/wwwroot/src/app.business-logic.ts @@ -39,7 +39,7 @@ messageService.subscribeToChannel("show-contact-info", () => { ModalHelper.ShowM // messageService.subscribeToChannel("show-axes-calibration", () => { ModalHelper.ShowNcModal(AxesCalibration); }); // messageService.subscribeToChannel("hide-axes-calibration", () => { ModalHelper.HideNcModal(AxesCalibration); }); -// messageService.subscribeToChannel("show-m155-questions", () => { ModalHelper.ShowNextM155Modal(); }); +messageService.subscribeToChannel("show-m155-questions", () => { ModalHelper.ShowNextM155Modal(); }); // messageService.subscribeToChannel("show-nochange-page", () => { // ModalHelper.ShowMessage( // Vue.filter('localize')("modal_nochangepage_title", "Operazione non possibile"), diff --git a/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.ts b/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.ts new file mode 100644 index 00000000..353080a5 --- /dev/null +++ b/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.ts @@ -0,0 +1,64 @@ +import { AppModel } from "src/store"; +import { Modal, ModalHelper } from "src/components/modals"; +import Component from "vue-class-component"; +import Vue from "vue"; +import { Hub } from "src/services"; +import { Factory, messageService } from "src/_base"; +import { Watch } from "vue-property-decorator"; + +@Component({ components: { modal: Modal } }) +export default class M155Dialog extends Vue{ + + data = null; + value = 0; + + MULTIPLE_BUTTONS = "MULTIPLE_BUTTONS"; + REAL = "REAL"; + SHOW_VAL = "SHOW_VAL" + + mounted(){ + this.data = ModalHelper.M155ModalData.data; + this.value = 0; + messageService.subscribeToChannel("show-modal-nc", args => { + this.data = ModalHelper.M155ModalData.data; + }); + } + + + get process(){ + if(this.data) + return this.data.process; + return 0; + } + + @Watch("data") + dataChanged(){ + this.value = 0; + } + + ischecked(k){ + return k == this.value; + } + check(k){ + return this.value = k; + } + canSendAnswer(){ + if(this.getType == this.REAL) + return this.value != null && this.value != undefined; + else + return this.value && this.value != 0; + } + get getType(){ + if(this.data) + return this.data.type + + return "" + } + hide() { + ModalHelper.M155ModalData.data.toDisplay = false; + ModalHelper.HideThisM155Modal(ModalHelper.M155ModalData.data.processId); + } + answer(){ + Hub.Current.WriteM155Response(this.data.process,this.value); + } +}; diff --git a/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.vue b/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.vue new file mode 100644 index 00000000..147b145d --- /dev/null +++ b/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.vue @@ -0,0 +1,33 @@ + + + diff --git a/Thermo.Active/wwwroot/src/app_modules/machine/index.ts b/Thermo.Active/wwwroot/src/app_modules/machine/index.ts index 1fde7a77..b6631c4c 100644 --- a/Thermo.Active/wwwroot/src/app_modules/machine/index.ts +++ b/Thermo.Active/wwwroot/src/app_modules/machine/index.ts @@ -12,6 +12,7 @@ export { MachineInfoDialog, ContactInfoDialog, UserInfoDialog, + M155Questions, UserInfo, CmsconnectInfoDialog } diff --git a/Thermo.Active/wwwroot/src/components/modals/ModalHelper.ts b/Thermo.Active/wwwroot/src/components/modals/ModalHelper.ts index 8d127389..16d39615 100644 --- a/Thermo.Active/wwwroot/src/components/modals/ModalHelper.ts +++ b/Thermo.Active/wwwroot/src/components/modals/ModalHelper.ts @@ -2,6 +2,7 @@ import { Factory, messageService } from "@/_base"; import ConfirmModal from "./modal-confirm.vue"; import { Deferred } from "@/services/Deferred"; +import { M155Questions } from "src/app_modules/machine"; import { processStore, processModelActions } from "@/store/runningProcess.store"; import { store } from "@/store"; declare let $: any; @@ -57,6 +58,9 @@ export class ModalHelper { isMessage: false }; + public static M155ModalData = { + data: null + }; public static MaintenancePasswordData = { maintenance: null, @@ -101,6 +105,37 @@ export class ModalHelper { return deferred.promise; } + public static ShowNextM155Modal() { + ModalHelper.M155ModalData.data = null; + for (let i = 0; i < processStore.state.m155messages.length; i++) { + if (processStore.state.m155messages[i].toDisplay) { + ModalHelper.M155ModalData.data = processStore.state.m155messages[i]; + break; + } + } + if (ModalHelper.M155ModalData.data) { + messageService.publishToChannel("show-modal-nc", M155Questions); + } + else { + messageService.publishToChannel("hide-modal-nc", M155Questions); + } + } + + public static HideThisM155Modal(processId) { + processModelActions.hideM155Messsage(store, processId); + } + + + public static ShowM155ModaloOfProcess(proc: number) { + if (!ModalHelper.M155ModalData.data) { + let find = processStore.state.m155messages.find(X => X.process == proc) + if (find) { + ModalHelper.M155ModalData.data = find; + messageService.publishToChannel("show-modal-nc", M155Questions); + } + } + } + public static HideModal(modalname: string = "modal") { messageService.publishToChannel("hide-" + modalname); } From e28b736ebf80e7fb9d9b1cf3862bb88117293235 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 16 Sep 2020 09:54:23 +0200 Subject: [PATCH 2/9] fix keyboard --- .../src/app_modules_thermo/components/keyboard.ts | 11 ++++++++--- .../src/app_modules_thermo/components/numeric.ts | 9 +++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/keyboard.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/components/keyboard.ts index c4b493f3..b301fa01 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/keyboard.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/keyboard.ts @@ -24,9 +24,14 @@ export default class Keyboard extends Vue { set Value(v: number) { try { - let scale = Math.pow(10, this.actualValue.numDec); - this.actualValue.setpointHMI = Math.round(v * scale) / scale; - } catch{ + let scale = Math.pow(10, this.actualValue.numDec ?? 0); + let result = Math.round(v * scale) / scale; + + if (!Number.isNaN(result) && Number.isFinite(result)) + this.actualValue.setpointHMI = result; + else + this.actualValue.setpointHMI = v; + } catch { this.actualValue.setpointHMI = v; } } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/numeric.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/components/numeric.ts index 730c31a8..42dba465 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/numeric.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/numeric.ts @@ -34,9 +34,14 @@ export default class Numeric extends Vue { } set Value(v: number) { + debugger try { - let scale = Math.pow(10, this.value.numDec); - this.value.setpointHMI = Math.round(v * scale) / scale; + let scale = Math.pow(10, this.value.numDec ?? 0); + let result = Math.round(v * scale) / scale; + if (!Number.isNaN(result) && Number.isFinite(result)) + this.value.setpointHMI = result; + else + this.value.setpointHMI = v; } catch { this.value.setpointHMI = v; } From 7d29511fdb7ff7a6c8182eb01e05aed39467e7aa Mon Sep 17 00:00:00 2001 From: = Date: Wed, 16 Sep 2020 10:30:56 +0200 Subject: [PATCH 3/9] click fuori da combo e paddle --- Thermo.Active/wwwroot/src/App.ts | 1 + .../wwwroot/src/app_modules_thermo/components/combo.ts | 3 ++- .../wwwroot/src/app_modules_thermo/components/combo.vue | 2 +- .../src/app_modules_thermo/components/paddle/paddle.ts | 2 ++ .../src/app_modules_thermo/components/paddle/paddle.vue | 6 +++++- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Thermo.Active/wwwroot/src/App.ts b/Thermo.Active/wwwroot/src/App.ts index 400b08c2..7338b188 100644 --- a/Thermo.Active/wwwroot/src/App.ts +++ b/Thermo.Active/wwwroot/src/App.ts @@ -180,6 +180,7 @@ export default class app extends Vue { onmousedown() { KeyboardHelper.hideKeyboard(); + messageService.publishToChannel('hideall'); } @Watch("isMainViewLiftedUp") diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.ts index b8b6ed74..b6dc6ff8 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.ts @@ -2,6 +2,7 @@ import Component from "vue-class-component"; import Vue from "vue"; import { Prop } from "vue-property-decorator"; import lottie from "lottie-web"; +import { messageService } from "@/_base"; @Component({}) export default class Combo extends Vue { @@ -42,7 +43,7 @@ export default class Combo extends Vue { } mounted() { - + messageService.subscribeToChannel('hideall', () => this.hideList()); } } \ No newline at end of file diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.vue index a41ebdbf..f1f9533f 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.vue @@ -9,7 +9,7 @@ -
+
{ this.isOpen = false; this.openFull = false; }) } @Watch("isOpen") diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/paddle/paddle.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/components/paddle/paddle.vue index d4b60d73..f6ce7417 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/paddle/paddle.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/paddle/paddle.vue @@ -1,5 +1,9 @@ diff --git a/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.vue b/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.vue index 91dd60c0..fd093446 100644 --- a/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.vue +++ b/Thermo.Active/wwwroot/src/app_modules/machine/components/m155-dialog.vue @@ -24,10 +24,10 @@
- +
diff --git a/Thermo.Active/wwwroot/src/app_modules/machine/index.ts b/Thermo.Active/wwwroot/src/app_modules/machine/index.ts index 227bcb71..1cba2f8b 100644 --- a/Thermo.Active/wwwroot/src/app_modules/machine/index.ts +++ b/Thermo.Active/wwwroot/src/app_modules/machine/index.ts @@ -12,7 +12,6 @@ export { MachineInfoDialog, ContactInfoDialog, UserInfoDialog, - M155Questions, UserInfo, CmsconnectInfoDialog, M155Questions diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/ComboboxHelper.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/components/ComboboxHelper.ts deleted file mode 100644 index 010493dd..00000000 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/ComboboxHelper.ts +++ /dev/null @@ -1,20 +0,0 @@ -export class ComboboxHelper { - - static currentCombobox: any = null; - static setCurrent(element) { - ComboboxHelper.currentCombobox = element; - } - - static show() { - - if (ComboboxHelper.currentCombobox) { - ComboboxHelper.currentCombobox.visible = true; - } - } - - static hide() { - if (ComboboxHelper.currentCombobox) { - ComboboxHelper.currentCombobox.visible = false; - } - } -} \ No newline at end of file diff --git a/Thermo.Active/wwwroot/src/components/modals/ModalHelper.ts b/Thermo.Active/wwwroot/src/components/modals/ModalHelper.ts index f432d115..fbffbe03 100644 --- a/Thermo.Active/wwwroot/src/components/modals/ModalHelper.ts +++ b/Thermo.Active/wwwroot/src/components/modals/ModalHelper.ts @@ -4,7 +4,6 @@ import ConfirmModal from "./modal-confirm.vue"; import { Deferred } from "@/services/Deferred"; import { M155Questions } from "src/app_modules/machine"; import { processStore, processModelActions } from "@/store/runningProcess.store"; -import { M155Questions } from "src/app_modules/machine"; import { store } from "@/store"; declare let $: any; @@ -126,26 +125,6 @@ export class ModalHelper { return deferred.promise; } - public static ShowNextM155Modal() { - ModalHelper.M155ModalData.data = null; - for (let i = 0; i < processStore.state.m155messages.length; i++) { - if (processStore.state.m155messages[i].toDisplay) { - ModalHelper.M155ModalData.data = processStore.state.m155messages[i]; - break; - } - } - if (ModalHelper.M155ModalData.data) { - messageService.publishToChannel("show-modal-nc", M155Questions); - } - else { - messageService.publishToChannel("hide-modal-nc", M155Questions); - } - } - - public static HideThisM155Modal(processId) { - processModelActions.hideM155Messsage(store, processId); - } - public static ShowM155ModaloOfProcess(proc: number) { if (!ModalHelper.M155ModalData.data) { From afaa8f3576b5002ce3c210e05d215d61391d38d1 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 16 Sep 2020 15:46:14 +0200 Subject: [PATCH 7/9] fix numeric unit of measure --- .../wwwroot/src/app_modules_thermo/components/numeric.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/numeric.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/components/numeric.vue index a268eaa9..2bbe8f67 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/numeric.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/numeric.vue @@ -12,7 +12,7 @@ :id="id" :disabled="value.status && !value.status.enabled" /> - {{unitMeasure}} + {{value.unitMeasure}}
\ No newline at end of file From 550b448dc2d96111b9be40aadadcd5a61674c5e5 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 16 Sep 2020 15:46:42 +0200 Subject: [PATCH 8/9] disegno piastra... mancano le dimensioni dei riscaldi --- .../base-components/riscaldi-inferiori.vue | 3 ++- .../base-components/riscaldi-superiori.vue | 9 +++++++-- .../riscaldi/components/base-components/warmers.ts | 3 +++ .../components/base-components/warmers.vue | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/riscaldi-inferiori.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/riscaldi-inferiori.vue index 7e4a5e60..e6badc9d 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/riscaldi-inferiori.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/riscaldi-inferiori.vue @@ -58,7 +58,7 @@ @@ -95,6 +95,7 @@
+1% @@ -91,7 +91,12 @@
- +