|
@ -41,17 +41,20 @@ public class ResHeatingTubeRackSlot { |
|
|
public String taskUuid; |
|
|
public String taskUuid; |
|
|
// manager |
|
|
// manager |
|
|
private final ResHeatingTubeRackSlotManager manager; |
|
|
private final ResHeatingTubeRackSlotManager manager; |
|
|
// tube status list |
|
|
|
|
|
private final List<String> tubeStatusList; |
|
|
|
|
|
|
|
|
// tube rack location |
|
|
|
|
|
private final List<ResHeatingTubeRackTubeSlot> tubes; |
|
|
|
|
|
|
|
|
// constructor |
|
|
// constructor |
|
|
public ResHeatingTubeRackSlot( ResHeatingTubeRackSlotManager manager, Integer index ) { |
|
|
public ResHeatingTubeRackSlot( ResHeatingTubeRackSlotManager manager, Integer index ) { |
|
|
this.isLocked = false; |
|
|
this.isLocked = false; |
|
|
this.index = index; |
|
|
this.index = index; |
|
|
this.manager = manager; |
|
|
this.manager = manager; |
|
|
this.tubeStatusList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.tubes = new ArrayList<>(); |
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
this.tubeStatusList.add(TUBE_STATUS_EMPTY); |
|
|
|
|
|
|
|
|
var tube = new ResHeatingTubeRackTubeSlot(); |
|
|
|
|
|
tube.setHasTube(false); |
|
|
|
|
|
this.tubes.add(tube); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -74,9 +77,11 @@ public class ResHeatingTubeRackSlot { |
|
|
// setup as error slot |
|
|
// setup as error slot |
|
|
public void setupAsErrorSlot() { |
|
|
public void setupAsErrorSlot() { |
|
|
this.isErrorSlot = true; |
|
|
this.isErrorSlot = true; |
|
|
this.tubeStatusList.clear(); |
|
|
|
|
|
|
|
|
this.tubes.clear(); |
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
this.tubeStatusList.add(TUBE_STATUS_EMPTY); |
|
|
|
|
|
|
|
|
var tube = new ResHeatingTubeRackTubeSlot(); |
|
|
|
|
|
tube.setHasTube(false); |
|
|
|
|
|
this.tubes.add(tube); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -84,7 +89,7 @@ public class ResHeatingTubeRackSlot { |
|
|
public List<Integer> allocEmptyTubeIndexes( Integer count ) { |
|
|
public List<Integer> allocEmptyTubeIndexes( Integer count ) { |
|
|
List<Integer> indexes = new ArrayList<>(); |
|
|
List<Integer> indexes = new ArrayList<>(); |
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
for ( int i = 0; i < 16; i++ ) { |
|
|
if ( TUBE_STATUS_EMPTY.equals(this.tubeStatusList.get(i)) && indexes.size() < count ) { |
|
|
|
|
|
|
|
|
if ( !this.tubes.get(i).getHasTube() && indexes.size() < count ) { |
|
|
indexes.add(i); |
|
|
indexes.add(i); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -92,23 +97,18 @@ public class ResHeatingTubeRackSlot { |
|
|
throw new RuntimeException("异常处理区试管空位不足"); |
|
|
throw new RuntimeException("异常处理区试管空位不足"); |
|
|
} |
|
|
} |
|
|
for ( var index : indexes ) { |
|
|
for ( var index : indexes ) { |
|
|
this.tubeStatusList.set(index, TUBE_STATUS_USED); |
|
|
|
|
|
|
|
|
this.tubes.get(index).setHasTube(true); |
|
|
} |
|
|
} |
|
|
return indexes; |
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// set rack position |
|
|
// set rack position |
|
|
public void setRackPosition(String rackPosition) { |
|
|
public void setRackPosition(String rackPosition) { |
|
|
this.rackPosition = rackPosition; |
|
|
this.rackPosition = rackPosition; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// get tubes |
|
|
|
|
|
public List<ResHeatingTubeRackTubeSlot> getTubes() { |
|
|
|
|
|
return tubes; |
|
|
|
|
|
} |
|
|
} |
|
|
} |