From 9bdcb6ef1453648cc99e90055a5a6d6df1d92155 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 5 Feb 2021 14:39:24 +0100 Subject: [PATCH 01/12] preparazione a signalr --- .../wwwroot/src/modules/app-footer.ts | 14 ++++---- .../wwwroot/src/store/underTheHood.store.ts | 32 +++++++++++++++++++ 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/Thermo.Active/wwwroot/src/modules/app-footer.ts b/Thermo.Active/wwwroot/src/modules/app-footer.ts index eb7b1b8f..795d1dfb 100644 --- a/Thermo.Active/wwwroot/src/modules/app-footer.ts +++ b/Thermo.Active/wwwroot/src/modules/app-footer.ts @@ -39,14 +39,14 @@ export default class AppFooter extends Vue { openProgram(path: string) { this.$router.push(path); - //appModelActions.MainViewLiftDown(this.$store); + appModelActions.MainViewLiftDown(this.$store); } isInPath(value: string) { return this.$route.path.indexOf(value) >= 0; } - isInMainPage(){ + isInMainPage() { return this.$route.path == "/"; } @@ -76,11 +76,11 @@ export default class AppFooter extends Vue { async runManual() { ModalHelper.AskConfirm(this.$options.filters.localize("modal_confirm_title", "Richiesta di conferma"), - this.$options.filters.localize("modal_confirm_mode_manual", "Confermi di voler passare alla modalità manuale?"), - () => { - prodService.Manual(); - }, null, "modal"); - + this.$options.filters.localize("modal_confirm_mode_manual", "Confermi di voler passare alla modalità manuale?"), + () => { + prodService.Manual(); + }, null, "modal"); + } async runAuto() { diff --git a/Thermo.Active/wwwroot/src/store/underTheHood.store.ts b/Thermo.Active/wwwroot/src/store/underTheHood.store.ts index 295ad04e..836333f7 100644 --- a/Thermo.Active/wwwroot/src/store/underTheHood.store.ts +++ b/Thermo.Active/wwwroot/src/store/underTheHood.store.ts @@ -4,6 +4,7 @@ import { CONFIGURATION } from "@/config"; export interface UnderTheHoodStoreModel { ioChannels: server.channels; ioChannelsConfig: { [id: string]: number[] } + _channels: Map> } @@ -20,6 +21,7 @@ export const underTheHoodStore = { state: { ioChannels: {}, ioChannelsConfig: {}, + _channels: new Map>() } as UnderTheHoodStoreModel, getters: { @@ -29,10 +31,37 @@ export const underTheHoodStore = { SetIOChannels(state: UnderTheHoodStoreModel, model: server.channels) { state.ioChannels = model; + + // reset maps for fast updating + state._channels = new Map>() + for (const key in model) { + if (Object.prototype.hasOwnProperty.call(model, key)) { + const element = model[key]; + state._channels.set(key, new Map()); + + let g = state._channels.get(key); + for (const item of element) { + g.set(item.id, item); + } + } + } }, SetIOChannelsConfig(state: UnderTheHoodStoreModel, model: { [id: string]: number[] }) { state.ioChannelsConfig = model; }, + UpdateIOChannels(state: UnderTheHoodStoreModel, model: server.channels) { + for (const key in model) { + + let g = state._channels.get(key); + + const values = model[key]; + for (const item of values) { + + let v = g.get(item.id); + Object.assign(v, item); + } + } + } }, actions: { @@ -43,6 +72,9 @@ export const underTheHoodStore = { async SetIOChannelsConfig(context, model: { [id: string]: number[] }) { context.commit("SetIOChannelsConfig", model); }, + async UpdateIOChannels(context, model: server.channels) { + context.commit("UpdateIOChannels", model); + } } as UnderTheHoodActions } From ee6fc599d83f217a0a3d88f56d684da40d9010a7 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 5 Feb 2021 14:44:26 +0100 Subject: [PATCH 02/12] signalr per channels IO --- Thermo.Active/wwwroot/src/services/hub.ts | 7 ++++++- Thermo.Active/wwwroot/src/store/underTheHood.store.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Thermo.Active/wwwroot/src/services/hub.ts b/Thermo.Active/wwwroot/src/services/hub.ts index 707753f0..f4581892 100644 --- a/Thermo.Active/wwwroot/src/services/hub.ts +++ b/Thermo.Active/wwwroot/src/services/hub.ts @@ -29,6 +29,7 @@ import { recipeService } from "./recipeService"; import { warmersActions, warmersStore } from "@/store/warmers.store"; import { cmsConnectActions } from "@/store/cmsConnect.store"; import { warmersService } from "./warmersService"; +import { underTheHoodActions } from "@/store/underTheHood.store"; declare const PRODUCTION; @@ -120,6 +121,7 @@ export class Hub { this._hub.client.prodCycleData = Hub.prodCycleData; this._hub.client.gaugeData = Hub.gaugeData; this._hub.client.axisInfo = Hub.axisInfoData; + this._hub.client.channelsIoVal = Hub.channelsIOUpdate; @@ -160,6 +162,9 @@ export class Hub { } + public static channelsIOUpdate(data: server.channels) { + underTheHoodActions.UpdateIOChannels(store, data); + } public cmsConnectUpdateActivationData(authData) { cmsConnectActions.updateActivationData(store, authData); @@ -195,7 +200,7 @@ export class Hub { recipeActions.setCurrent(store, data, true); } - public static warmersData(data){ + public static warmersData(data) { warmersActions.setChannels(store, data as { [id: number]: Warmers.IChannel }); } diff --git a/Thermo.Active/wwwroot/src/store/underTheHood.store.ts b/Thermo.Active/wwwroot/src/store/underTheHood.store.ts index 836333f7..38a3a2be 100644 --- a/Thermo.Active/wwwroot/src/store/underTheHood.store.ts +++ b/Thermo.Active/wwwroot/src/store/underTheHood.store.ts @@ -11,6 +11,7 @@ export interface UnderTheHoodStoreModel { export interface UnderTheHoodActions { SetIOChannels(context, model: server.channels) SetIOChannelsConfig(context, model: { [id: string]: number[] }) + UpdateIOChannels(context, model: server.channels) } export interface UnderTheHoodGetters { From 617802ddf6e26b45d0d1aa8e4cbbcfb642ed9a10 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 5 Feb 2021 14:47:17 +0100 Subject: [PATCH 03/12] fix layout --- .../src/app_modules_thermo/sotto-cofano/sotto-cofano.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/sotto-cofano/sotto-cofano.less b/Thermo.Active/wwwroot/src/app_modules_thermo/sotto-cofano/sotto-cofano.less index 5bf8d024..0d75fcae 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/sotto-cofano/sotto-cofano.less +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/sotto-cofano/sotto-cofano.less @@ -137,12 +137,12 @@ background-color: @fill-under-grey-2-2; display: grid; > table { - margin: 20px 0 0 20px + margin: 20px 0 0 20px; } } .one-column-table-container { - height: 800px; + height: 750px; margin: 20px 0 0 20px; > table { width: -webkit-fill-available; From ba6894e15dc66ff904c28597433076fafd13f9a2 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 5 Feb 2021 15:24:29 +0100 Subject: [PATCH 04/12] fix rimozione "main-container" nei file innestati di background --- .../log-ciclo-automatico/log-ciclo-automatico.vue | 8 +++----- .../components/log-misurazioni/log-misurazioni.vue | 8 +++----- .../log-misurazioni-table/log-misurazioni-table.less | 4 +--- .../Riscaldi/components/riscaldi/riscaldi.vue | 8 +++----- .../sotto-cofano/menu-sx/menu-sx.less | 11 +++++++---- .../sotto-cofano/menu-sx/menu-sx.vue | 2 +- 6 files changed, 18 insertions(+), 23 deletions(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/sotto-cofano/LogCicloAutomatico/components/log-ciclo-automatico/log-ciclo-automatico.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/sotto-cofano/LogCicloAutomatico/components/log-ciclo-automatico/log-ciclo-automatico.vue index c85e3931..9b0acc50 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/sotto-cofano/LogCicloAutomatico/components/log-ciclo-automatico/log-ciclo-automatico.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/sotto-cofano/LogCicloAutomatico/components/log-ciclo-automatico/log-ciclo-automatico.vue @@ -1,9 +1,7 @@