|
|
@ -1,4 +1,5 @@ |
|
|
|
package com.iflytop.a800.device; |
|
|
|
import com.iflytop.a800.resource.BufferTube; |
|
|
|
import com.iflytop.uf.UfActuatorCmdExecutor; |
|
|
|
import com.iflytop.uf.UfCmdSnippetExecutor; |
|
|
|
import com.iflytop.uf.model.UfMdbOption; |
|
|
@ -18,10 +19,9 @@ public class Pipette { |
|
|
|
|
|
|
|
// |
|
|
|
public Pipette() { |
|
|
|
// @TODO : 删除下面三行,测试用 |
|
|
|
this.tipAmountList.add(0); |
|
|
|
this.tipAmountList.add(120-29); |
|
|
|
this.tipAmountList.add(120); |
|
|
|
this.tipAmountList.add(0); |
|
|
|
this.tipAmountList.add(0); |
|
|
|
} |
|
|
|
|
|
|
|
// set tip amount |
|
|
@ -114,4 +114,27 @@ public class Pipette { |
|
|
|
} |
|
|
|
return existsCount > 1; |
|
|
|
} |
|
|
|
|
|
|
|
// move to given position |
|
|
|
public void dispense( BufferTube tube ) { |
|
|
|
if ( !this.hasTip ) { |
|
|
|
throw new RuntimeException("Pipette has no tip"); |
|
|
|
} |
|
|
|
|
|
|
|
Integer startX = UfMdbOption.getInteger(String.format("%sZoneStartX.%d", tube.type, tube.zoneIndex)); |
|
|
|
Integer startY = UfMdbOption.getInteger(String.format("%sZoneStartY.%d", tube.type, tube.zoneIndex)); |
|
|
|
Integer distanceX = UfMdbOption.getInteger(String.format("%sDistanceX", tube.type)); |
|
|
|
Integer distanceY = UfMdbOption.getInteger(String.format("%sDistanceY", tube.type)); |
|
|
|
Integer indexX = tube.tubeIndex % 5; |
|
|
|
Integer indexY = tube.tubeIndex / 5; |
|
|
|
Integer tubeX = startX + indexX * distanceX; |
|
|
|
Integer tubeY = startY + indexY * distanceY; |
|
|
|
Map<String,Object> dispenseParams = Map.of("tubeX", tubeX, "tubeY", tubeY); |
|
|
|
|
|
|
|
String snippetKey = "SampleReactionAtDetectionTube"; |
|
|
|
if ( "BufferTube".equals(tube.type) ) { |
|
|
|
snippetKey = "SampleReactionAtBufferTube"; |
|
|
|
} |
|
|
|
UfCmdSnippetExecutor.execute(snippetKey, dispenseParams); |
|
|
|
} |
|
|
|
} |