This commit is contained in:
2023-12-13 09:00:41 +08:00
7 changed files with 51 additions and 33 deletions

View File

@@ -230,7 +230,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
log.info("下发电气信号失败:" + e.getMessage()); log.info("下发电气信号失败:" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
if (standardAutodoorDeviceDriver.getOpen() == 1) { if (standardAutodoorDeviceDriver.getOpen() == 1 && standardAutodoorDeviceDriver.getToOpen() == 1 ) {
log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }

View File

@@ -194,10 +194,10 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
String device_code = dto.getDevice_code(); String device_code = dto.getDevice_code();
DeviceDto deviceDto = this.findByCode(device_code); DeviceDto deviceDto = this.findByCode(device_code);
if (deviceDto != null && deviceDto.getIs_delete().equals("0") // if (deviceDto != null && deviceDto.getIs_delete().equals("0")
&& !deviceDto.getDevice_id().equals(dto.getDevice_id())) { // && !deviceDto.getDevice_id().equals(dto.getDevice_id())) {
throw new BadRequestException("存在相同的设备编码"); // throw new BadRequestException("存在相同的设备编码");
} // }
String currentUsername = SecurityUtils.getCurrentUsername(); String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now(); String now = DateUtil.now();

View File

@@ -89,10 +89,14 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
//报警 //报警
int error = 0; int error = 0;
int last_error = 0; int last_error = 0;
//任务号 //任务号1
int task = 0; int task = 0;
int last_task = 0; int last_task = 0;
//任务号2
int task1 = 0;
int last_task1 = 0;
String material1 = null; String material1 = null;
String last_material1 = null; String last_material1 = null;
@@ -136,6 +140,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
carrier_direction = this.itemProtocol.getCarrier_direction(); carrier_direction = this.itemProtocol.getCarrier_direction();
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
task1 = this.itemProtocol.getTask1();
material1 = this.itemProtocol.getMaterial1(); material1 = this.itemProtocol.getMaterial1();
material2 = this.itemProtocol.getMaterial2(); material2 = this.itemProtocol.getMaterial2();
qty = this.itemProtocol.getQty(); qty = this.itemProtocol.getQty();
@@ -161,6 +166,10 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task); logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task);
} }
if (task1 != last_task1) {
logServer.deviceItemValue(this.device_code, "task1", String.valueOf(task1));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task1" + last_task1 + "->" + task1);
}
if (error != last_error) { if (error != last_error) {
if (error != 0) { if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto(); DeviceErrorLogDto dto = new DeviceErrorLogDto();
@@ -195,7 +204,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceExecuteLog(this.device_code, "", "", "信号qty" + last_qty + "->" + qty); logServer.deviceExecuteLog(this.device_code, "", "", "信号qty" + last_qty + "->" + qty);
} }
if (move != 0 && task > 1) { if (move != 0 && task > 1 && task1 > 0) {
update_instruction_status(); update_instruction_status();
} }
@@ -216,6 +225,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
message = ""; message = "";
Instruction instruction = null; Instruction instruction = null;
List toInstructions; List toInstructions;
//纸管库申请任务 //纸管库申请任务
switch (mode) { switch (mode) {

View File

@@ -22,8 +22,10 @@ public class ItemProtocol {
public static String item_carrier_direction = "carrier_direction"; public static String item_carrier_direction = "carrier_direction";
//报警 //报警
public static String item_error = "error"; public static String item_error = "error";
//任务号 //任务号1
public static String item_task = "task"; public static String item_task = "task";
//任务号2
public static String item_task1 = "task1";
//物料1 //物料1
public static String item_material1 = "material1"; public static String item_material1 = "material1";
//物料2 //物料2
@@ -66,6 +68,10 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_task); return this.getOpcIntegerValue(item_task);
} }
public int getTask1() {
return this.getOpcIntegerValue(item_task1);
}
public String getMaterial1() { public String getMaterial1() {
return this.getOpcStringValue(item_material1); return this.getOpcStringValue(item_material1);
} }
@@ -108,19 +114,20 @@ public class ItemProtocol {
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB101.W0")); list.add(new ItemDto(item_heartbeat, "心跳", "DB101.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB101.W2")); list.add(new ItemDto(item_mode, "工作模式", "DB101.W2"));
list.add(new ItemDto(item_move, "光电信号", "DB101.W3")); list.add(new ItemDto(item_move, "光电信号", "DB101.W4"));
list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB101.W4")); list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB101.W6"));
list.add(new ItemDto(item_error, "报警", "DB101.W58")); list.add(new ItemDto(item_error, "报警", "DB101.W8"));
list.add(new ItemDto(item_task, "任务号", "DB101.W6")); list.add(new ItemDto(item_task, "任务号1", "DB101.D116"));
list.add(new ItemDto(item_material1, "物料1", "DB101.W7")); list.add(new ItemDto(item_task1, "任务号2", "DB101.D118"));
list.add(new ItemDto(item_material2, "物料2", "DB101.W8")); list.add(new ItemDto(item_material1, "物料1", "DB102.STRING10.50"));
list.add(new ItemDto(item_material2, "物料2", "DB102.STRING62.50"));
list.add(new ItemDto(item_qty, "数量", "DB101.W114")); list.add(new ItemDto(item_qty, "数量", "DB101.W114"));
return list; return list;
} }
public static List<ItemDto> getWriteableItemDtos() { public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "下发命令", "DB201.W4")); list.add(new ItemDto(item_to_command, "下发命令", "DB201.W0"));
return list; return list;
} }

View File

@@ -16,7 +16,7 @@ public class ItemProtocol {
public static String item_move = "move"; public static String item_move = "move";
public static String item_error = "error"; public static String item_error = "error";
public static String item_task1 = "task1"; public static String item_task1 = "task1";
public static String item_task2 = "task2"; // public static String item_task2 = "task2";
public static String item_to_command = "to_command"; public static String item_to_command = "to_command";
private PluggingUnpluggingMachineDeviceDriver driver; private PluggingUnpluggingMachineDeviceDriver driver;
@@ -44,9 +44,9 @@ public class ItemProtocol {
public int getTask1() { public int getTask1() {
return this.getOpcIntegerValue(item_task1); return this.getOpcIntegerValue(item_task1);
} }
public int getTask2() { // public int getTask2() {
return this.getOpcIntegerValue(item_task2); // return this.getOpcIntegerValue(item_task2);
} // }
public int getToCommand() { public int getToCommand() {
return this.getOpcIntegerValue(item_to_command); return this.getOpcIntegerValue(item_to_command);
@@ -80,7 +80,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3")); list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3"));
list.add(new ItemDto(item_error, "报警信号", "DB600.B5")); list.add(new ItemDto(item_error, "报警信号", "DB600.B5"));
list.add(new ItemDto(item_task1, "任务号1(行架任务号)", "DB600.D6")); list.add(new ItemDto(item_task1, "任务号1(行架任务号)", "DB600.D6"));
list.add(new ItemDto(item_task2, "任务号2(纸管任务号)", "DB600.D10")); // list.add(new ItemDto(item_task2, "任务号2(纸管任务号)", "DB600.D10"));
return list; return list;
} }

View File

@@ -62,12 +62,12 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
int error = 0; int error = 0;
int move = 0; int move = 0;
int task1 = 0; int task1 = 0;
int task2 = 0; // int task2 = 0;
int last_mode = 0; int last_mode = 0;
int last_error = 0; int last_error = 0;
int last_move = 0; int last_move = 0;
int last_task1 = 0; int last_task1 = 0;
int last_task2 = 0; // int last_task2 = 0;
Boolean isonline = true; Boolean isonline = true;
Boolean iserror = false; Boolean iserror = false;
@@ -98,7 +98,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
move = this.itemProtocol.getMove(); move = this.itemProtocol.getMove();
task1 = this.itemProtocol.getTask1(); task1 = this.itemProtocol.getTask1();
task2 = this.itemProtocol.getTask2(); // task2 = this.itemProtocol.getTask2();
if (mode != last_mode) { if (mode != last_mode) {
this.requireSucess=false; this.requireSucess=false;
@@ -137,12 +137,12 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
case 3: case 3:
break; break;
case 4: case 4:
if ((task1 > 0 || task2 > 0) && !requireSucess) { if ((task1 > 0) && !requireSucess) {
applyBushing(); applyBushing();
} }
break; break;
case 5: case 5:
if ((task1 > 0 || task2 > 0) && !requireSucess) { if ((task1 > 0) && !requireSucess) {
bushingSucess(); bushingSucess();
} }
break; break;
@@ -161,7 +161,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
last_error = error; last_error = error;
last_move = move; last_move = move;
last_task1 = task1; last_task1 = task1;
last_task2 = task2; // last_task2 = task2;
} }
private synchronized void pullingSucess() { private synchronized void pullingSucess() {
@@ -194,12 +194,12 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
ApplyManipulatorActionResponse applyManipulatorActionResponse; ApplyManipulatorActionResponse applyManipulatorActionResponse;
Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
Instruction inst2 = instructionService.findByCode(String.valueOf(task2)); // Instruction inst2 = instructionService.findByCode(String.valueOf(task2));
String task_code1 = inst1.getTask_code(); String task_code1 = inst1.getTask_code();
String task_code2 = inst2.getTask_code(); // String task_code2 = inst2.getTask_code();
applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setDevice_code(device_code);
applyManipulatorActionRequest.setTask_code1(task_code1); applyManipulatorActionRequest.setTask_code1(task_code1);
applyManipulatorActionRequest.setTask_code2(task_code2); // applyManipulatorActionRequest.setTask_code2(task_code2);
applyManipulatorActionRequest.setType("7"); applyManipulatorActionRequest.setType("7");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse.getstatus()==200) { if (applyManipulatorActionResponse.getstatus()==200) {
@@ -224,12 +224,12 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
ApplyManipulatorActionResponse applyManipulatorActionResponse; ApplyManipulatorActionResponse applyManipulatorActionResponse;
Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
Instruction inst2 = instructionService.findByCode(String.valueOf(task2)); // Instruction inst2 = instructionService.findByCode(String.valueOf(task2));
String task_code1 = inst1.getTask_code(); String task_code1 = inst1.getTask_code();
String task_code2 = inst2.getTask_code(); // String task_code2 = inst2.getTask_code();
applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setDevice_code(device_code);
applyManipulatorActionRequest.setTask_code1(task_code1); applyManipulatorActionRequest.setTask_code1(task_code1);
applyManipulatorActionRequest.setTask_code2(task_code2); // applyManipulatorActionRequest.setTask_code2(task_code2);
applyManipulatorActionRequest.setType("6"); applyManipulatorActionRequest.setType("6");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse.getstatus()==200) { if (applyManipulatorActionResponse.getstatus()==200) {

View File

@@ -316,6 +316,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("carrier_direction", casingStationConveyorDeviceDriver.getCarrier_direction()); jo.put("carrier_direction", casingStationConveyorDeviceDriver.getCarrier_direction());
jo.put("error", casingStationConveyorDeviceDriver.getError()); jo.put("error", casingStationConveyorDeviceDriver.getError());
jo.put("task", casingStationConveyorDeviceDriver.getTask()); jo.put("task", casingStationConveyorDeviceDriver.getTask());
jo.put("task1", casingStationConveyorDeviceDriver.getTask1());
jo.put("material1", casingStationConveyorDeviceDriver.getMaterial1()); jo.put("material1", casingStationConveyorDeviceDriver.getMaterial1());
jo.put("material2", casingStationConveyorDeviceDriver.getMaterial2()); jo.put("material2", casingStationConveyorDeviceDriver.getMaterial2());
jo.put("qty", casingStationConveyorDeviceDriver.getQty()); jo.put("qty", casingStationConveyorDeviceDriver.getQty());
@@ -484,7 +485,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("mode", driver.getMode()); jo.put("mode", driver.getMode());
jo.put("move", driver.getMove()); jo.put("move", driver.getMove());
jo.put("task1", driver.getTask1()); jo.put("task1", driver.getTask1());
jo.put("task2", driver.getTask2()); // jo.put("task2", driver.getTask2());
jo.put("error", driver.getError()); jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError()))); jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError())));
} else { } else {