|
|
@ -43,6 +43,8 @@ public class ItemProtocol { |
|
|
|
public static String item_flatness = "flatness"; |
|
|
|
public static String item_unqualified_qty = "unqualified_qty"; |
|
|
|
|
|
|
|
public static String item_weight = "weight"; |
|
|
|
|
|
|
|
public static String item_to_command = "to_command"; |
|
|
|
public static String item_to_error = "to_error"; |
|
|
|
public static String item_to_order_No = "to_order_No"; |
|
|
@ -129,44 +131,48 @@ public class ItemProtocol { |
|
|
|
return this.getOpcStringValue(item_grinding_number); |
|
|
|
} |
|
|
|
|
|
|
|
public int getHeight1() { |
|
|
|
return this.getOpcIntegerValue(item_height1); |
|
|
|
public float getHeight1() { |
|
|
|
return this.getOpcFloatValue(item_height1); |
|
|
|
} |
|
|
|
|
|
|
|
public float getHeight2() { |
|
|
|
return this.getOpcFloatValue(item_height2); |
|
|
|
} |
|
|
|
|
|
|
|
public int getHeight2() { |
|
|
|
return this.getOpcIntegerValue(item_height2); |
|
|
|
public float getHeight3() { |
|
|
|
return this.getOpcFloatValue(item_height3); |
|
|
|
} |
|
|
|
|
|
|
|
public int getHeight3() { |
|
|
|
return this.getOpcIntegerValue(item_height3); |
|
|
|
public float getHeight4() { |
|
|
|
return this.getOpcFloatValue(item_height4); |
|
|
|
} |
|
|
|
|
|
|
|
public int getHeight4() { |
|
|
|
return this.getOpcIntegerValue(item_height4); |
|
|
|
public float getWidth1() { |
|
|
|
return this.getOpcFloatValue(item_width1); |
|
|
|
} |
|
|
|
|
|
|
|
public int getWidth1() { |
|
|
|
return this.getOpcIntegerValue(item_width1); |
|
|
|
public float getWidth2() { |
|
|
|
return this.getOpcFloatValue(item_width2); |
|
|
|
} |
|
|
|
|
|
|
|
public int getWidth2() { |
|
|
|
return this.getOpcIntegerValue(item_width2); |
|
|
|
public float getLen() { |
|
|
|
return this.getOpcFloatValue(item_len); |
|
|
|
} |
|
|
|
|
|
|
|
public int getLen() { |
|
|
|
return this.getOpcIntegerValue(item_len); |
|
|
|
public float getVolume() { |
|
|
|
return this.getOpcFloatValue(item_volume); |
|
|
|
} |
|
|
|
|
|
|
|
public int getVolume() { |
|
|
|
return this.getOpcIntegerValue(item_volume); |
|
|
|
public float getFlatness() { |
|
|
|
return this.getOpcFloatValue(item_flatness); |
|
|
|
} |
|
|
|
|
|
|
|
public int getFlatness() { |
|
|
|
return this.getOpcIntegerValue(item_flatness); |
|
|
|
public float getUnqualified_qty() { |
|
|
|
return this.getOpcFloatValue(item_unqualified_qty); |
|
|
|
} |
|
|
|
|
|
|
|
public int getUnqualified_qty() { |
|
|
|
return this.getOpcIntegerValue(item_unqualified_qty); |
|
|
|
public Float getWeight() { |
|
|
|
return this.getOpcFloatValue(item_weight); |
|
|
|
} |
|
|
|
|
|
|
|
Boolean isonline; |
|
|
@ -194,6 +200,16 @@ public class ItemProtocol { |
|
|
|
return "0"; |
|
|
|
} |
|
|
|
|
|
|
|
public Float getOpcFloatValue(String protocol) { |
|
|
|
Float value = this.driver.getFloatValue(protocol); |
|
|
|
if (ObjectUtil.isEmpty(value)) { |
|
|
|
// log.error("读取错误!");
|
|
|
|
} else { |
|
|
|
return value; |
|
|
|
} |
|
|
|
return 0f; |
|
|
|
} |
|
|
|
|
|
|
|
public static List<ItemDto> getReadableItemDtos() { |
|
|
|
ArrayList list = new ArrayList(); |
|
|
|
list.add(new ItemDto(item_heartbeat, "心跳", "DB112.B0")); |
|
|
@ -220,6 +236,7 @@ public class ItemProtocol { |
|
|
|
list.add(new ItemDto(item_volume, "体积", "DB112.REAL206")); |
|
|
|
list.add(new ItemDto(item_flatness, "平面度", "DB112.REAL210")); |
|
|
|
list.add(new ItemDto(item_unqualified_qty, "缺陷个数", "DB112.REAL214")); |
|
|
|
list.add(new ItemDto(item_weight, "重量", "DB112.REAL218")); |
|
|
|
|
|
|
|
return list; |
|
|
|
} |
|
|
|