headsproperty

This commit is contained in:
Alessandro Francia
2018-03-22 14:57:50 +01:00
parent f93c75cb86
commit f405fca15d
9 changed files with 894 additions and 853 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<ncConfig>
<ncVendor>SIEMENS</ncVendor> <!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI -->
<ncVendor>DEMO</ncVendor> <!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI -->
<showNcHMI>true</showNcHMI>
<ncIpAddress>192.168.157.2</ncIpAddress>
<ncPort>8080</ncPort>
+110 -110
View File
File diff suppressed because one or more lines are too long
+20 -20
View File
File diff suppressed because one or more lines are too long
+19 -19
View File
File diff suppressed because one or more lines are too long
+6 -6
View File
File diff suppressed because one or more lines are too long
+6 -6
View File
File diff suppressed because one or more lines are too long
+694 -688
View File
File diff suppressed because one or more lines are too long
+8 -2
View File
@@ -1,6 +1,6 @@
<template>
<div class="heads-container scrollable">
<head-std title="head1" process="1" v-for="h in heads" :key="h.id" ></head-std>
<head-std :title="getHeadsProperty(h.id)" process="1" v-for="h in heads" :key="h.id" ></head-std>
<!-- <head-std :percentage="40" :load="55" :tool=1 :rpm=160000 title="head2" process="1"></head-std>
<head-std :percentage="100" :load="65" :tool=2 title="head3" process="1"></head-std>
<head-std title="head4" :load="100" process="1"></head-std>
@@ -11,13 +11,19 @@
</template>
<script>
import { headStd, headAwj, headSpindle } from "./heads";
import { AppModel } from 'src/store';
import { AppModel, HeadsPropertyModel } from 'src/store';
export default {
components: { headStd, headAwj, headSpindle },
computed:{
heads: function(){
return (this.$store.state).machineInfo.heads;
}
}, methods:{
getHeadsProperty: function(id){
var variable = this.$store.getters.getHeadsProperty(id);
console.log(variable);
return variable;
}
}
};
</script>
+30 -1
View File
@@ -16,6 +16,16 @@ export interface SoftKeyModel {
Value: boolean
}
export interface HeadsPropertyModel {
id: number;
type: string;
inWarning: boolean;
inAlarm: boolean;
overrideEditable: boolean;
override: number;
process: number;
}
export interface MachineStatusModel {
powerOnAlarm: buttonStatus,
airPressureAlarm: buttonStatus,
@@ -32,6 +42,8 @@ export interface MachineStatusModel {
softKeys: Array<SoftKeyModel>,
headsProperty: Array<HeadsPropertyModel>,
resetAxes: boolean,
resetAxesProgress: number,
@@ -62,6 +74,7 @@ export interface MachineStatusActions {
setNcConnectionStatus(context, connected: boolean);
setSecurityFunction(context, securityFunctions: Array<signalr_security.securityFunction>);
setSoftKeyStatus(context, status: SoftKeyModel);
setHeadsProperty(context, status: HeadsPropertyModel);
}
export const machineStatusStore = {
@@ -82,7 +95,9 @@ export const machineStatusStore = {
softKeys: [],
_softKeys: new Map<number, SoftKeyModel>(),
headsProperty: [],
_headsProperty: new Map<number, HeadsPropertyModel>(),
resetAxes: false,
resetAxesProgress: 0,
@@ -110,6 +125,9 @@ export const machineStatusStore = {
},
getSoftKeyStatus: state => id =>{
return state._softKeys.get[id];
},
getHeadsProperty: state => id =>{
return state._headsProperty.get[id];
}
},
mutations: {
@@ -132,6 +150,14 @@ export const machineStatusStore = {
store._softKeys[model.Id] = model;
store.softKeys = Array.from(store._softKeys.values());
},
SetHeadsProperty(store, model: HeadsPropertyModel){
if(!store._headsProperty.has(model.id))
store._headsProperty.set(model.id, model);
else
store._headsProperty[model.id] = model;
store.headsProperty = Array.from(store._headsProperty.values());
}
},
actions: {
@@ -228,6 +254,9 @@ export const machineStatusStore = {
setSoftKeyStatus(context, status: SoftKeyModel) {
context.commit("SetSoftKeyStatus", status);
},
setHeadsProperty(context, status: HeadsPropertyModel){
context.commit("SetHeadsProperty",status);
}
} as MachineStatusActions
}