|
@ -302,7 +302,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//前工位取货时判断取货位光电信号
|
|
|
//前工位取货时判断取货位光电信号
|
|
|
if (mode == 3 && error == 0 && status != 3 && action1 == 1 && move1 == 0 && task1 > 0 && action2 != 1) { |
|
|
if (mode == 3 && error == 0 && status != 3 && action1 == 0 && move1 == 0 && task1 > 0 && action2 != 1) { |
|
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); |
|
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); |
|
|
String start_device_code = inst1.getStart_device_code(); |
|
|
String start_device_code = inst1.getStart_device_code(); |
|
|
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code); |
|
|
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code); |
|
@ -313,7 +313,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
// && (driver.getIo_action() == 3 || driver.getIo_action() == 1)
|
|
|
// && (driver.getIo_action() == 3 || driver.getIo_action() == 1)
|
|
|
// && (driver.getAction() == 3 || driver.getAction() == 1)
|
|
|
// && (driver.getAction() == 3 || driver.getAction() == 1)
|
|
|
) { |
|
|
) { |
|
|
this.writing("to_command1", "2"); |
|
|
this.writing("to_command1", "1"); |
|
|
driver.setMessage(""); |
|
|
driver.setMessage(""); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", "允许RGV前工位取货。"); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", "允许RGV前工位取货。"); |
|
|
} else { |
|
|
} else { |
|
@ -336,13 +336,13 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", msg); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", msg); |
|
|
} |
|
|
} |
|
|
} else if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
} else if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
this.writing("to_command1", "2"); |
|
|
this.writing("to_command1", "3"); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", "允许RGV前工位取货。"); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", "允许RGV前工位取货。"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//前工位放货时判断放货位光电信号
|
|
|
//前工位放货时判断放货位光电信号
|
|
|
if (mode == 3 && error == 0 && status != 3 && action1 == 3 && move1 != 0 && task1 > 0 && action2 != 3) { |
|
|
if (mode == 3 && error == 0 && status != 3 && action1 == 2 && move1 != 0 && task1 > 0 && action2 == 3) { |
|
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); |
|
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1)); |
|
|
String next_device_code = inst1.getNext_device_code(); |
|
|
String next_device_code = inst1.getNext_device_code(); |
|
|
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code); |
|
|
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code); |
|
@ -350,9 +350,10 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
LnshStationDeviceDriver driver = (LnshStationDeviceDriver) nextDevice.getDeviceDriver(); |
|
|
LnshStationDeviceDriver driver = (LnshStationDeviceDriver) nextDevice.getDeviceDriver(); |
|
|
if (driver.getMode() != 0 |
|
|
if (driver.getMode() != 0 |
|
|
&& driver.getMove() == 0 |
|
|
&& driver.getMove() == 0 |
|
|
&& (driver.getAction() == 2 || driver.getAction() == 3) |
|
|
// && (driver.getAction() == 2 || driver.getAction() == 3)
|
|
|
&& (driver.getIo_action() == 1 || driver.getIo_action() == 3)) { |
|
|
// && (driver.getIo_action() == 1 || driver.getIo_action() == 3)
|
|
|
this.writing("to_command1", "3"); |
|
|
) { |
|
|
|
|
|
this.writing("to_command1", "2"); |
|
|
driver.setMessage(""); |
|
|
driver.setMessage(""); |
|
|
logServer.deviceExecuteLog(nextDevice.getDevice_code(), "", "", "允许RGV前工位放货。"); |
|
|
logServer.deviceExecuteLog(nextDevice.getDevice_code(), "", "", "允许RGV前工位放货。"); |
|
|
} else { |
|
|
} else { |
|
@ -378,9 +379,10 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
LnshPackageSiteDeviceDriver driver = (LnshPackageSiteDeviceDriver) nextDevice.getDeviceDriver(); |
|
|
LnshPackageSiteDeviceDriver driver = (LnshPackageSiteDeviceDriver) nextDevice.getDeviceDriver(); |
|
|
if (driver.getMode() != 0 |
|
|
if (driver.getMode() != 0 |
|
|
&& driver.getMove() == 0 |
|
|
&& driver.getMove() == 0 |
|
|
&& (driver.getAction() == 2 || driver.getAction() == 3) |
|
|
// && (driver.getAction() == 2 || driver.getAction() == 3)
|
|
|
&& (driver.getIoaction() == 1 || driver.getIoaction() == 3)) { |
|
|
// && (driver.getIoaction() == 1 || driver.getIoaction() == 3)
|
|
|
this.writing("to_command1", "3"); |
|
|
) { |
|
|
|
|
|
this.writing("to_command1", "2"); |
|
|
driver.setMessage(""); |
|
|
driver.setMessage(""); |
|
|
logServer.deviceExecuteLog(nextDevice.getDevice_code(), "", "", "允许RGV前工位放货。"); |
|
|
logServer.deviceExecuteLog(nextDevice.getDevice_code(), "", "", "允许RGV前工位放货。"); |
|
|
} else { |
|
|
} else { |
|
@ -405,8 +407,8 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//后工位取货时判断取货位光电信号
|
|
|
//后工位取货时判断取货位光电信号 没问题
|
|
|
if (mode == 3 && error == 0 && status != 3 && action2 == 1 && move2 == 0 && task2 > 0) { |
|
|
if (mode == 2 && error == 0 && status != 3 && action2 == 1 && move2 == 0 && task2 > 0) { |
|
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); |
|
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); |
|
|
String start_device_code = inst1.getStart_device_code(); |
|
|
String start_device_code = inst1.getStart_device_code(); |
|
|
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code); |
|
|
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code); |
|
@ -414,7 +416,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
LnshLaminatingMachineDeviceDriver driver = (LnshLaminatingMachineDeviceDriver) startDevice.getDeviceDriver(); |
|
|
LnshLaminatingMachineDeviceDriver driver = (LnshLaminatingMachineDeviceDriver) startDevice.getDeviceDriver(); |
|
|
if (driver.getMode() != 0 |
|
|
if (driver.getMode() != 0 |
|
|
&& driver.getMove() != 0) { |
|
|
&& driver.getMove() != 0) { |
|
|
this.writing("to_command2", "2"); |
|
|
this.writing("to_command2", "1"); |
|
|
driver.setMessage(""); |
|
|
driver.setMessage(""); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", "允许RGV后工位取货。"); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", "允许RGV后工位取货。"); |
|
|
} else { |
|
|
} else { |
|
@ -436,7 +438,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
&& driver.getMove() != 0 |
|
|
&& driver.getMove() != 0 |
|
|
&& (driver.getIo_action() == 3 || driver.getIo_action() == 1) |
|
|
&& (driver.getIo_action() == 3 || driver.getIo_action() == 1) |
|
|
&& (driver.getAction() == 3 || driver.getAction() == 1)) { |
|
|
&& (driver.getAction() == 3 || driver.getAction() == 1)) { |
|
|
this.writing("to_command2", "2"); |
|
|
this.writing("to_command2", "1"); |
|
|
driver.setMessage(""); |
|
|
driver.setMessage(""); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", "允许RGV后工位取货。"); |
|
|
logServer.deviceExecuteLog(startDevice.getDevice_code(), "", "", "允许RGV后工位取货。"); |
|
|
} else { |
|
|
} else { |
|
@ -462,9 +464,9 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//后工位放货时判断放货位光电信号
|
|
|
//后工位放货时判断放货位光电信号
|
|
|
if (mode == 3 && error == 0 && status != 3 && action2 == 3 && move2 != 0 && task2 > 0 && action1 != 1) { |
|
|
if (mode == 3 && error == 0 && status != 3 && action2 == 2 && move2 != 0 && task2 > 0 && action1 == 2) { |
|
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); |
|
|
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); |
|
|
String next_device_code = inst1.getNext_device_code(); |
|
|
String next_device_code = inst1.getNext_device_code2(); |
|
|
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code); |
|
|
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code); |
|
|
if (nextDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { |
|
|
if (nextDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { |
|
|
LnshPalletizingManipulatorSiteDeviceDriver driver = (LnshPalletizingManipulatorSiteDeviceDriver) nextDevice.getDeviceDriver(); |
|
|
LnshPalletizingManipulatorSiteDeviceDriver driver = (LnshPalletizingManipulatorSiteDeviceDriver) nextDevice.getDeviceDriver(); |
|
@ -473,7 +475,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
// && (driver.getIo_action() == 1 || driver.getIo_action() == 3)
|
|
|
// && (driver.getIo_action() == 1 || driver.getIo_action() == 3)
|
|
|
// && (driver.getAction() == 2 || driver.getAction() == 3)
|
|
|
// && (driver.getAction() == 2 || driver.getAction() == 3)
|
|
|
) { |
|
|
) { |
|
|
this.writing("to_command2", "3"); |
|
|
this.writing("to_command2", "2"); |
|
|
driver.setMessage(""); |
|
|
driver.setMessage(""); |
|
|
logServer.deviceExecuteLog(nextDevice.getDevice_code(), "", "", "允许RGV后工位放货。"); |
|
|
logServer.deviceExecuteLog(nextDevice.getDevice_code(), "", "", "允许RGV后工位放货。"); |
|
|
} else { |
|
|
} else { |
|
@ -496,7 +498,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
logServer.deviceExecuteLog(device_code, "", "", msg); |
|
|
logServer.deviceExecuteLog(device_code, "", "", msg); |
|
|
} |
|
|
} |
|
|
} else if (nextDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
} else if (nextDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
this.writing("to_command2", "3"); |
|
|
this.writing("to_command2", "2"); |
|
|
logServer.deviceExecuteLog(nextDevice.getDevice_code(), "", "", "允许RGV后工位放货。"); |
|
|
logServer.deviceExecuteLog(nextDevice.getDevice_code(), "", "", "允许RGV后工位放货。"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -608,6 +610,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
String priority = task.getPriority(); |
|
|
String priority = task.getPriority(); |
|
|
String start_point_code = task.getStart_point_code(); |
|
|
String start_point_code = task.getStart_point_code(); |
|
|
String start_device_code = task.getStart_device_code(); |
|
|
String start_device_code = task.getStart_device_code(); |
|
|
|
|
|
String put_device_code=task.getPut_device_code(); |
|
|
String start_device_code2 = task.getStart_device_code2(); |
|
|
String start_device_code2 = task.getStart_device_code2(); |
|
|
String route_plan_code = task.getRoute_plan_code(); |
|
|
String route_plan_code = task.getRoute_plan_code(); |
|
|
String next_point_code = task.getNext_point_code(); |
|
|
String next_point_code = task.getNext_point_code(); |
|
@ -662,7 +665,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
taskserver.update(task); |
|
|
taskserver.update(task); |
|
|
LnshLaminatingMachineDeviceDriver lnshLaminatingMachineDeviceDriver; |
|
|
LnshLaminatingMachineDeviceDriver lnshLaminatingMachineDeviceDriver; |
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
|
Device addressdevice = appService.findDeviceByCode(start_device_code); |
|
|
Device addressdevice = appService.findDeviceByCode(put_device_code); |
|
|
//下发4个点任务
|
|
|
//下发4个点任务
|
|
|
if (ObjectUtil.isNotEmpty(start_device_code2) && ObjectUtil.isNotEmpty(next_device_code2)) { |
|
|
if (ObjectUtil.isNotEmpty(start_device_code2) && ObjectUtil.isNotEmpty(next_device_code2)) { |
|
|
sendHeadBackSignalType(instdto); |
|
|
sendHeadBackSignalType(instdto); |
|
@ -1014,7 +1017,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
writing("to_target2", "0"); |
|
|
writing("to_target2", "0"); |
|
|
writing("to_task2", "0"); |
|
|
writing("to_task2", "0"); |
|
|
writing("to_container_type", "0"); |
|
|
writing("to_container_type", "0"); |
|
|
|
|
|
requireSucess1 = false; |
|
|
} |
|
|
} |
|
|
this.requireSucess1 = false; |
|
|
this.requireSucess1 = false; |
|
|
//单独的后工位任务
|
|
|
//单独的后工位任务
|
|
@ -1032,7 +1035,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
writing("to_onset2", "0"); |
|
|
writing("to_onset2", "0"); |
|
|
writing("to_target2", "0"); |
|
|
writing("to_target2", "0"); |
|
|
writing("to_task2", "0"); |
|
|
writing("to_task2", "0"); |
|
|
|
|
|
requireSucess1 = false; |
|
|
} |
|
|
} |
|
|
this.requireSucess1 = false; |
|
|
this.requireSucess1 = false; |
|
|
} else if (action1 == 4 && move1 == 0 && task1 > 0 && action2 == 0 && move2 == 0 && task2 == 0) { |
|
|
} else if (action1 == 4 && move1 == 0 && task1 > 0 && action2 == 0 && move2 == 0 && task2 == 0) { |
|
@ -1049,6 +1052,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
writing("to_target1", "0"); |
|
|
writing("to_target1", "0"); |
|
|
writing("to_task1", "0"); |
|
|
writing("to_task1", "0"); |
|
|
writing("to_container_type", "0"); |
|
|
writing("to_container_type", "0"); |
|
|
|
|
|
requireSucess1 = false; |
|
|
} |
|
|
} |
|
|
this.requireSucess1 = false; |
|
|
this.requireSucess1 = false; |
|
|
} |
|
|
} |
|
|