|
@@ -115,7 +115,7 @@ public class MesClient extends JFrame {
|
|
|
public static JTextField torsionalMaxValue; //扭力值范围
|
|
public static JTextField torsionalMaxValue; //扭力值范围
|
|
|
public static JTextField torsionalValue;//当前扭力值
|
|
public static JTextField torsionalValue;//当前扭力值
|
|
|
public static Integer cur = 0; // 当前数
|
|
public static Integer cur = 0; // 当前数
|
|
|
- public static Integer max = 3; //任务数
|
|
|
|
|
|
|
+ public static Integer max = 2; //任务数
|
|
|
public static List<String> atids = new ArrayList<>();
|
|
public static List<String> atids = new ArrayList<>();
|
|
|
public static ArrayList<String> torsionalValueList = new ArrayList<String>();//扭力值存储数组
|
|
public static ArrayList<String> torsionalValueList = new ArrayList<String>();//扭力值存储数组
|
|
|
public static Boolean fininsh_flag = false; // false=不合格 true=合格
|
|
public static Boolean fininsh_flag = false; // false=不合格 true=合格
|
|
@@ -448,17 +448,21 @@ public class MesClient extends JFrame {
|
|
|
//刷新界面
|
|
//刷新界面
|
|
|
mesClientFrame.repaint();
|
|
mesClientFrame.repaint();
|
|
|
|
|
|
|
|
- if(!tcp_connect_flag) {
|
|
|
|
|
- JOptionPane.showMessageDialog(mesClientFrame,"设备未连接Mes服务器","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
|
|
|
|
+ //扭力扳手未连接则无法作业
|
|
|
|
|
+ if(ygslClient == null) {
|
|
|
|
|
+ JOptionPane.showMessageDialog(mesClientFrame,"扭力扳手未连接","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 查询工件质量
|
|
|
|
|
- Boolean sendret = DataUtil.checkQuality(nettyClient,barcode36,user20);
|
|
|
|
|
- if(!sendret){
|
|
|
|
|
- JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //本客户端只采集扭力参数,不上传工位结果、不过MES质量检查,扫码后本地直接放行开工
|
|
|
|
|
+ check_quality_result = true;
|
|
|
|
|
+ work_status = 1;
|
|
|
|
|
+ f_scan_data_bt_1.setEnabled(false);
|
|
|
|
|
+ finish_ok_bt.setEnabled(false);
|
|
|
|
|
+ finish_ng_bt.setEnabled(true);
|
|
|
|
|
+ setMenuStatus("该工件可以加工",0);
|
|
|
|
|
+ //选择Pset,之后由deviceOnline定时器按work_status使能扳手
|
|
|
|
|
+ YgslUtil.pSet(ygslClient);
|
|
|
}else {
|
|
}else {
|
|
|
JOptionPane.showMessageDialog(mesClientFrame,"请扫工件码","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
JOptionPane.showMessageDialog(mesClientFrame,"请扫工件码","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
return;
|
|
return;
|
|
@@ -665,33 +669,16 @@ public class MesClient extends JFrame {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(connect_request_flag){
|
|
|
|
|
- setMenuStatus("设备未连接Mes服务器!",-1);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
if(product_sn.getText().isEmpty()){
|
|
if(product_sn.getText().isEmpty()){
|
|
|
setMenuStatus("未扫工件码!",-1);
|
|
setMenuStatus("未扫工件码!",-1);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(work_status == 1 && check_quality_result){
|
|
if(work_status == 1 && check_quality_result){
|
|
|
-
|
|
|
|
|
- String sn = getBarcode(product_sn.getText());
|
|
|
|
|
- getUser();
|
|
|
|
|
-
|
|
|
|
|
- String qret = "OK";
|
|
|
|
|
- if (cur != max) {
|
|
|
|
|
- qret = "NG";
|
|
|
|
|
- }
|
|
|
|
|
- Boolean result = DataUtil.sendQuality(sn,qret,user20);
|
|
|
|
|
- if(result) {
|
|
|
|
|
- MesClient.resetScanA();
|
|
|
|
|
- MesClient.setMenuStatus("结果提交成功,请扫下一件", 0);
|
|
|
|
|
- MesClient.scan_type = 1;
|
|
|
|
|
-// MesClient.scanBarcode();
|
|
|
|
|
- } else {
|
|
|
|
|
- MesClient.setMenuStatus("结果提交失败,请重试",-1);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //不上传工位结果,扭力参数已入本地库、由定时任务上传,这里只做复位
|
|
|
|
|
+ MesClient.resetScanA();
|
|
|
|
|
+ MesClient.setMenuStatus("请扫下一件", 0);
|
|
|
|
|
+ MesClient.scan_type = 1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -707,19 +694,11 @@ public class MesClient extends JFrame {
|
|
|
finish_ng_bt.addActionListener(new ActionListener() {
|
|
finish_ng_bt.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
if(work_status == 1 && check_quality_result){
|
|
if(work_status == 1 && check_quality_result){
|
|
|
-
|
|
|
|
|
- String sn = getBarcode(product_sn.getText());
|
|
|
|
|
- getUser();
|
|
|
|
|
- String qret = "NG";
|
|
|
|
|
- Boolean result = DataUtil.sendQuality(sn,qret,user20);
|
|
|
|
|
- if(result) {
|
|
|
|
|
- MesClient.resetScanA();
|
|
|
|
|
- MesClient.setMenuStatus("结果提交成功,请扫下一件", 0);
|
|
|
|
|
- MesClient.scan_type = 1;
|
|
|
|
|
- MesClient.scanBarcode();
|
|
|
|
|
- } else {
|
|
|
|
|
- MesClient.setMenuStatus("结果提交失败,请重试",-1);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //不上传工位结果,只做复位
|
|
|
|
|
+ MesClient.resetScanA();
|
|
|
|
|
+ MesClient.setMenuStatus("请扫下一件", 0);
|
|
|
|
|
+ MesClient.scan_type = 1;
|
|
|
|
|
+ MesClient.scanBarcode();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|