opt: 优化设备监控中的纸管库

This commit is contained in:
yanps
2023-12-14 13:50:12 +08:00
parent ac19e9145e
commit 4338fe8955
4 changed files with 192 additions and 59 deletions

View File

@@ -351,58 +351,58 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "1001.W0"));
list.add(new ItemDto(item_mode, "工作模式", "1001.W2"));
list.add(new ItemDto(item_move, "光电信号", "1001.W4"));
list.add(new ItemDto(item_carrier_direction, "托盘方向", "1001.W6"));
list.add(new ItemDto(item_error, "报警", "1001.W8"));
list.add(new ItemDto(item_task, "任务号", "1001.W10"));
list.add(new ItemDto(item_out_seq_arr, "出库顺序数组", "1001.String.150"));
list.add(new ItemDto(item_out_qty_arr, "出库数量数组", "1001.W166"));
list.add(new ItemDto(item_material1, "物料1", "1001.String170.50"));
list.add(new ItemDto(item_qty1, "数量1", "1001.W222"));
list.add(new ItemDto(item_material2, "物料2", "1001.String224.50"));
list.add(new ItemDto(item_qty2, "数量2", "1001.W276"));
list.add(new ItemDto(item_material3, "物料3", "1001.String278.50"));
list.add(new ItemDto(item_qty3, "数量3", "1001.W330"));
list.add(new ItemDto(item_material4, "物料4", "1001.String332.50"));
list.add(new ItemDto(item_qty4, "数量4", "1001.W384"));
list.add(new ItemDto(item_material5, "物料5", "1001.String386.50"));
list.add(new ItemDto(item_qty5, "数量5", "1001.W438"));
list.add(new ItemDto(item_material6, "物料6", "1001.String440.50"));
list.add(new ItemDto(item_qty6, "数量6", "1001.W492"));
list.add(new ItemDto(item_material7, "物料7", "1001.String494.50"));
list.add(new ItemDto(item_qty7, "数量7", "1001.W546"));
list.add(new ItemDto(item_material8, "物料8", "1001.String548.50"));
list.add(new ItemDto(item_qty8, "数量8", "1001.W600"));
list.add(new ItemDto(item_material9, "物料9", "1001.String602.50"));
list.add(new ItemDto(item_qty9, "数量9", "1001.W654"));
list.add(new ItemDto(item_material10, "物料10", "1001.String656.50"));
list.add(new ItemDto(item_qty10, "数量10", "1001.W708"));
list.add(new ItemDto(item_material11, "物料11", "1001.String710.50"));
list.add(new ItemDto(item_qty11, "数量11", "1001.W762"));
list.add(new ItemDto(item_material12, "物料12", "1001.String764.50"));
list.add(new ItemDto(item_qty12, "数量12", "1001.W816"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1001.W0"));
list.add(new ItemDto(item_mode, "工作模式", "DB1001.W2"));
list.add(new ItemDto(item_move, "光电信号", "DB1001.W4"));
list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB1001.W6"));
list.add(new ItemDto(item_error, "报警", "DB1001.W8"));
list.add(new ItemDto(item_task, "任务号", "DB1001.W10"));
list.add(new ItemDto(item_out_seq_arr, "出库顺序数组", "DB1001.String.150"));
list.add(new ItemDto(item_out_qty_arr, "出库数量数组", "DB1001.W166"));
list.add(new ItemDto(item_material1, "物料1", "DB1001.String170.50"));
list.add(new ItemDto(item_qty1, "数量1", "DB1001.W222"));
list.add(new ItemDto(item_material2, "物料2", "DB1001.String224.50"));
list.add(new ItemDto(item_qty2, "数量2", "DB1001.W276"));
list.add(new ItemDto(item_material3, "物料3", "DB1001.String278.50"));
list.add(new ItemDto(item_qty3, "数量3", "DB1001.W330"));
list.add(new ItemDto(item_material4, "物料4", "DB1001.String332.50"));
list.add(new ItemDto(item_qty4, "数量4", "DB1001.W384"));
list.add(new ItemDto(item_material5, "物料5", "DB1001.String386.50"));
list.add(new ItemDto(item_qty5, "数量5", "DB1001.W438"));
list.add(new ItemDto(item_material6, "物料6", "DB1001.String440.50"));
list.add(new ItemDto(item_qty6, "数量6", "DB1001.W492"));
list.add(new ItemDto(item_material7, "物料7", "DB1001.String494.50"));
list.add(new ItemDto(item_qty7, "数量7", "DB1001.W546"));
list.add(new ItemDto(item_material8, "物料8", "DB1001.String548.50"));
list.add(new ItemDto(item_qty8, "数量8", "DB1001.W600"));
list.add(new ItemDto(item_material9, "物料9", "DB1001.String602.50"));
list.add(new ItemDto(item_qty9, "数量9", "DB1001.W654"));
list.add(new ItemDto(item_material10, "物料10", "DB1001.String656.50"));
list.add(new ItemDto(item_qty10, "数量10", "DB1001.W708"));
list.add(new ItemDto(item_material11, "物料11", "DB1001.String710.50"));
list.add(new ItemDto(item_qty11, "数量11", "DB1001.W762"));
list.add(new ItemDto(item_material12, "物料12", "DB1001.String764.50"));
list.add(new ItemDto(item_qty12, "数量12", "DB1001.W816"));
return list;
}
public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_target , "下发仓位号", "1002.W0"));
list.add(new ItemDto(item_to_command, "下发命令", "1002.W2"));
list.add(new ItemDto(item_to_task, "下发任务号", "1002.DW4"));
list.add(new ItemDto(item_to_material1, "下发物料1", "1002.String8.50"));
list.add(new ItemDto(item_to_out_qty1, "下发物料1数量", "1002.W60"));
list.add(new ItemDto(item_to_seq1, "出库顺序1", "1002.W62"));
list.add(new ItemDto(item_to_position1, "仓位1", "1002.W64"));
list.add(new ItemDto(item_to_material2, "下发物料2", "1002.String66.50"));
list.add(new ItemDto(item_to_out_qty2, "下发物料2数量", "1002.W118"));
list.add(new ItemDto(item_to_seq2, "出库顺序2", "1002.W120"));
list.add(new ItemDto(item_to_position2, "仓位2", "1002.W122"));
list.add(new ItemDto(item_to_material3, "下发物料3", "1002.String124.50"));
list.add(new ItemDto(item_to_out_qty3, "下发物料3数量", "1002.W176"));
list.add(new ItemDto(item_to_seq3, "出库顺序3", "1002.W178"));
list.add(new ItemDto(item_to_position3, "仓位3", "1002.W180"));
list.add(new ItemDto(item_to_target , "下发仓位号", "DB1002.W0"));
list.add(new ItemDto(item_to_command, "下发命令", "DB1002.W2"));
list.add(new ItemDto(item_to_task, "下发任务号", "DB1002.DW4"));
list.add(new ItemDto(item_to_material1, "下发物料1", "DB1002.String8.50"));
list.add(new ItemDto(item_to_out_qty1, "下发物料1数量", "DB1002.W60"));
list.add(new ItemDto(item_to_seq1, "出库顺序1", "DB1002.W62"));
list.add(new ItemDto(item_to_position1, "仓位1", "DB1002.W64"));
list.add(new ItemDto(item_to_material2, "下发物料2", "DB1002.String66.50"));
list.add(new ItemDto(item_to_out_qty2, "下发物料2数量", "DB1002.W118"));
list.add(new ItemDto(item_to_seq2, "出库顺序2", "DB1002.W120"));
list.add(new ItemDto(item_to_position2, "仓位2", "DB1002.W122"));
list.add(new ItemDto(item_to_material3, "下发物料3", "DB1002.String124.50"));
list.add(new ItemDto(item_to_out_qty3, "下发物料3数量", "DB1002.W176"));
list.add(new ItemDto(item_to_seq3, "出库顺序3", "DB1002.W178"));
list.add(new ItemDto(item_to_position3, "仓位3", "DB1002.W180"));
return list;
}

View File

@@ -686,7 +686,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
//JSONObject jo = new JSONObject();
String mode = "";
String move = "";
@@ -706,15 +706,70 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
}else if(this.getMove() == 1){
move = "有托盘";
}
jo.put("device_name", this.getDevice().getDevice_name());
/*jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("inventory_qty", item_qty1);
jo.put("move", move);
jo.put("out_finish", out_finish);
jo.put("material", item_material1);
jo.put("isOnline", this.getIsonline());
jo.put("material1", this.getItem_material1());
jo.put("z_qty1", this.getItem_qty1());
jo.put("material2", this.getItem_material2());
jo.put("z_qty2", this.getItem_qty2());
jo.put("material3", this.getItem_material3());
jo.put("z_qty3", this.getItem_qty3());
jo.put("material4", this.getItem_material4());
jo.put("z_qty4", this.getItem_qty4());
jo.put("material5", this.getItem_material5());
jo.put("z_qty5", this.getItem_qty5());
jo.put("material6", this.getItem_material6());
jo.put("z_qty6", this.getItem_qty6());
jo.put("material7", this.getItem_material7());
jo.put("z_qty7", this.getItem_qty7());
jo.put("material8", this.getItem_material8());
jo.put("z_qty8", this.getItem_qty8());
jo.put("material9", this.getItem_material9());
jo.put("z_qty9", this.getItem_qty9());
jo.put("material10", this.getItem_material10());
jo.put("z_qty10", this.getItem_qty10());
jo.put("material11", this.getItem_material11());
jo.put("z_qty11", this.getItem_qty11());
jo.put("material12", this.getItem_material12());
jo.put("z_qty12", this.getItem_qty12());*/
Map<String, Object> map = new LinkedHashMap<>();
map.put("device_name", this.getDevice().getDevice_name());
map.put("mode", mode);
map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
map.put("move", move);
map.put("isOnline", this.getIsonline());
map.put("material1", this.getItem_material1());
map.put("z_qty1", this.getItem_qty1());
map.put("material2", this.getItem_material2());
map.put("z_qty2", this.getItem_qty2());
map.put("material3", this.getItem_material3());
map.put("z_qty3", this.getItem_qty3());
map.put("material4", this.getItem_material4());
map.put("z_qty4", this.getItem_qty4());
map.put("material5", this.getItem_material5());
map.put("z_qty5", this.getItem_qty5());
map.put("material6", this.getItem_material6());
map.put("z_qty6", this.getItem_qty6());
map.put("material7", this.getItem_material7());
map.put("z_qty7", this.getItem_qty7());
map.put("material8", this.getItem_material8());
map.put("z_qty8", this.getItem_qty8());
map.put("material9", this.getItem_material9());
map.put("z_qty9", this.getItem_qty9());
map.put("material10", this.getItem_material10());
map.put("z_qty10", this.getItem_qty10());
map.put("material11", this.getItem_material11());
map.put("z_qty11", this.getItem_qty11());
map.put("material12", this.getItem_material12());
map.put("z_qty12", this.getItem_qty12());
JSONObject jo = new JSONObject(map);
return jo;
}