Filter disabled pucks from free list

This commit is contained in:
gac-S_Changer
2025-01-09 15:15:56 +01:00
parent 41936ef6f7
commit 80c828036d
2 changed files with 4 additions and 2 deletions

View File

@@ -411,8 +411,8 @@ public class Controller {
public List<Puck> getFreePucks() {
List<Puck> ret = new ArrayList<>();
for (Puck p : basePlate.getPucks()) {
if (p.getDetection() == Detection.Empty ) {
for (Puck p : basePlate.getPucks()) {
if (!p.isDisabled() && (p.getDetection() == Detection.Empty )) {
ret.add(p);
}
}

View File

@@ -382,6 +382,7 @@ public class Puck extends DeviceBase {
return (getSegment() - new Character('A')) * BasePlate.numberOfPucksPerSegments + getNumber() - 1;
}
/*
boolean enabled;
public boolean isEnabled() {
@@ -391,6 +392,7 @@ public class Puck extends DeviceBase {
public void setEnabled(boolean value) {
enabled = value;
}
*/
public enum Detection {
Empty,