diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.less b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.less index 15b7aaf1..ef340462 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.less +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.less @@ -13,7 +13,7 @@ flex-flow: column; align-items: center; justify-content: space-between; - height: 300px; + height: 350px; input[type="range"][orient="vertical"] { writing-mode: bt-lr; /* IE */ 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 f036de10..d6dddd00 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,7 +1,7 @@ import Vue from 'vue'; import Component from 'vue-class-component'; import { store } from '@/store'; -import { Prop,Watch } from 'vue-property-decorator'; +import { Prop, Watch } from 'vue-property-decorator'; import warmers from "./warmers.vue"; import { thermocameraService } from "@/services/thermocameraService"; import { warmersService } from "@/services/warmersService"; @@ -22,149 +22,87 @@ export default class Thermocamera extends Vue { uniformChannelValue: number = -1; btnModeEnabled = true; - -/* - modeEnabled: Recipe.IValue = { - setpointHMI: this.thermocameraMode, - checkpointHMI: this.thermocameraMode, - - range: { min: 0, max: 999999 }, - status: { - enabled: true, - hasError: false, - visible: true - } - } as Recipe.IValue; - - OnOffEnabled: Recipe.IValue = { - setpointHMI: this.thermocameraOnOff, - checkpointHMI: this.thermocameraOnOff, - range: { min: 0, max: 999999 }, - status: { - enabled: true, - hasError: false, - visible: true - } - } as Recipe.IValue; - @Watch("modeEnabled.setpointHMI", { deep: true }) - async ChangedMode(n, o) { - if(this.modeEnabled.checkpointHMI != this.modeEnabled.setpointHMI) - this.$emit("enabChanged"); - if(this.modeEnabled.setpointHMI == 1) - { - store.state.warmers.tCamStatus.thermoCamMode = true; - store.state.warmers.channels.forEach(function(element, index){ - if (element.setpointHMI==0) - store.state.warmers.channels[index].tCamActive = false; - }); - } - else - store.state.warmers.tCamStatus.thermoCamMode = false; - } - - @Watch("OnOffEnabled.setpointHMI", { deep: true }) - async ChangedOnOff(n, o) { - if(this.OnOffEnabled.checkpointHMI != this.OnOffEnabled.setpointHMI) - this.$emit("enabChanged"); - if(this.OnOffEnabled.setpointHMI == 1) - store.state.warmers.tCamStatus.thermoCamOnOff = true; - else - store.state.warmers.tCamStatus.thermoCamOnOff = false; - }*/ + thermoImageUri: string = "/thermoprophet/colored/_last.jpg"; + thermoImageOpacity: number = 0; @Watch("warmers", { deep: true }) - async ChangedTemps() { - - /* - if(store.state.warmers.tCamStatus.thermoCamOnOff) - this.OnOffEnabled.setpointHMI = 1; - else - this.OnOffEnabled.setpointHMI = 0; + async ChangedTemps() { - if(store.state.warmers.tCamStatus.thermoCamMode) - this.modeEnabled.setpointHMI = 1; - else - this.modeEnabled.setpointHMI = 0; - */ this.btnModeEnabled = false; - for(const ch of store.state.warmers.channels){ - if(ch.tCamTempSet > 0){ + for (const ch of store.state.warmers.channels) { + if (ch.tCamTempSet > 0) { this.btnModeEnabled = true; break; } } } - beforeMount(){ + beforeMount() { this.uniformChannelValue = -1; } - async mounted(){ + async mounted() { this.ChangedTemps(); - /* - this.modeEnabled.checkpointHMI = this.modeEnabled.setpointHMI; - this.OnOffEnabled.checkpointHMI = this.OnOffEnabled.setpointHMI; - */ } - + get selectedChannels(): Warmers.IChannel[] { return store.state.warmers.channels.filter(i => this.selectedChannelIds.indexOf(i.idChannel) >= 0); } - - get isEnableDisableEnabled(): Boolean{ + + get isEnableDisableEnabled(): Boolean { return !store.state.warmers.tCamStatus.thermoCamOnOff; } get thermocameraMode(): number { - if(store.state.warmers.tCamStatus.thermoCamMode) + if (store.state.warmers.tCamStatus.thermoCamMode) return 1 else return 0 } - + get thermocameraModeBTN(): boolean { - return (store.state.warmers.tCamStatus.thermoCamMode) ; + return (store.state.warmers.tCamStatus.thermoCamMode); } get thermocameraRunBTN(): boolean { - return (store.state.warmers.tCamStatus.thermoCamOnOff) ; - } - - async toggleEnable(){ - store.state.warmers.tCamStatus.thermoCamMode = !store.state.warmers.tCamStatus.thermoCamMode; - await awaiter (warmersService.setTCamMode(store.state.warmers.tCamStatus.thermoCamMode)); + return (store.state.warmers.tCamStatus.thermoCamOnOff); } - async toggleRun(){ + async toggleEnable() { + store.state.warmers.tCamStatus.thermoCamMode = !store.state.warmers.tCamStatus.thermoCamMode; + await awaiter(warmersService.setTCamMode(store.state.warmers.tCamStatus.thermoCamMode)); + } + + async toggleRun() { store.state.warmers.tCamStatus.thermoCamOnOff = !store.state.warmers.tCamStatus.thermoCamOnOff; - await awaiter (warmersService.setTCamOn(store.state.warmers.tCamStatus.thermoCamOnOff)); + await awaiter(warmersService.setTCamOn(store.state.warmers.tCamStatus.thermoCamOnOff)); } get thermocameraOnOff(): number { - if(store.state.warmers.tCamStatus.thermoCamOnOff) + if (store.state.warmers.tCamStatus.thermoCamOnOff) return 1 else return 0 } - + get thermoCamModeNotEnabled(): boolean { return !store.state.warmers.tCamStatus.thermoCamMode; } selectionMethod = "none" - changedSelectValue(v){ - if(this.uniformChannelValue>=0) - for (const c of this.selectedChannels) c.tCamTempSet = this.uniformChannelValue; - + changedSelectValue(v) { + if (this.uniformChannelValue >= 0) + for (const c of this.selectedChannels) c.tCamTempSet = this.uniformChannelValue; + this.$emit("tempsChanged"); } get warmers() { return store.state.warmers; } - + zoomIn() { (this.$refs.warmers as any).zoomIn(); } @@ -176,9 +114,9 @@ export default class Thermocamera extends Vue { (this.$refs.warmers as any).zoomReset(); } - async showcamera(){ + async showcamera() { this.zoomReset() - await thermocameraService.show(); + await thermocameraService.show(); } selectionChanged(selected: number[]) { @@ -187,26 +125,26 @@ export default class Thermocamera extends Vue { this.selectedChannelIds = selected; } - disableHeater(){ + disableHeater() { for (const c of this.selectedChannels) c.tCamActive = false; - this.$emit("enabChanged"); + this.$emit("enabChanged"); } - enableHeater(){ + enableHeater() { for (const c of this.selectedChannels) c.tCamActive = true; - this.$emit("enabChanged"); + this.$emit("enabChanged"); } - setAllTemperature(){ - (this.$refs.warmers as any).automateTemp(); - this.$emit("tempsChanged"); - } - - clearAllTemperature(){ - (this.$refs.warmers as any).clearTemp(); + setAllTemperature() { + (this.$refs.warmers as any).automateTemp(); this.$emit("tempsChanged"); } - + + clearAllTemperature() { + (this.$refs.warmers as any).clearTemp(); + this.$emit("tempsChanged"); + } + add5() { for (const c of this.selectedChannels) c.tCamTempSet = Math.min(Math.max(parseFloat(c.tCamTempSet.toString()) + 5, 0), 300); this.$emit("tempsChanged"); diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.vue index ea182a7a..3f76a5fb 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/thermocamera.vue @@ -144,6 +144,9 @@ @methodChanged="m => selectionMethod = m" :recipe="recipe" :temperature="true" + thermoImage="/thermoprophet/colored/_last.jpg" + :thermoImageVisible="!!thermoImageOpacity" + :thermoImageOpacity="thermoImageOpacity" >