Add send_event to scripting API
This commit is contained in:
@@ -965,7 +965,34 @@ public class Controller {
|
||||
try{
|
||||
showingPuckLoadingDialog = (dialogPuckLoading != null) && (dialogPuckLoading.isShowing());
|
||||
if ("loading".equals(Context.getSetting("puck_detection"))){
|
||||
puck_detection.setEnabled(showingPuckLoadingDialog);
|
||||
|
||||
if (showingPuckLoadingDialog){
|
||||
var werePresent = new ArrayList<String>();
|
||||
Puck[] pucks = basePlate.getPucks();
|
||||
for (Puck p : pucks){
|
||||
if (p.getDetection() == Puck.Detection.Present){
|
||||
werePresent.add(p.getName());
|
||||
}
|
||||
}
|
||||
puck_detection.applyCache();
|
||||
|
||||
|
||||
var present = new ArrayList<String>();
|
||||
for (Puck p : pucks){
|
||||
if (p.getDetection() == Puck.Detection.Present){
|
||||
present.add(p.getName());
|
||||
}
|
||||
}
|
||||
var removed = new ArrayList<>(werePresent);
|
||||
removed.removeAll(present);
|
||||
|
||||
if (removed.size()>0){
|
||||
PuckDetectionErrorDialog dlg = new PuckDetectionErrorDialog(mainFrame.getTopLevel());
|
||||
dlg.initialize(removed);
|
||||
dlg.setVisible(true);
|
||||
}
|
||||
}
|
||||
puck_detection.setEnabled(showingPuckLoadingDialog);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
|
||||
|
||||
Reference in New Issue
Block a user