Puck detetion mode - during loading only
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user