Files
PhotonVision/chameleon-client/src/store.js

116 lines
3.3 KiB
JavaScript
Raw Normal View History

2019-03-26 22:01:10 +02:00
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);
const set = key => (state,val) =>{
state[key] = val
};
2019-03-26 22:01:10 +02:00
export const store = new Vuex.Store({
state:{
2019-03-26 22:28:58 +02:00
//header
curr_camera:"",
curr_pipeline:"",
cameraList:[],
pipelineList:[],
2019-03-26 22:28:58 +02:00
//input
2019-03-27 23:12:15 +02:00
exposure:54,
2019-03-26 22:01:10 +02:00
brightness:0,
orientation:0,
resolution:0,
resolutionList:[],
2019-08-09 02:21:52 -07:00
FOV:0,
2019-03-26 22:28:58 +02:00
//threshold
hue:[0,10],
saturation:[0,10],
value:[0,10],
erode: false,
dilate: false,
//contours
area:[0,100],
2019-07-17 22:05:31 -07:00
ratio:[0,20],
2019-04-23 14:42:51 -07:00
extent:[0,100],
2019-07-13 13:45:33 -07:00
sort_mode:'Largest', //
target_group:'Single', //
target_intersection:'Up', //
2019-04-23 14:42:51 -07:00
//Settings
2019-08-09 02:21:52 -07:00
team_number:0,
connection_type:"DHCP",
ip:0,
gateWay:0,
2019-08-09 02:21:52 -07:00
hostname:"",
2019-04-26 17:12:49 +03:00
//live info
port:1181,
2019-07-19 01:40:06 -07:00
is_binary:0,
2019-08-09 05:27:08 -07:00
//points
raw_point:[],
point:{}
2019-03-26 22:01:10 +02:00
},
mutations:{
curr_camera (state,value){
state['curr_camera'] = value;
state['pipeline'] = "0";
},
curr_pipeline: set('curr_pipeline'),
2019-03-26 22:01:10 +02:00
brightness: set('brightness'),
exposure: set('exposure'),
orientation:set('orientation'),
2019-03-26 22:28:58 +02:00
resolution: set('resolution'),
hue: set('hue'),
saturation: set('saturation'),
value: set('value'),
erode: set('erode'),
dilate: set('dilate'),
area: set('area'),
ratio: set('ratio'),
2019-04-23 14:42:51 -07:00
extent: set('extent'),
2019-08-09 02:21:52 -07:00
team_number: set('team_number'),
connection_type: set('connection_type'),
ip: set('ip'),
2019-05-01 19:57:03 +03:00
gateWay : set('gateway'),
2019-08-09 02:21:52 -07:00
hostname : set('hostname'),
2019-07-19 01:40:06 -07:00
is_binary: set('is_binary'),
2019-05-01 19:46:22 +03:00
cameraList : set('cameraList'),
2019-07-13 13:45:33 -07:00
pipelineList: set('piplineList'),
sort_mode: set('sort_mode'),
target_group:set('target_group'),
2019-08-09 02:21:52 -07:00
target_intersection:set('target_intersection'),
FOV:set('FOV'),
2019-08-09 05:27:08 -07:00
port:set('port'),
raw_point:set('raw_point'),
point:set('point')
2019-03-26 22:01:10 +02:00
},
getters:{
curr_camera: state => state.curr_camera,
curr_pipeline: state => state.curr_pipeline,
2019-03-26 22:01:10 +02:00
brightness: state => state.brightness,
exposure: state => state.exposure,
orientation: state => state.orientation,
2019-03-26 22:28:58 +02:00
resolution: state => state.resolution,
hue: state => state.hue,
saturation: state => state.saturation,
value: state => state.value,
erode: state => state.dilate,
dilate: state => state.dilate,
area: state =>state.area,
ratio: state =>state.ratio,
2019-04-23 14:42:51 -07:00
extent: state =>state.extent,
2019-08-09 02:21:52 -07:00
team_number: state => state.teamValue,
connection_type: state => state.connectionType,
ip: state => state.ip,
gateWay: state => state.gateWay,
2019-08-09 02:21:52 -07:00
hostname: state => state.hostName,
2019-07-19 01:40:06 -07:00
is_binary: state => state.is_binary,
2019-05-01 19:46:22 +03:00
cameraList: state => state.cameraList,
2019-07-13 13:45:33 -07:00
pipelineList: state => state.pipelineList,
sort_mode: state => state.sort_mode,
target_group: state => state.target_group,
2019-08-09 02:21:52 -07:00
target_intersection: state => state.target_intersection,
FOV: state => state.FOV,
2019-08-09 05:27:08 -07:00
port: state => state.port,
raw_point:state => state.raw_point,
point: state => state.point
2019-03-26 22:01:10 +02:00
},
});