Ottimizzazione Frontend
This commit is contained in:
@@ -326,6 +326,10 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
lastSetpointHmiInvalid = currMessage;
|
||||
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
|
||||
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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -130,8 +130,6 @@ export default class Dashboard extends Vue {
|
||||
}
|
||||
|
||||
async mounted() {
|
||||
prodService.GetProdPanel();
|
||||
|
||||
let $this = this;
|
||||
setInterval(() => {
|
||||
$this.now = moment();
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user