add agv自动门驱动
This commit is contained in:
@@ -249,16 +249,20 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
log.info(agvaddr + "对应设备号为空!");
|
log.info(agvaddr + "对应设备号为空!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
device = deviceAppService.findDeviceByCode(device_code);
|
||||||
if (ObjectUtil.isNotEmpty(device)) {
|
if (ObjectUtil.isNotEmpty(device)) {
|
||||||
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
||||||
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
||||||
if (standardAutodoorDeviceDriver.getDoor() == 1) {
|
if(device_code.equals("AD1")||device_code.equals("AD2")||device_code.equals("AD3")||device_code.equals("AD4")) {
|
||||||
|
standardAutodoorDeviceDriver.writing("to_command", 1);
|
||||||
|
if (standardAutodoorDeviceDriver.getDoor() == 1) {
|
||||||
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
|
} else {
|
||||||
|
log.info("未下发NDC信号原因: 读取开门到位信号值为:{}", standardAutodoorDeviceDriver.getDoor());
|
||||||
|
}
|
||||||
|
}else if(device_code.equals("AD5")||device_code.equals("AD6")||device_code.equals("AD7")||device_code.equals("AD8")||device_code.equals("AD9")) {
|
||||||
standardAutodoorDeviceDriver.writing("to_command", 1);
|
standardAutodoorDeviceDriver.writing("to_command", 1);
|
||||||
}
|
|
||||||
if (standardAutodoorDeviceDriver.getTo_command() == 1) {
|
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
} else {
|
|
||||||
log.info("未下发NDC信号原因: 读取下发信号值为:{}", standardAutodoorDeviceDriver.getTo_command());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -270,8 +274,11 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
log.info(agvaddr + "对应设备号为空!");
|
log.info(agvaddr + "对应设备号为空!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
device = deviceAppService.findDeviceByCode(device_code);
|
||||||
if (ObjectUtil.isNotEmpty(device)) {
|
if (ObjectUtil.isNotEmpty(device)) {
|
||||||
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
||||||
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
||||||
|
standardAutodoorDeviceDriver.writing("to_command", 2);
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -350,13 +357,13 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
dos.flush();
|
dos.flush();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
try {
|
try{
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
log.info("再次下发agv数据:" + Bytes2HexString(b));
|
log.info("再次下发agv数据:" + Bytes2HexString(b));
|
||||||
System.out.println("再次下发agv数据:" + Bytes2HexString(b));
|
System.out.println("再次下发agv数据:" + Bytes2HexString(b));
|
||||||
dos.write(b);
|
dos.write(b);
|
||||||
dos.flush();
|
dos.flush();
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1){
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1176,27 +1176,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
//
|
//
|
||||||
// } else
|
// } else
|
||||||
//1=XZ 2=NDC
|
//1=XZ 2=NDC
|
||||||
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
|
|
||||||
// NDC agv指令不当场取消指令,需要等agv上报
|
|
||||||
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
|
||||||
ndcAgvService.deleteAgvInstToNDC(BeanUtil.copyProperties(entity, Instruction.class));
|
ndcAgvService.deleteAgvInstToNDC(BeanUtil.copyProperties(entity, Instruction.class));
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
} else if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.ONE)
|
|
||||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
|
||||||
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
|
||||||
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
|
||||||
flag = true;
|
|
||||||
} else if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type)
|
|
||||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
|
||||||
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
|
||||||
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
|
||||||
flag = true;
|
|
||||||
} else {
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
String currentUsername = SecurityUtils.getCurrentNickName();
|
String currentUsername = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
@@ -1549,7 +1530,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1607,18 +1587,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
@Override
|
@Override
|
||||||
public Integer querySameOriginInst(String devicecode) {
|
public Integer querySameOriginInst(String devicecode) {
|
||||||
int num = 0;
|
int num = 0;
|
||||||
Iterator<Instruction> it = instructions.iterator();
|
|
||||||
while (it.hasNext()) {
|
|
||||||
Instruction inst = it.next();
|
|
||||||
// 处理空盘位站点
|
|
||||||
String start_code = inst.getStart_point_code();
|
|
||||||
if (start_code.indexOf(".") != -1) {
|
|
||||||
start_code = start_code.substring(0, start_code.indexOf("."));
|
|
||||||
}
|
|
||||||
if (StrUtil.equals(devicecode, start_code)) {
|
|
||||||
num = num + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ ENV = 'production'
|
|||||||
|
|
||||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||||
VUE_APP_BASE_API = 'http://192.168.0.8:8011'
|
VUE_APP_BASE_API = 'http://10.200.172.67.8:8011'
|
||||||
# 如果接口是 http 形式, wss 需要改为 ws
|
# 如果接口是 http 形式, wss 需要改为 ws
|
||||||
VUE_APP_WS_API = 'ws://192.168.0.8:8011'
|
VUE_APP_WS_API = 'ws://10.200.172.67:8011'
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
window.g = {
|
window.g = {
|
||||||
dev: {
|
dev: {
|
||||||
VUE_APP_BASE_API: 'http://127.0.0.1:8011'
|
VUE_APP_BASE_API: 'http://10.200.172.67:8011'
|
||||||
},
|
},
|
||||||
prod: {
|
prod: {
|
||||||
VUE_APP_BASE_API: 'http://192.168.0.8:8011'
|
VUE_APP_BASE_API: 'http://10.200.172.67:8011'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user