mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-29 02:21:41 +00:00
Rename to PhotonVision
This commit is contained in:
14
photon-client/src/store/modules/cameraSettings.js
Normal file
14
photon-client/src/store/modules/cameraSettings.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export default {
|
||||
state: {
|
||||
calibration: [],
|
||||
fov: 0,
|
||||
resolution: 0,
|
||||
streamDivisor: 0,
|
||||
tilt: 0
|
||||
},
|
||||
getters: {
|
||||
cameraSettings: state => {
|
||||
return state
|
||||
}
|
||||
}
|
||||
}
|
||||
10
photon-client/src/store/modules/generalSettings.js
Normal file
10
photon-client/src/store/modules/generalSettings.js
Normal file
@@ -0,0 +1,10 @@
|
||||
export default {
|
||||
state:{
|
||||
teamNumber: 1577,
|
||||
connectionType: 0,
|
||||
ip: "",
|
||||
gateway: "",
|
||||
netmask: "",
|
||||
hostname: "chameleon-vision"
|
||||
}
|
||||
}
|
||||
45
photon-client/src/store/modules/pipeline.js
Normal file
45
photon-client/src/store/modules/pipeline.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
export default {
|
||||
state: {
|
||||
exposure: 0,
|
||||
brightness: 0,
|
||||
gain: 0,
|
||||
rotationMode: 0,
|
||||
hue: [0, 15],
|
||||
saturation: [0, 15],
|
||||
value: [0, 25],
|
||||
erode: false,
|
||||
dilate: false,
|
||||
area: [0, 12],
|
||||
ratio: [0, 12],
|
||||
extent: [0, 12],
|
||||
speckle: 5,
|
||||
targetGrouping: 0,
|
||||
targetIntersection: 0,
|
||||
sortMode: 0,
|
||||
multiple: false,
|
||||
isBinary: 0,
|
||||
calibrationMode: 0,
|
||||
videoModeIndex: 0,
|
||||
streamDivisor: 0,
|
||||
is3D: false,
|
||||
targetRegion: 0,
|
||||
targetOrientation: 1
|
||||
},
|
||||
mutations: {
|
||||
isBinary: (state, value) => {
|
||||
state.isBinary = value
|
||||
},
|
||||
mutatePipeline: (state, {key, value}) => {
|
||||
Vue.set(state, key, value)
|
||||
}
|
||||
|
||||
},
|
||||
actions: {},
|
||||
getters: {
|
||||
pipeline: state => {
|
||||
return state
|
||||
}
|
||||
}
|
||||
};
|
||||
72
photon-client/src/store/modules/undoRedo.js
Normal file
72
photon-client/src/store/modules/undoRedo.js
Normal file
@@ -0,0 +1,72 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import Vue from 'vue'
|
||||
|
||||
export default {
|
||||
state: {
|
||||
done: [],
|
||||
undone: [],
|
||||
newMutation: true
|
||||
},
|
||||
mutations: {
|
||||
updatePipeline: (state, val) => {
|
||||
state.done.push(val)
|
||||
if (state.newMutation) {
|
||||
state.undone = []
|
||||
}
|
||||
},
|
||||
addUndone: (state, val) => {
|
||||
state.undone.push(val);
|
||||
},
|
||||
removeLastDone: state => {
|
||||
state.done.pop()
|
||||
},
|
||||
removeLastUnDone: state => {
|
||||
state.undone.pop()
|
||||
},
|
||||
updateStatus: (state, bool) => {
|
||||
state.newMutation = bool;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
undo: (context, {vm}) => {
|
||||
let commit = context.getters.lastDone;
|
||||
context.commit('removeLastDone')
|
||||
context.commit('updateStatus', false)
|
||||
for (let key in commit) {
|
||||
if (commit.hasOwnProperty(key)) {
|
||||
context.commit('addUndone', {[key]: context.getters["pipeline"][key]});
|
||||
context.commit('mutatePipeline', {'key': key, 'value': commit[key]});
|
||||
vm.handleInput(key, commit[key]);
|
||||
}
|
||||
}
|
||||
context.commit('updateStatus', true)
|
||||
},
|
||||
redo: (context, {vm}) => {
|
||||
let commit = context.getters.lastUnDone;
|
||||
context.commit('removeLastUnDone');
|
||||
context.commit('updateStatus', false)
|
||||
for (let key in commit) {
|
||||
if (commit.hasOwnProperty(key)) {
|
||||
context.commit('mutatePipeline', {'key': key, 'value': commit[key]});
|
||||
vm.handleInput(key, commit[key]);
|
||||
}
|
||||
}
|
||||
context.commit('updateStatus', true)
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
lastDone: state => {
|
||||
return state.done[state.done.length - 1]
|
||||
},
|
||||
lastUnDone: state => {
|
||||
return state.undone[state.undone.length - 1]
|
||||
},
|
||||
canUndo: state => {
|
||||
return state.done.length
|
||||
},
|
||||
canRedo: state => {
|
||||
return state.undone.length
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user