@ -19,7 +19,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory ;
import org.slf4j.LoggerFactory ;
import org.springframework.stereotype.Component ;
import org.springframework.stereotype.Component ;
/ * *
/ * *
* Hbot控制服务
* Hbot控制服务
* /
* /
@ -29,7 +28,6 @@ import org.springframework.stereotype.Component;
public class HbotControlService {
public class HbotControlService {
static Logger logger = LoggerFactory . getLogger ( HbotControlService . class ) ;
static Logger logger = LoggerFactory . getLogger ( HbotControlService . class ) ;
@Resource
@Resource
A8kCanBusService canBus ;
A8kCanBusService canBus ;
@Resource
@Resource
@ -41,29 +39,30 @@ public class HbotControlService {
@Resource
@Resource
DebugParam dp ;
DebugParam dp ;
/ /
/ /
public Integer getGripperZeroYPos ( ) {
public Integer getGripperZeroYPos ( ) {
/ / 之所以这样写 , 是因为是为了放置两个类之间的循环依赖
/ / 之所以这样写 , 是因为是为了放置两个类之间的循环依赖
/ / assert appCxt ! = null ;
/ / assert appCxt ! = null ;
/ / TODO
/ / TODO
/ / return appCxt . getBean ( SamplesPreProcessModuleCtrlService . class ) . getGripperZeroYPos ( ) ;
/ / return
/ / appCxt . getBean ( SamplesPreProcessModuleCtrlService . class ) . getGripperZeroYPos ( ) ;
return 0 ;
return 0 ;
}
}
/ / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
/ / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
/ / 基础控制
/ / 基础控制
/ / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
/ / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
private void checkPublicArea ( ) throws HardwareException {
private void checkPublicArea ( ) throws HardwareException {
if ( canBus . miniServoReadPos ( MId . ShakeModGripperYSV ) > getGripperZeroYPos ( ) + 20 ) {
if ( canBus . miniServoReadPos ( MId . ShakeModGripperYSV ) > getGripperZeroYPos ( ) + 20 ) {
logger . error ( "ShakeModGripperYSV Pos:{} > {}" , canBus . miniServoReadPos ( MId . ShakeModGripperYSV ) , getGripperZeroYPos ( ) + 20 ) ;
logger . error ( "ShakeModGripperYSV Pos:{} > {}" , canBus . miniServoReadPos ( MId . ShakeModGripperYSV ) ,
getGripperZeroYPos ( ) + 20 ) ;
throw new HardwareException ( A8kEcode . ShakeModGripperYSVInXYPublicArea ) ;
throw new HardwareException ( A8kEcode . ShakeModGripperYSVInXYPublicArea ) ;
}
}
}
}
/ * *
/ * *
* Hboot 移动
* Hboot 移动
*
* @param targetPos 目标位置
* @param targetPos 目标位置
* @throws HardwareException e
* @throws HardwareException e
* @throws InterruptedException e
* @throws InterruptedException e
@ -88,7 +87,6 @@ public class HbotControlService {
canBus . stepMotorEasyMoveToZeroPointQuickBlock ( MId . PipetteModZM , timep . getActionOvertime ( ) ) ;
canBus . stepMotorEasyMoveToZeroPointQuickBlock ( MId . PipetteModZM , timep . getActionOvertime ( ) ) ;
}
}
if ( ! getZPPS ( ) ) {
if ( ! getZPPS ( ) ) {
throw new HardwareException ( A8kEcode . ZMNotAtZPosWhenHbotTryMove ) ;
throw new HardwareException ( A8kEcode . ZMNotAtZPosWhenHbotTryMove ) ;
}
}
@ -116,7 +114,6 @@ public class HbotControlService {
canBus . hbotEnable ( MId . HbotM , hbotEnable ? 1 : 0 ) ;
canBus . hbotEnable ( MId . HbotM , hbotEnable ? 1 : 0 ) ;
}
}
public void zMoveTo ( Integer z ) throws HardwareException , InterruptedException {
public void zMoveTo ( Integer z ) throws HardwareException , InterruptedException {
if ( z = = 0 ) {
if ( z = = 0 ) {
canBus . stepMotorEasyMoveToZeroPointQuickBlock ( MId . PipetteModZM , timep . getActionOvertime ( ) ) ;
canBus . stepMotorEasyMoveToZeroPointQuickBlock ( MId . PipetteModZM , timep . getActionOvertime ( ) ) ;
@ -125,12 +122,10 @@ public class HbotControlService {
}
}
}
}
private void hbotCheckAndMoveTo ( Pos2d targetPos ) throws HardwareException , InterruptedException {
private void hbotCheckAndMoveTo ( Pos2d targetPos ) throws HardwareException , InterruptedException {
hbotCheckAndMoveTo ( new Pos3d ( targetPos . x , targetPos . y , 0 ) ) ;
hbotCheckAndMoveTo ( new Pos3d ( targetPos . x , targetPos . y , 0 ) ) ;
}
}
private void modGroupMoveToZero ( ) throws HardwareException , InterruptedException {
private void modGroupMoveToZero ( ) throws HardwareException , InterruptedException {
if ( ! canBus . getIOState ( IOId . PlateBoxCoverClosurePPS ) ) {
if ( ! canBus . getIOState ( IOId . PlateBoxCoverClosurePPS ) ) {
throw new HardwareException ( A8kEcode . PlateBoxNotCover ) ;
throw new HardwareException ( A8kEcode . PlateBoxNotCover ) ;
@ -190,8 +185,8 @@ public class HbotControlService {
zCompensate = 2 ;
zCompensate = 2 ;
}
}
canBus . stepMotorEasyMoveToBlock ( MId . PipetteModZM , tipPos . getPickUpZPos ( groupId ) + zCompensate , timep . getActionOvertime ( ) ) ;
canBus . stepMotorEasyMoveToBlock ( MId . PipetteModZM , tipPos . getPickUpZPos ( groupId ) + zCompensate ,
timep . getActionOvertime ( ) ) ;
canBus . stepMotorEasyMoveToZeroPointQuickBlock ( MId . PipetteModZM , timep . getActionOvertime ( ) ) ;
canBus . stepMotorEasyMoveToZeroPointQuickBlock ( MId . PipetteModZM , timep . getActionOvertime ( ) ) ;
Boolean isGetTip = canBus . moduleGetReg ( MId . PipetteMod , RegIndex . kreg_pipette_tip_state ) = = 1 ;
Boolean isGetTip = canBus . moduleGetReg ( MId . PipetteMod , RegIndex . kreg_pipette_tip_state ) = = 1 ;
@ -207,7 +202,8 @@ public class HbotControlService {
}
}
@EnginnerPageAction ( name = "HBot移动到小瓶缓冲液X孔" , group = "单步测试" )
@EnginnerPageAction ( name = "HBot移动到小瓶缓冲液X孔" , group = "单步测试" )
public void hbotMoveToSmallBottleGroup ( ConsumableGroup group , Integer Xhole ) throws HardwareException , InterruptedException {
public void hbotMoveToSmallBottleGroup ( ConsumableGroup group , Integer Xhole )
throws HardwareException , InterruptedException {
BottleGroupsPosInfo posInfo = pp . getBottleBufferPosInfo ( ) ;
BottleGroupsPosInfo posInfo = pp . getBottleBufferPosInfo ( ) ;
if ( Xhole < 0 | | Xhole > BottlesPosInfo . cgetMAX ( ) ) {
if ( Xhole < 0 | | Xhole > BottlesPosInfo . cgetMAX ( ) ) {
throw new HardwareException ( A8kEcode . ParamOutOfRange ) ;
throw new HardwareException ( A8kEcode . ParamOutOfRange ) ;
@ -216,9 +212,9 @@ public class HbotControlService {
hbotCheckAndMoveTo ( pos ) ;
hbotCheckAndMoveTo ( pos ) ;
}
}
@EnginnerPageAction ( name = "HBot移动到探测物质X孔" , group = "单步测试" )
@EnginnerPageAction ( name = "HBot移动到探测物质X孔" , group = "单步测试" )
public void hbotMoveToDetectMaterialPos ( ConsumableGroup group , Integer Xhole ) throws HardwareException , InterruptedException {
public void hbotMoveToDetectMaterialPos ( ConsumableGroup group , Integer Xhole )
throws HardwareException , InterruptedException {
BottleGroupsPosInfo posInfo = pp . getBottleBufferPosInfo ( ) ;
BottleGroupsPosInfo posInfo = pp . getBottleBufferPosInfo ( ) ;
if ( Xhole < 0 | | Xhole > BottlesPosInfo . cgetMAX ( ) ) {
if ( Xhole < 0 | | Xhole > BottlesPosInfo . cgetMAX ( ) ) {
throw new HardwareException ( A8kEcode . ParamOutOfRange ) ;
throw new HardwareException ( A8kEcode . ParamOutOfRange ) ;
@ -312,7 +308,8 @@ public class HbotControlService {
/ / 扫描大缓冲液二维码
/ / 扫描大缓冲液二维码
@EnginnerPageAction ( name = "扫描大缓冲液二维码" , group = "扫码" )
@EnginnerPageAction ( name = "扫描大缓冲液二维码" , group = "扫码" )
public AppRet < String > scanBigBottleBufferCode ( ConsumableGroup group ) throws HardwareException , InterruptedException {
public AppRet < String > scanBigBottleBufferCode ( ConsumableGroup group )
throws HardwareException , InterruptedException {
LargeBottleBufferPos posInfo = pp . getLargeBottleBufferPosInfo ( ) ;
LargeBottleBufferPos posInfo = pp . getLargeBottleBufferPosInfo ( ) ;
return hBotMoveToAndScan ( posInfo . cgetScanPos ( group . off ) ) ;
return hBotMoveToAndScan ( posInfo . cgetScanPos ( group . off ) ) ;
}
}
@ -321,7 +318,6 @@ public class HbotControlService {
/ / hbot取样品
/ / hbot取样品
/ / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
/ / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
public Boolean getZPPS ( ) throws HardwareException {
public Boolean getZPPS ( ) throws HardwareException {
return canBus . stepMotorReadIoState ( MId . PipetteModZM , 0 ) ;
return canBus . stepMotorReadIoState ( MId . PipetteModZM , 0 ) ;
}
}