added client structure handling for all message types

This commit is contained in:
ori agranat
2019-10-12 16:58:32 +03:00
parent 16d15070d3
commit 276e425183
3 changed files with 18 additions and 19 deletions

View File

@@ -32,9 +32,17 @@ export default {
},
methods:{
handleMessage(key,value){
switch(key){
default:{
this.$store.commit(key,value);
if(this.$store.state.hasOwnProperty(key)){
this.$store.commit(key,value);
} else if(this.$store.state.pipeline.hasOwnProperty(key)){
this.$store.commit('setPipeValues',{[key]:value});
}
else{
switch(key){
default:{
console.log(key + " : " + value);
}
}
}
}

View File

@@ -4,7 +4,8 @@ import Vuex from 'vuex'
Vue.use(Vuex)
const set = key => (state,val) =>{
state[key] = val
// state[key] = val
Vue.set(state,key,val);
};
export default new Vuex.Store({
@@ -59,5 +60,10 @@ export default new Vuex.Store({
cameraList: state =>state.cameraList,
pipelinelist: state =>state.pipelinelist,
point: state =>state.point,
setPipeValues(state,obj){
for(let i in obj){
Vue.set(state.pipeline,i,obj[i]);
}
}
}
})

View File

@@ -129,41 +129,26 @@ import CVicon from '../components/cv-icon'
currentCameraIndex:{
get(){
return this.$store.state.currentCameraIndex;
},
set(value){
this.$store.commit('currentCameraIndex',value);
}
},
currentPipelineIndex:{
get(){
return this.$store.state.currentPipelineIndex;
},
set(value){
this.$store.commit('currentPipelineIndex',value);
}
},
cameraList:{
get(){
return this.$store.state.cameraList;
},
set(value){
this.$store.commit('cameraList',value);
}
},
pipelineList:{
get(){
return this.$store.state.pipelinelist;
},
set(value){
this.$store.commit('pipelinelist',value);
}
},
pipeline:{
get(){
return this.$store.state.pipeline;
},
set(value){
this.$store.commit('pipeline',value);
}
},
steamAdress: {