This commit is contained in:
USER-20220102CG\noblelift
2023-03-08 11:06:36 +08:00
parent 4f4b94e611
commit 3722f70737
16 changed files with 121 additions and 46 deletions

View File

@@ -72,7 +72,15 @@ public class NDCAgvServiceImpl implements NDCAgvService {
};
log.info("下发删除AGV指令--{}", Bytes2HexString(b));
// NDCSocketConnectionAutoRun.write(b);
if (StrUtil.equals(inst.getAgv_system_type(),"1")){
OneNDCSocketConnectionAutoRun.write(b);
} else if (StrUtil.equals(inst.getAgv_system_type(),"2")){
TwoNDCSocketConnectionAutoRun.write(b);
} else if (StrUtil.equals(inst.getAgv_system_type(),"3")){
TwoNDC2SocketConnectionAutoRun.write(b);
}
System.out.println("下发删除agv指令数据:" + Bytes2HexString(b));
}

View File

@@ -88,12 +88,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
if(ObjectUtil.isEmpty(inst)){
log.info("该指令号未找到对应指令:"+ikey);
message = "该指令号未找到对应指令:"+ikey;
logServer.deviceExecuteLog(this.device_code, "", "", "该指令号未找到对应指令:"+ikey);
return;
}
task = taskService.findByTaskCode(inst.getTask_code());
if(ObjectUtil.isEmpty(task)){
log.info("该指令号未找到对应任务:"+ikey);
message = "该指令号未找到对应任务:"+ikey;
logServer.deviceExecuteLog(this.device_code, "", "", "该指令号未找到对应任务:"+ikey);
return;
}
@@ -187,6 +189,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("等待LMS系统进行确认允许取货设备号{},指令号{}", device_code,ikey);
message = "等待LMS系统进行确认允许取货,设备号:"+device_code +",指令号:"+ikey;
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号"+device.getDevice_code()+",指令号"+ikey);
}
} else {
@@ -205,9 +208,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if(standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
message = "设备号:"+device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:"+ standardInspectSiteDeviceDriver.getAction() + ",指令号:"+ikey;
log.info("设备{}当前光电信号{},动作信号{},不满足取货条件,指令号{}", device_code,standardInspectSiteDeviceDriver.getMove(),standardInspectSiteDeviceDriver.getAction(),ikey);
}
}
else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -270,6 +273,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if(standardInspectSiteDeviceDriver.getMove() == 0 ){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
message = "设备号:"+device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:"+ standardInspectSiteDeviceDriver.getAction() + ",指令号:"+ikey;
log.info("设备{}当前光电信号{},动作信号{},不满足取货条件", device_code,standardInspectSiteDeviceDriver.getMove());
}
} else {
@@ -318,6 +322,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("等待LMS系统进行确认允许取货设备号{},指令号{}", device_code,ikey);
message = "等待LMS系统进行确认允许取货,设备号:"+device_code +",指令号:"+ikey;
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号"+device.getDevice_code());
}
@@ -398,7 +403,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if(ObjectUtil.isNotEmpty(task)){
logServer.deviceExecuteLog(this.device_code, "", "", "上报满卷重量,weight:" + weight);
message = "上报满卷重量,weight:"+weight +",指令号:"+ikey;
task.setWeight(String.valueOf(weight));
task.setCarno(this.device_code);
taskService.update(task);
}
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -505,7 +512,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
standardOrdinarySiteDeviceDriver.setOption(0);
} else {
log.info("等待LMS系统进行确认离开设备号{}", device_code);
log.info("等待LMS系统进行确认离开设备号{},指令号:{}", device_code,ikey);
message = "等待LMS系统进行确认离开,设备号:"+device_code +",指令号:"+ikey;
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -563,7 +571,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
standardOrdinarySiteDeviceDriver.setOption(0);
} else {
log.info("等待LMS系统进行确认离开设备号{}", device_code);
log.info("等待LMS系统进行确认离开设备号{},指令号:{}", device_code,ikey);
message = "等待LMS系统进行确认离开,设备号:"+device_code +",指令号:"+ikey;
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -619,7 +628,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
standardOrdinarySiteDeviceDriver.setOption(0);
} else {
log.info("等待LMS系统进行确认离开设备号{}", device_code);
log.info("等待LMS系统进行确认离开设备号{},指令号:{}", device_code,ikey);
message = "等待LMS系统进行确认离开,设备号:"+device_code +",指令号:"+ikey;
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -701,33 +711,36 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if(this.getPhase() ==0 ){
phase = "无任务";
} else if (this.getPhase() == 1) {
phase = "1 开始任务";
phase = "1 0X01 开始任务";
} else if (this.getPhase() == 2) {
phase = "2 分配车号";
phase = "2 0X02 分配车号";
} else if (this.getPhase() == 3) {
phase = "3 到达取货点1";
phase = "3 0X03 到达取货点1";
} else if (this.getPhase() == 5) {
phase = "5 取货点1取货完毕";
phase = "5 0X05 取货点1请求离开";
} else if (this.getPhase() == 8) {
phase = "8 到达取货点2";
phase = "8 0X08 到达取货点2";
} else if (this.getPhase() == 10) {
phase = "始任务";
} else if (this.getPhase() == 3) {
phase = "开始任务";
} else if (this.getPhase() == 3) {
phase = "开始任务";
} else if (this.getPhase() == 3) {
phase = "开始任务";
} else if (this.getPhase() == 3) {
phase = "开始任务";
} else if (this.getPhase() == 3) {
phase = "开始任务";
phase = "10 0X0A 取货点2请求离";
} else if (this.getPhase() == 12) {
phase = "12 0X0C 到达放货点";
} else if (this.getPhase() == 14) {
phase = "14 0X0E 放货完成";
} else if (this.getPhase() == 16) {
phase = "16 0X10 到达放货点";
} else if (this.getPhase() == 18) {
phase = "18 0X12 放货完成";
} else if (this.getPhase() == 20) {
phase = "20 0X14 任务完毕";
} else if (this.getPhase() == 100) {
phase = "100 0X64 上报称重";
}
jo.put("isOnline", this.getIsonline());
jo.put("phase", phase);
jo.put("isOnline", true);
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
jo.put("agv_power", this.getAgv_power());
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);

View File

@@ -131,9 +131,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
heartbeat = this.itemProtocol.getHeartbeat();
if(heartbeat != last_heartbeat){
logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
}
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
if (mode != last_mode) {
if (mode == 2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号复位前requireSuccess" + requireSucess);

View File

@@ -151,9 +151,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getTo_command();
heartbeat = this.itemProtocol.getHeartbeat();
if(heartbeat != last_heartbeat){
logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
}
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
if (mode != last_mode) {
if (mode == 2) {
requireSucess = false;

View File

@@ -144,9 +144,9 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
heartbeat = this.itemProtocol.getHeartbeat();
if(heartbeat != last_heartbeat){
logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
}
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
if (mode != last_mode) {
if (mode == 2) {
requireSucess = false;

View File

@@ -141,9 +141,9 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
task = this.itemProtocol.getTask();
weight = this.itemProtocol.getWeight();
heartbeat = this.itemProtocol.getHeartbeat();
if(heartbeat != last_heartbeat){
logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
}
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
if (mode != last_mode) {
if (mode == 2) {
requireSucess = false;

View File

@@ -162,9 +162,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
to_command1 = this.itemProtocol.getTo_command1();
to_command2 = this.itemProtocol.getTo_command2();
heartbeat = this.itemProtocol.getHeartbeat();
if(heartbeat != last_heartbeat){
logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
}
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
if (mode != last_mode) {
if (mode == 2) {
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为:" + requireSucess);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_autodoor;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -7,6 +8,7 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.modules.wql.util.SpringContextHolder;
@@ -20,7 +22,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver {
public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@@ -44,9 +46,10 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem
open = this.itemProtocol.getOpen();
close = this.itemProtocol.getClose();
if (open != last_open) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号open" + last_open + "->" + open);
}
if (close != last_close) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号close" + last_close + "->" + close);
}
@@ -66,4 +69,33 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String open = "";
String close = "";
if(this.getOpen() == 0){
open = "未知";
} else if(this.getOpen() == 1){
open = "开到位";
}
if(this.getClose() == 0){
open = "未知";
} else if(this.getOpen() == 1){
open = "关到位";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("open", open);
jo.put("close", close);
jo.put("isOnline", true);
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -16,6 +16,7 @@ import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyor
import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.EmptyVehicleStackingPositionDeviceDriver;
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.lamp_three_color.LampThreecolorDeviceDriver;
import org.nl.acs.device_driver.basedriver.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
@@ -170,12 +171,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
throw new Exception("未找到对应设备:" + device_code);
}
HongXiangStationDeviceDriver hongXiangStationDeviceDriver;
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
hongXiangStationDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) device.getDeviceDriver();
lampThreecolorDeviceDriver.writing(code, value);
}
}

View File

@@ -290,4 +290,10 @@ public class TaskDto implements Serializable {
* 烘箱温度
*/
private String temperature;
/**
* 车号
*/
private String carno;
}

View File

@@ -680,6 +680,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
if(ObjectUtil.isNotEmpty(dto.getWeight())){
feed_jo.put("weight",dto.getWeight());
}
if(ObjectUtil.isNotEmpty(dto.getCarno())){
feed_jo.put("car_no",dto.getCarno());
}
JSONArray ja = new JSONArray();
ja.add(feed_jo);
String message = null;