client deafult language fix
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
@@ -3,11 +3,11 @@ import { ModalHelper } from "./modules/base-components";
|
||||
import { machineService } from "src/services/machineService";
|
||||
import { LoginService } from "src/services/loginService";
|
||||
|
||||
import { store, AppModel, MachineStatusModel, machineStatusActions, localizationModelActions } from "src/store";
|
||||
import { store, AppModel, MachineStatusModel, machineStatusActions, localizationModelActions, machineInfoActions } from "src/store";
|
||||
|
||||
import { UserInfoDialog, MachineInfoDialog, AxesCalibration } from "./app.modules";
|
||||
import { AreaModel } from "src/store/machineStatus.store";
|
||||
import { machineInfoActions } from "src/store/machineInfo.store";
|
||||
|
||||
import Login from "src/modules/login";
|
||||
|
||||
declare let cmsClient: any;
|
||||
@@ -53,6 +53,8 @@ async function loadMachineConfig() {
|
||||
default: machineInfoActions.updateMachineInfo(store, { isSiemens: false, isFanuc: false, isOsai: false, defaultLanguage: mcresult.defaultLanguage }); break;
|
||||
}
|
||||
|
||||
machineInfoActions.updateMachineInfo(store, { clientDefaultLanguage: mcresult.defaultLanguage });
|
||||
|
||||
// load default language
|
||||
if ((store.state as AppModel).localization.currentLanguage == "")
|
||||
localizationModelActions.changeCurrentLanguage(store, mcresult.defaultLanguage);
|
||||
@@ -91,13 +93,13 @@ if (typeof cmsClient != "undefined") {
|
||||
ShowHmi()
|
||||
});
|
||||
|
||||
Factory.Get(MessageService).subscribeToChannel("HMI-hide", args => {
|
||||
Factory.Get(MessageService).subscribeToChannel("HMI-hide", args => {
|
||||
clearTimeout(HMIshowTimeout);
|
||||
if (args[0] > 0)
|
||||
HMIshowTimeout = setTimeout(HideHmi, args[0]);
|
||||
else
|
||||
HideHmi()
|
||||
|
||||
|
||||
});
|
||||
|
||||
Factory.Get(MessageService).subscribeToChannel("HMI-show-alarms", args => {
|
||||
@@ -146,33 +148,33 @@ if (typeof cmsClient != "undefined") {
|
||||
HMIDraggingTimeout = setTimeout(stopDrag, args[0]);
|
||||
else
|
||||
stopDrag()
|
||||
});
|
||||
|
||||
|
||||
/* Factory.Get(MessageService).subscribeToChannel("HMI-end-render", args => {
|
||||
clearTimeout(RerenderInterval);
|
||||
RerenderInterval = setTimeout(ElaborateHMIStatus, 15);
|
||||
}); */
|
||||
|
||||
});
|
||||
|
||||
|
||||
/* Factory.Get(MessageService).subscribeToChannel("HMI-end-render", args => {
|
||||
clearTimeout(RerenderInterval);
|
||||
RerenderInterval = setTimeout(ElaborateHMIStatus, 15);
|
||||
}); */
|
||||
|
||||
}
|
||||
|
||||
//Private functions for HMI State (show-functions):
|
||||
/**
|
||||
//Private functions for HMI State (show-functions):
|
||||
/**
|
||||
* 1) Show HMI
|
||||
* */
|
||||
function ShowHmi() {
|
||||
HMIvisible = true;
|
||||
function ShowHmi() {
|
||||
HMIvisible = true;
|
||||
ElaborateHMIStatus();
|
||||
}
|
||||
function hideAlarms(){
|
||||
function hideAlarms() {
|
||||
HMIAlarmsVisible = false;
|
||||
ElaborateHMIStatus();
|
||||
}
|
||||
function hideModal(){
|
||||
function hideModal() {
|
||||
HMIModalsVisible = false;
|
||||
ElaborateHMIStatus();
|
||||
}
|
||||
function stopDrag(){
|
||||
function stopDrag() {
|
||||
HMIDragging = false;
|
||||
ElaborateHMIStatus();
|
||||
}
|
||||
@@ -184,31 +186,30 @@ function stopDrag(){
|
||||
* 3) Hide HMI
|
||||
* */
|
||||
function HideHmi() {
|
||||
HMIvisible = false;
|
||||
HMIvisible = false;
|
||||
ElaborateHMIStatus();
|
||||
//Factory.Get(MessageService).publishToChannel("HMI-start-render");
|
||||
//Factory.Get(MessageService).publishToChannel("HMI-start-render");
|
||||
}
|
||||
function showAlarms() {
|
||||
HMIAlarmsVisible = true;
|
||||
ElaborateHMIStatus();
|
||||
//Factory.Get(MessageService).publishToChannel("HMI-start-render");
|
||||
//Factory.Get(MessageService).publishToChannel("HMI-start-render");
|
||||
}
|
||||
function showModal() {
|
||||
HMIModalsVisible = true;
|
||||
ElaborateHMIStatus();
|
||||
//Factory.Get(MessageService).publishToChannel("HMI-start-render");
|
||||
//Factory.Get(MessageService).publishToChannel("HMI-start-render");
|
||||
}
|
||||
function startDrag() {
|
||||
HMIDragging = true;
|
||||
ElaborateHMIStatus();
|
||||
//Factory.Get(MessageService).publishToChannel("HMI-start-render");
|
||||
//Factory.Get(MessageService).publishToChannel("HMI-start-render");
|
||||
}
|
||||
|
||||
//Private function for elaborate status
|
||||
function ElaborateHMIStatus(){
|
||||
if(!HMIvisible)
|
||||
{
|
||||
if(HMIScreenshotInterval)
|
||||
function ElaborateHMIStatus() {
|
||||
if (!HMIvisible) {
|
||||
if (HMIScreenshotInterval)
|
||||
clearInterval(HMIScreenshotInterval);
|
||||
cmsClient.setNcWindowState(0);
|
||||
}
|
||||
@@ -217,8 +218,7 @@ function ElaborateHMIStatus(){
|
||||
clearInterval(HMIScreenshotInterval);
|
||||
cmsClient.setNcWindowState(1);
|
||||
}
|
||||
else if(HMIvisible && (HMIAlarmsVisible || HMIModalsVisible || HMIDragging))
|
||||
{
|
||||
cmsClient.setNcWindowState(0);
|
||||
else if (HMIvisible && (HMIAlarmsVisible || HMIModalsVisible || HMIDragging)) {
|
||||
cmsClient.setNcWindowState(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ const _store = {
|
||||
if (userinfo)
|
||||
localizationModelActions.changeCurrentLanguage(context, userinfo.language);
|
||||
else
|
||||
localizationModelActions.changeCurrentLanguage(context, (context.state as AppModel).machineInfo.defaultLanguage);
|
||||
localizationModelActions.changeCurrentLanguage(context, (context.state as AppModel).machineInfo.defaultLanguage || (context.state as AppModel).machineInfo.clientDefaultLanguage);
|
||||
},
|
||||
CheckLogoff(context, userid) {
|
||||
if ((context.state as AppModel).currentUser.id == userid)
|
||||
|
||||
@@ -17,7 +17,8 @@ export interface MachineInfoModel {
|
||||
isFanuc?: boolean,
|
||||
isOsai?: boolean,
|
||||
|
||||
defaultLanguage?: string
|
||||
defaultLanguage?: string,
|
||||
clientDefaultLanguage?: string
|
||||
}
|
||||
|
||||
export interface MachineInfoActions {
|
||||
@@ -46,7 +47,8 @@ export const machineInfoStore = {
|
||||
isSiemens: false,
|
||||
isFanuc: false,
|
||||
isOsai: false,
|
||||
defaultLanguage: "en"
|
||||
defaultLanguage: "en",
|
||||
clientDefaultLanguage: "en"
|
||||
|
||||
} as MachineInfoModel,
|
||||
mutations: {
|
||||
|
||||
Reference in New Issue
Block a user