mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
Make pipeline index rollback work with multiple cameras
This commit is contained in:
@@ -145,7 +145,7 @@ import Logs from "./views/LogsView"
|
|||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
// Used so that we can switch back to the previously selected pipeline after camera calibration
|
// Used so that we can switch back to the previously selected pipeline after camera calibration
|
||||||
previouslySelectedIndex: undefined,
|
previouslySelectedIndices: [],
|
||||||
timer: undefined,
|
timer: undefined,
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
@@ -240,15 +240,23 @@ import Logs from "./views/LogsView"
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
switchToDriverMode() {
|
switchToDriverMode() {
|
||||||
this.previouslySelectedIndex = this.$store.getters.currentPipelineIndex;
|
if (!this.previouslySelectedIndices) this.previouslySelectedIndices = [];
|
||||||
this.handleInputWithIndex('currentPipeline', -1)
|
|
||||||
},
|
for (const [i, cameraSettings] of this.$store.state.cameraSettings.entries()) {
|
||||||
rollbackPipelineIndex() {
|
this.previouslySelectedIndices[i] = cameraSettings.currentPipelineIndex;
|
||||||
if (this.previouslySelectedIndex !== null) {
|
this.handleInputWithIndex('currentPipeline', -1, i);
|
||||||
this.handleInputWithIndex('currentPipeline', this.previouslySelectedIndex || 0);
|
|
||||||
}
|
}
|
||||||
this.previouslySelectedIndex = null;
|
|
||||||
},
|
},
|
||||||
|
rollbackPipelineIndex()
|
||||||
|
{
|
||||||
|
if (this.previouslySelectedIndices !== null) {
|
||||||
|
for (const [i] of this.$store.state.cameraSettings.entries()) {
|
||||||
|
this.handleInputWithIndex('currentPipeline', this.previouslySelectedIndices[i] || 0, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.previouslySelectedIndices = null;
|
||||||
|
}
|
||||||
|
,
|
||||||
switchToSettingsTab() {
|
switchToSettingsTab() {
|
||||||
this.axios.post('http://' + this.$address + '/api/sendMetrics', {})
|
this.axios.post('http://' + this.$address + '/api/sendMetrics', {})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ export const dataHandleMixin = {
|
|||||||
let msg = this.$msgPack.encode({[key]: value});
|
let msg = this.$msgPack.encode({[key]: value});
|
||||||
this.$socket.send(msg);
|
this.$socket.send(msg);
|
||||||
},
|
},
|
||||||
handleInputWithIndex(key, value) {
|
handleInputWithIndex(key, value, cameraIndex = this.$store.getters.currentCameraIndex) {
|
||||||
let msg = this.$msgPack.encode({
|
let msg = this.$msgPack.encode({
|
||||||
[key]: value,
|
[key]: value,
|
||||||
["cameraIndex"]: this.$store.getters.currentCameraIndex
|
["cameraIndex"]: cameraIndex,
|
||||||
});
|
});
|
||||||
this.$socket.send(msg);
|
this.$socket.send(msg);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user