|
@@ -456,11 +456,11 @@ public class MesClient extends JFrame {
|
|
|
MesClient.tjFlaga = 0;
|
|
MesClient.tjFlaga = 0;
|
|
|
MesClient.checkA = 0;
|
|
MesClient.checkA = 0;
|
|
|
|
|
|
|
|
-// MesClient.batch_status = 0;
|
|
|
|
|
-// MesClient.textField.setText("");
|
|
|
|
|
-// MesClient.batch_scan_1.setEnabled(false);
|
|
|
|
|
|
|
+ MesClient.batch_status = 0;
|
|
|
|
|
+ MesClient.textField.setText("");
|
|
|
|
|
+ MesClient.batch_scan_1.setEnabled(false);
|
|
|
MesClient.formatScanType(1);
|
|
MesClient.formatScanType(1);
|
|
|
- PlcUtil.changeEnable(MesClient.s7PLC,false);
|
|
|
|
|
|
|
+// PlcUtil.changeEnable(MesClient.s7PLC,false);
|
|
|
|
|
|
|
|
finish_ok_bt.setEnabled(false);
|
|
finish_ok_bt.setEnabled(false);
|
|
|
finish_ng_bt.setEnabled(false);
|
|
finish_ng_bt.setEnabled(false);
|
|
@@ -517,11 +517,11 @@ public class MesClient extends JFrame {
|
|
|
MesClient.tjFlagb = 0;
|
|
MesClient.tjFlagb = 0;
|
|
|
MesClient.checkB = 0;
|
|
MesClient.checkB = 0;
|
|
|
|
|
|
|
|
-// MesClient.batch_status2 = 0;
|
|
|
|
|
-// MesClient.textField_1.setText("");
|
|
|
|
|
-// MesClient.batch_scan_2.setEnabled(false);
|
|
|
|
|
|
|
+ MesClient.batch_status2 = 0;
|
|
|
|
|
+ MesClient.textField_1.setText("");
|
|
|
|
|
+ MesClient.batch_scan_2.setEnabled(false);
|
|
|
MesClient.formatScanType(1);
|
|
MesClient.formatScanType(1);
|
|
|
- PlcUtil.changeEnable(MesClient.s7PLC,false);
|
|
|
|
|
|
|
+// PlcUtil.changeEnable(MesClient.s7PLC,false);
|
|
|
finish_ok_bt2.setEnabled(false);
|
|
finish_ok_bt2.setEnabled(false);
|
|
|
finish_ng_bt2.setEnabled(false);
|
|
finish_ng_bt2.setEnabled(false);
|
|
|
|
|
|
|
@@ -568,6 +568,25 @@ public class MesClient extends JFrame {
|
|
|
return sn.length() >= 22 && sn.length() <= 36 && sn.matches("[A-Za-z0-9]+");
|
|
return sn.length() >= 22 && sn.length() <= 36 && sn.matches("[A-Za-z0-9]+");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 根据工件码前13位识别驱动类型:5019016600341-四驱,5019016600511-二驱
|
|
|
|
|
+ public static String getDriveTypeByBarcode(String barcode){
|
|
|
|
|
+ if(barcode == null){
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ String sn = barcode.trim();
|
|
|
|
|
+ if(sn.length() < 13){
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ String prefix = sn.substring(0,13);
|
|
|
|
|
+ if(prefix.equals("5019016600341")){
|
|
|
|
|
+ return "四驱";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(prefix.equals("5019016600511")){
|
|
|
|
|
+ return "二驱";
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static synchronized void beginQualityCheck(String sn, String page){
|
|
public static synchronized void beginQualityCheck(String sn, String page){
|
|
|
waitingQualityReply = true;
|
|
waitingQualityReply = true;
|
|
|
waitingQualitySn = sn == null ? "" : sn.trim();
|
|
waitingQualitySn = sn == null ? "" : sn.trim();
|
|
@@ -1011,14 +1030,14 @@ public class MesClient extends JFrame {
|
|
|
lblNewLabel.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel.setBounds(26, 340, 100, 40);
|
|
lblNewLabel.setBounds(26, 340, 100, 40);
|
|
|
lblNewLabel.setVisible(true);
|
|
lblNewLabel.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1 = new JLabel("电流");
|
|
JLabel lblNewLabel_1 = new JLabel("电流");
|
|
|
lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_1.setBounds(226, 340, 100, 40);
|
|
lblNewLabel_1.setBounds(226, 340, 100, 40);
|
|
|
lblNewLabel_1.setVisible(true);
|
|
lblNewLabel_1.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_1);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_1);
|
|
|
|
|
|
|
|
param1 = new JTextField();
|
|
param1 = new JTextField();
|
|
|
param1.setEnabled(false);
|
|
param1.setEnabled(false);
|
|
@@ -1027,7 +1046,7 @@ public class MesClient extends JFrame {
|
|
|
param1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
param1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
param1.setBounds(136, 340, 70, 40);
|
|
param1.setBounds(136, 340, 70, 40);
|
|
|
param1.setVisible(true);
|
|
param1.setVisible(true);
|
|
|
- indexPanelA.add(param1);
|
|
|
|
|
|
|
+// indexPanelA.add(param1);
|
|
|
param1.setColumns(10);
|
|
param1.setColumns(10);
|
|
|
|
|
|
|
|
param2 = new JTextField();
|
|
param2 = new JTextField();
|
|
@@ -1038,14 +1057,14 @@ public class MesClient extends JFrame {
|
|
|
param2.setColumns(10);
|
|
param2.setColumns(10);
|
|
|
param2.setBounds(345, 340, 70, 40);
|
|
param2.setBounds(345, 340, 70, 40);
|
|
|
param2.setVisible(true);
|
|
param2.setVisible(true);
|
|
|
- indexPanelA.add(param2);
|
|
|
|
|
|
|
+// indexPanelA.add(param2);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_2 = new JLabel("送丝速度");
|
|
JLabel lblNewLabel_2 = new JLabel("送丝速度");
|
|
|
lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_2.setBounds(26, 401, 100, 40);
|
|
lblNewLabel_2.setBounds(26, 401, 100, 40);
|
|
|
lblNewLabel_2.setVisible(true);
|
|
lblNewLabel_2.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_2);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_2);
|
|
|
|
|
|
|
|
param3 = new JTextField();
|
|
param3 = new JTextField();
|
|
|
param3.setEnabled(false);
|
|
param3.setEnabled(false);
|
|
@@ -1055,14 +1074,14 @@ public class MesClient extends JFrame {
|
|
|
param3.setColumns(10);
|
|
param3.setColumns(10);
|
|
|
param3.setBounds(136, 401, 70, 40);
|
|
param3.setBounds(136, 401, 70, 40);
|
|
|
param3.setVisible(true);
|
|
param3.setVisible(true);
|
|
|
- indexPanelA.add(param3);
|
|
|
|
|
|
|
+// indexPanelA.add(param3);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1_1 = new JLabel("错误代码");
|
|
JLabel lblNewLabel_1_1 = new JLabel("错误代码");
|
|
|
lblNewLabel_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_1_1.setBounds(213, 401, 122, 40);
|
|
lblNewLabel_1_1.setBounds(213, 401, 122, 40);
|
|
|
lblNewLabel_1_1.setVisible(true);
|
|
lblNewLabel_1_1.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_1_1);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_1_1);
|
|
|
|
|
|
|
|
param4 = new JTextField();
|
|
param4 = new JTextField();
|
|
|
param4.setEnabled(false);
|
|
param4.setEnabled(false);
|
|
@@ -1072,7 +1091,7 @@ public class MesClient extends JFrame {
|
|
|
param4.setColumns(10);
|
|
param4.setColumns(10);
|
|
|
param4.setBounds(345, 401, 70, 40);
|
|
param4.setBounds(345, 401, 70, 40);
|
|
|
param4.setVisible(true);
|
|
param4.setVisible(true);
|
|
|
- indexPanelA.add(param4);
|
|
|
|
|
|
|
+// indexPanelA.add(param4);
|
|
|
|
|
|
|
|
param5 = new JTextField();
|
|
param5 = new JTextField();
|
|
|
param5.setEnabled(false);
|
|
param5.setEnabled(false);
|
|
@@ -1082,14 +1101,14 @@ public class MesClient extends JFrame {
|
|
|
param5.setColumns(10);
|
|
param5.setColumns(10);
|
|
|
param5.setBounds(226, 470, 70, 40);
|
|
param5.setBounds(226, 470, 70, 40);
|
|
|
param5.setVisible(true);
|
|
param5.setVisible(true);
|
|
|
- indexPanelA.add(param5);
|
|
|
|
|
|
|
+// indexPanelA.add(param5);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1_1_1 = new JLabel("JOB号");
|
|
JLabel lblNewLabel_1_1_1 = new JLabel("JOB号");
|
|
|
lblNewLabel_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_1_1_1.setBounds(106, 470, 122, 40);
|
|
lblNewLabel_1_1_1.setBounds(106, 470, 122, 40);
|
|
|
lblNewLabel_1_1_1.setVisible(true);
|
|
lblNewLabel_1_1_1.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_1_1_1);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_1_1_1);
|
|
|
|
|
|
|
|
product_sn2 = new JTextField();
|
|
product_sn2 = new JTextField();
|
|
|
product_sn2.setText("");
|
|
product_sn2.setText("");
|
|
@@ -1114,7 +1133,7 @@ public class MesClient extends JFrame {
|
|
|
lblNewLabel_3.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_3.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_3.setBounds(528, 340, 100, 40);
|
|
lblNewLabel_3.setBounds(528, 340, 100, 40);
|
|
|
lblNewLabel_3.setVisible(true);
|
|
lblNewLabel_3.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_3);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_3);
|
|
|
|
|
|
|
|
param21 = new JTextField();
|
|
param21 = new JTextField();
|
|
|
param21.setEnabled(false);
|
|
param21.setEnabled(false);
|
|
@@ -1124,14 +1143,14 @@ public class MesClient extends JFrame {
|
|
|
param21.setColumns(10);
|
|
param21.setColumns(10);
|
|
|
param21.setBounds(638, 340, 70, 40);
|
|
param21.setBounds(638, 340, 70, 40);
|
|
|
param21.setVisible(true);
|
|
param21.setVisible(true);
|
|
|
- indexPanelA.add(param21);
|
|
|
|
|
|
|
+// indexPanelA.add(param21);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1_2 = new JLabel("电流");
|
|
JLabel lblNewLabel_1_2 = new JLabel("电流");
|
|
|
lblNewLabel_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_1_2.setBounds(742, 340, 100, 40);
|
|
lblNewLabel_1_2.setBounds(742, 340, 100, 40);
|
|
|
lblNewLabel_1_2.setVisible(true);
|
|
lblNewLabel_1_2.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_1_2);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_1_2);
|
|
|
|
|
|
|
|
param22 = new JTextField();
|
|
param22 = new JTextField();
|
|
|
param22.setEnabled(false);
|
|
param22.setEnabled(false);
|
|
@@ -1141,14 +1160,14 @@ public class MesClient extends JFrame {
|
|
|
param22.setColumns(10);
|
|
param22.setColumns(10);
|
|
|
param22.setBounds(852, 340, 70, 40);
|
|
param22.setBounds(852, 340, 70, 40);
|
|
|
param22.setVisible(true);
|
|
param22.setVisible(true);
|
|
|
- indexPanelA.add(param22);
|
|
|
|
|
|
|
+// indexPanelA.add(param22);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_2_1 = new JLabel("送丝速度");
|
|
JLabel lblNewLabel_2_1 = new JLabel("送丝速度");
|
|
|
lblNewLabel_2_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_2_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_2_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_2_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_2_1.setBounds(528, 401, 100, 40);
|
|
lblNewLabel_2_1.setBounds(528, 401, 100, 40);
|
|
|
lblNewLabel_2_1.setVisible(true);
|
|
lblNewLabel_2_1.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_2_1);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_2_1);
|
|
|
|
|
|
|
|
param23 = new JTextField();
|
|
param23 = new JTextField();
|
|
|
param23.setEnabled(false);
|
|
param23.setEnabled(false);
|
|
@@ -1158,14 +1177,14 @@ public class MesClient extends JFrame {
|
|
|
param23.setColumns(10);
|
|
param23.setColumns(10);
|
|
|
param23.setBounds(638, 401, 70, 40);
|
|
param23.setBounds(638, 401, 70, 40);
|
|
|
param23.setVisible(true);
|
|
param23.setVisible(true);
|
|
|
- indexPanelA.add(param23);
|
|
|
|
|
|
|
+// indexPanelA.add(param23);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1_1_2 = new JLabel("错误代码");
|
|
JLabel lblNewLabel_1_1_2 = new JLabel("错误代码");
|
|
|
lblNewLabel_1_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_1_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_1_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_1_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_1_1_2.setBounds(718, 401, 122, 40);
|
|
lblNewLabel_1_1_2.setBounds(718, 401, 122, 40);
|
|
|
lblNewLabel_1_1_2.setVisible(true);
|
|
lblNewLabel_1_1_2.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_1_1_2);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_1_1_2);
|
|
|
|
|
|
|
|
param24 = new JTextField();
|
|
param24 = new JTextField();
|
|
|
param24.setEnabled(false);
|
|
param24.setEnabled(false);
|
|
@@ -1175,14 +1194,14 @@ public class MesClient extends JFrame {
|
|
|
param24.setColumns(10);
|
|
param24.setColumns(10);
|
|
|
param24.setBounds(852, 401, 70, 40);
|
|
param24.setBounds(852, 401, 70, 40);
|
|
|
param24.setVisible(true);
|
|
param24.setVisible(true);
|
|
|
- indexPanelA.add(param24);
|
|
|
|
|
|
|
+// indexPanelA.add(param24);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1_1_1_1 = new JLabel("JOB号");
|
|
JLabel lblNewLabel_1_1_1_1 = new JLabel("JOB号");
|
|
|
lblNewLabel_1_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
lblNewLabel_1_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
|
|
|
lblNewLabel_1_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
lblNewLabel_1_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
|
|
|
lblNewLabel_1_1_1_1.setBounds(609, 470, 122, 40);
|
|
lblNewLabel_1_1_1_1.setBounds(609, 470, 122, 40);
|
|
|
lblNewLabel_1_1_1_1.setVisible(true);
|
|
lblNewLabel_1_1_1_1.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_1_1_1_1);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_1_1_1_1);
|
|
|
|
|
|
|
|
param25 = new JTextField();
|
|
param25 = new JTextField();
|
|
|
param25.setEnabled(false);
|
|
param25.setEnabled(false);
|
|
@@ -1192,7 +1211,7 @@ public class MesClient extends JFrame {
|
|
|
param25.setColumns(10);
|
|
param25.setColumns(10);
|
|
|
param25.setBounds(742, 470, 70, 40);
|
|
param25.setBounds(742, 470, 70, 40);
|
|
|
param25.setVisible(true);
|
|
param25.setVisible(true);
|
|
|
- indexPanelA.add(param25);
|
|
|
|
|
|
|
+// indexPanelA.add(param25);
|
|
|
|
|
|
|
|
pxstatus1 = new JLabel("A");
|
|
pxstatus1 = new JLabel("A");
|
|
|
pxstatus1.setForeground(new Color(255, 128, 64));
|
|
pxstatus1.setForeground(new Color(255, 128, 64));
|
|
@@ -1217,14 +1236,14 @@ public class MesClient extends JFrame {
|
|
|
lblNewLabel_4.setFont(new Font("微软雅黑", Font.PLAIN, 24));
|
|
lblNewLabel_4.setFont(new Font("微软雅黑", Font.PLAIN, 24));
|
|
|
lblNewLabel_4.setBounds(170, 290, 156, 40);
|
|
lblNewLabel_4.setBounds(170, 290, 156, 40);
|
|
|
lblNewLabel_4.setVisible(true);
|
|
lblNewLabel_4.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_4);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_4);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_4_1 = new JLabel("焊机2");
|
|
JLabel lblNewLabel_4_1 = new JLabel("焊机2");
|
|
|
lblNewLabel_4_1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
lblNewLabel_4_1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
lblNewLabel_4_1.setFont(new Font("微软雅黑", Font.PLAIN, 24));
|
|
lblNewLabel_4_1.setFont(new Font("微软雅黑", Font.PLAIN, 24));
|
|
|
lblNewLabel_4_1.setBounds(670, 287, 156, 40);
|
|
lblNewLabel_4_1.setBounds(670, 287, 156, 40);
|
|
|
lblNewLabel_4_1.setVisible(true);
|
|
lblNewLabel_4_1.setVisible(true);
|
|
|
- indexPanelA.add(lblNewLabel_4_1);
|
|
|
|
|
|
|
+// indexPanelA.add(lblNewLabel_4_1);
|
|
|
|
|
|
|
|
JSeparator separator_1_1 = new JSeparator();
|
|
JSeparator separator_1_1 = new JSeparator();
|
|
|
separator_1_1.setOrientation(SwingConstants.VERTICAL);
|
|
separator_1_1.setOrientation(SwingConstants.VERTICAL);
|
|
@@ -1238,24 +1257,24 @@ public class MesClient extends JFrame {
|
|
|
textField.setEditable(false);
|
|
textField.setEditable(false);
|
|
|
textField.setColumns(10);
|
|
textField.setColumns(10);
|
|
|
textField.setBounds(26, 333, 446, 70);
|
|
textField.setBounds(26, 333, 446, 70);
|
|
|
-// indexPanelA.add(textField);
|
|
|
|
|
|
|
+ indexPanelA.add(textField);
|
|
|
|
|
|
|
|
batch_scan_1 = new JButton("解绑");
|
|
batch_scan_1 = new JButton("解绑");
|
|
|
batch_scan_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/delete.png")));
|
|
batch_scan_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/delete.png")));
|
|
|
batch_scan_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 32));
|
|
batch_scan_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 32));
|
|
|
batch_scan_1.setEnabled(false);
|
|
batch_scan_1.setEnabled(false);
|
|
|
- batch_scan_1.setVisible(false);
|
|
|
|
|
|
|
+ batch_scan_1.setVisible(true);
|
|
|
batch_scan_1.setBounds(136, 430, 230, 80);
|
|
batch_scan_1.setBounds(136, 430, 230, 80);
|
|
|
batch_scan_1.addActionListener(new ActionListener() {
|
|
batch_scan_1.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
if(MesClient.curPage.equals("B")){
|
|
if(MesClient.curPage.equals("B")){
|
|
|
- MesClient.setMenuStatus("该状态后梁无法解绑",-1);
|
|
|
|
|
|
|
+ MesClient.setMenuStatus("该状态前梁压铸码无法解绑",-1);
|
|
|
}else{
|
|
}else{
|
|
|
String sn = MesClient.product_sn.getText().trim();
|
|
String sn = MesClient.product_sn.getText().trim();
|
|
|
String wsn = MesClient.textField.getText().trim();
|
|
String wsn = MesClient.textField.getText().trim();
|
|
|
- JSONObject retObj = DataUtil.unBindWarehouseData(sn,wsn,user_menu.getText().trim(),"400007");
|
|
|
|
|
|
|
+ JSONObject retObj = DataUtil.unBindWarehouseData(sn,wsn,user_menu.getText().trim(),"400002");
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
- MesClient.setMenuStatus("后梁码解绑成功",0);
|
|
|
|
|
|
|
+ MesClient.setMenuStatus("前梁压铸码解绑成功",0);
|
|
|
MesClient.formatScanType(2);
|
|
MesClient.formatScanType(2);
|
|
|
|
|
|
|
|
textField.setText("");
|
|
textField.setText("");
|
|
@@ -1265,7 +1284,7 @@ public class MesClient extends JFrame {
|
|
|
MesClient.formatScanType(2);
|
|
MesClient.formatScanType(2);
|
|
|
batch_scan_1.setEnabled(true);
|
|
batch_scan_1.setEnabled(true);
|
|
|
if(retObj.get("result")==null){
|
|
if(retObj.get("result")==null){
|
|
|
- MesClient.setMenuStatus("请求失败,后梁码解绑失败,请重试",-1);
|
|
|
|
|
|
|
+ MesClient.setMenuStatus("请求失败,前梁压铸码解绑失败,请重试",-1);
|
|
|
}else{
|
|
}else{
|
|
|
if(retObj.get("result").toString().equalsIgnoreCase("false")){
|
|
if(retObj.get("result").toString().equalsIgnoreCase("false")){
|
|
|
MesClient.setMenuStatus(retObj.getString("message"),-1);
|
|
MesClient.setMenuStatus(retObj.getString("message"),-1);
|
|
@@ -1284,31 +1303,31 @@ public class MesClient extends JFrame {
|
|
|
textField_1.setEditable(false);
|
|
textField_1.setEditable(false);
|
|
|
textField_1.setColumns(10);
|
|
textField_1.setColumns(10);
|
|
|
textField_1.setBounds(517, 333, 446, 70);
|
|
textField_1.setBounds(517, 333, 446, 70);
|
|
|
-// indexPanelA.add(textField_1);
|
|
|
|
|
|
|
+ indexPanelA.add(textField_1);
|
|
|
|
|
|
|
|
batch_scan_2 = new JButton("解绑");
|
|
batch_scan_2 = new JButton("解绑");
|
|
|
batch_scan_2.setIcon(new ImageIcon(MesClient.class.getResource("/bg/delete.png")));
|
|
batch_scan_2.setIcon(new ImageIcon(MesClient.class.getResource("/bg/delete.png")));
|
|
|
batch_scan_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 32));
|
|
batch_scan_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 32));
|
|
|
batch_scan_2.setEnabled(false);
|
|
batch_scan_2.setEnabled(false);
|
|
|
- batch_scan_2.setVisible(false);
|
|
|
|
|
|
|
+ batch_scan_2.setVisible(true);
|
|
|
batch_scan_2.setBounds(633, 430, 230, 80);
|
|
batch_scan_2.setBounds(633, 430, 230, 80);
|
|
|
batch_scan_2.addActionListener(new ActionListener() {
|
|
batch_scan_2.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
if(MesClient.curPage.equals("A")){
|
|
if(MesClient.curPage.equals("A")){
|
|
|
- MesClient.setMenuStatus("该状态后梁无法解绑",-1);
|
|
|
|
|
|
|
+ MesClient.setMenuStatus("该状态前梁压铸码无法解绑",-1);
|
|
|
}else{
|
|
}else{
|
|
|
String sn = MesClient.product_sn2.getText().trim();
|
|
String sn = MesClient.product_sn2.getText().trim();
|
|
|
String wsn = MesClient.textField_1.getText().trim();
|
|
String wsn = MesClient.textField_1.getText().trim();
|
|
|
- JSONObject retObj = DataUtil.unBindWarehouseData(sn,wsn,user_menu.getText().trim(),"400007");
|
|
|
|
|
|
|
+ JSONObject retObj = DataUtil.unBindWarehouseData(sn,wsn,user_menu.getText().trim(),"400002");
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
- MesClient.setMenuStatus("后梁码解绑成功",0);
|
|
|
|
|
|
|
+ MesClient.setMenuStatus("前梁压铸码解绑成功",0);
|
|
|
MesClient.formatScanType(2);
|
|
MesClient.formatScanType(2);
|
|
|
textField_1.setText("");
|
|
textField_1.setText("");
|
|
|
batch_scan_2.setEnabled(false);
|
|
batch_scan_2.setEnabled(false);
|
|
|
PlcUtil.changeEnable(s7PLC,false);
|
|
PlcUtil.changeEnable(s7PLC,false);
|
|
|
}else{
|
|
}else{
|
|
|
if(retObj.get("result")==null){
|
|
if(retObj.get("result")==null){
|
|
|
- MesClient.setMenuStatus("请求失败,前梁码解绑失败,请重试",-1);
|
|
|
|
|
|
|
+ MesClient.setMenuStatus("请求失败,前梁压铸码解绑失败,请重试",-1);
|
|
|
}else{
|
|
}else{
|
|
|
if(retObj.get("result").toString().equalsIgnoreCase("false")){
|
|
if(retObj.get("result").toString().equalsIgnoreCase("false")){
|
|
|
MesClient.setMenuStatus(retObj.getString("message"),-1);
|
|
MesClient.setMenuStatus(retObj.getString("message"),-1);
|
|
@@ -1320,19 +1339,19 @@ public class MesClient extends JFrame {
|
|
|
});
|
|
});
|
|
|
indexPanelA.add(batch_scan_2);
|
|
indexPanelA.add(batch_scan_2);
|
|
|
|
|
|
|
|
- JLabel pxstatus1_1 = new JLabel("A后梁");
|
|
|
|
|
|
|
+ JLabel pxstatus1_1 = new JLabel("A前梁压铸码");
|
|
|
pxstatus1_1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
pxstatus1_1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
pxstatus1_1.setForeground(new Color(0, 0, 0));
|
|
pxstatus1_1.setForeground(new Color(0, 0, 0));
|
|
|
pxstatus1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
|
|
pxstatus1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
|
|
|
pxstatus1_1.setBounds(26, 283, 446, 44);
|
|
pxstatus1_1.setBounds(26, 283, 446, 44);
|
|
|
-// indexPanelA.add(pxstatus1_1);
|
|
|
|
|
|
|
+ indexPanelA.add(pxstatus1_1);
|
|
|
|
|
|
|
|
- JLabel pxstatus1_1_1 = new JLabel("B后梁");
|
|
|
|
|
|
|
+ JLabel pxstatus1_1_1 = new JLabel("B前梁压铸码");
|
|
|
pxstatus1_1_1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
pxstatus1_1_1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
pxstatus1_1_1.setForeground(Color.BLACK);
|
|
pxstatus1_1_1.setForeground(Color.BLACK);
|
|
|
pxstatus1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
|
|
pxstatus1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
|
|
|
pxstatus1_1_1.setBounds(517, 283, 446, 44);
|
|
pxstatus1_1_1.setBounds(517, 283, 446, 44);
|
|
|
-// indexPanelA.add(pxstatus1_1_1);
|
|
|
|
|
|
|
+ indexPanelA.add(pxstatus1_1_1);
|
|
|
|
|
|
|
|
txtfa = new JTextField();
|
|
txtfa = new JTextField();
|
|
|
txtfa.setHorizontalAlignment(SwingConstants.LEFT);
|
|
txtfa.setHorizontalAlignment(SwingConstants.LEFT);
|
|
@@ -1394,7 +1413,7 @@ public class MesClient extends JFrame {
|
|
|
if(scan_type == 1){
|
|
if(scan_type == 1){
|
|
|
scan_type_text.setText("镭雕码");
|
|
scan_type_text.setText("镭雕码");
|
|
|
}else if(scan_type == 2){
|
|
}else if(scan_type == 2){
|
|
|
- scan_type_text.setText("后梁码");
|
|
|
|
|
|
|
+ scan_type_text.setText("前梁压铸码");
|
|
|
}else{
|
|
}else{
|
|
|
scan_type_text.setText("");
|
|
scan_type_text.setText("");
|
|
|
}
|
|
}
|
|
@@ -1425,6 +1444,12 @@ public class MesClient extends JFrame {
|
|
|
MesClient.setMenuStatus("未连接MES服务器",-1);
|
|
MesClient.setMenuStatus("未连接MES服务器",-1);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 校验工件码与PLC程序号是否匹配(二驱/四驱)
|
|
|
|
|
+ String programErr = PlcUtil.checkBarcodeProgram(s7PLC, scanBarcodeSn, MesClient.curPage);
|
|
|
|
|
+ if(programErr != null){
|
|
|
|
|
+ MesClient.setMenuStatus(programErr, 1);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if(MesClient.curPage.equals("A")){
|
|
if(MesClient.curPage.equals("A")){
|
|
|
System.out.println("typeA");
|
|
System.out.println("typeA");
|
|
|
if(!product_sn.getText().isEmpty() && mesQualityFlagA){
|
|
if(!product_sn.getText().isEmpty() && mesQualityFlagA){
|
|
@@ -1456,6 +1481,46 @@ public class MesClient extends JFrame {
|
|
|
}else{
|
|
}else{
|
|
|
MesClient.setMenuStatus("正在校验工件码",0);
|
|
MesClient.setMenuStatus("正在校验工件码",0);
|
|
|
}
|
|
}
|
|
|
|
|
+ }else if(MesClient.scan_type == 2){ // 前梁压铸码
|
|
|
|
|
+ if(scanBarcodeSn.isEmpty()){
|
|
|
|
|
+ MesClient.setMenuStatus("前梁压铸码不能为空",1);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String sn = "";
|
|
|
|
|
+ if(MesClient.curPage.equals("A")){
|
|
|
|
|
+ sn = product_sn.getText().trim();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ sn = product_sn2.getText().trim();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+// if(!checkSnAndBatch(sn,scanBarcodeSn)){
|
|
|
|
|
+// MesClient.setMenuStatus("前梁压铸码与工件不匹配",1);
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject retObj = DataUtil.bindWarehouseData(sn,scanBarcodeSn,user_menu.getText().trim(),"400004");
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ MesClient.setMenuStatus("前梁压铸码扫码绑定成功",0);
|
|
|
|
|
+ MesClient.formatScanType(1);
|
|
|
|
|
+ if(MesClient.curPage.equals("A")){
|
|
|
|
|
+ textField.setText(scanBarcodeSn);
|
|
|
|
|
+ batch_scan_1.setEnabled(true);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ textField_1.setText(scanBarcodeSn);
|
|
|
|
|
+ batch_scan_2.setEnabled(true);
|
|
|
|
|
+ }
|
|
|
|
|
+ PlcUtil.changeEnable(s7PLC,true);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ MesClient.formatScanType(2);
|
|
|
|
|
+ if(retObj.get("result")==null){
|
|
|
|
|
+ MesClient.setMenuStatus("请求失败,前梁压铸码绑定失败,请重试",-1);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if(retObj.get("result").toString().equalsIgnoreCase("false")){
|
|
|
|
|
+ MesClient.setMenuStatus(retObj.getString("message"),-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1602,13 +1667,13 @@ public class MesClient extends JFrame {
|
|
|
},1000, 5000);
|
|
},1000, 5000);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static void formatBatchSn(){
|
|
|
|
|
- if((MesClient.batch_status == 1 && MesClient.tjFlaga == 1) || (MesClient.batch_status2 == 1 && MesClient.tjFlagb == 1)){
|
|
|
|
|
- PlcUtil.changeEnable(MesClient.s7PLC,true);
|
|
|
|
|
- }else{
|
|
|
|
|
- PlcUtil.changeEnable(MesClient.s7PLC,false);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// public static void formatBatchSn(){
|
|
|
|
|
+// if((MesClient.batch_status == 1 && MesClient.tjFlaga == 1) || (MesClient.batch_status2 == 1 && MesClient.tjFlagb == 1)){
|
|
|
|
|
+// PlcUtil.changeEnable(MesClient.s7PLC,true);
|
|
|
|
|
+// }else{
|
|
|
|
|
+// PlcUtil.changeEnable(MesClient.s7PLC,false);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
private static String checkSnType(String sn){
|
|
private static String checkSnType(String sn){
|
|
|
String str = sn.substring(9,12);
|
|
String str = sn.substring(9,12);
|
|
@@ -1622,17 +1687,17 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 检查工件是否匹配
|
|
// 检查工件是否匹配
|
|
|
- private static Boolean checkSnAndBatch(String sn,String batchSn){
|
|
|
|
|
- String gdStr1 = "151245P000012131001000"; // MX11-2
|
|
|
|
|
- String gdStr2 = "151245P000017812001000"; // MX11-2S
|
|
|
|
|
- String cate = sn.substring(0,22);
|
|
|
|
|
- String ptype = checkSnType(batchSn);
|
|
|
|
|
- if(ptype.equals("MX11-2") && cate.equals(gdStr1)){
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- if(ptype.equals("MX11-2S") && cate.equals(gdStr2)){
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// private static Boolean checkSnAndBatch(String sn,String batchSn){
|
|
|
|
|
+// String gdStr1 = "151245P000012131001000"; // MX11-2
|
|
|
|
|
+// String gdStr2 = "151245P000017812001000"; // MX11-2S
|
|
|
|
|
+// String cate = sn.substring(0,22);
|
|
|
|
|
+// String ptype = checkSnType(batchSn);
|
|
|
|
|
+// if(ptype.equals("MX11-2") && cate.equals(gdStr1)){
|
|
|
|
|
+// return true;
|
|
|
|
|
+// }
|
|
|
|
|
+// if(ptype.equals("MX11-2S") && cate.equals(gdStr2)){
|
|
|
|
|
+// return true;
|
|
|
|
|
+// }
|
|
|
|
|
+// return false;
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|