diff --git a/Thermo.Active/Listeners/SignalR/SignalRListener.cs b/Thermo.Active/Listeners/SignalR/SignalRListener.cs index 41ec6578..089dfaa4 100644 --- a/Thermo.Active/Listeners/SignalR/SignalRListener.cs +++ b/Thermo.Active/Listeners/SignalR/SignalRListener.cs @@ -326,6 +326,10 @@ namespace Thermo.Active.Listeners.SignalR lastSetpointHmiInvalid = currMessage; var context = GlobalHost.ConnectionManager.GetHubContext(); context.Clients.Group("ncData").setpointHmiInvalid(currMessage); + + context.Clients.Group("ncData").recipeFullDataInvalidSetpoint(LastRecipeFullData); + context.Clients.Group("ncData").warmersData(LastWarmersData); + } } @@ -686,7 +690,7 @@ namespace Thermo.Active.Listeners.SignalR // Send THERMO Recipe data group.recipeFullData(LastRecipeFullData); group.recipeOverData(LastRecipeOverData); - group.setpointHmiInvalid(); + // Send THERMO Modules data group.modulesData(LastModulesData); // Send THERMO Warmers data @@ -696,6 +700,8 @@ namespace Thermo.Active.Listeners.SignalR group.gaugeData(LastLiveProdData); // THERMO prod info data group.prodInfoData(LastProdInfoData); + + group.prodPanelData(LastProdPanelData); // THERMO prod cycle data group.prodCycleData(LastProdCycleData); diff --git a/Thermo.Active/wwwroot/src/app.business-logic.ts b/Thermo.Active/wwwroot/src/app.business-logic.ts index aea533a4..68361993 100644 --- a/Thermo.Active/wwwroot/src/app.business-logic.ts +++ b/Thermo.Active/wwwroot/src/app.business-logic.ts @@ -12,6 +12,7 @@ import { loginService, machineService, localizationService } from "./services"; import { prodService } from "./services/prodService"; import * as iziToast from "izitoast"; import { underTheHoodService } from "./services/underTheHoodService"; +import { warmersService } from "./services/warmersService"; // import { UsersService } from "./services/usersService"; @@ -60,19 +61,16 @@ async function loadMachineConfig() { await loginService.getUserInfo(); - try { let machine = new machineService(); let result = await machine.getAreasConfiguration(); machineStatusActions.setAreasConfg(store, result); let mcresult = await machine.getMachineConfiguration(); + await underTheHoodService.getChannelsConfig(); + await warmersService.GetResistances(); machineStatusActions.setWarmersParameters(store, mcresult.additionalParameters); - await prodService.GetProdPanel(); - - await underTheHoodService.getChannels(); - await underTheHoodService.getChannelsConfig(); // load default language if (!(store.state as AppModel).localization.currentLanguage) { diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts index c231648c..5abebe43 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts @@ -130,8 +130,6 @@ export default class Dashboard extends Vue { } async mounted() { - prodService.GetProdPanel(); - let $this = this; setInterval(() => { $this.now = moment(); diff --git a/Thermo.Active/wwwroot/src/main.ts b/Thermo.Active/wwwroot/src/main.ts index f4dd6bd1..9ccc048d 100644 --- a/Thermo.Active/wwwroot/src/main.ts +++ b/Thermo.Active/wwwroot/src/main.ts @@ -24,12 +24,6 @@ import "./app.business-logic"; import "./app.modules"; import { messageService } from "src/_base"; -import { warmersService } from "./services/warmersService"; -warmersService.GetChannels(); -warmersService.GetResistances(); -import { prodService } from "./services/prodService"; -prodService.GetProd(); - const App = () => import("./App.vue"); diff --git a/Thermo.Active/wwwroot/src/services/hub.ts b/Thermo.Active/wwwroot/src/services/hub.ts index 7ffaa307..c5dc8d53 100644 --- a/Thermo.Active/wwwroot/src/services/hub.ts +++ b/Thermo.Active/wwwroot/src/services/hub.ts @@ -113,6 +113,7 @@ export class Hub { // qui i NUOVI metodi NUOVI dal server (Recipe, gauges) da completare lato HUB this._hub.client.recipeFullData = Hub.recipeFullData; + this._hub.client.recipeFullDataInvalidSetpoint = Hub.recipeFullDataInvalidSetpoint; this._hub.client.warmersData = Hub.warmersData; this._hub.client.setpointHmiInvalid = Hub.setpointHmiInvalid; this._hub.client.recipeOverData = Hub.recipeOverData; @@ -201,14 +202,17 @@ export class Hub { recipeActions.setCurrent(store, data, true); } + + public static recipeFullDataInvalidSetpoint(data) { + recipeActions.setCurrent(store, data, false); + } + public static warmersData(data) { warmersActions.setChannels(store, data as { [id: number]: Warmers.IChannel }); } public static async setpointHmiInvalid(data) { if (data) { - await recipeService.GetCurrent(); - await warmersService.GetChannels(); await warmersService.GetThermocameraStatus(); // await recipeService.GetOverview(); } @@ -231,11 +235,14 @@ export class Hub { prodActions.setProd(store, data); } + + public updateAuthToken() { // Set or update authorization token let authData = JSON.parse(window.localStorage.getItem("authorizationData") || window.sessionStorage.getItem("authorizationData")) as AuthToken; $.connection.hub.qs = {}; + console.log(authData); if (authData) $.connection.hub.qs.Authorization = authData.access_token; @@ -243,6 +250,7 @@ export class Hub { $.connection.hub.qs.CmsClientId = cmsClient.getClientID; } + private logout(e) { if (e) appModelActions.CheckLogoff(store, e.id);