|
|
@ -11,21 +11,18 @@ import java.util.List; |
|
|
|
@Data |
|
|
|
public class ItemProtocol { |
|
|
|
|
|
|
|
public static String item_heartbeat = "heartbeat"; |
|
|
|
public static String item_mode = "mode"; |
|
|
|
public static String item_move = "move"; |
|
|
|
public static String item_action = "action"; |
|
|
|
public static String item_ioaction = "ioaction"; |
|
|
|
public static String item_error = "error"; |
|
|
|
public static String item_task = "task"; |
|
|
|
public static String item_to_command = "to_command"; |
|
|
|
public static String item_to_target = "to_target"; |
|
|
|
public static String item_to_task = "to_task"; |
|
|
|
|
|
|
|
public static String item_weight = "weight"; |
|
|
|
public static String item_product_code = "product_code"; |
|
|
|
public static String item_batch_code = "batch_code"; |
|
|
|
public static String item_product_specifications = "product_specifications"; |
|
|
|
public static String item_time = "time"; |
|
|
|
public static String item_year = "year"; |
|
|
|
public static String item_month = "month"; |
|
|
|
public static String item_day = "day"; |
|
|
|
public static String item_hour = "hour"; |
|
|
|
public static String item_minute = "minute"; |
|
|
|
public static String item_second = "second"; |
|
|
|
|
|
|
|
|
|
|
|
private StandardInspectSiteSmartDeviceDriver driver; |
|
|
|
|
|
|
@ -33,30 +30,6 @@ public class ItemProtocol { |
|
|
|
this.driver = driver; |
|
|
|
} |
|
|
|
|
|
|
|
public int getHeartbeat() { |
|
|
|
return this.getOpcIntegerValue(item_heartbeat); |
|
|
|
} |
|
|
|
|
|
|
|
public int getMode() { |
|
|
|
return this.getOpcIntegerValue(item_mode); |
|
|
|
} |
|
|
|
|
|
|
|
public int getMove() { |
|
|
|
return this.getOpcIntegerValue(item_move); |
|
|
|
} |
|
|
|
|
|
|
|
public int getIoaction() { |
|
|
|
return this.getOpcIntegerValue(item_ioaction); |
|
|
|
} |
|
|
|
|
|
|
|
public int getError() { |
|
|
|
return this.getOpcIntegerValue(item_error); |
|
|
|
} |
|
|
|
|
|
|
|
public int getTask() { |
|
|
|
return this.getOpcIntegerValue(item_task); |
|
|
|
} |
|
|
|
|
|
|
|
public String getWeight() { |
|
|
|
return this.getOpcStringValue(item_weight); |
|
|
|
} |
|
|
@ -73,23 +46,32 @@ public class ItemProtocol { |
|
|
|
return this.getOpcStringValue(item_product_specifications); |
|
|
|
} |
|
|
|
|
|
|
|
public String getTime() { |
|
|
|
return this.getOpcStringValue(item_time); |
|
|
|
public String getYear() { |
|
|
|
return this.getOpcStringValue(item_year); |
|
|
|
} |
|
|
|
|
|
|
|
public String getMonth() { |
|
|
|
return this.getOpcStringValue(item_month); |
|
|
|
} |
|
|
|
|
|
|
|
public String getDay() { |
|
|
|
return this.getOpcStringValue(item_day); |
|
|
|
} |
|
|
|
|
|
|
|
public int getToCommand() { |
|
|
|
return this.getOpcIntegerValue(item_to_command); |
|
|
|
public String getHour() { |
|
|
|
return this.getOpcStringValue(item_hour); |
|
|
|
} |
|
|
|
|
|
|
|
public int getToTarget() { |
|
|
|
return this.getOpcIntegerValue(item_to_target); |
|
|
|
public String getMinute() { |
|
|
|
return this.getOpcStringValue(item_minute); |
|
|
|
} |
|
|
|
|
|
|
|
public int getToTask() { |
|
|
|
return this.getOpcIntegerValue(item_to_task); |
|
|
|
public String getSecond() { |
|
|
|
return this.getOpcStringValue(item_second); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//是否有货
|
|
|
|
public int hasGoods(int move) { |
|
|
|
return move; |
|
|
@ -123,25 +105,23 @@ public class ItemProtocol { |
|
|
|
|
|
|
|
public static List<ItemDto> getReadableItemDtos() { |
|
|
|
ArrayList list = new ArrayList(); |
|
|
|
list.add(new ItemDto(item_heartbeat, "心跳", "VW0")); |
|
|
|
list.add(new ItemDto(item_mode, "工作状态", "VW2", Boolean.valueOf(true))); |
|
|
|
list.add(new ItemDto(item_move, "光电开关信号", "VW4")); |
|
|
|
list.add(new ItemDto(item_action, "动作信号", "VW8")); |
|
|
|
list.add(new ItemDto(item_error, "报警信号", "VW12")); |
|
|
|
list.add(new ItemDto(item_task, "任务号", "VD14")); |
|
|
|
list.add(new ItemDto(item_product_code, "产品名称", "VW18")); |
|
|
|
list.add(new ItemDto(item_batch_code, "批次号", "VW20", Boolean.valueOf(true))); |
|
|
|
list.add(new ItemDto(item_product_specifications, "产品规格", "VW40")); |
|
|
|
list.add(new ItemDto(item_weight, "重量", "VW50")); |
|
|
|
list.add(new ItemDto(item_time, "时间", "VW60")); |
|
|
|
list.add(new ItemDto(item_product_code, "产品名称", "VB3251 ")); |
|
|
|
list.add(new ItemDto(item_batch_code, "批次号", "VB3264")); |
|
|
|
list.add(new ItemDto(item_product_specifications, "产品规格", "VB3277")); |
|
|
|
list.add(new ItemDto(item_weight, "重量", "VD380")); |
|
|
|
list.add(new ItemDto(item_year, "年", "VB1056")); |
|
|
|
list.add(new ItemDto(item_month, "月", "VB1057")); |
|
|
|
list.add(new ItemDto(item_day, "日", "VB1058")); |
|
|
|
list.add(new ItemDto(item_hour, "时", "VB1059")); |
|
|
|
list.add(new ItemDto(item_minute, "分", "VB1060")); |
|
|
|
list.add(new ItemDto(item_second, "秒", "VB1061")); |
|
|
|
|
|
|
|
|
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
public static List<ItemDto> getWriteableItemDtos() { |
|
|
|
ArrayList list = new ArrayList(); |
|
|
|
list.add(new ItemDto(item_to_command, "作业命令", "VW52", Boolean.valueOf(true))); |
|
|
|
list.add(new ItemDto(item_to_target, "目标站", "VW54")); |
|
|
|
list.add(new ItemDto(item_to_task, "任务号", "VD58")); |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|