|
|
@ -31,8 +31,8 @@ public class ItemProtocol { |
|
|
|
this.driver = driver; |
|
|
|
} |
|
|
|
|
|
|
|
public String getWeight() { |
|
|
|
return this.getOpcStringValue(item_weight); |
|
|
|
public Float getWeight() { |
|
|
|
return this.getOpcFloatValue(item_weight); |
|
|
|
} |
|
|
|
|
|
|
|
public String getProductCode() { |
|
|
@ -47,32 +47,32 @@ public class ItemProtocol { |
|
|
|
return this.getOpcStringValue(item_product_specifications); |
|
|
|
} |
|
|
|
|
|
|
|
public String getYear() { |
|
|
|
return this.getOpcStringValue(item_year); |
|
|
|
public Integer getYear() { |
|
|
|
return this.getOpcIntegerValue(item_year); |
|
|
|
} |
|
|
|
|
|
|
|
public String getMonth() { |
|
|
|
return this.getOpcStringValue(item_month); |
|
|
|
public Integer getMonth() { |
|
|
|
return this.getOpcIntegerValue(item_month); |
|
|
|
} |
|
|
|
|
|
|
|
public String getDay() { |
|
|
|
return this.getOpcStringValue(item_day); |
|
|
|
public Integer getDay() { |
|
|
|
return this.getOpcIntegerValue(item_day); |
|
|
|
} |
|
|
|
|
|
|
|
public String getHour() { |
|
|
|
return this.getOpcStringValue(item_hour); |
|
|
|
public Integer getHour() { |
|
|
|
return this.getOpcIntegerValue(item_hour); |
|
|
|
} |
|
|
|
|
|
|
|
public String getMinute() { |
|
|
|
return this.getOpcStringValue(item_minute); |
|
|
|
public Integer getMinute() { |
|
|
|
return this.getOpcIntegerValue(item_minute); |
|
|
|
} |
|
|
|
|
|
|
|
public String getSecond() { |
|
|
|
return this.getOpcStringValue(item_second); |
|
|
|
public Integer getSecond() { |
|
|
|
return this.getOpcIntegerValue(item_second); |
|
|
|
} |
|
|
|
|
|
|
|
public String getFlag() { |
|
|
|
return this.getOpcStringValue(item_flag); |
|
|
|
public Integer getFlag() { |
|
|
|
return this.getOpcIntegerValue(item_flag); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -97,6 +97,18 @@ public class ItemProtocol { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Float getOpcFloatValue(String protocol) { |
|
|
|
Float value = this.driver.getFloatValue(protocol); |
|
|
|
if (value == null) { |
|
|
|
//throw new BusinessException("{} : {}", new Object[]{protocol, DeviceErrorProtocol.getMessage(10000)});
|
|
|
|
|
|
|
|
} else { |
|
|
|
return value; |
|
|
|
} |
|
|
|
return 0f; |
|
|
|
} |
|
|
|
|
|
|
|
public String getOpcStringValue(String protocol) { |
|
|
|
String value = this.driver.getStringValue(protocol); |
|
|
|
if (value == null) { |
|
|
|