Browse Source

耗材检查

master
sige 2 years ago
parent
commit
0dc0aa7971
  1. 10
      src/main/java/com/dreamworks/boditech/driver/consumable/CsmBufferTubeManager.java
  2. 9
      src/main/java/com/dreamworks/boditech/driver/consumable/CsmLargeBufferTubeManager.java
  3. 10
      src/main/java/com/dreamworks/boditech/driver/consumable/CsmPipetteTipManager.java
  4. 10
      src/main/java/com/dreamworks/boditech/driver/consumable/CsmTestCardManager.java
  5. 11
      src/main/java/com/dreamworks/boditech/service/DeviceService.java

10
src/main/java/com/dreamworks/boditech/driver/consumable/CsmBufferTubeManager.java

@ -99,4 +99,14 @@ public class CsmBufferTubeManager {
public Device getDevice() {
return this.device;
}
// check if all buffer tubes are used
public Boolean isEmpty() {
for ( CsmBufferTubeBox box : this.bufferTubeBoxes ) {
if ( 0 < box.tubeAmount ) {
return false;
}
}
return true;
}
}

9
src/main/java/com/dreamworks/boditech/driver/consumable/CsmLargeBufferTubeManager.java

@ -64,6 +64,15 @@ public class CsmLargeBufferTubeManager {
box.isLoaded = true;
}
// check if all large buffer tubes are used
public Boolean isEmpty() {
for ( CsmLargeBufferTube tube : this.largeBufferTubes ) {
if ( 0 < tube.amount ) {
return false;
}
}
return true;
}

10
src/main/java/com/dreamworks/boditech/driver/consumable/CsmPipetteTipManager.java

@ -50,4 +50,14 @@ public class CsmPipetteTipManager {
public Device getDevice() {
return this.device;
}
// check if all pipette tips are used
public Boolean isEmpty() {
for ( CsmPipetteTipBox box : this.pipetteTipBoxes ) {
if ( 0 < box.tipAmount ) {
return false;
}
}
return true;
}
}

10
src/main/java/com/dreamworks/boditech/driver/consumable/CsmTestCardManager.java

@ -108,4 +108,14 @@ public class CsmTestCardManager {
}
throw new RuntimeException("no test card available");
}
// check if all test cards are used
public Boolean isEmpty() {
for ( CsmTestCardBox box : this.testCardBoxes ) {
if ( 0 < box.cardAmount ) {
return false;
}
}
return true;
}
}

11
src/main/java/com/dreamworks/boditech/service/DeviceService.java

@ -86,6 +86,17 @@ public class DeviceService {
throw new RuntimeException("DEVICE_ALREADY_STARTED");
}
// @TODO : 后面要详细检查耗材
if ( !this.device.testCards.getIsLoaded() ) {
throw new RuntimeException("耗材未加载");
}
if (this.device.pipetteTips.isEmpty()
|| this.device.testCards.isEmpty()
|| this.device.bufferTubes.isEmpty()
|| this.device.largeBufferTubes.isEmpty()) {
throw new RuntimeException("耗材不足, 请检查耗材");
}
this.actionLog.log("device.start");
this.taskExecutor = new Executor(this.testService, this.device);
this.taskExecutorThread = new Thread(this.taskExecutor);

Loading…
Cancel
Save