|
|
@ -108,6 +108,7 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
|
1230, |
|
|
|
1250, |
|
|
|
new Pos2d(579, 1097), |
|
|
|
283, |
|
|
|
new BottlesPosInfo/*大孔*/( |
|
|
|
new Pos2d(160, 160), |
|
|
|
210, |
|
|
@ -137,12 +138,10 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
|
public LargeBottleBufferPos getLargeBottleBufferPosInfo() { |
|
|
|
return settingReader.getObject("LargeBottleBufferPosInfo", LargeBottleBufferPos.class, |
|
|
|
new LargeBottleBufferPos( |
|
|
|
new Pos2d(4583, 1363), |
|
|
|
new Pos2d(4594, 1350), |
|
|
|
280, |
|
|
|
280, |
|
|
|
0, |
|
|
|
0, |
|
|
|
0 |
|
|
|
165 |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
@ -182,6 +181,14 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
|
throw new HardwareException(A8kEcode.PlateBoxNotCover); |
|
|
|
} |
|
|
|
|
|
|
|
boolean zEnable = true; |
|
|
|
boolean hbotEnable = canBus.moduleGetReg(MId.HbotM, RegIndex.kreg_xyrobot_is_enable) == 1; |
|
|
|
if (canBus.moduleGetReg(MId.PipetteModZM, RegIndex.kreg_step_motor_is_enable) == 0) { |
|
|
|
canBus.stepMotorEnable(MId.PipetteModZM, 1); |
|
|
|
canBus.stepMotorEasyMoveToZeroBlock(MId.PipetteModZM, getActionOvertime()); |
|
|
|
zEnable = false; |
|
|
|
} |
|
|
|
|
|
|
|
//Z轴归零 |
|
|
|
if (!getZPPS()) { |
|
|
|
canBus.stepMotorEnable(MId.PipetteModZM, 1); |
|
|
@ -212,6 +219,8 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
|
canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.PipetteModZM, getActionOvertime()); |
|
|
|
zMoveTo(targetPos.z); |
|
|
|
} |
|
|
|
canBus.stepMotorEnable(MId.PipetteModZM, zEnable ? 1 : 0); |
|
|
|
canBus.hbotEnable(MId.HbotM, hbotEnable ? 1 : 0); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -323,17 +332,31 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
|
@HardwareServiceAction(name = "HBot移动到小瓶缓冲液X孔", group = "单步测试") |
|
|
|
public void hbotMoveToSmallBottleGroup(ConsumableGroup group, Integer Xhole) throws HardwareException, InterruptedException { |
|
|
|
BottleGroupsPosInfo posInfo = getBottleBufferPosInfo(); |
|
|
|
Pos2d pos = posInfo.cgetSmallBottleBufferPos(group.off, Xhole); |
|
|
|
if (Xhole < 0 || Xhole > BottlesPosInfo.cgetMAX()) { |
|
|
|
throw new HardwareException(A8kEcode.ParamOutOfRange); |
|
|
|
} |
|
|
|
Pos2d pos = posInfo.cgetSmallBottleBufferPos(group.off, Xhole); |
|
|
|
hbotCheckAndMoveTo(pos); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@HardwareServiceAction(name = "HBot移动到探测物质X孔", group = "单步测试") |
|
|
|
public void hbotMoveToDetectMaterialPos(ConsumableGroup group, Integer Xhole) throws HardwareException, InterruptedException { |
|
|
|
BottleGroupsPosInfo posInfo = getBottleBufferPosInfo(); |
|
|
|
Pos2d pos = posInfo.cgetDetectMaterialPos(group.off, Xhole); |
|
|
|
if (Xhole < 0 || Xhole > BottlesPosInfo.cgetMAX()) { |
|
|
|
throw new HardwareException(A8kEcode.ParamOutOfRange); |
|
|
|
} |
|
|
|
Pos2d pos = posInfo.cgetDetectMaterialPos(group.off, Xhole); |
|
|
|
hbotCheckAndMoveTo(pos); |
|
|
|
} |
|
|
|
|
|
|
|
@HardwareServiceAction(name = "HBot移动到大瓶缓冲液X孔", group = "单步测试") |
|
|
|
public void hbotMoveToLargeBottleGroup(ConsumableGroup ch) throws HardwareException, InterruptedException { |
|
|
|
LargeBottleBufferPos posInfo = getLargeBottleBufferPosInfo(); |
|
|
|
Pos2d pos = posInfo.cgetBottlePos( ch.off); |
|
|
|
hbotCheckAndMoveTo(pos); |
|
|
|
} |
|
|
|
|
|
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
|
// 坐标获取工具 |
|
|
@ -447,14 +470,14 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
|
// 测试 |
|
|
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
|
Boolean testTakeTipFlag; |
|
|
|
Boolean testScriptWorkFlag = false; |
|
|
|
|
|
|
|
@HardwareServiceAction(name = "取放Tip", group = "测试脚本") |
|
|
|
public AppRet<Boolean> takeTipTestStep(Integer groupId, Integer index) throws HardwareException, InterruptedException { |
|
|
|
var ret = takeTip(groupId, index); |
|
|
|
public AppRet<Boolean> takeTipTestStep(Integer tipgroup, Integer index) throws HardwareException, InterruptedException { |
|
|
|
var ret = takeTip(tipgroup, index); |
|
|
|
TipPickUpPosInfo tipPos = getTipPickUpPosInfo(); |
|
|
|
|
|
|
|
canBus.stepMotorEasyMoveToBlock(MId.PipetteModZM, tipPos.getPickUpZPos(groupId) - 100, getActionOvertime()); |
|
|
|
canBus.stepMotorEasyMoveToBlock(MId.PipetteModZM, tipPos.getPickUpZPos(tipgroup) - 100, getActionOvertime()); |
|
|
|
canBus.pipetteCtrlPutTipBlock(MId.PipetteMod); |
|
|
|
|
|
|
|
if (canBus.moduleGetReg(MId.PipetteMod, RegIndex.kreg_pipette_tip_state) == 1) { |
|
|
@ -468,7 +491,7 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
|
@HardwareServiceAction(name = "取全部Tip", group = "测试脚本") |
|
|
|
public AppRet<Map<String, String>> testTakeAllTip(Integer groupId, Integer startFrom) throws HardwareException, InterruptedException { |
|
|
|
// ObjectMapper mapper = new ObjectMapper(); |
|
|
|
testTakeTipFlag = true; |
|
|
|
testScriptWorkFlag = true; |
|
|
|
Map<String, String> result = new HashMap<>(); |
|
|
|
for (int i = startFrom; i < TipPickUpPosInfo.cgetTipNum(); i++) { |
|
|
|
var ret = takeTipTestStep(groupId, i); |
|
|
@ -478,17 +501,42 @@ public class HbotControlService implements HardwareCtrlModule { |
|
|
|
|
|
|
|
result.put("Tip" + i, ret.getData() ? "suc" : "fail"); |
|
|
|
logger.info("Take Tip {}-{} => {}", groupId, i, ret.getData()); |
|
|
|
if (!testTakeTipFlag) { |
|
|
|
if (!testScriptWorkFlag) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return AppRet.success(result); |
|
|
|
} |
|
|
|
|
|
|
|
@HardwareServiceAction(name = "测试所有小瓶缓冲液位置", group = "测试脚本") |
|
|
|
public void testAllLittleBottleBufferPos(ConsumableGroup group) throws HardwareException, InterruptedException { |
|
|
|
testScriptWorkFlag = true; |
|
|
|
BottleGroupsPosInfo posInfo = getBottleBufferPosInfo(); |
|
|
|
for (int i = 0; i < BottlesPosInfo.cgetMAX(); i++) { |
|
|
|
Pos2d pos = posInfo.cgetSmallBottleBufferPos(group.off, i); |
|
|
|
hbotCheckAndMoveTo(new Pos3d(pos.x, pos.y, posInfo.posTestZ)); |
|
|
|
if (!testScriptWorkFlag) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@HardwareServiceAction(name = "测试所有探测物质位置", group = "测试脚本") |
|
|
|
public void testAllDetectMaterialPos(ConsumableGroup group) throws HardwareException, InterruptedException { |
|
|
|
testScriptWorkFlag = true; |
|
|
|
BottleGroupsPosInfo posInfo = getBottleBufferPosInfo(); |
|
|
|
for (int i = 0; i < BottlesPosInfo.cgetMAX(); i++) { |
|
|
|
Pos2d pos = posInfo.cgetDetectMaterialPos(group.off, i); |
|
|
|
hbotCheckAndMoveTo(new Pos3d(pos.x, pos.y, posInfo.posTestZ)); |
|
|
|
if (!testScriptWorkFlag) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@HardwareServiceAction(name = "停止取全部Tip", group = "测试脚本") |
|
|
|
@HardwareServiceAction(name = "停止测试脚本", group = "测试脚本") |
|
|
|
public void testTakeAllTipStop() throws HardwareException, InterruptedException { |
|
|
|
testTakeTipFlag = false; |
|
|
|
testScriptWorkFlag = false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|