|
|
@ -6,6 +6,15 @@ import java.util.List; |
|
|
|
public class ResHeatingTubeRackSlot { |
|
|
|
// logger |
|
|
|
public static final Logger LOG = LoggerFactory.getLogger(ResHeatingTubeRackSlot.class); |
|
|
|
// tube status empty |
|
|
|
public static final String TUBE_STATUS_EMPTY = "empty"; |
|
|
|
// tube status used |
|
|
|
public static final String TUBE_STATUS_USED = "used"; |
|
|
|
// tube rack location liquid plate |
|
|
|
public static final String LOCATION_LIQUID_PLATE = "LIQUID_PLATE"; |
|
|
|
// tube rack location heat plate |
|
|
|
public static final String LOCATION_HEAT_PLATE = "HEAT_PLATE"; |
|
|
|
|
|
|
|
// index of slot |
|
|
|
public final Integer index; |
|
|
|
// dest temperature |
|
|
@ -41,6 +50,9 @@ public class ResHeatingTubeRackSlot { |
|
|
|
this.index = index; |
|
|
|
this.manager = manager; |
|
|
|
this.tubeStatusList = new ArrayList<>(); |
|
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
|
this.tubeStatusList.add(TUBE_STATUS_EMPTY); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// get is slot locked |
|
|
@ -61,8 +73,9 @@ public class ResHeatingTubeRackSlot { |
|
|
|
// setup as error slot |
|
|
|
public void setupAsErrorSlot() { |
|
|
|
this.isErrorSlot = true; |
|
|
|
this.tubeStatusList.clear(); |
|
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
|
this.tubeStatusList.add("empty"); |
|
|
|
this.tubeStatusList.add(TUBE_STATUS_EMPTY); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -70,7 +83,7 @@ public class ResHeatingTubeRackSlot { |
|
|
|
public List<Integer> allocEmptyTubeIndexes( Integer count ) { |
|
|
|
List<Integer> indexes = new ArrayList<>(); |
|
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
|
if ( "empty".equals(this.tubeStatusList.get(i)) && indexes.size() < count ) { |
|
|
|
if ( TUBE_STATUS_EMPTY.equals(this.tubeStatusList.get(i)) && indexes.size() < count ) { |
|
|
|
indexes.add(i); |
|
|
|
} |
|
|
|
} |
|
|
@ -78,8 +91,18 @@ public class ResHeatingTubeRackSlot { |
|
|
|
throw new RuntimeException("No enough empty tube"); |
|
|
|
} |
|
|
|
for ( var index : indexes ) { |
|
|
|
this.tubeStatusList.set(index, "used"); |
|
|
|
this.tubeStatusList.set(index, TUBE_STATUS_USED); |
|
|
|
} |
|
|
|
return indexes; |
|
|
|
} |
|
|
|
|
|
|
|
// set tube status |
|
|
|
public void setTubeStatus( Integer index, String status ) { |
|
|
|
this.tubeStatusList.set(index, status); |
|
|
|
} |
|
|
|
|
|
|
|
// get tube status |
|
|
|
public String getTubeStatus( Integer index ) { |
|
|
|
return this.tubeStatusList.get(index); |
|
|
|
} |
|
|
|
} |