From 00a9634b76646fa75dcd52520445b18d8741d0a4 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 17 Jul 2020 14:32:55 +0200 Subject: [PATCH] fix gant timing & setpoingHMI --- .../dashboard/base-components/item.vue | 8 ++--- .../dashboard/dashboard.vue | 2 +- .../processo/components/gantt/gantt.ts | 2 +- Thermo.Active/wwwroot/src/services/hub.ts | 2 +- .../wwwroot/src/services/recipeService.ts | 3 +- .../wwwroot/src/store/recipe.store.ts | 33 ++++++++++--------- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/item.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/item.vue index b6173af5..d794b975 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/item.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/base-components/item.vue @@ -4,7 +4,7 @@
{{'history-item_warmup' | localize("tempo riscaldo")}} - {{value.timeWarm / 60 | round(0)}}'{{value.timeWarm % 60 | round(0)}}'' + {{Math.floor(value.timeWarm / 60) | round(0)}}'{{value.timeWarm % 60 | round(0)}}''
{{'history-item_vacuum' | localize("vuoto")}} @@ -12,7 +12,7 @@
{{'history-item_cycletime' | localize("tempo ciclo netto")}} - {{value.timeCycleNet / 60 | round(0)}}'{{value.timeCycleNet % 60 | round(0)}}'' + {{Math.floor(value.timeCycleNet / 60) | round(0)}}'{{value.timeCycleNet % 60 | round(0)}}''
@@ -32,7 +32,7 @@
{{'history-item_cycletimegross' | localize("tempo ciclo lordo")}} - {{value.timeCycleGross / 60 | round(0)}}'{{value.timeCycleGross % 60 | round(0)}}'' + {{Math.floor(value.timeCycleGross / 60) | round(0)}}'{{value.timeCycleGross % 60 | round(0)}}''
@@ -52,7 +52,7 @@
{{'history-item_vacuumtime' | localize("tempo vuoto")}} - {{value.timeVacuum / 60 | round(0)}}'{{value.timeVacuum % 60 | round(0)}}'' + {{Math.floor(value.timeVacuum / 60) | round(0)}}'{{value.timeVacuum % 60 | round(0)}}''
{{'history-item_mouldEnergyIN' | localize("energia utilizzata in")}} diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue index 50127437..648a84a9 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue @@ -143,7 +143,7 @@ {{'dashboard-time-cycle' | localize('tempo/ciclo')}} {{panel.lastTCiclo / 60 | round(0)}}'{{panel.lastTCiclo % 60 | round(0)}}'' + >{{Math.floor(panel.lastTCiclo / 60) | round(0)}}'{{panel.lastTCiclo % 60 | round(0)}}'' --
diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts index e5a9ec4f..73f8a570 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts @@ -29,7 +29,7 @@ export default class Gantt extends Vue { secondSize: 20, stepDuration: 2, labelInterval: 10, - maxGanttDuration: 500, + maxGanttDuration: 5000, block_status_minDuration: 4, block_delay_minDuration: 1.5, block_body_Heating_minDuration: 5, diff --git a/Thermo.Active/wwwroot/src/services/hub.ts b/Thermo.Active/wwwroot/src/services/hub.ts index b0b4ba5a..67127a83 100644 --- a/Thermo.Active/wwwroot/src/services/hub.ts +++ b/Thermo.Active/wwwroot/src/services/hub.ts @@ -154,7 +154,7 @@ export class Hub { } public static recipeFullData(data) { - recipeActions.setCurrent(store, data); + recipeActions.setCurrent(store, data, true); } public static recipeOverData(data) { diff --git a/Thermo.Active/wwwroot/src/services/recipeService.ts b/Thermo.Active/wwwroot/src/services/recipeService.ts index a6ff7c6b..3889d83f 100644 --- a/Thermo.Active/wwwroot/src/services/recipeService.ts +++ b/Thermo.Active/wwwroot/src/services/recipeService.ts @@ -2,6 +2,7 @@ import { baseRestService } from "../_base/baseRestService"; import { CONFIGURATION } from "@/config"; import { recipeActions } from "@/store/recipe.store"; import { store } from "@/store"; +import { dataService } from "./dataService"; export class RecipeService extends baseRestService { @@ -9,7 +10,7 @@ export class RecipeService extends baseRestService { async GetCurrent() { let result = await this.Get((await this.BASE_URL()) + "current"); - recipeActions.setCurrent(store, result); + recipeActions.setCurrent(store, result, false); return result; } diff --git a/Thermo.Active/wwwroot/src/store/recipe.store.ts b/Thermo.Active/wwwroot/src/store/recipe.store.ts index 3c59fbff..cedfc6cb 100644 --- a/Thermo.Active/wwwroot/src/store/recipe.store.ts +++ b/Thermo.Active/wwwroot/src/store/recipe.store.ts @@ -8,7 +8,7 @@ export interface RecipeStoreModel { export interface RecipeActions { - setCurrent(context, model: Recipe.IRecipe); + setCurrent(context, model: Recipe.IRecipe, avoidSetpointHMI: boolean); setOverview(context, model: Overview.IOverview); } @@ -46,16 +46,22 @@ export const recipeStore = { mutations: { - SetCurrent(state, model: Recipe.IRecipe) { - for (const key in model) { - if (model.hasOwnProperty(key)) { - if (model[key]) { - const m = model[key] as Recipe.IValue; - Vue.set(state.current, key, m); - if ((state._map as Map).has(m.id)) - Object.assign((state._map as Map).get(m.id), m) - else + SetCurrent(state, model: { avoidSetpoint: boolean, recipe: Recipe.IRecipe }) { + for (const key in model.recipe) { + if (model.recipe.hasOwnProperty(key)) { + if (model.recipe[key]) { + const m = model.recipe[key] as Recipe.IValue; + if ((state._map as Map).has(m.id)) { + + let v = (state._map as Map).get(m.id); + if (model.avoidSetpoint) + m.setpointHMI = undefined; + Object.assign(v, m); + } + else { (state._map as Map).set(m.id, m) + Vue.set(state.current, key, m); + } } } } @@ -75,15 +81,13 @@ export const recipeStore = { state.current[key].status.visible = true; } } - } - }, actions: { - async setCurrent(context, model: Recipe.IRecipe) { - context.commit("SetCurrent", model); + async setCurrent(context, model: Recipe.IRecipe, avoidSetpointHMI: boolean = false) { + context.commit("SetCurrent", { avoidSetpoint: avoidSetpointHMI, recipe: model }); var c = await CONFIGURATION; if (c.allUIVisible) context.commit("SetAllVisible") @@ -92,7 +96,6 @@ export const recipeStore = { setOverview(context, model: Overview.IOverview) { context.commit("SetOverview", model); }, - } as RecipeActions }