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 98cda37f..f88fe66e 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 @@ -16,7 +16,7 @@ import { recipeService } from "@/services/recipeService"; import { warmersService } from "@/services/warmersService"; import { debounce } from "@/_base/debounce"; -@Component({ components: { modal: Modal, stepfooter: StepFooter, riscaldiinf: RiscaldiInf, riscaldisup: RiscaldiSup, sostdecomp: SostDecomp,thermocamera:Thermocamera } }) +@Component({ components: { modal: Modal, stepfooter: StepFooter, riscaldiinf: RiscaldiInf, riscaldisup: RiscaldiSup, sostdecomp: SostDecomp, thermocamera: Thermocamera } }) export default class ShowRiscaldamentoSuperioreInfo extends Vue { recipe: Recipe.IRecipe = this.$store.getters.getCurrent(); @@ -30,7 +30,7 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue { @Prop() value: string; - + isLoading: boolean = false; mounted() { @@ -68,10 +68,34 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue { async enabChanged() { this.tempEnabledEdited = true; }; - + debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200); + get lowerHasErrors() { + return (this.recipe.heats_lowerheaters_max_time.status.visible && this.recipe.heats_lowerheaters_max_time.status.hasError) || + (this.recipe.heats_lowerheaters_movement_enabled.status.visible && this.recipe.heats_lowerheaters_movement_enabled.status.hasError) || + (this.recipe.heats_lowerheaters_enabled.status.visible && this.recipe.heats_lowerheaters_enabled.status.hasError) || + (this.recipe.heats_lowerheaters_oscillation.status.visible && this.recipe.heats_lowerheaters_oscillation.status.hasError); + } + + get upperHasErrors() { + return (this.recipe.heats_upperheaters_max_time.status.visible && this.recipe.heats_upperheaters_max_time.status.hasError) || + (this.recipe.heats_upperheaters_movement_enabled.status.visible && this.recipe.heats_upperheaters_movement_enabled.status.hasError) || + (this.recipe.heats_upperheaters_enabled.status.visible && this.recipe.heats_upperheaters_enabled.status.hasError) || + (this.recipe.heats_upperheaters_oscillation.status.visible && this.recipe.heats_upperheaters_oscillation.status.hasError); + } + + get decoSumHasErrors() { + return (this.recipe.heats_decomsustain_type.status.visible && this.recipe.heats_decomsustain_type.status.hasError) || + (this.recipe.heats_decomsustain_decompression_flow.status.visible && this.recipe.heats_decomsustain_decompression_flow.status.hasError) || + (this.recipe.heats_decomsustain_min_blowing_time.status.visible && this.recipe.heats_decomsustain_min_blowing_time.status.hasError) || + (this.recipe.heats_decomsustain_sustain_delay.status.visible && this.recipe.heats_decomsustain_sustain_delay.status.hasError) || + (this.recipe.heats_decomsustain_decompression_delay.status.visible && this.recipe.heats_decomsustain_decompression_delay.status.hasError) || + (this.recipe.heats_decomsustain_decompression_duration.status.visible && this.recipe.heats_decomsustain_decompression_duration.status.hasError) || + (this.recipe.heats_decomsustain_smoke_function_enabled.status.visible && this.recipe.heats_decomsustain_smoke_function_enabled.status.hasError); + } + get payload() { return { heats_lowerheaters_max_time: this.recipe.heats_lowerheaters_max_time, @@ -103,7 +127,7 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue { } hasChanges() { - if(this.warmersEdited || this.tempsEdited|| this.tempEnabledEdited) + if (this.warmersEdited || this.tempsEdited || this.tempEnabledEdited) return true; let result = false; for (const key in this.recipe) { @@ -127,7 +151,7 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue { return result; } - + takeScreenshot() { messageService.publishToChannel("take-screenshot"); } @@ -166,17 +190,17 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue { // recipeActions.setCurrent(store, this.recipe); this.isLoading = true; - if(this.warmersEdited){ + if (this.warmersEdited) { await warmersService.Update(store.state.warmers.channels.reduce((p, c) => { p[c.idChannel] = c.setpointHMI; return p; }, {})); } - if(this.tempsEdited) + if (this.tempsEdited) await warmersService.UpdateTemp(store.state.warmers.channels.reduce((p, c) => { p[c.idChannel] = c.tCamTempSet; return p; }, {})); - if(this.warmersEdited || this.tempEnabledEdited){ + if (this.warmersEdited || this.tempEnabledEdited) { await warmersService.UpdateEnable(store.state.warmers.channels.reduce((p, c) => { p[c.idChannel] = c.tCamActive; return p; }, {})); } - - if(this.warmersEdited || this.tempsEdited || this.tempEnabledEdited) + + if (this.warmersEdited || this.tempsEdited || this.tempEnabledEdited) await warmersService.Confirm(); await recipeService.Confirm('Heats'); diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.vue index ae30deaa..1439d665 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.vue @@ -3,17 +3,17 @@
@@ -31,12 +31,19 @@
- - - + + +