fix 信号写入重新建立group
This commit is contained in:
@@ -227,7 +227,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setPhase(phase);
|
|
||||||
|
|
||||||
} else if (device.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) {
|
} else if (device.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) {
|
||||||
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) device.getDeviceDriver();
|
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -344,11 +343,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
|
|
||||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||||
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
||||||
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
||||||
&& StrUtil.equals(task.getTask_type(), "1")) {
|
&& StrUtil.equals(task.getTask_type(), "1")) {
|
||||||
//
|
//
|
||||||
if (standardOrdinarySiteDeviceDriver.getOption() == 1) {
|
if (standardOrdinarySiteDeviceDriver.getOption() == 1) {
|
||||||
|
standardOrdinarySiteDeviceDriver.setAgvphase(0);
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
} else {
|
} else {
|
||||||
log.info("等待LMS系统进行确认允许取货,设备号{},指令号{}", device_code, ikey);
|
log.info("等待LMS系统进行确认允许取货,设备号{},指令号{}", device_code, ikey);
|
||||||
@@ -360,7 +361,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setPhase(phase);
|
|
||||||
} else {
|
} else {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
@@ -533,21 +533,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
// if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
||||||
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
// && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
||||||
&& StrUtil.equals(task.getTask_type(), "1")) {
|
// && StrUtil.equals(task.getTask_type(), "1")) {
|
||||||
//
|
// //
|
||||||
if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
// if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
standardOrdinarySiteDeviceDriver.setOption(0);
|
// standardOrdinarySiteDeviceDriver.setOption(0);
|
||||||
} else {
|
// } else {
|
||||||
log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
// log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
||||||
message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
// message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
// }
|
||||||
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
this.setPhase(phase);
|
this.setPhase(phase);
|
||||||
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -592,21 +592,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
|
|
||||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
// if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
||||||
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
// && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
||||||
&& StrUtil.equals(task.getTask_type(), "1")) {
|
// && StrUtil.equals(task.getTask_type(), "1")) {
|
||||||
//
|
// //
|
||||||
if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
// if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
standardOrdinarySiteDeviceDriver.setOption(0);
|
// standardOrdinarySiteDeviceDriver.setOption(0);
|
||||||
} else {
|
// } else {
|
||||||
log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
// log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
||||||
message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
// message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
// }
|
||||||
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
this.setPhase(phase);
|
this.setPhase(phase);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -649,21 +649,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
// if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
||||||
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
// && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
||||||
&& StrUtil.equals(task.getTask_type(), "1")) {
|
// && StrUtil.equals(task.getTask_type(), "1")) {
|
||||||
//
|
// //
|
||||||
if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
// if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
standardOrdinarySiteDeviceDriver.setOption(0);
|
// standardOrdinarySiteDeviceDriver.setOption(0);
|
||||||
} else {
|
// } else {
|
||||||
log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
// log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
||||||
message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
// message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
}
|
// }
|
||||||
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
this.setPhase(phase);
|
this.setPhase(phase);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -648,6 +648,21 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map3.put("value", "1");
|
map3.put("value", "1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
|
|
||||||
|
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||||
|
, inst.getInstruction_code())) {
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发信号");
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||||
// this.writing(list);
|
// this.writing(list);
|
||||||
// message = "重新下发电气信号";
|
// message = "重新下发电气信号";
|
||||||
@@ -760,11 +775,17 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
this.writing(list);
|
this.writing(list);
|
||||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||||
try {
|
try {
|
||||||
Thread.sleep(500);
|
Thread.sleep(1000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if(ObjectUtil.isEmpty(taskserver.findByCode(taskdto.getTask_code()))){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||||
// this.writing(list);
|
// this.writing(list);
|
||||||
// message = "重新下发电气信号";
|
// message = "重新下发电气信号";
|
||||||
@@ -806,6 +827,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if(ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||||
// this.writing(list);
|
// this.writing(list);
|
||||||
@@ -977,6 +1001,17 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
} else {
|
} else {
|
||||||
if (jo.getInteger("status") == 200) {
|
if (jo.getInteger("status") == 200) {
|
||||||
message = "申请补码AGV搬运任务成功";
|
message = "申请补码AGV搬运任务成功";
|
||||||
|
List list = new ArrayList();
|
||||||
|
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".to_command").toString()
|
||||||
|
, "8")) {
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", "再次下发mode信号");
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请补码AGV任务,返回参数:" + jo);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请补码AGV任务,返回参数:" + jo);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -1013,6 +1048,22 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
} else {
|
} else {
|
||||||
if (jo.getInteger("status") == 200) {
|
if (jo.getInteger("status") == 200) {
|
||||||
message = "申请AGV搬运任务成功";
|
message = "申请AGV搬运任务成功";
|
||||||
|
List list = new ArrayList();
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code", "to_command");
|
||||||
|
map.put("value", "8");
|
||||||
|
list.add(map);
|
||||||
|
this.writing(list);
|
||||||
|
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".to_command").toString()
|
||||||
|
, "8")) {
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发mode信号");
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -1059,5 +1110,4 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -585,6 +585,16 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
map3.put("value", "1");
|
map3.put("value", "1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
|
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||||
|
, inst.getInstruction_code())) {
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发信号");
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -659,11 +669,23 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
map2.put("value", inst.getInstruction_code());
|
map2.put("value", inst.getInstruction_code());
|
||||||
list.add(map4);
|
list.add(map4);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||||
|
// this.writing(list);
|
||||||
|
// message = "重新下发电气信号";
|
||||||
|
// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||||
|
// }
|
||||||
|
|
||||||
|
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||||
|
, inst.getInstruction_code())) {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
message = "重新下发电气信号";
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发信号");
|
||||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message = "下发电气任务号成功";
|
message = "下发电气任务号成功";
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
return true;
|
return true;
|
||||||
@@ -770,10 +792,20 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
map2.put("value", inst.getInstruction_code());
|
map2.put("value", inst.getInstruction_code());
|
||||||
list.add(map4);
|
list.add(map4);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||||
|
// this.writing(list);
|
||||||
|
// message = "重新下发电气信号";
|
||||||
|
// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||||
|
// }
|
||||||
|
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||||
|
, inst.getInstruction_code())) {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
message = "重新下发电气信号";
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发信号");
|
||||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//如果不存在则直接找对应指令
|
//如果不存在则直接找对应指令
|
||||||
@@ -799,9 +831,19 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
map3.put("value", "1");
|
map3.put("value", "1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||||
|
// this.writing(list);
|
||||||
|
// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||||
|
// }
|
||||||
|
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||||
|
, inst.getInstruction_code())) {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发信号");
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,67 +123,67 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
|
|||||||
batch = this.getDevice().getBatch();
|
batch = this.getDevice().getBatch();
|
||||||
device_code = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
|
|
||||||
if (agvphase == 0x03) {
|
// if (agvphase == 0x03) {
|
||||||
if (ObjectUtil.isNotEmpty(inst)) {
|
// if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
inst.setExecute_status("1");
|
// inst.setExecute_status("1");
|
||||||
instructionService.update(inst);
|
// instructionService.update(inst);
|
||||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
// byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
agvphase = 0;
|
// agvphase = 0;
|
||||||
index = 0;
|
// index = 0;
|
||||||
inst = null;
|
// inst = null;
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
// logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
} else {
|
// } else {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
// logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (agvphase == 0x05) {
|
// if (agvphase == 0x05) {
|
||||||
if (ObjectUtil.isNotEmpty(inst)) {
|
// if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
inst.setExecute_status("2");
|
// inst.setExecute_status("2");
|
||||||
instructionService.update(inst);
|
// instructionService.update(inst);
|
||||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
// byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
// OneNDCSocketConnectionAutoRun.write(data);
|
//// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
agvphase = 0;
|
// agvphase = 0;
|
||||||
index = 0;
|
// index = 0;
|
||||||
inst = null;
|
// inst = null;
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
// logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
} else {
|
// } else {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
// logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (agvphase == 0x07) {
|
// if (agvphase == 0x07) {
|
||||||
if (ObjectUtil.isNotEmpty(inst)) {
|
// if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
inst.setExecute_status("5");
|
// inst.setExecute_status("5");
|
||||||
instructionService.update(inst);
|
// instructionService.update(inst);
|
||||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
// byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
// OneNDCSocketConnectionAutoRun.write(data);
|
//// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
agvphase = 0;
|
// agvphase = 0;
|
||||||
index = 0;
|
// index = 0;
|
||||||
inst = null;
|
// inst = null;
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
// logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
} else {
|
// } else {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
// logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (agvphase == 0x09) {
|
// if (agvphase == 0x09) {
|
||||||
if (ObjectUtil.isNotEmpty(inst)) {
|
// if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
inst.setExecute_status("6");
|
// inst.setExecute_status("6");
|
||||||
instructionService.update(inst);
|
// instructionService.update(inst);
|
||||||
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
// byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
// OneNDCSocketConnectionAutoRun.write(data);
|
//// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
agvphase = 0;
|
// agvphase = 0;
|
||||||
index = 0;
|
// index = 0;
|
||||||
inst = null;
|
// inst = null;
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
// logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
} else {
|
// } else {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
// logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,24 +70,24 @@ public class OpcServerServiceImpl implements OpcServerService, ApplicationAutoIn
|
|||||||
public Group getServer(String code) {
|
public Group getServer(String code) {
|
||||||
synchronized(this.buildLock(code)) {
|
synchronized(this.buildLock(code)) {
|
||||||
Group group = null;
|
Group group = null;
|
||||||
group = (Group)this.groups.get(code);
|
// group = (Group)this.groups.get(code);
|
||||||
if (group != null) {
|
// if (group != null) {
|
||||||
label68: {
|
// label68: {
|
||||||
Group var10000;
|
// Group var10000;
|
||||||
try {
|
// try {
|
||||||
if (!group.isActive()) {
|
// if (!group.isActive()) {
|
||||||
break label68;
|
// break label68;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
var10000 = group;
|
// var10000 = group;
|
||||||
} catch (JIException var14) {
|
// } catch (JIException var14) {
|
||||||
log.error(code, var14);
|
// log.error(code, var14);
|
||||||
break label68;
|
// break label68;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return var10000;
|
// return var10000;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Server server = (Server)this.servers.get(code);
|
Server server = (Server)this.servers.get(code);
|
||||||
boolean needcreate = false;
|
boolean needcreate = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user