rev 驱动更新
This commit is contained in:
@@ -31,8 +31,8 @@ public class ItemProtocol {
|
|||||||
this.driver = driver;
|
this.driver = driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getWeight() {
|
public Float getWeight() {
|
||||||
return this.getOpcStringValue(item_weight);
|
return this.getOpcFloatValue(item_weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProductCode() {
|
public String getProductCode() {
|
||||||
@@ -47,32 +47,32 @@ public class ItemProtocol {
|
|||||||
return this.getOpcStringValue(item_product_specifications);
|
return this.getOpcStringValue(item_product_specifications);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getYear() {
|
public Integer getYear() {
|
||||||
return this.getOpcStringValue(item_year);
|
return this.getOpcIntegerValue(item_year);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMonth() {
|
public Integer getMonth() {
|
||||||
return this.getOpcStringValue(item_month);
|
return this.getOpcIntegerValue(item_month);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDay() {
|
public Integer getDay() {
|
||||||
return this.getOpcStringValue(item_day);
|
return this.getOpcIntegerValue(item_day);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHour() {
|
public Integer getHour() {
|
||||||
return this.getOpcStringValue(item_hour);
|
return this.getOpcIntegerValue(item_hour);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMinute() {
|
public Integer getMinute() {
|
||||||
return this.getOpcStringValue(item_minute);
|
return this.getOpcIntegerValue(item_minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSecond() {
|
public Integer getSecond() {
|
||||||
return this.getOpcStringValue(item_second);
|
return this.getOpcIntegerValue(item_second);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFlag() {
|
public Integer getFlag() {
|
||||||
return this.getOpcStringValue(item_flag);
|
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) {
|
public String getOpcStringValue(String protocol) {
|
||||||
String value = this.driver.getStringValue(protocol);
|
String value = this.driver.getStringValue(protocol);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
|||||||
@@ -144,8 +144,8 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
|
|||||||
Boolean islock = false;
|
Boolean islock = false;
|
||||||
|
|
||||||
// 重量
|
// 重量
|
||||||
private String weight;
|
private Float weight;
|
||||||
private String last_weight;
|
private Float last_weight;
|
||||||
|
|
||||||
// 产品名称
|
// 产品名称
|
||||||
private String product_code;
|
private String product_code;
|
||||||
@@ -160,24 +160,24 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
|
|||||||
private String last_product_specifications;
|
private String last_product_specifications;
|
||||||
|
|
||||||
// 时间
|
// 时间
|
||||||
private String year;
|
private int year;
|
||||||
private String last_year;
|
private int last_year;
|
||||||
private String month;
|
private int month;
|
||||||
private String last_month;
|
private int last_month;
|
||||||
private String day;
|
private int day;
|
||||||
private String last_day;
|
private int last_day;
|
||||||
private String hour;
|
private int hour;
|
||||||
private String last_hour;
|
private int last_hour;
|
||||||
private String minute;
|
private int minute;
|
||||||
private String last_minute;
|
private int last_minute;
|
||||||
private String second;
|
private int second;
|
||||||
private String last_second;
|
private int last_second;
|
||||||
private String time;
|
private String time;
|
||||||
private String last_time;
|
private String last_time;
|
||||||
|
|
||||||
//气缸分离状态0-不分离,1分离
|
//气缸分离状态0-不分离,1分离
|
||||||
private String flag;
|
private int flag;
|
||||||
private String last_flag;
|
private int last_flag;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Device getDevice() {
|
public Device getDevice() {
|
||||||
|
|||||||
Reference in New Issue
Block a user