|
@ -1,6 +1,7 @@ |
|
|
package a8k.service.hardware; |
|
|
package a8k.service.hardware; |
|
|
|
|
|
|
|
|
import a8k.appbean.HardwareException; |
|
|
import a8k.appbean.HardwareException; |
|
|
|
|
|
import a8k.appbean.PlateBoxCh; |
|
|
import a8k.appbean.cfg.*; |
|
|
import a8k.appbean.cfg.*; |
|
|
import a8k.appbean.ecode.AppRet; |
|
|
import a8k.appbean.ecode.AppRet; |
|
|
import a8k.canbus.A8kCanBusService; |
|
|
import a8k.canbus.A8kCanBusService; |
|
@ -284,7 +285,7 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
throw new HardwareException(A8kEcode.ParamOutOfRange); |
|
|
throw new HardwareException(A8kEcode.ParamOutOfRange); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (index > TipPickUpPosInfo.ROW_MAX * TipPickUpPosInfo.COL_MAX || index < 0) { |
|
|
|
|
|
|
|
|
if (index > TipPickUpPosInfo.cgetTipNum() || index < 0) { |
|
|
throw new HardwareException(A8kEcode.ParamOutOfRange); |
|
|
throw new HardwareException(A8kEcode.ParamOutOfRange); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -337,13 +338,44 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
return AppRet.success(canBus.stepMotorReadPosByMoveToZeroBlock(MId.PipetteModZM, getActionOvertime())); |
|
|
return AppRet.success(canBus.stepMotorReadPosByMoveToZeroBlock(MId.PipetteModZM, getActionOvertime())); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
|
|
|
// hbot移动到并扫码 |
|
|
|
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
|
|
|
|
|
|
|
|
|
private AppRet<String> hBotMoveToAndScan(Pos2d pos) throws HardwareException, InterruptedException { |
|
|
|
|
|
hbotCheckAndMoveTo(pos); |
|
|
|
|
|
canBus.codeScanerStartScan(MId.PipetteModCodeScanner); |
|
|
|
|
|
String result = canBus.codeScanerWaittingForResult(MId.PipetteModCodeScanner, getScancodeOvertime()); |
|
|
|
|
|
return AppRet.success(result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//扫描板夹仓二维码 |
|
|
|
|
|
public AppRet<String> scanPlatesCode(PlateBoxCh ch) throws HardwareException, InterruptedException { |
|
|
|
|
|
var posInfo = getPlates2dCodeScanPosInfo(); |
|
|
|
|
|
return hBotMoveToAndScan(new Pos2d(posInfo.ch0ScanPos.x, posInfo.ch0ScanPos.y + posInfo.scanYSpacing * ch.off)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//扫描小缓冲液二维码 |
|
|
|
|
|
public AppRet<String> scanSmallBottleBufferCode(Integer group) { |
|
|
|
|
|
var posInfo = getSmallBottleBufferPosInfo(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//扫描大缓冲液二维码 |
|
|
|
|
|
public String scanBigBottleBufferCode(Integer index) { |
|
|
|
|
|
return ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
// 测试 |
|
|
// 测试 |
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
Boolean testTakeTipFlag; |
|
|
Boolean testTakeTipFlag; |
|
|
|
|
|
|
|
|
private AppRet<Boolean> takeTipTestStep(Integer groupId, Integer index) throws HardwareException, InterruptedException { |
|
|
|
|
|
|
|
|
@HardwareServiceAction(name = "取放Tip", group = "测试脚本") |
|
|
|
|
|
public AppRet<Boolean> takeTipTestStep(Integer groupId, Integer index) throws HardwareException, InterruptedException { |
|
|
var ret = takeTip(groupId, index); |
|
|
var ret = takeTip(groupId, index); |
|
|
TipPickUpPosInfo tipPos = getTipPickUpPosInfo(); |
|
|
TipPickUpPosInfo tipPos = getTipPickUpPosInfo(); |
|
|
|
|
|
|
|
@ -358,7 +390,7 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
// ObjectMapper mapper = new ObjectMapper(); |
|
|
// ObjectMapper mapper = new ObjectMapper(); |
|
|
testTakeTipFlag = true; |
|
|
testTakeTipFlag = true; |
|
|
Map<String, String> result = new HashMap<>(); |
|
|
Map<String, String> result = new HashMap<>(); |
|
|
for (int i = startFrom; i < TipPickUpPosInfo.COL_MAX * TipPickUpPosInfo.ROW_MAX; i++) { |
|
|
|
|
|
|
|
|
for (int i = startFrom; i < TipPickUpPosInfo.cgetTipNum(); i++) { |
|
|
var ret = takeTipTestStep(groupId, i); |
|
|
var ret = takeTipTestStep(groupId, i); |
|
|
result.put("Tip" + i, ret.getData() ? "suc" : "fail"); |
|
|
result.put("Tip" + i, ret.getData() ? "suc" : "fail"); |
|
|
logger.info("Take Tip {}-{} => {}", groupId, i, ret.getData()); |
|
|
logger.info("Take Tip {}-{} => {}", groupId, i, ret.getData()); |
|
@ -369,37 +401,13 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
return AppRet.success(result); |
|
|
return AppRet.success(result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@HardwareServiceAction(name = "停止取全部Tip", group = "测试脚本") |
|
|
@HardwareServiceAction(name = "停止取全部Tip", group = "测试脚本") |
|
|
public void testTakeAllTipStop() throws HardwareException, InterruptedException { |
|
|
public void testTakeAllTipStop() throws HardwareException, InterruptedException { |
|
|
testTakeTipFlag = false; |
|
|
testTakeTipFlag = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private AppRet<String> hBotMoveToAndScan(Pos2d pos) throws HardwareException, InterruptedException { |
|
|
|
|
|
hbotMoveTo(pos.x, pos.y); |
|
|
|
|
|
canBus.codeScanerStartScan(MId.PipetteModCodeScanner); |
|
|
|
|
|
String result = canBus.codeScanerWaittingForResult(MId.PipetteModCodeScanner, getScancodeOvertime()); |
|
|
|
|
|
return AppRet.success(result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//扫描板夹仓二维码 |
|
|
|
|
|
public AppRet<String> scanPlatesCode(Integer index) throws HardwareException, InterruptedException { |
|
|
|
|
|
var posInfo = getPlates2dCodeScanPosInfo(); |
|
|
|
|
|
return hBotMoveToAndScan(new Pos2d(posInfo.ch0ScanPos.x, posInfo.ch0ScanPos.y + posInfo.scanYSpacing * index)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//扫描小缓冲液二维码 |
|
|
|
|
|
public AppRet<String> scanSmallBottleBufferCode(Integer index) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//扫描大缓冲液二维码 |
|
|
|
|
|
public String scanBigBottleBufferCode(Integer index) { |
|
|
|
|
|
return ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//在试管架的位置取样品 |
|
|
//在试管架的位置取样品 |
|
|
public boolean takeSampleFromPos0(Integer ul) { |
|
|
public boolean takeSampleFromPos0(Integer ul) { |
|
|
return false; |
|
|
return false; |
|
|