diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/riscaldi-superiori.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/riscaldi-superiori.ts index 841ef796..de2c6ccb 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/riscaldi-superiori.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/riscaldi-superiori.ts @@ -6,7 +6,6 @@ import { store } from '@/store'; @Component({ name: "riscaldisup", components: { - warmers } }) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.ts index 0533b89b..e3d8c5e1 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.ts @@ -1,8 +1,8 @@ import Vue from 'vue'; import Component from 'vue-class-component'; +import { store } from '@/store'; import { Prop,Watch } from 'vue-property-decorator'; import warmers from "./warmers.vue"; -import { store } from '@/store'; import { thermocameraService } from "@/services/thermocameraService"; @Component({ @@ -21,6 +21,8 @@ export default class Thermocamera extends Vue { modeEnabled: Recipe.IValue = { setpointHMI: this.thermocameraMode, + checkpointHMI: this.thermocameraMode, + range: { min: 0, max: 999999 }, status: { enabled: true, @@ -31,6 +33,7 @@ export default class Thermocamera extends Vue { OnOffEnabled: Recipe.IValue = { setpointHMI: this.thermocameraOnOff, + checkpointHMI: this.thermocameraOnOff, range: { min: 0, max: 999999 }, status: { enabled: true, @@ -40,18 +43,20 @@ export default class Thermocamera extends Vue { } as Recipe.IValue; - @Watch("modeEnabled", { deep: true }) + @Watch("modeEnabled.setpointHMI", { deep: true }) async ChangedMode(n, o) { - this.$emit("enabChanged"); + if(this.modeEnabled.checkpointHMI != this.modeEnabled.setpointHMI) + this.$emit("enabChanged"); if(this.modeEnabled.setpointHMI == 1) store.state.warmers.tCamStatus.thermoCamMode = true; else store.state.warmers.tCamStatus.thermoCamMode = false; } - @Watch("OnOffEnabled", { deep: true }) + @Watch("OnOffEnabled.setpointHMI", { deep: true }) async ChangedOnOff(n, o) { - this.$emit("enabChanged"); + if(this.OnOffEnabled.checkpointHMI != this.OnOffEnabled.setpointHMI) + this.$emit("enabChanged"); if(this.OnOffEnabled.setpointHMI == 1) store.state.warmers.tCamStatus.thermoCamOnOff = true; else @@ -60,6 +65,18 @@ export default class Thermocamera extends Vue { @Watch("warmers", { deep: true }) async ChangedTemps() { + + if(store.state.warmers.tCamStatus.thermoCamOnOff) + this.OnOffEnabled.setpointHMI = 1; + else + this.OnOffEnabled.setpointHMI = 0; + + if(store.state.warmers.tCamStatus.thermoCamMode) + this.modeEnabled.setpointHMI = 1; + else + this.modeEnabled.setpointHMI = 0; + + this.OnOffEnabled.status.enabled = false; for(const ch of store.state.warmers.channels){ if(ch.tCamTempSet > 0){ @@ -74,6 +91,8 @@ export default class Thermocamera extends Vue { } async mounted(){ this.ChangedTemps(); + this.modeEnabled.checkpointHMI = this.modeEnabled.setpointHMI; + this.OnOffEnabled.checkpointHMI = this.OnOffEnabled.setpointHMI; } get selectedChannels(): Warmers.IChannel[] { diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.ts index 1f14ca65..b37531f5 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.ts @@ -44,7 +44,6 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue { async annulla() { this.isLoading = true; await recipeService.Cancel(); - await warmersService.GetThermocameraStatus(); this.isLoading = false; this.warmersEdited = false; this.tempsEdited = false; diff --git a/Thermo.Active/wwwroot/src/services/hub.ts b/Thermo.Active/wwwroot/src/services/hub.ts index 69f5f1a9..fe3cdb33 100644 --- a/Thermo.Active/wwwroot/src/services/hub.ts +++ b/Thermo.Active/wwwroot/src/services/hub.ts @@ -28,6 +28,7 @@ import { prodService } from "./prodService"; import { recipeService } from "./recipeService"; import { warmersActions } from "@/store/warmers.store"; import { cmsConnectActions } from "@/store/cmsConnect.store"; +import { warmersService } from "./warmersService"; declare const PRODUCTION; @@ -201,6 +202,8 @@ export class Hub { public static async setpointHmiInvalid(data) { if (data) { await recipeService.GetCurrent(); + await warmersService.GetChannels(); + await warmersService.GetThermocameraStatus(); // await recipeService.GetOverview(); } }