mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-24 01:31:44 +00:00
Replace with stripped down NT4 client Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>
54 lines
1.9 KiB
JavaScript
54 lines
1.9 KiB
JavaScript
export const dataHandleMixin = {
|
|
methods: {
|
|
handleInput(key, value) {
|
|
let msg = this.$msgPack.encode({[key]: value});
|
|
this.$store.state.websocket.ws.send(msg);
|
|
},
|
|
handleInputWithIndex(key, value, cameraIndex = this.$store.getters.currentCameraIndex) {
|
|
let msg = this.$msgPack.encode({
|
|
[key]: value,
|
|
["cameraIndex"]: cameraIndex,
|
|
});
|
|
this.$store.state.websocket.ws.send(msg);
|
|
},
|
|
handleData(val) {
|
|
this.handleInput(val, this[val]);
|
|
this.$emit('update')
|
|
},
|
|
handlePipelineData(val) {
|
|
let msg = this.$msgPack.encode({
|
|
["changePipelineSetting"]: {
|
|
[val]: this[val],
|
|
["cameraIndex"]: this.$store.getters.currentCameraIndex
|
|
}
|
|
});
|
|
this.$store.state.websocket.ws.send(msg);
|
|
this.$emit('update')
|
|
},
|
|
handlePipelineUpdate(key, val) {
|
|
let msg = this.$msgPack.encode({
|
|
["changePipelineSetting"]: {
|
|
[key]: val,
|
|
["cameraIndex"]: this.$store.getters.currentCameraIndex
|
|
}
|
|
});
|
|
this.$store.state.websocket.ws.send(msg);
|
|
this.$emit('update')
|
|
},
|
|
handleTruthyPipelineData(val) {
|
|
let msg = this.$msgPack.encode({
|
|
["changePipelineSetting"]: {
|
|
[val]: !!(this[val]),
|
|
["cameraIndex"]: this.$store.getters.currentCameraIndex
|
|
}
|
|
});
|
|
this.$store.state.websocket.ws.send(msg);
|
|
this.$emit('update')
|
|
},
|
|
rollback(val, e) {
|
|
//TODO UPDATE VALUES INTO WEBSOCKET
|
|
this.$store.commit('updatePipeline', {[val]: e})
|
|
}
|
|
}
|
|
};
|