更新
This commit is contained in:
@@ -52,23 +52,9 @@ public class StandardConveyorControlDefination implements OpcDeviceDriverDefinat
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getReadableItemDtos() {
|
||||
return getReadableItemDtos2();
|
||||
return ItemProtocol.getReadableItemDtos();
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos2() {
|
||||
List<ItemDto> list = new ArrayList();
|
||||
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0"));
|
||||
list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B2"));
|
||||
list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "DB600.B3"));
|
||||
list.add(new ItemDto(ItemProtocol.item_ioaction, "进出类型", "DB600.B4"));
|
||||
list.add(new ItemDto(ItemProtocol.item_height, "高度类型", "DB600.B5"));
|
||||
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B6"));
|
||||
list.add(new ItemDto(ItemProtocol.item_direction, "电机方向", "DB600.B7"));
|
||||
list.add(new ItemDto(ItemProtocol.item_operation_type, "作业类型", "DB600.B8"));
|
||||
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D22"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getWriteableItemDtos() {
|
||||
|
||||
@@ -51,24 +51,9 @@ public class StandardConveyorControlWithPlcScannerDefination implements OpcDevic
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getReadableItemDtos() {
|
||||
return getReadableItemDtos2();
|
||||
return ItemProtocol.getReadableItemDtos();
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos2() {
|
||||
List<ItemDto> list = new ArrayList();
|
||||
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0"));
|
||||
list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B2"));
|
||||
list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "DB600.B3"));
|
||||
list.add(new ItemDto(ItemProtocol.item_ioaction, "进出类型", "DB600.B4"));
|
||||
list.add(new ItemDto(ItemProtocol.item_height, "高度类型", "DB600.B5"));
|
||||
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B6"));
|
||||
list.add(new ItemDto(ItemProtocol.item_direction, "电机方向", "DB600.B7"));
|
||||
list.add(new ItemDto(ItemProtocol.item_operation_type, "作业类型", "DB600.B8"));
|
||||
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D22"));
|
||||
list.add(new ItemDto(ItemProtocol.item_barcode, "托盘号", "DB600.S26"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getWriteableItemDtos() {
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.opc.WcsConfig;
|
||||
@@ -42,7 +43,7 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
|
||||
public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
@Autowired
|
||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
||||
@@ -546,5 +547,69 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
String mode = "";
|
||||
String action = "";
|
||||
String io_action = "";
|
||||
String move = "";
|
||||
String status = "";
|
||||
if (this.getMode() == 0) {
|
||||
mode = "未联机";
|
||||
} else if (this.getMode() == 1) {
|
||||
mode = "单机";
|
||||
} else if (this.getMode() == 2) {
|
||||
mode = "联机";
|
||||
} else if (this.getMode() == 4) {
|
||||
mode = "人工排产确认";
|
||||
} else if (this.getMode() == 5) {
|
||||
mode = "申请空盘";
|
||||
} else if (this.getMode() == 6) {
|
||||
mode = "申请入库";
|
||||
} else if (this.getMode() == 7) {
|
||||
mode = "码垛完成";
|
||||
} else if (this.getMode() == 8) {
|
||||
mode = "码垛强制完成";
|
||||
} else if (this.getMode() == 9) {
|
||||
mode = "工单完成";
|
||||
}
|
||||
|
||||
if (this.getAction() == 0) {
|
||||
action = "禁止取放";
|
||||
} else if (this.getAction() == 1) {
|
||||
action = "允许取货";
|
||||
} else if (this.getAction() == 2) {
|
||||
action = "允许放货";
|
||||
} else if (this.getAction() == 3) {
|
||||
action = "允许取放";
|
||||
}
|
||||
|
||||
|
||||
if (this.getMove() == 0) {
|
||||
move = "无货";
|
||||
} else if (this.getMove() == 1) {
|
||||
move = "有货";
|
||||
} else if (this.getMove() == 2) {
|
||||
move = "有托盘有货";
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
jo.put("action", action);
|
||||
jo.put("status", status);
|
||||
jo.put("io_action", io_action);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("error", this.getError());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", this.getMessage());
|
||||
jo.put("task", this.getTask());
|
||||
jo.put("barcode", this.getBarcode());
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user