|
@ -423,52 +423,51 @@ public class MagicAgvServiceImpl implements MagicAgvService { |
|
|
ModbusInspectSiteDeviceDriver driver = (ModbusInspectSiteDeviceDriver) addressdevice.getDeviceDriver(); |
|
|
ModbusInspectSiteDeviceDriver driver = (ModbusInspectSiteDeviceDriver) addressdevice.getDeviceDriver(); |
|
|
//请求取货
|
|
|
//请求取货
|
|
|
if ("Load".equals(action)) { |
|
|
if ("Load".equals(action)) { |
|
|
|
|
|
log.info("driver.getTo_command():" + driver.getTo_command()); |
|
|
|
|
|
log.info("driver.getAction():" + driver.getAction()); |
|
|
|
|
|
//请求进入
|
|
|
if (driver.getTo_command() == 1) { |
|
|
if (driver.getTo_command() == 1) { |
|
|
|
|
|
// 1允许进入
|
|
|
if (driver.getAction() == 1) { |
|
|
if (driver.getAction() == 1) { |
|
|
|
|
|
log.info("111:"+addressdevice.getExtraValue().get("inspect_in_stocck")); |
|
|
|
|
|
//是否判断光电
|
|
|
if ("1".equals(addressdevice.getExtraValue().get("inspect_in_stocck"))) { |
|
|
if ("1".equals(addressdevice.getExtraValue().get("inspect_in_stocck"))) { |
|
|
if (driver.getMove() == 1) { |
|
|
if (driver.getMove() == 1) { |
|
|
if (driver.getTo_command() == 2) { |
|
|
driver.writing(2); |
|
|
|
|
|
log.info("下发to_command:2"); |
|
|
inst.setExecute_status("1"); |
|
|
inst.setExecute_status("1"); |
|
|
is_feedback = true; |
|
|
is_feedback = true; |
|
|
} else { |
|
|
|
|
|
driver.writing(2); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if (driver.getTo_command() == 2) { |
|
|
driver.writing(2); |
|
|
|
|
|
log.info("下发to_command:2"); |
|
|
inst.setExecute_status("1"); |
|
|
inst.setExecute_status("1"); |
|
|
is_feedback = true; |
|
|
is_feedback = true; |
|
|
} else { |
|
|
|
|
|
driver.writing(2); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
log.info("当前to_command:" + driver.getTo_command() + ",下发to_command:1"); |
|
|
driver.writing(1); |
|
|
driver.writing(1); |
|
|
} |
|
|
} |
|
|
//请求放货
|
|
|
//请求放货
|
|
|
} else if ("Unload".equals(action)) { |
|
|
} else if ("Unload".equals(action)) { |
|
|
if (driver.getTo_command() == 1) { |
|
|
if (driver.getTo_command() == 1) { |
|
|
if (driver.getAction() == 1) { |
|
|
if (driver.getAction() == 1) { |
|
|
|
|
|
log.info("111:"+addressdevice.getExtraValue().get("inspect_in_stocck")); |
|
|
if ("1".equals(addressdevice.getExtraValue().get("inspect_in_stocck"))) { |
|
|
if ("1".equals(addressdevice.getExtraValue().get("inspect_in_stocck"))) { |
|
|
if (driver.getMove() == 0) { |
|
|
if (driver.getMove() == 0) { |
|
|
if (driver.getTo_command() == 2) { |
|
|
driver.writing(2); |
|
|
inst.setExecute_status("3"); |
|
|
inst.setExecute_status("3"); |
|
|
is_feedback = true; |
|
|
is_feedback = true; |
|
|
} else { |
|
|
|
|
|
driver.writing(2); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if (driver.getTo_command() == 2) { |
|
|
driver.writing(2); |
|
|
inst.setExecute_status("3"); |
|
|
inst.setExecute_status("3"); |
|
|
is_feedback = true; |
|
|
is_feedback = true; |
|
|
} else { |
|
|
|
|
|
driver.writing(2); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
log.info("当前to_command:" + driver.getTo_command() + ",下发to_command:1"); |
|
|
driver.writing(1); |
|
|
driver.writing(1); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -483,7 +482,6 @@ public class MagicAgvServiceImpl implements MagicAgvService { |
|
|
} |
|
|
} |
|
|
//取放货完成
|
|
|
//取放货完成
|
|
|
} else if ("onStation".equals(type)) { |
|
|
} else if ("onStation".equals(type)) { |
|
|
|
|
|
|
|
|
if (addressdevice.getDeviceDriver() instanceof ModbusInspectSiteDeviceDriver) { |
|
|
if (addressdevice.getDeviceDriver() instanceof ModbusInspectSiteDeviceDriver) { |
|
|
//取货完成
|
|
|
//取货完成
|
|
|
if ("Load".equals(action)) { |
|
|
if ("Load".equals(action)) { |
|
@ -576,6 +574,7 @@ public class MagicAgvServiceImpl implements MagicAgvService { |
|
|
} else if (addressdevice.getDeviceDriver() instanceof ModbusInspectSiteDeviceDriver) { |
|
|
} else if (addressdevice.getDeviceDriver() instanceof ModbusInspectSiteDeviceDriver) { |
|
|
ModbusInspectSiteDeviceDriver driver = (ModbusInspectSiteDeviceDriver) addressdevice.getDeviceDriver(); |
|
|
ModbusInspectSiteDeviceDriver driver = (ModbusInspectSiteDeviceDriver) addressdevice.getDeviceDriver(); |
|
|
driver.writing(3); |
|
|
driver.writing(3); |
|
|
|
|
|
log.info("AGV请求离开,to_command:{}", driver.getTo_command()); |
|
|
flag = true; |
|
|
flag = true; |
|
|
} else { |
|
|
} else { |
|
|
flag = true; |
|
|
flag = true; |
|
|