|
@ -9,6 +9,8 @@ import a8k.base_hardware.A8kCanBusService; |
|
|
import a8k.service.db.dao.A8kTubeInfoDao; |
|
|
import a8k.service.db.dao.A8kTubeInfoDao; |
|
|
import a8k.service.db.dao.SamplesPreProcessModuleCtrlParamsService; |
|
|
import a8k.service.db.dao.SamplesPreProcessModuleCtrlParamsService; |
|
|
import a8k.utils.HardwareService; |
|
|
import a8k.utils.HardwareService; |
|
|
|
|
|
import a8k.utils.HardwareServiceAction; |
|
|
|
|
|
import a8k.utils.HardwareServiceActionParam; |
|
|
import com.iflytop.uf.util.UfCommon; |
|
|
import com.iflytop.uf.util.UfCommon; |
|
|
import jakarta.annotation.Resource; |
|
|
import jakarta.annotation.Resource; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
@ -32,9 +34,7 @@ public class SamplesPreProcessModuleCtrlService { |
|
|
基础方法 |
|
|
基础方法 |
|
|
=======================================================================================*/ |
|
|
=======================================================================================*/ |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 按照一定顺序归零设备 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
@HardwareServiceAction(name="归零") |
|
|
public void moveToZero() throws HardwareException, InterruptedException { |
|
|
public void moveToZero() throws HardwareException, InterruptedException { |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
this.a8kCanBusService.callblockcmd( |
|
|
this.a8kCanBusService.callblockcmd( |
|
@ -75,11 +75,8 @@ public class SamplesPreProcessModuleCtrlService { |
|
|
*/ |
|
|
*/ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 使能模组 |
|
|
|
|
|
* @param enable 是否使能模组 |
|
|
|
|
|
*/ |
|
|
|
|
|
public void enableModule(Boolean enable) throws HardwareException { |
|
|
|
|
|
|
|
|
@HardwareServiceAction(name="使能") |
|
|
|
|
|
public void enableModule(@HardwareServiceActionParam(name="使能") Boolean enable) throws HardwareException { |
|
|
this.a8kCanBusService.callcmd( |
|
|
this.a8kCanBusService.callcmd( |
|
|
MId.ShakeModShakeM.toInt(), |
|
|
MId.ShakeModShakeM.toInt(), |
|
|
CmdId.step_motor_enable.toInt(), |
|
|
CmdId.step_motor_enable.toInt(), |
|
@ -122,6 +119,7 @@ public class SamplesPreProcessModuleCtrlService { |
|
|
* @param tubeType TubeType_HighBlood,TubeType_ShortBlood,TubeType_Mini,TubeType_MiniBlood,TubeType_BulletTube1P5,TubeType_BulletTube0P5 |
|
|
* @param tubeType TubeType_HighBlood,TubeType_ShortBlood,TubeType_Mini,TubeType_MiniBlood,TubeType_BulletTube1P5,TubeType_BulletTube0P5 |
|
|
* @param judgeCapExist 是否判断试管帽子存在与否 |
|
|
* @param judgeCapExist 是否判断试管帽子存在与否 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@HardwareServiceAction(name="取试管") |
|
|
public A8kEcode takeTube(String tubeType, Boolean judgeCapExist) throws HardwareException, InterruptedException { |
|
|
public A8kEcode takeTube(String tubeType, Boolean judgeCapExist) throws HardwareException, InterruptedException { |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
this.a8kCanBusService.callblockcmd( |
|
|
this.a8kCanBusService.callblockcmd( |
|
@ -241,6 +239,7 @@ public class SamplesPreProcessModuleCtrlService { |
|
|
/** |
|
|
/** |
|
|
* 取试管帽 |
|
|
* 取试管帽 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@HardwareServiceAction(name="取试管帽") |
|
|
public A8kEcode takeTubeCap( String tubeType ) throws HardwareException, InterruptedException { |
|
|
public A8kEcode takeTubeCap( String tubeType ) throws HardwareException, InterruptedException { |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
this.a8kCanBusService.callblockcmd( |
|
|
this.a8kCanBusService.callblockcmd( |
|
@ -295,6 +294,7 @@ public class SamplesPreProcessModuleCtrlService { |
|
|
/** |
|
|
/** |
|
|
* 盖试管帽,并将试管移动回试管架中 |
|
|
* 盖试管帽,并将试管移动回试管架中 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@HardwareServiceAction(name="盖试管帽并送回试管架") |
|
|
public void pushBackTubeCapAndTakeBakTube(String tubeType) throws HardwareException, InterruptedException { |
|
|
public void pushBackTubeCapAndTakeBakTube(String tubeType) throws HardwareException, InterruptedException { |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
this.a8kCanBusService.callblockcmd( |
|
|
this.a8kCanBusService.callblockcmd( |
|
@ -356,7 +356,8 @@ public class SamplesPreProcessModuleCtrlService { |
|
|
* @param times 摇匀次数 |
|
|
* @param times 摇匀次数 |
|
|
* @param shakeDegree 摇匀角度 |
|
|
* @param shakeDegree 摇匀角度 |
|
|
*/ |
|
|
*/ |
|
|
public void ShakeTube(String tubeType, Integer times, Integer shakeDegree) throws HardwareException, InterruptedException { |
|
|
|
|
|
|
|
|
@HardwareServiceAction(name="摇匀") |
|
|
|
|
|
public void ShakeTube(A8kTubeType tubeType, Integer times, Integer shakeDegree) throws HardwareException, InterruptedException { |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var standByPos = params.getShakeMotor_standbyPos(); |
|
|
var standByPos = params.getShakeMotor_standbyPos(); |
|
|
var startPos = standByPos - shakeDegree/2; |
|
|
var startPos = standByPos - shakeDegree/2; |
|
@ -371,24 +372,18 @@ public class SamplesPreProcessModuleCtrlService { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 打开气溶胶风扇 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
@HardwareServiceAction(name="打开气溶胶风扇") |
|
|
public void openAerosolFan() throws HardwareException { |
|
|
public void openAerosolFan() throws HardwareException { |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
this.a8kCanBusService.callcmd(MId.WbTubeFanMod.toInt(), CmdId.fan_controler_set_speed.toInt(), params.getAerosolFanLevel()); |
|
|
this.a8kCanBusService.callcmd(MId.WbTubeFanMod.toInt(), CmdId.fan_controler_set_speed.toInt(), params.getAerosolFanLevel()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 关闭气溶胶风扇 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
@HardwareServiceAction(name="关闭气溶胶风扇") |
|
|
public void closeAerosolFan() throws HardwareException { |
|
|
public void closeAerosolFan() throws HardwareException { |
|
|
this.a8kCanBusService.callcmd(MId.WbTubeFanMod.toInt(), CmdId.fan_controler_set_speed.toInt(), 0); |
|
|
this.a8kCanBusService.callcmd(MId.WbTubeFanMod.toInt(), CmdId.fan_controler_set_speed.toInt(), 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 设备初始化时复位 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
@HardwareServiceAction(name="设备初始化时复位") |
|
|
public void moduleResetWhenPowerOn() throws HardwareException, InterruptedException { |
|
|
public void moduleResetWhenPowerOn() throws HardwareException, InterruptedException { |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
this.a8kCanBusService.callblockcmd( |
|
|
this.a8kCanBusService.callblockcmd( |
|
@ -424,9 +419,7 @@ public class SamplesPreProcessModuleCtrlService { |
|
|
this.a8kCanBusService.waitForMod(MId.ShakeModShakeM, params.getActionOvertime()); |
|
|
this.a8kCanBusService.waitForMod(MId.ShakeModShakeM, params.getActionOvertime()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 设备运行时复位 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
@HardwareServiceAction(name="设备运行时复位") |
|
|
public void moduleRuntimeReset() throws HardwareException, InterruptedException { |
|
|
public void moduleRuntimeReset() throws HardwareException, InterruptedException { |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
var params = this.samplesPreProcessModuleCtrlParamsService; |
|
|
this.a8kCanBusService.callblockcmd( |
|
|
this.a8kCanBusService.callblockcmd( |
|
|