This commit is contained in:
2023-02-17 14:04:25 +08:00
parent 2c3323b375
commit 1e4da54e54

View File

@@ -15,6 +15,7 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDeviceDriver;
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.photoelectric_inspection_site.PhotoelectricInspectionSiteDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
@@ -194,7 +195,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction();
int error1 = hongXiangConveyorDeviceDriver.getError1();
if (mode == 1 && door == 1 && action == 1 && error1 == 0) {
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 1) {
if (this.getNow_steps_type() == 2) {
this.writing("to_command", "2");
this.setNow_steps_type(3);
@@ -213,6 +215,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (action != 1) {
feedMessage = feedMessage + "允许取放(action)信号未允许取放,";
}
if (move != 1){
feedMessage = feedMessage + "取货位光电信号move不应该为无货状态,";
}
if (error1 != 0) {
feedMessage = feedMessage + "故障(error1)信号出现故障,故障值:" + error1 + "";
}
@@ -287,6 +292,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
String next_device_code = instructionDto.getNext_device_code();
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
PhotoelectricInspectionSiteDeviceDriver photoelectricInspectionSiteDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
//hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
@@ -294,7 +300,38 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction();
int error1 = hongXiangConveyorDeviceDriver.getError1();
if (mode == 1 && door == 1 && action == 1 && error1 == 0) {
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 0) {
if (this.getNow_steps_type() == 4) {
this.writing("to_command", "4");
this.setNow_steps_type(5);
} else {
feedMessage = "未反馈电气信号原因:当前步骤不为允许放货now_steps_type=4";
logServer.deviceExecuteLog(this.device_code, "", "", "未反馈电气信号原因:当前步骤不为允许放货now_steps_type=4");
}
} else {
if (this.getNow_steps_type() == 4) {
feedMessage = "烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code();
if (mode != 1) {
feedMessage = feedMessage + "工作模式(mode)信号未联机,";
}
if (door != 1) {
feedMessage = feedMessage + "门状态(door)信号未开门,";
}
if (action != 1) {
feedMessage = feedMessage + "允许取放(action)信号未允许取放,";
}
if (move != 0) {
feedMessage = feedMessage + "放货位光电信号不应该为有货状态";
}
if (error1 != 0) {
feedMessage = feedMessage + "故障(error1)信号出现故障。";
}
}
}
} else if (nextDevice.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver){
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) device.getDeviceDriver();
if (photoelectricInspectionSiteDeviceDriver.getMove() == 0){
if (this.getNow_steps_type() == 4) {
this.writing("to_command", "4");
this.setNow_steps_type(5);
@@ -302,26 +339,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceExecuteLog(this.device_code, "", "", "未反馈电气信号原因:当前步骤不为允许放货now_steps_type=4");
}
} else {
feedMessage = "烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code();
if (mode != 1) {
feedMessage = feedMessage + "工作模式(mode)信号未联机,";
if (this.getNow_steps_type() == 4) {
if (photoelectricInspectionSiteDeviceDriver.getMove() != 0){
feedMessage = "烘箱对接位有货不允许放货!";
}
}
if (door != 1) {
feedMessage = feedMessage + "门状态(door)信号未开门,";
}
if (action != 1) {
feedMessage = feedMessage + "允许取放(action)信号未允许取放,";
}
if (error1 != 0) {
feedMessage = feedMessage + "故障(error1)信号出现故障。";
}
}
} else {
if (this.getNow_steps_type() == 4) {
this.writing("to_command", "4");
this.setNow_steps_type(5);
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "未反馈电气信号原因:当前步骤不为允许放货now_steps_type=4");
}
}
} else {