1 changed files with 71 additions and 5 deletions
@ -1,20 +1,86 @@ |
|||||
package com.my.graphiteDigesterBg.task; |
package com.my.graphiteDigesterBg.task; |
||||
|
import com.my.graphiteDigesterBg.MyDevice; |
||||
import com.my.graphiteDigesterBg.diframe.DiTaskBase; |
import com.my.graphiteDigesterBg.diframe.DiTaskBase; |
||||
import com.my.graphiteDigesterBg.diframe.Task; |
import com.my.graphiteDigesterBg.diframe.Task; |
||||
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActCameraBasler; |
||||
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor; |
||||
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActPeristalticPump; |
||||
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActServo; |
||||
import com.my.graphiteDigesterBg.model.MdbOperationLog; |
import com.my.graphiteDigesterBg.model.MdbOperationLog; |
||||
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager; |
||||
@Task(name="StopReset") |
@Task(name="StopReset") |
||||
public class TaskStopReset extends DiTaskBase { |
public class TaskStopReset extends DiTaskBase { |
||||
@Override |
@Override |
||||
protected void execute() { |
protected void execute() { |
||||
this.setStatus(TaskStatus.RUNNING); |
this.setStatus(TaskStatus.RUNNING); |
||||
MdbOperationLog.log(this.getUser(), "停止复位"); |
MdbOperationLog.log(this.getUser(), "停止复位"); |
||||
|
var runtimeVars = this.getDevice().getRuntimeVariables(); |
||||
|
|
||||
// @TODO : 停止并复位 |
|
||||
try { |
|
||||
Thread.sleep(3000); |
|
||||
} catch (InterruptedException e) { |
|
||||
throw new RuntimeException(e); |
|
||||
|
// 结束温度刷新 |
||||
|
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
||||
|
slotMan.stopTemperatureRefresh(); |
||||
|
|
||||
|
// 相机关闭 |
||||
|
DiActCameraBasler camera = this.getActuator(MyDevice.ACT_CAMERA, DiActCameraBasler.class); |
||||
|
camera.setEnable(false); |
||||
|
|
||||
|
// 关闭设备门 |
||||
|
DiActMotor doorMotor = this.getActuator(MyDevice.ACT_DOOR_MOTOR, DiActMotor.class); |
||||
|
doorMotor.moveToIO(1, 1); |
||||
|
doorMotor.setEnable(false); |
||||
|
|
||||
|
// 关闭夹爪 |
||||
|
DiActServo transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class); |
||||
|
transferClipServo.moveTo("TransClipServoClose"); |
||||
|
transferClipServo.setEnable(false); |
||||
|
|
||||
|
// 加液臂复位 |
||||
|
DiActMotor liquidMotor = this.getActuator(MyDevice.ACT_LIQUID_MOTOR, DiActMotor.class); |
||||
|
liquidMotor.reset(); |
||||
|
liquidMotor.moveTo("LiquidArmStandby"); |
||||
|
liquidMotor.setEnable(false); |
||||
|
|
||||
|
// 搬运机械臂上下移动复 |
||||
|
DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class); |
||||
|
transUdMotor.reset(); |
||||
|
transUdMotor.moveTo("TransUdMotorStandby"); |
||||
|
transUdMotor.setEnable(false); |
||||
|
|
||||
|
// 搬运机械臂左右移动复 |
||||
|
DiActMotor transLrMotor = this.getActuator(MyDevice.ACT_TRANSFER_LR_MOTOR, DiActMotor.class); |
||||
|
transLrMotor.reset(); |
||||
|
transLrMotor.moveTo("TransLrMotorStandby"); |
||||
|
transLrMotor.setEnable(false); |
||||
|
|
||||
|
// 加热盘转盘槽盖关闭 |
||||
|
for ( int i=0; i<5; i++ ) { |
||||
|
String key = "HeatingPlateMotorSlotCover_" + i; |
||||
|
DiActServo heatSlotCoverServo = this.getActuator(key, DiActServo.class); |
||||
|
heatSlotCoverServo.setEnable(false); |
||||
|
} |
||||
|
|
||||
|
// 加热盘转盘复位 |
||||
|
DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); |
||||
|
liquidPlateMotor.reset(); |
||||
|
liquidPlateMotor.setEnable(false); |
||||
|
|
||||
|
// 加热盘转盘复位 |
||||
|
DiActMotor heatPlateMotor = this.getActuator(MyDevice.ACT_HEAT_PLATE_MOTOR, DiActMotor.class); |
||||
|
heatPlateMotor.reset(); |
||||
|
heatPlateMotor.moveTo("HeatPlateStandby"); |
||||
|
heatPlateMotor.setEnable(false); |
||||
|
|
||||
|
// 蠕动泵复位 |
||||
|
int peristalticPumpCount = 1; |
||||
|
var actuators = this.getDevice().getActuators().getAll(); |
||||
|
for ( var actuator : actuators ) { |
||||
|
if (actuator instanceof DiActPeristalticPump pump) { |
||||
|
pump.setEnable(false); |
||||
|
peristalticPumpCount++; |
||||
|
} |
||||
} |
} |
||||
|
|
||||
|
runtimeVars.setString("NO","IsDeviceReady"); |
||||
this.setStatus(TaskStatus.FINISHED); |
this.setStatus(TaskStatus.FINISHED); |
||||
} |
} |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue