Add send_event to scripting API

This commit is contained in:
2025-08-20 15:18:55 +02:00
parent 795026b34e
commit 83a1ae739d
7 changed files with 452 additions and 8 deletions
+28 -1
View File
@@ -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);