diff --git a/New client/chameleon-client/src/App.vue b/New client/chameleon-client/src/App.vue index 6c5494e4b..e7eb67e95 100644 --- a/New client/chameleon-client/src/App.vue +++ b/New client/chameleon-client/src/App.vue @@ -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); + } } } } diff --git a/New client/chameleon-client/src/store.js b/New client/chameleon-client/src/store.js index 1b4c7e6a7..147d48653 100644 --- a/New client/chameleon-client/src/store.js +++ b/New client/chameleon-client/src/store.js @@ -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]); + } + } } }) diff --git a/New client/chameleon-client/src/views/Camera.vue b/New client/chameleon-client/src/views/Camera.vue index 283fb3dfc..f0426f47f 100644 --- a/New client/chameleon-client/src/views/Camera.vue +++ b/New client/chameleon-client/src/views/Camera.vue @@ -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: {