|
|
@ -7,14 +7,39 @@ import java.util.List; |
|
|
|
public class CsmPipetteTipManager { |
|
|
|
// device instance |
|
|
|
private Device device; |
|
|
|
// list of test cards |
|
|
|
private final List<CsmPipetteTip> pipetteTips = new ArrayList<>(); |
|
|
|
// pipetteTipBoxes |
|
|
|
private final List<CsmPipetteTipBox> pipetteTipBoxes = new ArrayList<>(); |
|
|
|
|
|
|
|
// constructor |
|
|
|
public CsmPipetteTipManager(Device device) { |
|
|
|
this.device = device; |
|
|
|
|
|
|
|
// @TODO : 测试数据 |
|
|
|
for ( int i=0; i<3; i++ ) { |
|
|
|
CsmPipetteTipBox box = new CsmPipetteTipBox(); |
|
|
|
box.tipAmount = 120; |
|
|
|
box.position = i; |
|
|
|
this.pipetteTipBoxes.add(box); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void updateByBox( ParamPipetteTipUpdate param ) { |
|
|
|
CsmPipetteTipBox box = this.pipetteTipBoxes.get(param.index); |
|
|
|
box.tipAmount = param.tipAmount; |
|
|
|
} |
|
|
|
|
|
|
|
// get all pipette tips |
|
|
|
public List<CsmPipetteTipBox> getAll() { |
|
|
|
return this.pipetteTipBoxes; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// list of test cards |
|
|
|
private final List<CsmPipetteTip> pipetteTips = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get device |
|
|
|
public Device getDevice() { |
|
|
|
return this.device; |
|
|
@ -33,23 +58,23 @@ public class CsmPipetteTipManager { |
|
|
|
return this.pipetteTips.remove(0); |
|
|
|
} |
|
|
|
|
|
|
|
// append pipette tip by box code |
|
|
|
public void update(ParamPipetteTipUpdate param ) { |
|
|
|
if ( 120 < param.amount || 0 > param.amount ) { |
|
|
|
throw new RuntimeException("invalid amount " + param.amount); |
|
|
|
} |
|
|
|
|
|
|
|
// delete all pipette tips with matched areaIndex |
|
|
|
this.pipetteTips.removeIf(pipetteTip -> pipetteTip.areaIndex.equals(param.areaIndex)); |
|
|
|
|
|
|
|
// append new pipette tips |
|
|
|
for ( int i=0; i<param.amount; i++ ) { |
|
|
|
CsmPipetteTip pipetteTip = new CsmPipetteTip(this); |
|
|
|
pipetteTip.areaIndex = param.areaIndex; |
|
|
|
pipetteTip.position = i; |
|
|
|
this.pipetteTips.add(pipetteTip); |
|
|
|
} |
|
|
|
} |
|
|
|
// // append pipette tip by box code |
|
|
|
// public void update(ParamPipetteTipUpdate param ) { |
|
|
|
// if ( 120 < param.amount || 0 > param.amount ) { |
|
|
|
// throw new RuntimeException("invalid amount " + param.amount); |
|
|
|
// } |
|
|
|
// |
|
|
|
// // delete all pipette tips with matched areaIndex |
|
|
|
// this.pipetteTips.removeIf(pipetteTip -> pipetteTip.areaIndex.equals(param.areaIndex)); |
|
|
|
// |
|
|
|
// // append new pipette tips |
|
|
|
// for ( int i=0; i<param.amount; i++ ) { |
|
|
|
// CsmPipetteTip pipetteTip = new CsmPipetteTip(this); |
|
|
|
// pipetteTip.areaIndex = param.areaIndex; |
|
|
|
// pipetteTip.position = i; |
|
|
|
// this.pipetteTips.add(pipetteTip); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// append pipette tip |
|
|
|
public void append( Integer areaIndex, Integer amount ) { |
|
|
@ -61,8 +86,5 @@ public class CsmPipetteTipManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// get all pipette tips |
|
|
|
public List<CsmPipetteTip> getAll() { |
|
|
|
return this.pipetteTips; |
|
|
|
} |
|
|
|
|
|
|
|
} |