Puck detection dialog is maximized

This commit is contained in:
gac-S_Changer
2026-03-25 11:02:53 +01:00
parent 652ea5352e
commit a31418e0bf
3 changed files with 23 additions and 13 deletions
+11 -1
View File
@@ -58,6 +58,8 @@ import javax.swing.table.DefaultTableModel;
public class Controller {
final boolean DIALOG_PUCK_LOAD_SHOW_BASEPLATE = true;
final int REMOVE_PUCK_TIMEOUT = 20000;
static Controller instance;
final BasePlate basePlate;
RoomTemperatureBasePlate roomTemperatureBasePlate;
@@ -923,9 +925,15 @@ public class Controller {
playSound("mounted");
logPuckDetectionChange(puck, true);
onPuckScanned(null);
//If no new puck is scanned and detected mounted in the same place of the last unmount,
//considers the detection is flickering (up to a timeout)
if ((datamatrix==null) || (datamatrix.isBlank())){
if (puck == removedPuck){
datamatrix = insertedPuckDatamatrix;
if ((System.currentTimeMillis() - removeTimestamp) < REMOVE_PUCK_TIMEOUT){
datamatrix = insertedPuckDatamatrix;
}
} else {
removedPuck = null;
}
}
@@ -945,6 +953,7 @@ public class Controller {
removedPuck = null;
}
long removeTimestamp;
//Called when a puck is detected removed from the the dewar
public void onPuckUnmounted(Puck puck) {
Logger.getLogger(Controller.class.getName()).info("Unmounted puck: " + puck.getName());
@@ -956,6 +965,7 @@ public class Controller {
dialogPuckLoading.onPuckUnmounted(puck);
}
removedPuck = puck;
removeTimestamp = System.currentTimeMillis();
}
public boolean hasLoadDialog(){