Puck detetion mode - during loading only

This commit is contained in:
gac-S_Changer
2025-08-20 13:20:52 +02:00
parent 9b4179478b
commit 795026b34e
2 changed files with 115 additions and 110 deletions
+9 -8
View File
@@ -358,7 +358,7 @@ public class Controller {
} else {
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, "No puck_detection detected.");
}
checkEnablePuckDetection();
checkPuckLoading();
}
PuckState[] puckState;
@@ -959,12 +959,13 @@ public class Controller {
}
}
public void checkEnablePuckDetection(){
boolean showingPuckLoadingDialog;
public void checkPuckLoading(){
try{
if ("loading".equals(Context.getSetting("puck_detection"))){
boolean loading = (dialogPuckLoading != null) && (dialogPuckLoading.isShowing());
puck_detection.setEnabled(loading);
showingPuckLoadingDialog = (dialogPuckLoading != null) && (dialogPuckLoading.isShowing());
if ("loading".equals(Context.getSetting("puck_detection"))){
puck_detection.setEnabled(showingPuckLoadingDialog);
}
} catch (Exception ex) {
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
@@ -979,7 +980,7 @@ public class Controller {
dialogPuckLoading = new PuckLoadingDialog(mainFrame.getTopLevel(), load, false);
dialogPuckLoading.setLocationRelativeTo(mainFrame);
dialogPuckLoading.setVisible(true);
checkEnablePuckDetection();
checkPuckLoading();
dialogPuckLoading.addWindowListener(new WindowAdapter() {
@Override
@@ -992,7 +993,7 @@ public class Controller {
}
@Override
public void windowClosed(WindowEvent e) {
checkEnablePuckDetection();
checkPuckLoading();
}
});