mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-26 01:51:40 +00:00
added client structure handling for all message types
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user