Memory of last datamatrix in case puck detection is flickering during load.
This commit is contained in:
@@ -701,6 +701,9 @@ public class Controller {
|
||||
if (isDoorClosed()){
|
||||
return;
|
||||
}
|
||||
insertedPuckDatamatrix = null;
|
||||
removedPuck = null;
|
||||
|
||||
} else {
|
||||
Controller.getInstance().setLaserPos((Puck)null);
|
||||
}
|
||||
@@ -781,6 +784,7 @@ public class Controller {
|
||||
System.out.println("Detected Puck: " + datamatrix);
|
||||
onPuckScanned(datamatrix);
|
||||
}
|
||||
removedPuck = null;
|
||||
}
|
||||
|
||||
public void onSampleBarcode(String datamatrix) {
|
||||
@@ -808,19 +812,28 @@ public class Controller {
|
||||
currentDetection = detection;
|
||||
}
|
||||
}
|
||||
String insertedPuckDatamatrix;
|
||||
Puck removedPuck;
|
||||
|
||||
public void onPuckInserted(Puck puck) {
|
||||
playSound("mounted");
|
||||
String datamatrix = getMainFrame().getPuckDatamatrix();
|
||||
logPuckDetectionChange(puck, true);
|
||||
logPuckDetectionChange(puck, true);
|
||||
onPuckScanned(null);
|
||||
onPuckMounted(puck, datamatrix);
|
||||
if ((datamatrix==null) || (datamatrix.isBlank())){
|
||||
if (puck == removedPuck){
|
||||
datamatrix = insertedPuckDatamatrix;
|
||||
}
|
||||
}
|
||||
onPuckMounted(puck, datamatrix);
|
||||
insertedPuckDatamatrix = datamatrix;
|
||||
removedPuck = null;
|
||||
}
|
||||
|
||||
public void onPuckRemoved(Puck puck) {
|
||||
playSound("unmounted");
|
||||
logPuckDetectionChange(puck, false);
|
||||
onPuckUnmounted(puck);
|
||||
onPuckUnmounted(puck);
|
||||
}
|
||||
|
||||
void linkPuckDatamatrix(Puck puck, String datamatrix, boolean showMessage) {
|
||||
@@ -1021,6 +1034,7 @@ public class Controller {
|
||||
} else {
|
||||
linkPuckDatamatrix(puck, null, true);
|
||||
}
|
||||
removedPuck = puck;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user