|
@@ -153,9 +153,21 @@ public class MesClientComponent extends JPanel {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
- String sn = S7PLCUtils.getSnInOprno(oprnoClass, MesClient.s7PLC);
|
|
|
|
|
|
|
+ String sn = "";
|
|
|
|
|
+ boolean hgA = MesClient.s7PLC.readBoolean(oprnoClass.getHgA_out());
|
|
|
|
|
+ boolean hgB = MesClient.s7PLC.readBoolean(oprnoClass.getHgB_out());
|
|
|
|
|
+ if (!hgA && !hgB) {
|
|
|
|
|
+ sn = "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (hgA) {
|
|
|
|
|
+ sn = MesClient.s7PLC.readString(oprnoClass.getHgA_sn());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (hgB) {
|
|
|
|
|
+ sn = MesClient.s7PLC.readString(oprnoClass.getHgB_sn());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (sn == null || sn.trim().isEmpty()) {
|
|
|
|
|
|
|
+ if (sn == null || sn.trim().isEmpty() || "".equals(sn)) {
|
|
|
setMenuStatus("扫码结果为空", -1);
|
|
setMenuStatus("扫码结果为空", -1);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -201,12 +213,20 @@ public class MesClientComponent extends JPanel {
|
|
|
}else if (work_status == 1){
|
|
}else if (work_status == 1){
|
|
|
// 已扫码,等待允许加工信号
|
|
// 已扫码,等待允许加工信号
|
|
|
String sn = productSn.getText();
|
|
String sn = productSn.getText();
|
|
|
|
|
+ if (sn == null || sn.trim().isEmpty() || "".equals(sn)) {
|
|
|
|
|
+ setMenuStatus("读码结果为空", -1);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
Boolean checkQualityResult = DataUtil.checkQualityByGw(MesClient.nettyClient, sn,MesClient.user20,oprnoClass.getOprno());
|
|
Boolean checkQualityResult = DataUtil.checkQualityByGw(MesClient.nettyClient, sn,MesClient.user20,oprnoClass.getOprno());
|
|
|
if (!checkQualityResult){
|
|
if (!checkQualityResult){
|
|
|
setMenuStatus("消息发送失败,请重试",-1);
|
|
setMenuStatus("消息发送失败,请重试",-1);
|
|
|
}
|
|
}
|
|
|
}else if (work_status == 2){
|
|
}else if (work_status == 2){
|
|
|
|
|
+ if (MesClient.s7PLC.readBoolean(oprnoClass.getOut_ok())){
|
|
|
|
|
+ MesClient.s7PLC.writeBoolean(oprnoClass.getMes_in(),false);
|
|
|
|
|
+ }
|
|
|
if (MesClient.s7PLC.readBoolean(oprnoClass.getProcess_ok())){
|
|
if (MesClient.s7PLC.readBoolean(oprnoClass.getProcess_ok())){
|
|
|
|
|
+ MesClient.s7PLC.writeBoolean(oprnoClass.getMes_out(),true);
|
|
|
String sn = productSn.getText();
|
|
String sn = productSn.getText();
|
|
|
String ret = "OK";
|
|
String ret = "OK";
|
|
|
if (MesClient.s7PLC.readBoolean(oprnoClass.getProcess_result_ng())){
|
|
if (MesClient.s7PLC.readBoolean(oprnoClass.getProcess_result_ng())){
|
|
@@ -222,7 +242,7 @@ public class MesClientComponent extends JPanel {
|
|
|
work_status = 0;
|
|
work_status = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- },100,3000);
|
|
|
|
|
|
|
+ },100,1000);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 刷新
|
|
// 刷新
|