|
@@ -101,13 +101,13 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static Timer cjTimer3;
|
|
public static Timer cjTimer3;
|
|
|
|
|
|
|
|
- public static Short aSetNum = 81;
|
|
|
|
|
|
|
+ public static Short aSetNum = 40;
|
|
|
// public static Short aSetNum = 49;
|
|
// public static Short aSetNum = 49;
|
|
|
public static Short sortA = 0;
|
|
public static Short sortA = 0;
|
|
|
public static Short aMax = 0;
|
|
public static Short aMax = 0;
|
|
|
public static Short aFinish = 0;
|
|
public static Short aFinish = 0;
|
|
|
public static List<Map> alist = new ArrayList<>();
|
|
public static List<Map> alist = new ArrayList<>();
|
|
|
- public static Short bSetNum = 1;
|
|
|
|
|
|
|
+ public static Short bSetNum = 41;
|
|
|
// public static Short bSetNum = 27;
|
|
// public static Short bSetNum = 27;
|
|
|
public static Short sortB = 0;
|
|
public static Short sortB = 0;
|
|
|
public static Short bMax = 0;
|
|
public static Short bMax = 0;
|
|
@@ -116,6 +116,17 @@ public class MesClient extends JFrame {
|
|
|
public static Short sortC = 0;
|
|
public static Short sortC = 0;
|
|
|
public static Short cMax = 0;
|
|
public static Short cMax = 0;
|
|
|
public static List<Map> clist = new ArrayList<>();
|
|
public static List<Map> clist = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ /** 国内版工件码前缀:C枪1颗 */
|
|
|
|
|
+ public static final String[] SN_DOMESTIC_PREFIXES = {
|
|
|
|
|
+ "5019016600341", "5019016600511"
|
|
|
|
|
+ };
|
|
|
|
|
+ /** 海外版工件码前缀:C枪2颗 */
|
|
|
|
|
+ public static final String[] SN_OVERSEAS_PREFIXES = {
|
|
|
|
|
+ "5019016600571", "5003136600051", "5003136600651", "5003136600661"
|
|
|
|
|
+ };
|
|
|
|
|
+ public static final Short C_SET_NUM_DOMESTIC = 1;
|
|
|
|
|
+ public static final Short C_SET_NUM_OVERSEAS = 2;
|
|
|
public static Short deviceControl = 0; // 0=本地 1=远程
|
|
public static Short deviceControl = 0; // 0=本地 1=远程
|
|
|
public static Integer tjStatus = 0; // 1=提交失败
|
|
public static Integer tjStatus = 0; // 1=提交失败
|
|
|
|
|
|
|
@@ -123,6 +134,40 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static String curSn = "";
|
|
public static String curSn = "";
|
|
|
|
|
|
|
|
|
|
+ public static Integer zdStatusA = 0;
|
|
|
|
|
+ public static Integer zdStatusB = 0;
|
|
|
|
|
+ public static Integer zdStatusC = 0;
|
|
|
|
|
+ public static String foutA = "";
|
|
|
|
|
+ public static String fmaxA = "";
|
|
|
|
|
+ public static String fminA = "";
|
|
|
|
|
+ public static String soutA = "";
|
|
|
|
|
+ public static String smaxA = "";
|
|
|
|
|
+ public static String sminA = "";
|
|
|
|
|
+ public static String curA = "";
|
|
|
|
|
+ public static String foutB = "";
|
|
|
|
|
+ public static String fmaxB = "";
|
|
|
|
|
+ public static String fminB = "";
|
|
|
|
|
+ public static String soutB = "";
|
|
|
|
|
+ public static String smaxB = "";
|
|
|
|
|
+ public static String sminB = "";
|
|
|
|
|
+ public static String curB = "";
|
|
|
|
|
+ public static String foutC = "";
|
|
|
|
|
+ public static String fmaxC = "";
|
|
|
|
|
+ public static String fminC = "";
|
|
|
|
|
+ public static String soutC = "";
|
|
|
|
|
+ public static String smaxC = "";
|
|
|
|
|
+ public static String sminC = "";
|
|
|
|
|
+ public static String curC = "";
|
|
|
|
|
+ public static JButton resetResultA;
|
|
|
|
|
+ public static JButton okResultA;
|
|
|
|
|
+ public static JButton ngResultA;
|
|
|
|
|
+ public static JButton resetResultB;
|
|
|
|
|
+ public static JButton okResultB;
|
|
|
|
|
+ public static JButton ngResultB;
|
|
|
|
|
+ public static JButton resetResultC;
|
|
|
|
|
+ public static JButton okResultC;
|
|
|
|
|
+ public static JButton ngResultC;
|
|
|
|
|
+
|
|
|
public static JTable table;
|
|
public static JTable table;
|
|
|
public static Object[] columnNames = { "物料名称", "绑定批次", "剩余次数", "操作" };
|
|
public static Object[] columnNames = { "物料名称", "绑定批次", "剩余次数", "操作" };
|
|
|
public static Object[][] rowData = null;
|
|
public static Object[][] rowData = null;
|
|
@@ -171,7 +216,9 @@ public class MesClient extends JFrame {
|
|
|
if(work_status == 1){
|
|
if(work_status == 1){
|
|
|
List<Boolean> yxstatus = plcA.readCoil(3128,1);
|
|
List<Boolean> yxstatus = plcA.readCoil(3128,1);
|
|
|
if(yxstatus.size() >= 1 && !yxstatus.get(0)){
|
|
if(yxstatus.size() >= 1 && !yxstatus.get(0)){
|
|
|
- if(!MesClient.curSn.isEmpty() && MesClient.aMax > 0 && MesClient.aMax == MesClient.sortA){
|
|
|
|
|
|
|
+ if(MesClient.zdStatusA == 1){
|
|
|
|
|
+ // NG复判中断中,保持锁枪
|
|
|
|
|
+ }else if(!MesClient.curSn.isEmpty() && MesClient.aMax > 0 && MesClient.aMax == MesClient.sortA){
|
|
|
ModbusUtil.setPowerOff(plcA);
|
|
ModbusUtil.setPowerOff(plcA);
|
|
|
}else{
|
|
}else{
|
|
|
ModbusUtil.setPowerOn(plcA);
|
|
ModbusUtil.setPowerOn(plcA);
|
|
@@ -180,7 +227,9 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
List<Boolean> yxstatusb = plcB.readCoil(3128,1);
|
|
List<Boolean> yxstatusb = plcB.readCoil(3128,1);
|
|
|
if(yxstatusb.size() >= 1 && !yxstatusb.get(0)){
|
|
if(yxstatusb.size() >= 1 && !yxstatusb.get(0)){
|
|
|
- if(!MesClient.curSn.isEmpty() && MesClient.bMax > 0 && MesClient.bMax == MesClient.sortB){
|
|
|
|
|
|
|
+ if(MesClient.zdStatusB == 1){
|
|
|
|
|
+ // NG复判中断中,保持锁枪
|
|
|
|
|
+ }else if(!MesClient.curSn.isEmpty() && MesClient.bMax > 0 && MesClient.bMax == MesClient.sortB){
|
|
|
ModbusUtil.setPowerOff(plcB);
|
|
ModbusUtil.setPowerOff(plcB);
|
|
|
}else{
|
|
}else{
|
|
|
ModbusUtil.setPowerOn(plcB);
|
|
ModbusUtil.setPowerOn(plcB);
|
|
@@ -189,7 +238,9 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
List<Boolean> yxstatusc = plcC.readCoil(3128,1);
|
|
List<Boolean> yxstatusc = plcC.readCoil(3128,1);
|
|
|
if(yxstatusc.size() >= 1 && !yxstatusc.get(0)){
|
|
if(yxstatusc.size() >= 1 && !yxstatusc.get(0)){
|
|
|
- if(!MesClient.curSn.isEmpty() && MesClient.cMax > 0 && MesClient.cMax == MesClient.sortC){
|
|
|
|
|
|
|
+ if(MesClient.zdStatusC == 1){
|
|
|
|
|
+ // NG复判中断中,保持锁枪
|
|
|
|
|
+ }else if(!MesClient.curSn.isEmpty() && MesClient.cMax > 0 && MesClient.cMax == MesClient.sortC){
|
|
|
ModbusUtil.setPowerOff(plcC);
|
|
ModbusUtil.setPowerOff(plcC);
|
|
|
}else{
|
|
}else{
|
|
|
ModbusUtil.setPowerOn(plcC);
|
|
ModbusUtil.setPowerOn(plcC);
|
|
@@ -450,6 +501,7 @@ public class MesClient extends JFrame {
|
|
|
MesClient.sortB = 0;
|
|
MesClient.sortB = 0;
|
|
|
MesClient.sortA = 0;
|
|
MesClient.sortA = 0;
|
|
|
MesClient.sortC = 0;
|
|
MesClient.sortC = 0;
|
|
|
|
|
+ MesClient.cSetNum = C_SET_NUM_DOMESTIC;
|
|
|
MesClient.param1.setText("");
|
|
MesClient.param1.setText("");
|
|
|
MesClient.param2.setText("");
|
|
MesClient.param2.setText("");
|
|
|
MesClient.param3.setText("");
|
|
MesClient.param3.setText("");
|
|
@@ -457,6 +509,19 @@ public class MesClient extends JFrame {
|
|
|
MesClient.param5.setText("");
|
|
MesClient.param5.setText("");
|
|
|
MesClient.param6.setText("");
|
|
MesClient.param6.setText("");
|
|
|
|
|
|
|
|
|
|
+ zdStatusA = 0;
|
|
|
|
|
+ zdStatusB = 0;
|
|
|
|
|
+ zdStatusC = 0;
|
|
|
|
|
+ resetResultA.setEnabled(false);
|
|
|
|
|
+ okResultA.setEnabled(false);
|
|
|
|
|
+ ngResultA.setEnabled(false);
|
|
|
|
|
+ resetResultB.setEnabled(false);
|
|
|
|
|
+ okResultB.setEnabled(false);
|
|
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
|
|
+ resetResultC.setEnabled(false);
|
|
|
|
|
+ okResultC.setEnabled(false);
|
|
|
|
|
+ ngResultC.setEnabled(false);
|
|
|
|
|
+
|
|
|
deviceControl = ModbusUtil.getControlModel(plcA);
|
|
deviceControl = ModbusUtil.getControlModel(plcA);
|
|
|
if(deviceControl == 1){
|
|
if(deviceControl == 1){
|
|
|
|
|
|
|
@@ -509,6 +574,31 @@ public class MesClient extends JFrame {
|
|
|
return barcodeRet;
|
|
return barcodeRet;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 按工件码前缀判断国内/海外,设置C枪颗数:国内1颗,海外2颗。
|
|
|
|
|
+ * 国内:5019016600341(四驱)、5019016600511(后驱)
|
|
|
|
|
+ * 海外:5019016600571(四驱)、5003136600051(后驱)、5003136600651(右舵四驱)、5003136600661(右舵二驱)
|
|
|
|
|
+ */
|
|
|
|
|
+ public static void updateCSetNumBySn(String sn) {
|
|
|
|
|
+ if(sn == null || sn.isEmpty()){
|
|
|
|
|
+ cSetNum = C_SET_NUM_DOMESTIC;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ for(String p : SN_OVERSEAS_PREFIXES){
|
|
|
|
|
+ if(sn.startsWith(p)){
|
|
|
|
|
+ cSetNum = C_SET_NUM_OVERSEAS;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ for(String p : SN_DOMESTIC_PREFIXES){
|
|
|
|
|
+ if(sn.startsWith(p)){
|
|
|
|
|
+ cSetNum = C_SET_NUM_DOMESTIC;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ cSetNum = C_SET_NUM_DOMESTIC;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static void scanBarcode() {
|
|
public static void scanBarcode() {
|
|
|
if(work_status == 1){
|
|
if(work_status == 1){
|
|
|
JOptionPane.showMessageDialog(mesClientFrame,"工作中,勿扫码","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
JOptionPane.showMessageDialog(mesClientFrame,"工作中,勿扫码","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
@@ -535,6 +625,8 @@ public class MesClient extends JFrame {
|
|
|
case 1:
|
|
case 1:
|
|
|
product_sn.setText(scanBarcode);
|
|
product_sn.setText(scanBarcode);
|
|
|
curSn = scanBarcode;
|
|
curSn = scanBarcode;
|
|
|
|
|
+ // 扫码后按国内/海外前缀设置C枪颗数
|
|
|
|
|
+ updateCSetNumBySn(scanBarcode);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
//刷新界面
|
|
//刷新界面
|
|
@@ -760,7 +852,7 @@ public class MesClient extends JFrame {
|
|
|
finish_ok_bt.setIcon(new ImageIcon(MesClient.class.getResource("/bg/ok_bg.png")));
|
|
finish_ok_bt.setIcon(new ImageIcon(MesClient.class.getResource("/bg/ok_bg.png")));
|
|
|
finish_ok_bt.setFont(new Font("微软雅黑", Font.PLAIN, 32));
|
|
finish_ok_bt.setFont(new Font("微软雅黑", Font.PLAIN, 32));
|
|
|
// finish_ok_bt.setBounds(185, 291, 240, 80);
|
|
// finish_ok_bt.setBounds(185, 291, 240, 80);
|
|
|
- finish_ok_bt.setBounds(185, 371, 240, 80);
|
|
|
|
|
|
|
+ finish_ok_bt.setBounds(185, 395, 240, 80);
|
|
|
finish_ok_bt.setEnabled(false);
|
|
finish_ok_bt.setEnabled(false);
|
|
|
indexPanelA.add(finish_ok_bt);
|
|
indexPanelA.add(finish_ok_bt);
|
|
|
|
|
|
|
@@ -784,7 +876,7 @@ public class MesClient extends JFrame {
|
|
|
});
|
|
});
|
|
|
finish_ng_bt.setIcon(new ImageIcon(MesClient.class.getResource("/bg/ng_bg.png")));
|
|
finish_ng_bt.setIcon(new ImageIcon(MesClient.class.getResource("/bg/ng_bg.png")));
|
|
|
finish_ng_bt.setFont(new Font("微软雅黑", Font.PLAIN, 32));
|
|
finish_ng_bt.setFont(new Font("微软雅黑", Font.PLAIN, 32));
|
|
|
- finish_ng_bt.setBounds(508, 371, 240, 80);
|
|
|
|
|
|
|
+ finish_ng_bt.setBounds(508, 395, 240, 80);
|
|
|
finish_ng_bt.setEnabled(false);
|
|
finish_ng_bt.setEnabled(false);
|
|
|
indexPanelA.add(finish_ng_bt);
|
|
indexPanelA.add(finish_ng_bt);
|
|
|
|
|
|
|
@@ -890,6 +982,322 @@ public class MesClient extends JFrame {
|
|
|
param6.setBounds(743, 285, 83, 34);
|
|
param6.setBounds(743, 285, 83, 34);
|
|
|
indexPanelA.add(param6);
|
|
indexPanelA.add(param6);
|
|
|
|
|
|
|
|
|
|
+ JLabel lblNgJudgeA = new JLabel("NG\u590d\u5224");
|
|
|
|
|
+ lblNgJudgeA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ lblNgJudgeA.setBounds(100, 322, 167, 22);
|
|
|
|
|
+ indexPanelA.add(lblNgJudgeA);
|
|
|
|
|
+
|
|
|
|
|
+ JLabel lblNgJudgeB = new JLabel("NG\u590d\u5224");
|
|
|
|
|
+ lblNgJudgeB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ lblNgJudgeB.setBounds(380, 322, 167, 22);
|
|
|
|
|
+ indexPanelA.add(lblNgJudgeB);
|
|
|
|
|
+
|
|
|
|
|
+ JLabel lblNgJudgeC = new JLabel("NG\u590d\u5224");
|
|
|
|
|
+ lblNgJudgeC.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ lblNgJudgeC.setBounds(660, 322, 167, 22);
|
|
|
|
|
+ indexPanelA.add(lblNgJudgeC);
|
|
|
|
|
+
|
|
|
|
|
+ resetResultA = new JButton("重拉");
|
|
|
|
|
+ resetResultA.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusA == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ zdStatusA = 0;
|
|
|
|
|
+ resetResultA.setEnabled(false);
|
|
|
|
|
+ okResultA.setEnabled(false);
|
|
|
|
|
+ ngResultA.setEnabled(false);
|
|
|
|
|
+ sortA = (short)(sortA - 1);
|
|
|
|
|
+ param2.setText(sortA+"");
|
|
|
|
|
+ plcA.writeInt16(1136, sortA);
|
|
|
|
|
+ foutA = "";
|
|
|
|
|
+ soutA = "";
|
|
|
|
|
+ fmaxA = "";
|
|
|
|
|
+ fminA = "";
|
|
|
|
|
+ smaxA = "";
|
|
|
|
|
+ sminA = "";
|
|
|
|
|
+ curA = "";
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcA);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ resetResultA.setEnabled(false);
|
|
|
|
|
+ resetResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ resetResultA.setBounds(100, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(resetResultA);
|
|
|
|
|
+
|
|
|
|
|
+ okResultA = new JButton("OK");
|
|
|
|
|
+ okResultA.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusA == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ if(!product_sn.getText().isEmpty()){
|
|
|
|
|
+ aFinish++;
|
|
|
|
|
+ JdbcUtils.insertProdData(mes_gw, mes_line_sn, product_sn.getText(),"A",foutA,soutA,fminA,sminA,fmaxA,smaxA,"1",curA, user_menu.getText());
|
|
|
|
|
+ }
|
|
|
|
|
+ zdStatusA = 0;
|
|
|
|
|
+ resetResultA.setEnabled(false);
|
|
|
|
|
+ okResultA.setEnabled(false);
|
|
|
|
|
+ ngResultA.setEnabled(false);
|
|
|
|
|
+ foutA = "";
|
|
|
|
|
+ soutA = "";
|
|
|
|
|
+ fmaxA = "";
|
|
|
|
|
+ fminA = "";
|
|
|
|
|
+ smaxA = "";
|
|
|
|
|
+ sminA = "";
|
|
|
|
|
+ curA = "";
|
|
|
|
|
+ ModbusUtil.upResult();
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcA);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ okResultA.setEnabled(false);
|
|
|
|
|
+ okResultA.setForeground(new Color(0, 128, 0));
|
|
|
|
|
+ okResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ okResultA.setBounds(177, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(okResultA);
|
|
|
|
|
+
|
|
|
|
|
+ ngResultA = new JButton("NG");
|
|
|
|
|
+ ngResultA.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusA == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ if(!product_sn.getText().isEmpty()){
|
|
|
|
|
+ JdbcUtils.insertProdData(mes_gw, mes_line_sn, product_sn.getText(),"A",foutA,soutA,fminA,sminA,fmaxA,smaxA,"0",curA, user_menu.getText());
|
|
|
|
|
+ }
|
|
|
|
|
+ zdStatusA = 0;
|
|
|
|
|
+ resetResultA.setEnabled(false);
|
|
|
|
|
+ okResultA.setEnabled(false);
|
|
|
|
|
+ ngResultA.setEnabled(false);
|
|
|
|
|
+ foutA = "";
|
|
|
|
|
+ soutA = "";
|
|
|
|
|
+ fmaxA = "";
|
|
|
|
|
+ fminA = "";
|
|
|
|
|
+ smaxA = "";
|
|
|
|
|
+ sminA = "";
|
|
|
|
|
+ curA = "";
|
|
|
|
|
+ ModbusUtil.upResult();
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcA);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ ngResultA.setEnabled(false);
|
|
|
|
|
+ ngResultA.setForeground(new Color(255, 0, 0));
|
|
|
|
|
+ ngResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ ngResultA.setBounds(254, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(ngResultA);
|
|
|
|
|
+
|
|
|
|
|
+ resetResultB = new JButton("重拉");
|
|
|
|
|
+ resetResultB.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusB == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"B");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ zdStatusB = 0;
|
|
|
|
|
+ resetResultB.setEnabled(false);
|
|
|
|
|
+ okResultB.setEnabled(false);
|
|
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
|
|
+ sortB = (short)(sortB - 1);
|
|
|
|
|
+ param4.setText(sortB+"");
|
|
|
|
|
+ plcB.writeInt16(1136, sortB);
|
|
|
|
|
+ foutB = "";
|
|
|
|
|
+ soutB = "";
|
|
|
|
|
+ fmaxB = "";
|
|
|
|
|
+ fminB = "";
|
|
|
|
|
+ smaxB = "";
|
|
|
|
|
+ sminB = "";
|
|
|
|
|
+ curB = "";
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcB);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ resetResultB.setEnabled(false);
|
|
|
|
|
+ resetResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ resetResultB.setBounds(380, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(resetResultB);
|
|
|
|
|
+
|
|
|
|
|
+ okResultB = new JButton("OK");
|
|
|
|
|
+ okResultB.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusB == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"B");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ if(!product_sn.getText().isEmpty()){
|
|
|
|
|
+ JdbcUtils.insertProdData(mes_gw, mes_line_sn, product_sn.getText(),"B",foutB,soutB,fminB,sminB,fmaxB,smaxB,"1",curB, user_menu.getText());
|
|
|
|
|
+ }
|
|
|
|
|
+ zdStatusB = 0;
|
|
|
|
|
+ resetResultB.setEnabled(false);
|
|
|
|
|
+ okResultB.setEnabled(false);
|
|
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
|
|
+ foutB = "";
|
|
|
|
|
+ soutB = "";
|
|
|
|
|
+ fmaxB = "";
|
|
|
|
|
+ fminB = "";
|
|
|
|
|
+ smaxB = "";
|
|
|
|
|
+ sminB = "";
|
|
|
|
|
+ curB = "";
|
|
|
|
|
+ ModbusUtil.upResult();
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcB);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ okResultB.setEnabled(false);
|
|
|
|
|
+ okResultB.setForeground(new Color(0, 128, 0));
|
|
|
|
|
+ okResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ okResultB.setBounds(457, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(okResultB);
|
|
|
|
|
+
|
|
|
|
|
+ ngResultB = new JButton("NG");
|
|
|
|
|
+ ngResultB.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusB == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"B");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ if(!product_sn.getText().isEmpty()){
|
|
|
|
|
+ JdbcUtils.insertProdData(mes_gw, mes_line_sn, product_sn.getText(),"B",foutB,soutB,fminB,sminB,fmaxB,smaxB,"0",curB, user_menu.getText());
|
|
|
|
|
+ }
|
|
|
|
|
+ zdStatusB = 0;
|
|
|
|
|
+ resetResultB.setEnabled(false);
|
|
|
|
|
+ okResultB.setEnabled(false);
|
|
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
|
|
+ foutB = "";
|
|
|
|
|
+ soutB = "";
|
|
|
|
|
+ fmaxB = "";
|
|
|
|
|
+ fminB = "";
|
|
|
|
|
+ smaxB = "";
|
|
|
|
|
+ sminB = "";
|
|
|
|
|
+ curB = "";
|
|
|
|
|
+ ModbusUtil.upResult();
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcB);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
|
|
+ ngResultB.setForeground(new Color(255, 0, 0));
|
|
|
|
|
+ ngResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ ngResultB.setBounds(534, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(ngResultB);
|
|
|
|
|
+
|
|
|
|
|
+ resetResultC = new JButton("重拉");
|
|
|
|
|
+ resetResultC.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusC == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"C");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ zdStatusC = 0;
|
|
|
|
|
+ resetResultC.setEnabled(false);
|
|
|
|
|
+ okResultC.setEnabled(false);
|
|
|
|
|
+ ngResultC.setEnabled(false);
|
|
|
|
|
+ sortC = (short)(sortC - 1);
|
|
|
|
|
+ param6.setText(sortC+"");
|
|
|
|
|
+ plcC.writeInt16(1136, sortC);
|
|
|
|
|
+ foutC = "";
|
|
|
|
|
+ soutC = "";
|
|
|
|
|
+ fmaxC = "";
|
|
|
|
|
+ fminC = "";
|
|
|
|
|
+ smaxC = "";
|
|
|
|
|
+ sminC = "";
|
|
|
|
|
+ curC = "";
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcC);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ resetResultC.setEnabled(false);
|
|
|
|
|
+ resetResultC.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ resetResultC.setBounds(660, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(resetResultC);
|
|
|
|
|
+
|
|
|
|
|
+ okResultC = new JButton("OK");
|
|
|
|
|
+ okResultC.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusC == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"C");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ if(!product_sn.getText().isEmpty()){
|
|
|
|
|
+ JdbcUtils.insertProdData(mes_gw, mes_line_sn, product_sn.getText(),"C",foutC,soutC,fminC,sminC,fmaxC,smaxC,"1",curC, user_menu.getText());
|
|
|
|
|
+ }
|
|
|
|
|
+ zdStatusC = 0;
|
|
|
|
|
+ resetResultC.setEnabled(false);
|
|
|
|
|
+ okResultC.setEnabled(false);
|
|
|
|
|
+ ngResultC.setEnabled(false);
|
|
|
|
|
+ foutC = "";
|
|
|
|
|
+ soutC = "";
|
|
|
|
|
+ fmaxC = "";
|
|
|
|
|
+ fminC = "";
|
|
|
|
|
+ smaxC = "";
|
|
|
|
|
+ sminC = "";
|
|
|
|
|
+ curC = "";
|
|
|
|
|
+ ModbusUtil.upResult();
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcC);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ okResultC.setEnabled(false);
|
|
|
|
|
+ okResultC.setForeground(new Color(0, 128, 0));
|
|
|
|
|
+ okResultC.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ okResultC.setBounds(737, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(okResultC);
|
|
|
|
|
+
|
|
|
|
|
+ ngResultC = new JButton("NG");
|
|
|
|
|
+ ngResultC.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ if(zdStatusC == 1){
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"C");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ if(!product_sn.getText().isEmpty()){
|
|
|
|
|
+ JdbcUtils.insertProdData(mes_gw, mes_line_sn, product_sn.getText(),"C",foutC,soutC,fminC,sminC,fmaxC,smaxC,"0",curC, user_menu.getText());
|
|
|
|
|
+ }
|
|
|
|
|
+ zdStatusC = 0;
|
|
|
|
|
+ resetResultC.setEnabled(false);
|
|
|
|
|
+ okResultC.setEnabled(false);
|
|
|
|
|
+ ngResultC.setEnabled(false);
|
|
|
|
|
+ foutC = "";
|
|
|
|
|
+ soutC = "";
|
|
|
|
|
+ fmaxC = "";
|
|
|
|
|
+ fminC = "";
|
|
|
|
|
+ smaxC = "";
|
|
|
|
|
+ sminC = "";
|
|
|
|
|
+ curC = "";
|
|
|
|
|
+ ModbusUtil.upResult();
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcC);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ ngResultC.setEnabled(false);
|
|
|
|
|
+ ngResultC.setForeground(new Color(255, 0, 0));
|
|
|
|
|
+ ngResultC.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ ngResultC.setBounds(814, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(ngResultC);
|
|
|
|
|
+
|
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
|
tabbedPane.setEnabledAt(0, true);
|
|
tabbedPane.setEnabledAt(0, true);
|
|
|
|
|
|