|
|
@ -40,34 +40,33 @@ public class LiquidAdditionInstance { |
|
|
|
public void addLiquidToTubes(List<Integer> tubes, List<Integer> pumpIndexes, int volume ) { |
|
|
|
var pumpGroupOutIndex = pumpIndexes.get(0); |
|
|
|
var pumpGroupInIndex = pumpIndexes.get(1); |
|
|
|
var type = liquids.get(pumpGroupOutIndex/2).type; |
|
|
|
var rotateDistance = this.convertVolumeToPumpRotationDistance(type, volume); |
|
|
|
|
|
|
|
for ( int batchIndex=0; batchIndex<4; batchIndex++ ) { |
|
|
|
// 外圈 |
|
|
|
UfCmdSnippetExecutor.execute("LiquidAdditionPrepare.Out." + batchIndex); |
|
|
|
if ( this.checkTubeExists("GOUT", batchIndex, "TOUT", tubes) ) { |
|
|
|
UfCmdSnippetExecutor.execute( |
|
|
|
"LiquidAdditionPump" + pumpGroupOutIndex, |
|
|
|
Map.of("volume", volume) |
|
|
|
); |
|
|
|
var snippetKey = "LiquidAdditionPump." + pumpGroupOutIndex; |
|
|
|
Map<String,Object> snippetParams = Map.of("volume", rotateDistance); |
|
|
|
UfCmdSnippetExecutor.execute(snippetKey, snippetParams); |
|
|
|
} |
|
|
|
if ( this.checkTubeExists("GOUT", batchIndex, "TIN", tubes) ) { |
|
|
|
UfCmdSnippetExecutor.execute( |
|
|
|
"LiquidAdditionPump" + pumpGroupInIndex, |
|
|
|
Map.of("volume", volume) |
|
|
|
); |
|
|
|
var snippetKey = "LiquidAdditionPump." + pumpGroupInIndex; |
|
|
|
Map<String,Object> snippetParams = Map.of("volume", rotateDistance); |
|
|
|
UfCmdSnippetExecutor.execute(snippetKey, snippetParams); |
|
|
|
} |
|
|
|
|
|
|
|
// 内圈 |
|
|
|
UfCmdSnippetExecutor.execute("LiquidAdditionPrepare.In." + batchIndex); |
|
|
|
if ( this.checkTubeExists("GIN", batchIndex, "TOUT", tubes) ) { |
|
|
|
UfCmdSnippetExecutor.execute( |
|
|
|
"LiquidAdditionPump" + pumpGroupOutIndex, |
|
|
|
Map.of("volume", volume) |
|
|
|
); |
|
|
|
var snippetKey = "LiquidAdditionPump." + pumpGroupOutIndex; |
|
|
|
Map<String,Object> snippetParams = Map.of("volume", rotateDistance); |
|
|
|
UfCmdSnippetExecutor.execute(snippetKey, snippetParams); |
|
|
|
} |
|
|
|
if ( this.checkTubeExists("GIN", batchIndex, "TIN", tubes) ) { |
|
|
|
UfCmdSnippetExecutor.execute( |
|
|
|
"LiquidAdditionPump" + pumpGroupInIndex, |
|
|
|
Map.of("volume", volume) |
|
|
|
); |
|
|
|
var snippetKey = "LiquidAdditionPump." + pumpGroupInIndex; |
|
|
|
Map<String,Object> snippetParams = Map.of("volume", rotateDistance); |
|
|
|
UfCmdSnippetExecutor.execute(snippetKey, snippetParams); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -80,6 +79,14 @@ public class LiquidAdditionInstance { |
|
|
|
this.addLiquidToTubes(tubes, pumpIndexes, volume); |
|
|
|
} |
|
|
|
|
|
|
|
// 转换体积为蠕动泵旋转距离 |
|
|
|
private Integer convertVolumeToPumpRotationDistance( String type, int volume ) { |
|
|
|
var oneCirclePulse = 100; |
|
|
|
var volumePerCircle = UfMdbOption.getDouble(String.format("PumpVolumePerCircle.%s",type), 1.0); |
|
|
|
var circleCount = (int) (volume / volumePerCircle); |
|
|
|
return circleCount * oneCirclePulse; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查试管是否存在 |
|
|
|
private Boolean checkTubeExists(String groupType, Integer batchIndex, String slotType, List<Integer> tubes) { |
|
|
|
var slotIndexes = Map.of( |
|
|
|