fix e gestione aree

This commit is contained in:
Paolo Possanzini
2018-01-16 18:08:46 +01:00
parent b557022195
commit be1e491ad9
8 changed files with 35 additions and 26 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -5
View File
File diff suppressed because one or more lines are too long
+4 -2
View File
@@ -16,8 +16,10 @@ messageService.subscribeToChannel("show-machine-info", () => { ModalHelper.ShowM
messageService.subscribeToChannel("show-axes-calibration", () => { ModalHelper.ShowModal(AxesCalibration); });
// Load default languages
Factory.Get(LocalizationService).init();
// carica le lingue
new LocalizationService().init();
// setta la lingua di default
//
async function loadMachineConfig() {
+7 -7
View File
@@ -2,13 +2,13 @@ import { Home, TestLoader, TestEmpty, TestHeader } from "./app.modules";
export let routes = [
{ path: "", component: Home, name: "home", meta: { title: "Step - Dashboard" } },
{ path: "/production", meta: { title: "Step - Production" } },
{ path: "/tools", meta: { title: "Step - Tools" } },
{ path: "/report", meta: { title: "Step - Reports" } },
{ path: "/alarms", meta: { title: "Step - Alarms" } },
{ path: "/maintenance", meta: { title: "Step - Maintenance" } },
{ path: "/utility", meta: { title: "Step - Utility" } },
{ path: "/scada" },
{ path: "/production", meta: { title: "Step - Production", area: "production" } },
{ path: "/tooling", meta: { title: "Step - Tools", area: "tooling" } },
{ path: "/report", meta: { title: "Step - Reports", area: "report" } },
{ path: "/alarms", meta: { title: "Step - Alarms", area: "alarms" } },
{ path: "/maintenance", meta: { title: "Step - Maintenance", area: "maintenance" } },
{ path: "/utilities", meta: { title: "Step - Utility", area: "utilities" } },
{ path: "/scada", meta: { title: "", area: "scada" } },
{ path: "/test/loader", component: TestLoader, name: "testloader" },
{ path: "/test/empty", component: TestEmpty, name: "testloader" },
{ path: "/test/header", component: TestHeader, name: "testHeader" }
+7 -1
View File
@@ -1,6 +1,7 @@
import Vue from "vue";
import Component from "vue-class-component";
import { appModelActions } from "src/store";
import { appModelActions, store, machineStatusActions } from "src/store";
@Component({ name: "app-footer" })
export default class AppFooter extends Vue {
@@ -23,6 +24,11 @@ export default class AppFooter extends Vue {
return this.$route.path.indexOf(value) >= 0;
}
isAreaEnabled(areaname: string){
debugger
return machineStatusActions.isAreaEnabled(store, areaname);
}
get isFanuc():boolean{
return this.$store.state.machineInfo.isFanuc;
}
+7 -7
View File
@@ -2,13 +2,13 @@
<footer>
<div class="container">
<button @click="openProgram('/production')" class="oval main-production" :class="{ big:isInPath('production') && !state.isMainViewLiftedUp}"> </button>
<button @click="openProgram('/tools')" class="oval tools-manager" :class="{ big:isInPath('tools') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/report')" class="oval report-manager" :class="{ big:isInPath('report') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/alarms')" class="oval alarms-manager" :class="{ big:isInPath('alarms') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/maintenance')" class="oval maintenance-manager" :class="{ big:isInPath('maintenance') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/utilities')" class="oval utilities" :class="{ big:isInPath('utilities') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/test/header')" class="oval scada" :class="{ big:isInPath('/test/header') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/production')" v-if="isAreaEnabled('production')" class="oval main-production" :class="{ big:isInPath('production') && !state.isMainViewLiftedUp}"> </button>
<button @click="openProgram('/tooling')" v-if="isAreaEnabled('tooling')" class="oval tools-manager" :class="{ big:isInPath('tooling') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/report')" v-if="isAreaEnabled('report')" class="oval report-manager" :class="{ big:isInPath('report') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/alarms')" v-if="isAreaEnabled('alarms')" class="oval alarms-manager" :class="{ big:isInPath('alarms') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/maintenance')" v-if="isAreaEnabled('maintenance')" class="oval maintenance-manager" :class="{ big:isInPath('maintenance') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/utilities')" v-if="isAreaEnabled('utilities')" class="oval utilities" :class="{ big:isInPath('utilities') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/test/header')" v-if="isAreaEnabled('scada')" class="oval scada" :class="{ big:isInPath('/test/header') && !state.isMainViewLiftedUp}"></button>
</div>
<div class="machine-area">
<button class="under" @click="toggleMainView()" :class="{'pressed':state.isMainViewLiftedUp}">
@@ -15,8 +15,7 @@ export class LocalizationService extends baseRestService {
let state = store.state as AppModel;
// preload all default language labels
await this.getLabels(state.localization.currentLanguage)
localizationModelActions.changeCurrentLanguage(store,state.localization.currentLanguage );
}
public async getLanguages() {
@@ -116,9 +116,11 @@ export const machineStatusStore = {
if (areaconfig.hasOwnProperty(key)) {
const config = areaconfig[key];
if(config && config.name && confirm.name == areaname)
if(config && config.name && config.name == areaname)
{
if(inBrowser) return config.allowExternalBrowser && config.enabled;
return config.enabled;
}
}
}