This commit is contained in:
voulot_d
2017-01-13 15:58:33 +01:00
parent 67e6862dca
commit 818a0d6bc9
5 changed files with 84 additions and 276 deletions

View File

@@ -468,6 +468,9 @@ public class ScreenPanel extends Panel {
return (Integer) state.get("run");
}
}
Thread tcomboScreen;
Thread tcomboFilter;
void setCamera(String cameraName) throws IOException, InterruptedException {
System.out.println("Setting camera: " + cameraName + " [" + (buttonCamtool.isSelected() ? "camtool" : "direct") + "]");
@@ -493,6 +496,14 @@ public class ScreenPanel extends Panel {
renderer.removeOverlays(userOv);
renderer.clear();
renderer.resetZoom();
if ((tcomboScreen!=null) && (tcomboScreen.isAlive())){
tcomboScreen.interrupt();
}
if ((tcomboFilter!=null) && (tcomboFilter.isAlive())){
tcomboFilter.interrupt();
}
if (screen != null) {
screen.close();
@@ -504,7 +515,7 @@ public class ScreenPanel extends Panel {
}
//Parallelizing initialization
Thread tcomboScreen = new Thread(() -> {
tcomboScreen = new Thread(() -> {
try {
screen = new DiscretePositioner("CurrentScreen", cameraName + ":SET_SCREEN1_POS", cameraName + ":GET_SCREEN1_POS");
screen.initialize();
@@ -525,7 +536,7 @@ public class ScreenPanel extends Panel {
});
tcomboScreen.start();
Thread tcomboFilter = new Thread(() -> {
tcomboFilter = new Thread(() -> {
try {
filter = new DiscretePositioner("CurrentFilter", cameraName + ":SET_FILTER", cameraName + ":GET_FILTER");
filter.initialize();