opt: 驱动

This commit is contained in:
2025-09-15 16:44:17 +08:00
parent 83d88b0f56
commit 64ce01bfbf
4 changed files with 9 additions and 41 deletions

View File

@@ -209,28 +209,6 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} }
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
} else if (phase == 0x64) {
log.info("AGV车号{}反馈充电任务下发成功,锁定充电桩{}", agvaddr, station);
Dict dict = dictService.getDictByName3("station", String.valueOf(agvaddr), null);
if (ObjectUtil.isNotEmpty(dict)) {
dict.setValue("1");
dict.setPara2(String.valueOf(agvaddr));
dict.setPara3("下发成功");
dictService.updateDetail(dict);
}
//充电成功
} else if (phase == 0x65) {
log.info("AGV车号{}反馈充电中,充电桩{}", agvaddr, station);
//充电取消上报
} else if (phase == 0x66) {
log.info("AGV车号{}反馈充电任务已取消,释放充电桩{}", agvaddr, station);
Dict dict = dictService.getDictByName3("station", String.valueOf(agvaddr), null);
if (ObjectUtil.isNotEmpty(dict)) {
dict.setValue("0");
dict.setPara2("");
dict.setPara3("充电桩空闲");
dictService.updateDetail(dict);
}
} else { } else {
//上报异常信息 //上报异常信息
//不需要WCS反馈 //不需要WCS反馈

View File

@@ -1332,16 +1332,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
} }
this.setPhase(phase); this.setPhase(phase);
}
//到达位置点
//(需要WCS反馈)
//param,agv货位id待定
else if (phase == 0x64) {
//1、根据货位id找到对应三工位设备赋给agv属性地址对应的满料位设备
agvaddr = arr[18] * 256 + arr[19];
agvaddr_copy = agvaddr;
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
//进入交通灯区域
} else if (phase == 0x50) { } else if (phase == 0x50) {
// 判断自动门、区域需要向LMS请求、电梯 // 判断自动门、区域需要向LMS请求、电梯
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);

View File

@@ -20,7 +20,7 @@ public class ItemProtocol {
/** /**
* 心跳 * 心跳
*/ */
public static String item_heartbeat = "heartbeat"; // public static String item_heartbeat = "heartbeat";
/** /**
* 工作模式 * 工作模式
*/ */
@@ -54,9 +54,9 @@ public class ItemProtocol {
} }
/** =============== 从kep获取plc的值 ================ */ /** =============== 从kep获取plc的值 ================ */
public int getHeartbeat() { // public int getHeartbeat() {
return this.getOpcIntegerValue(item_heartbeat); // return this.getOpcIntegerValue(item_heartbeat);
} // }
public int getMode() { public int getMode() {
return this.getOpcIntegerValue(item_mode); return this.getOpcIntegerValue(item_mode);
@@ -125,7 +125,7 @@ public class ItemProtocol {
*/ */
public static List<ItemDto> getReadableItemDtos() { public static List<ItemDto> getReadableItemDtos() {
ArrayList<ItemDto> list = new ArrayList<>(); ArrayList<ItemDto> list = new ArrayList<>();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0")); // list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1")); list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
list.add(new ItemDto(item_action, "动作信号", "DB1.B3")); list.add(new ItemDto(item_action, "动作信号", "DB1.B3"));
list.add(new ItemDto(item_gross_weight, "毛重", "DB1.B4")); list.add(new ItemDto(item_gross_weight, "毛重", "DB1.B4"));

View File

@@ -43,8 +43,8 @@ public class UnpackingMachineDeviceDriver extends AbstractOpcDeviceDriver implem
private int instruction_require_time_out = 3000; private int instruction_require_time_out = 3000;
/** 心跳 */ /** 心跳 */
int heartbeat = 0; // int heartbeat = 0;
int last_heartbeat = 0; // int last_heartbeat = 0;
/** 工作模式 */ /** 工作模式 */
int mode = 0; int mode = 0;
int last_mode = 0; int last_mode = 0;
@@ -83,7 +83,7 @@ public class UnpackingMachineDeviceDriver extends AbstractOpcDeviceDriver implem
// 具体业务 // 具体业务
try { try {
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
heartbeat = itemProtocol.getHeartbeat(); // heartbeat = itemProtocol.getHeartbeat();
mode = itemProtocol.getMode(); mode = itemProtocol.getMode();
action = itemProtocol.getAction(); action = itemProtocol.getAction();
gross_weight = itemProtocol.getGross_weight(); gross_weight = itemProtocol.getGross_weight();
@@ -107,7 +107,7 @@ public class UnpackingMachineDeviceDriver extends AbstractOpcDeviceDriver implem
} }
last_mode = mode; last_mode = mode;
last_action = action; last_action = action;
last_heartbeat = heartbeat; // last_heartbeat = heartbeat;
last_gross_weight = gross_weight; last_gross_weight = gross_weight;
last_net_weight = net_weight; last_net_weight = net_weight;
last_to_command = to_command; last_to_command = to_command;