|
@@ -85,6 +85,8 @@ public class MesClient extends JFrame {
|
|
|
public static JTextField param2;
|
|
public static JTextField param2;
|
|
|
public static JTextField param3;
|
|
public static JTextField param3;
|
|
|
public static JTextField param4;
|
|
public static JTextField param4;
|
|
|
|
|
+ public static JTextField param5;
|
|
|
|
|
+ public static JTextField param6;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -92,9 +94,10 @@ public class MesClient extends JFrame {
|
|
|
// public static ModbusTcp plcA = new ModbusTcp(1, "192.168.1.7");//81
|
|
// public static ModbusTcp plcA = new ModbusTcp(1, "192.168.1.7");//81
|
|
|
// public static ModbusTcp plcB = new ModbusTcp(1, "192.168.1.8");//1
|
|
// public static ModbusTcp plcB = new ModbusTcp(1, "192.168.1.8");//1
|
|
|
|
|
|
|
|
-// tw-op130b
|
|
|
|
|
- public static ModbusTcp plcA = new ModbusTcp(1, "192.168.1.7");//29
|
|
|
|
|
- public static ModbusTcp plcB = new ModbusTcp(1, "192.168.1.8");//26
|
|
|
|
|
|
|
+// tw-op210a
|
|
|
|
|
+ public static ModbusTcp plcA = new ModbusTcp(1, "192.168.1.9");//29 气枪
|
|
|
|
|
+ public static ModbusTcp plcB = new ModbusTcp(1, "192.168.1.8");//26 气枪
|
|
|
|
|
+ public static ModbusTcp plcC = new ModbusTcp(1, "192.168.1.7");//电枪
|
|
|
|
|
|
|
|
public static Timer cjTimer;
|
|
public static Timer cjTimer;
|
|
|
|
|
|
|
@@ -102,19 +105,24 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static Timer cjTimer3;
|
|
public static Timer cjTimer3;
|
|
|
|
|
|
|
|
- public static Short aSetNum = 29;
|
|
|
|
|
|
|
+ public static Short aSetNum = 26;
|
|
|
//public static Short aSetNum = 81;
|
|
//public static Short aSetNum = 81;
|
|
|
|
|
|
|
|
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 = 26;
|
|
|
|
|
|
|
+ public static Short bSetNum = 28;
|
|
|
//public static Short bSetNum = 1;
|
|
//public static Short bSetNum = 1;
|
|
|
public static Short sortB = 0;
|
|
public static Short sortB = 0;
|
|
|
public static Short bMax = 0;
|
|
public static Short bMax = 0;
|
|
|
public static Short bFinish = 0;
|
|
public static Short bFinish = 0;
|
|
|
public static List<Map> blist = new ArrayList<>();
|
|
public static List<Map> blist = new ArrayList<>();
|
|
|
|
|
+ public static Short cSetNum = 1;
|
|
|
|
|
+ public static Short sortC = 0;
|
|
|
|
|
+ public static int cMax = 0;
|
|
|
|
|
+ public static Short cFinish = 0;
|
|
|
|
|
+ public static List<Map> clist = new ArrayList<>();
|
|
|
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=提交失败
|
|
|
|
|
|
|
@@ -124,6 +132,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static Integer zdStatusA = 0;
|
|
public static Integer zdStatusA = 0;
|
|
|
public static Integer zdStatusB = 0;
|
|
public static Integer zdStatusB = 0;
|
|
|
|
|
+ public static Integer zdStatusC = 0;
|
|
|
public static String foutA = "";
|
|
public static String foutA = "";
|
|
|
public static String fmaxA = "";
|
|
public static String fmaxA = "";
|
|
|
public static String fminA = "";
|
|
public static String fminA = "";
|
|
@@ -138,12 +147,22 @@ public class MesClient extends JFrame {
|
|
|
public static String smaxB = "";
|
|
public static String smaxB = "";
|
|
|
public static String sminB = "";
|
|
public static String sminB = "";
|
|
|
public static String curB = "";
|
|
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 resetResultA;
|
|
|
public static JButton okResultA;
|
|
public static JButton okResultA;
|
|
|
public static JButton ngResultA;
|
|
public static JButton ngResultA;
|
|
|
public static JButton resetResultB;
|
|
public static JButton resetResultB;
|
|
|
public static JButton okResultB;
|
|
public static JButton okResultB;
|
|
|
public static JButton ngResultB;
|
|
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 = { "物料名称", "绑定批次", "剩余次数", "操作" };
|
|
@@ -172,6 +191,8 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
setDeviceStart();
|
|
setDeviceStart();
|
|
|
|
|
|
|
|
|
|
+ startHeartTimerC();
|
|
|
|
|
+
|
|
|
getMaterailData();
|
|
getMaterailData();
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -193,7 +214,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);
|
|
@@ -202,12 +225,21 @@ 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);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // C电枪:写心跳放枪,停心跳锁枪
|
|
|
|
|
+ if(zdStatusC != 0 || (!MesClient.curSn.isEmpty() && MesClient.cMax > 0 && MesClient.sortC >= MesClient.cMax)){
|
|
|
|
|
+ heartBeatFlagC = false;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ heartBeatFlagC = true;
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
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)){
|
|
@@ -218,6 +250,8 @@ public class MesClient extends JFrame {
|
|
|
if(yxstatusb.size() >= 1 && yxstatusb.get(0)){
|
|
if(yxstatusb.size() >= 1 && yxstatusb.get(0)){
|
|
|
ModbusUtil.setPowerOff(plcB);
|
|
ModbusUtil.setPowerOff(plcB);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ heartBeatFlagC = false;
|
|
|
}
|
|
}
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -226,6 +260,29 @@ public class MesClient extends JFrame {
|
|
|
}, 1000,1000);
|
|
}, 1000,1000);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static java.util.Timer plcHeartBeatTimerC;
|
|
|
|
|
+ public static boolean heartBeatFlagC = false;
|
|
|
|
|
+ public static short heartBeatValueC = 1; // 心跳值,1→2→3→1循环
|
|
|
|
|
+
|
|
|
|
|
+ public static void startHeartTimerC() {
|
|
|
|
|
+ if (plcHeartBeatTimerC != null) {
|
|
|
|
|
+ plcHeartBeatTimerC.cancel();
|
|
|
|
|
+ }
|
|
|
|
|
+ plcHeartBeatTimerC = new java.util.Timer();
|
|
|
|
|
+ plcHeartBeatTimerC.schedule(new TimerTask() {
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ try{
|
|
|
|
|
+ if(heartBeatFlagC){
|
|
|
|
|
+ plcC.writeInt16(4160, heartBeatValueC);
|
|
|
|
|
+ heartBeatValueC = (short) (heartBeatValueC % 3 + 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e){
|
|
|
|
|
+ System.out.println("心跳C执行失败: " + e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 100, 500);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//读配置文件
|
|
//读配置文件
|
|
|
private static void readProperty() throws IOException{
|
|
private static void readProperty() throws IOException{
|
|
|
String enconding = "UTF-8";
|
|
String enconding = "UTF-8";
|
|
@@ -270,6 +327,15 @@ public class MesClient extends JFrame {
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ try{
|
|
|
|
|
+ if(work_status == 1){
|
|
|
|
|
+ ModbusUtil.getDataC(plcC);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}, 1000,500);
|
|
}, 1000,500);
|
|
|
}
|
|
}
|
|
@@ -441,25 +507,37 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
MesClient.aMax = 0;
|
|
MesClient.aMax = 0;
|
|
|
MesClient.bMax = 0;
|
|
MesClient.bMax = 0;
|
|
|
|
|
+ MesClient.cMax = 0;
|
|
|
MesClient.aFinish = 0;
|
|
MesClient.aFinish = 0;
|
|
|
MesClient.bFinish = 0;
|
|
MesClient.bFinish = 0;
|
|
|
|
|
+ MesClient.cFinish = 0;
|
|
|
MesClient.alist = new ArrayList<>();
|
|
MesClient.alist = new ArrayList<>();
|
|
|
MesClient.blist = new ArrayList<>();
|
|
MesClient.blist = new ArrayList<>();
|
|
|
|
|
+ MesClient.clist = new ArrayList<>();
|
|
|
MesClient.sortB = 0;
|
|
MesClient.sortB = 0;
|
|
|
MesClient.sortA = 0;
|
|
MesClient.sortA = 0;
|
|
|
|
|
+ MesClient.sortC = 0;
|
|
|
MesClient.param1.setText("");
|
|
MesClient.param1.setText("");
|
|
|
MesClient.param2.setText("");
|
|
MesClient.param2.setText("");
|
|
|
MesClient.param3.setText("");
|
|
MesClient.param3.setText("");
|
|
|
MesClient.param4.setText("");
|
|
MesClient.param4.setText("");
|
|
|
|
|
+ MesClient.param5.setText("");
|
|
|
|
|
+ MesClient.param6.setText("");
|
|
|
|
|
+
|
|
|
|
|
+ heartBeatFlagC = false;
|
|
|
|
|
|
|
|
zdStatusA = 0;
|
|
zdStatusA = 0;
|
|
|
zdStatusB = 0;
|
|
zdStatusB = 0;
|
|
|
|
|
+ zdStatusC = 0;
|
|
|
resetResultA.setEnabled(false);
|
|
resetResultA.setEnabled(false);
|
|
|
okResultA.setEnabled(false);
|
|
okResultA.setEnabled(false);
|
|
|
ngResultA.setEnabled(false);
|
|
ngResultA.setEnabled(false);
|
|
|
resetResultB.setEnabled(false);
|
|
resetResultB.setEnabled(false);
|
|
|
okResultB.setEnabled(false);
|
|
okResultB.setEnabled(false);
|
|
|
ngResultB.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){
|
|
@@ -473,6 +551,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
ModbusUtil.setTask(MesClient.plcA,MesClient.aSetNum);
|
|
ModbusUtil.setTask(MesClient.plcA,MesClient.aSetNum);
|
|
|
ModbusUtil.setTask(MesClient.plcB,MesClient.bSetNum);
|
|
ModbusUtil.setTask(MesClient.plcB,MesClient.bSetNum);
|
|
|
|
|
+ ModbusUtil.setTaskEle(MesClient.plcC,MesClient.cSetNum);
|
|
|
|
|
|
|
|
updateMaterailData();
|
|
updateMaterailData();
|
|
|
}
|
|
}
|
|
@@ -790,12 +869,12 @@ public class MesClient extends JFrame {
|
|
|
JLabel lblNewLabel = new JLabel("A\u67AA");
|
|
JLabel lblNewLabel = new JLabel("A\u67AA");
|
|
|
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
lblNewLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
lblNewLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
- lblNewLabel.setBounds(204, 186, 166, 28);
|
|
|
|
|
|
|
+ lblNewLabel.setBounds(100, 186, 166, 28);
|
|
|
indexPanelA.add(lblNewLabel);
|
|
indexPanelA.add(lblNewLabel);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1 = new JLabel("\u9884\u8BBE\u6570\u91CF");
|
|
JLabel lblNewLabel_1 = new JLabel("\u9884\u8BBE\u6570\u91CF");
|
|
|
lblNewLabel_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
lblNewLabel_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
- lblNewLabel_1.setBounds(204, 241, 83, 34);
|
|
|
|
|
|
|
+ lblNewLabel_1.setBounds(100, 241, 83, 34);
|
|
|
indexPanelA.add(lblNewLabel_1);
|
|
indexPanelA.add(lblNewLabel_1);
|
|
|
|
|
|
|
|
param1 = new JTextField();
|
|
param1 = new JTextField();
|
|
@@ -803,13 +882,13 @@ public class MesClient extends JFrame {
|
|
|
param1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
param1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
param1.setText("0");
|
|
param1.setText("0");
|
|
|
param1.setEditable(false);
|
|
param1.setEditable(false);
|
|
|
- param1.setBounds(288, 241, 83, 34);
|
|
|
|
|
|
|
+ param1.setBounds(184, 241, 83, 34);
|
|
|
indexPanelA.add(param1);
|
|
indexPanelA.add(param1);
|
|
|
param1.setColumns(10);
|
|
param1.setColumns(10);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1_1 = new JLabel("\u5B8C\u6210\u6570\u91CF");
|
|
JLabel lblNewLabel_1_1 = new JLabel("\u5B8C\u6210\u6570\u91CF");
|
|
|
lblNewLabel_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
lblNewLabel_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
- lblNewLabel_1_1.setBounds(204, 285, 83, 34);
|
|
|
|
|
|
|
+ lblNewLabel_1_1.setBounds(100, 285, 83, 34);
|
|
|
indexPanelA.add(lblNewLabel_1_1);
|
|
indexPanelA.add(lblNewLabel_1_1);
|
|
|
|
|
|
|
|
param2 = new JTextField();
|
|
param2 = new JTextField();
|
|
@@ -818,18 +897,18 @@ public class MesClient extends JFrame {
|
|
|
param2.setText("0");
|
|
param2.setText("0");
|
|
|
param2.setEditable(false);
|
|
param2.setEditable(false);
|
|
|
param2.setColumns(10);
|
|
param2.setColumns(10);
|
|
|
- param2.setBounds(288, 285, 83, 34);
|
|
|
|
|
|
|
+ param2.setBounds(184, 285, 83, 34);
|
|
|
indexPanelA.add(param2);
|
|
indexPanelA.add(param2);
|
|
|
|
|
|
|
|
JLabel lblB = new JLabel("B\u67AA");
|
|
JLabel lblB = new JLabel("B\u67AA");
|
|
|
lblB.setHorizontalAlignment(SwingConstants.CENTER);
|
|
lblB.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
lblB.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
lblB.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
- lblB.setBounds(525, 186, 166, 28);
|
|
|
|
|
|
|
+ lblB.setBounds(380, 186, 166, 28);
|
|
|
indexPanelA.add(lblB);
|
|
indexPanelA.add(lblB);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1_2 = new JLabel("\u9884\u8BBE\u6570\u91CF");
|
|
JLabel lblNewLabel_1_2 = new JLabel("\u9884\u8BBE\u6570\u91CF");
|
|
|
lblNewLabel_1_2.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
lblNewLabel_1_2.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
- lblNewLabel_1_2.setBounds(525, 241, 83, 34);
|
|
|
|
|
|
|
+ lblNewLabel_1_2.setBounds(380, 241, 83, 34);
|
|
|
indexPanelA.add(lblNewLabel_1_2);
|
|
indexPanelA.add(lblNewLabel_1_2);
|
|
|
|
|
|
|
|
param3 = new JTextField();
|
|
param3 = new JTextField();
|
|
@@ -838,12 +917,12 @@ public class MesClient extends JFrame {
|
|
|
param3.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
param3.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
param3.setEditable(false);
|
|
param3.setEditable(false);
|
|
|
param3.setColumns(10);
|
|
param3.setColumns(10);
|
|
|
- param3.setBounds(608, 241, 83, 34);
|
|
|
|
|
|
|
+ param3.setBounds(463, 241, 83, 34);
|
|
|
indexPanelA.add(param3);
|
|
indexPanelA.add(param3);
|
|
|
|
|
|
|
|
JLabel lblNewLabel_1_1_1 = new JLabel("\u5B8C\u6210\u6570\u91CF");
|
|
JLabel lblNewLabel_1_1_1 = new JLabel("\u5B8C\u6210\u6570\u91CF");
|
|
|
lblNewLabel_1_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
lblNewLabel_1_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
- lblNewLabel_1_1_1.setBounds(525, 285, 83, 34);
|
|
|
|
|
|
|
+ lblNewLabel_1_1_1.setBounds(380, 285, 83, 34);
|
|
|
indexPanelA.add(lblNewLabel_1_1_1);
|
|
indexPanelA.add(lblNewLabel_1_1_1);
|
|
|
|
|
|
|
|
param4 = new JTextField();
|
|
param4 = new JTextField();
|
|
@@ -852,19 +931,58 @@ public class MesClient extends JFrame {
|
|
|
param4.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
param4.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
param4.setEditable(false);
|
|
param4.setEditable(false);
|
|
|
param4.setColumns(10);
|
|
param4.setColumns(10);
|
|
|
- param4.setBounds(608, 285, 83, 34);
|
|
|
|
|
|
|
+ param4.setBounds(463, 285, 83, 34);
|
|
|
indexPanelA.add(param4);
|
|
indexPanelA.add(param4);
|
|
|
|
|
|
|
|
|
|
+ JLabel lblC = new JLabel("C\u67AA");
|
|
|
|
|
+ lblC.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
|
+ lblC.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
|
|
+ lblC.setBounds(660, 186, 166, 28);
|
|
|
|
|
+ indexPanelA.add(lblC);
|
|
|
|
|
+
|
|
|
|
|
+ JLabel lblNewLabel_1_3 = new JLabel("\u9884\u8BBE\u6570\u91CF");
|
|
|
|
|
+ lblNewLabel_1_3.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
|
|
+ lblNewLabel_1_3.setBounds(660, 241, 83, 34);
|
|
|
|
|
+ indexPanelA.add(lblNewLabel_1_3);
|
|
|
|
|
+
|
|
|
|
|
+ param5 = new JTextField();
|
|
|
|
|
+ param5.setText("0");
|
|
|
|
|
+ param5.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
|
+ param5.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
|
|
+ param5.setEditable(false);
|
|
|
|
|
+ param5.setColumns(10);
|
|
|
|
|
+ param5.setBounds(743, 241, 83, 34);
|
|
|
|
|
+ indexPanelA.add(param5);
|
|
|
|
|
+
|
|
|
|
|
+ JLabel lblNewLabel_1_1_2 = new JLabel("\u5B8C\u6210\u6570\u91CF");
|
|
|
|
|
+ lblNewLabel_1_1_2.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
|
|
+ lblNewLabel_1_1_2.setBounds(660, 285, 83, 34);
|
|
|
|
|
+ indexPanelA.add(lblNewLabel_1_1_2);
|
|
|
|
|
+
|
|
|
|
|
+ param6 = new JTextField();
|
|
|
|
|
+ param6.setText("0");
|
|
|
|
|
+ param6.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
|
+ param6.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
|
|
+ param6.setEditable(false);
|
|
|
|
|
+ param6.setColumns(10);
|
|
|
|
|
+ param6.setBounds(743, 285, 83, 34);
|
|
|
|
|
+ indexPanelA.add(param6);
|
|
|
|
|
+
|
|
|
JLabel lblNgJudgeA = new JLabel("NG\u590d\u5224");
|
|
JLabel lblNgJudgeA = new JLabel("NG\u590d\u5224");
|
|
|
lblNgJudgeA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
lblNgJudgeA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- lblNgJudgeA.setBounds(204, 322, 167, 22);
|
|
|
|
|
|
|
+ lblNgJudgeA.setBounds(100, 322, 167, 22);
|
|
|
indexPanelA.add(lblNgJudgeA);
|
|
indexPanelA.add(lblNgJudgeA);
|
|
|
|
|
|
|
|
JLabel lblNgJudgeB = new JLabel("NG\u590d\u5224");
|
|
JLabel lblNgJudgeB = new JLabel("NG\u590d\u5224");
|
|
|
lblNgJudgeB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
lblNgJudgeB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- lblNgJudgeB.setBounds(525, 322, 167, 22);
|
|
|
|
|
|
|
+ lblNgJudgeB.setBounds(380, 322, 167, 22);
|
|
|
indexPanelA.add(lblNgJudgeB);
|
|
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 = new JButton("重拉");
|
|
|
resetResultA.addActionListener(new ActionListener() {
|
|
resetResultA.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
@@ -894,7 +1012,7 @@ public class MesClient extends JFrame {
|
|
|
});
|
|
});
|
|
|
resetResultA.setEnabled(false);
|
|
resetResultA.setEnabled(false);
|
|
|
resetResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
resetResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- resetResultA.setBounds(204, 348, 70, 36);
|
|
|
|
|
|
|
+ resetResultA.setBounds(100, 348, 70, 36);
|
|
|
indexPanelA.add(resetResultA);
|
|
indexPanelA.add(resetResultA);
|
|
|
|
|
|
|
|
okResultA = new JButton("OK");
|
|
okResultA = new JButton("OK");
|
|
@@ -929,7 +1047,7 @@ public class MesClient extends JFrame {
|
|
|
okResultA.setEnabled(false);
|
|
okResultA.setEnabled(false);
|
|
|
okResultA.setForeground(new Color(0, 128, 0));
|
|
okResultA.setForeground(new Color(0, 128, 0));
|
|
|
okResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
okResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- okResultA.setBounds(281, 348, 70, 36);
|
|
|
|
|
|
|
+ okResultA.setBounds(177, 348, 70, 36);
|
|
|
indexPanelA.add(okResultA);
|
|
indexPanelA.add(okResultA);
|
|
|
|
|
|
|
|
ngResultA = new JButton("NG");
|
|
ngResultA = new JButton("NG");
|
|
@@ -963,7 +1081,7 @@ public class MesClient extends JFrame {
|
|
|
ngResultA.setEnabled(false);
|
|
ngResultA.setEnabled(false);
|
|
|
ngResultA.setForeground(new Color(255, 0, 0));
|
|
ngResultA.setForeground(new Color(255, 0, 0));
|
|
|
ngResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
ngResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- ngResultA.setBounds(358, 348, 70, 36);
|
|
|
|
|
|
|
+ ngResultA.setBounds(254, 348, 70, 36);
|
|
|
indexPanelA.add(ngResultA);
|
|
indexPanelA.add(ngResultA);
|
|
|
|
|
|
|
|
resetResultB = new JButton("重拉");
|
|
resetResultB = new JButton("重拉");
|
|
@@ -995,7 +1113,7 @@ public class MesClient extends JFrame {
|
|
|
});
|
|
});
|
|
|
resetResultB.setEnabled(false);
|
|
resetResultB.setEnabled(false);
|
|
|
resetResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
resetResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- resetResultB.setBounds(525, 348, 70, 36);
|
|
|
|
|
|
|
+ resetResultB.setBounds(380, 348, 70, 36);
|
|
|
indexPanelA.add(resetResultB);
|
|
indexPanelA.add(resetResultB);
|
|
|
|
|
|
|
|
okResultB = new JButton("OK");
|
|
okResultB = new JButton("OK");
|
|
@@ -1030,7 +1148,7 @@ public class MesClient extends JFrame {
|
|
|
okResultB.setEnabled(false);
|
|
okResultB.setEnabled(false);
|
|
|
okResultB.setForeground(new Color(0, 128, 0));
|
|
okResultB.setForeground(new Color(0, 128, 0));
|
|
|
okResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
okResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- okResultB.setBounds(602, 348, 70, 36);
|
|
|
|
|
|
|
+ okResultB.setBounds(457, 348, 70, 36);
|
|
|
indexPanelA.add(okResultB);
|
|
indexPanelA.add(okResultB);
|
|
|
|
|
|
|
|
ngResultB = new JButton("NG");
|
|
ngResultB = new JButton("NG");
|
|
@@ -1064,9 +1182,114 @@ public class MesClient extends JFrame {
|
|
|
ngResultB.setEnabled(false);
|
|
ngResultB.setEnabled(false);
|
|
|
ngResultB.setForeground(new Color(255, 0, 0));
|
|
ngResultB.setForeground(new Color(255, 0, 0));
|
|
|
ngResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
ngResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- ngResultB.setBounds(679, 348, 70, 36);
|
|
|
|
|
|
|
+ ngResultB.setBounds(534, 348, 70, 36);
|
|
|
indexPanelA.add(ngResultB);
|
|
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")) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ sortC = (short)(sortC - 1);
|
|
|
|
|
+ param6.setText(sortC+"");
|
|
|
|
|
+ plcC.writeInt16(66, sortC);
|
|
|
|
|
+ zdStatusC = 0;
|
|
|
|
|
+ resetResultC.setEnabled(false);
|
|
|
|
|
+ okResultC.setEnabled(false);
|
|
|
|
|
+ ngResultC.setEnabled(false);
|
|
|
|
|
+ foutC = "";
|
|
|
|
|
+ soutC = "";
|
|
|
|
|
+ fmaxC = "";
|
|
|
|
|
+ fminC = "";
|
|
|
|
|
+ smaxC = "";
|
|
|
|
|
+ sminC = "";
|
|
|
|
|
+ curC = "";
|
|
|
|
|
+ heartBeatFlagC = true;
|
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
|
+ setMenuStatus("C枪重拉失败", -1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }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()){
|
|
|
|
|
+ cFinish++;
|
|
|
|
|
+ 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();
|
|
|
|
|
+ heartBeatFlagC = true;
|
|
|
|
|
+ }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();
|
|
|
|
|
+ heartBeatFlagC = true;
|
|
|
|
|
+ }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);
|
|
|
|
|
|