fixed remove pipeline

This commit is contained in:
Unknown
2019-11-28 13:42:53 +02:00
parent 6ae0f0c127
commit 922bceda3e
2 changed files with 11 additions and 12 deletions

View File

@@ -269,6 +269,9 @@ public class VisionProcess {
addPipeline(new CVPipeline2d((CVPipeline2dSettings) settings));
}
}
public void deletePipeline(int index){
pipelines.remove(index);
}
public CameraCapture getCamera() {
return cameraCapture;

View File

@@ -105,19 +105,15 @@ public class SocketHandler {
sendFullSettings();
VisionManager.saveCurrentCameraPipelines();
break;
// TODO: (HIGH) this never worked before, re-visit now that VisionProcess is written sanely
case "deleteCurrentPipeline":
// int currentIndex = currentProcess.getCurrentPipelineIndex();
// int nextIndex;
// if (currentIndex == currentProcess.getPipelines().size() - 1) {
// nextIndex = currentIndex - 1;
// } else {
// nextIndex = currentIndex;
// }
// cam.deletePipeline();
// cam.setCurrentPipelineIndex(nextIndex);
// sendFullSettings();
// VisionManager.saveCurrentCameraPipelines();
int currentIndex = currentProcess.getCurrentPipelineIndex();
if (currentIndex == currentProcess.getPipelines().size() - 1) {
currentProcess.setPipeline(currentIndex -1, false);
}
currentProcess.deletePipeline(currentIndex);
sendFullSettings();
VisionManager.saveCurrentCameraPipelines();
// TODO remove pipeline file after deleting
break;
case "save":
ConfigManager.saveGeneralSettings();