|
|
@ -32,12 +32,12 @@ public class ItemProtocol { |
|
|
|
return this.getOpcIntegerValue(item_type); |
|
|
|
} |
|
|
|
|
|
|
|
public int getX_coordinate() { |
|
|
|
return this.getOpcIntegerValue(item_x_coordinate); |
|
|
|
public float getX_coordinate() { |
|
|
|
return this.getOpcFloatValue(item_x_coordinate); |
|
|
|
} |
|
|
|
|
|
|
|
public int getY_coordinate() { |
|
|
|
return this.getOpcIntegerValue(item_y_coordinate); |
|
|
|
public float getY_coordinate() { |
|
|
|
return this.getOpcFloatValue(item_y_coordinate); |
|
|
|
} |
|
|
|
|
|
|
|
Boolean isonline; |
|
|
@ -54,12 +54,24 @@ public class ItemProtocol { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public Float getOpcFloatValue(String protocol) { |
|
|
|
Float value = this.driver.getFloatValue(protocol); |
|
|
|
if (value == null) { |
|
|
|
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); |
|
|
|
setIsonline(false); |
|
|
|
} else { |
|
|
|
setIsonline(true); |
|
|
|
return value; |
|
|
|
} |
|
|
|
return 0.00f; |
|
|
|
} |
|
|
|
|
|
|
|
public static List<ItemDto> getReadableItemDtos() { |
|
|
|
ArrayList list = new ArrayList(); |
|
|
|
list.add(new ItemDto(item_status, "AGV状态", "DB602.W0")); |
|
|
|
list.add(new ItemDto(item_type, "AGV任务类型", "DB602.W2")); |
|
|
|
list.add(new ItemDto(item_x_coordinate, "AGVx坐标", "DB602.W4")); |
|
|
|
list.add(new ItemDto(item_y_coordinate, "AGVy坐标", "DB602.W6")); |
|
|
|
list.add(new ItemDto(item_x_coordinate, "AGVx坐标", "DB602.D4")); |
|
|
|
list.add(new ItemDto(item_y_coordinate, "AGVy坐标", "DB602.D6")); |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
@ -67,8 +79,8 @@ public class ItemProtocol { |
|
|
|
ArrayList list = new ArrayList(); |
|
|
|
list.add(new ItemDto(item_status, "AGV状态", "DB602.W0")); |
|
|
|
list.add(new ItemDto(item_type, "AGV任务类型", "DB602.W2")); |
|
|
|
list.add(new ItemDto(item_x_coordinate, "AGVx坐标", "DB602.W4")); |
|
|
|
list.add(new ItemDto(item_y_coordinate, "AGVy坐标", "DB602.W6")); |
|
|
|
list.add(new ItemDto(item_x_coordinate, "AGVx坐标", "DB602.D4")); |
|
|
|
list.add(new ItemDto(item_y_coordinate, "AGVy坐标", "DB602.D6")); |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|