|
|
@@ -71,6 +71,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
public static Boolean check_quality_result = false;
|
|
|
public static Integer work_status = 0;
|
|
|
+ public static Boolean bind_lb_result = false;
|
|
|
|
|
|
public static JButton heart_beat_menu;
|
|
|
public static JButton status_menu;
|
|
|
@@ -122,6 +123,9 @@ public class MesClient extends JFrame {
|
|
|
//读文件配置
|
|
|
readProperty();
|
|
|
|
|
|
+ s7PLC.setConnectTimeout(800);
|
|
|
+ s7PLC.setReceiveTimeout(800);
|
|
|
+
|
|
|
// 显示界面
|
|
|
mesClientFrame = new MesClient();
|
|
|
mesClientFrame.setVisible(false);
|
|
|
@@ -381,21 +385,18 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
|
public static void scanBarcode2() {
|
|
|
-
|
|
|
// 判断工件码是不是空的
|
|
|
- if(product_sn.getText().equalsIgnoreCase("")) {
|
|
|
- MesClient.setMenuStatus("等待机器人上料",-1);
|
|
|
+ if(work_status != 1) {
|
|
|
return;
|
|
|
}
|
|
|
// 绑定冷板
|
|
|
//弹窗扫工件码
|
|
|
String scanBarcode = JOptionPane.showInputDialog(null, "冷板码");
|
|
|
if(scanBarcode!=null&&!scanBarcode.equalsIgnoreCase("")) {
|
|
|
- String barcode36 = getBarcode(scanBarcode).trim();
|
|
|
- JSONObject retObj = DataUtil.bindWarehouseApi(product_sn.getText(),"400006",barcode36,user20);
|
|
|
- product_sn_LB.setText(product_sn.getText());
|
|
|
+ JSONObject retObj = DataUtil.bindWarehouseApi(product_sn.getText(),"400006",scanBarcode,user20);
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
-
|
|
|
+ bind_lb_result = true;
|
|
|
+ product_sn_LB.setText(scanBarcode);
|
|
|
}else{
|
|
|
setMenuStatus("绑定失败!", 1);
|
|
|
return;
|
|
|
@@ -1006,18 +1007,18 @@ public class MesClient extends JFrame {
|
|
|
// 将允许上料清空·
|
|
|
MesClient.s7PLC.writeBoolean("DB503.0.2", false);
|
|
|
//发送开始做件
|
|
|
- Boolean reg = DataUtil.startWork(MesClient.nettyClient, MesClient.product_sn.getText(), MesClient.user20);
|
|
|
- if (!reg){
|
|
|
- setMenuStatus("报文发送异常", -1);
|
|
|
- return;
|
|
|
- }
|
|
|
+// Boolean reg = DataUtil.startWork(MesClient.nettyClient, MesClient.product_sn.getText(), MesClient.user20);
|
|
|
+// if (!reg){
|
|
|
+// setMenuStatus("报文发送异常", -1);
|
|
|
+// return;
|
|
|
+// }
|
|
|
}
|
|
|
}else if (index == 3){
|
|
|
// 等待完成信号
|
|
|
if (MesClient.s7PLC.readBoolean("DB503.0.4")){
|
|
|
// 冷板为空不允许提交
|
|
|
- if (product_sn_LB.getText() == null || product_sn_LB.getText().trim().isEmpty()){
|
|
|
- setMenuStatus("请先绑定底板", -1);
|
|
|
+ if (!bind_lb_result){
|
|
|
+ setMenuStatus("请先绑定冷板", -1);
|
|
|
return;
|
|
|
}
|
|
|
Boolean reg = DataUtil.sendQuality(MesClient.nettyClient, MesClient.product_sn.getText(), "OK",MesClient.user20);
|
|
|
@@ -1033,15 +1034,16 @@ public class MesClient extends JFrame {
|
|
|
// 两个输入框制空
|
|
|
product_sn.setText("");
|
|
|
product_sn_LB.setText("");
|
|
|
+ bind_lb_result = false;
|
|
|
work_status = 0;
|
|
|
check_quality_result = false;
|
|
|
updateMaterailData();
|
|
|
- shiftUserCheck();
|
|
|
+// shiftUserCheck();
|
|
|
index = 0;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- }, 0, 1000);
|
|
|
+ }, 0, 1500);
|
|
|
}
|
|
|
|
|
|
|