|
@@ -97,8 +97,8 @@ public class MesClient extends JFrame {
|
|
|
public static JTextField param3;
|
|
public static JTextField param3;
|
|
|
public static JTextField param4;
|
|
public static JTextField param4;
|
|
|
|
|
|
|
|
- public static ModbusTcp plcA = new ModbusTcp(1, "192.168.1.7");
|
|
|
|
|
-// public static ModbusTcp plcB = new ModbusTcp(1, "192.168.1.8");
|
|
|
|
|
|
|
+ public static ModbusTcp plcA = new ModbusTcp(1, "192.168.1.27");
|
|
|
|
|
+ public static ModbusTcp plcB = new ModbusTcp(1, "192.168.1.28");
|
|
|
|
|
|
|
|
public static Timer cjTimer;
|
|
public static Timer cjTimer;
|
|
|
|
|
|
|
@@ -106,14 +106,15 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static Timer cjTimer3;
|
|
public static Timer cjTimer3;
|
|
|
|
|
|
|
|
- public static Short aSetNum = 48;
|
|
|
|
|
|
|
+ public static Short aSetNum = 24;
|
|
|
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 = 10;
|
|
|
|
|
|
|
+ public static Short bSetNum = 24;
|
|
|
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 List<Map> blist = new ArrayList<>();
|
|
public static List<Map> blist = 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=提交失败
|
|
@@ -123,6 +124,7 @@ public class MesClient extends JFrame {
|
|
|
public static String curSn = "";
|
|
public static String curSn = "";
|
|
|
|
|
|
|
|
public static Integer zdStatusA = 0;
|
|
public static Integer zdStatusA = 0;
|
|
|
|
|
+ public static Integer zdStatusB = 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 = "";
|
|
@@ -130,9 +132,19 @@ public class MesClient extends JFrame {
|
|
|
public static String smaxA = "";
|
|
public static String smaxA = "";
|
|
|
public static String sminA = "";
|
|
public static String sminA = "";
|
|
|
public static String curA = "";
|
|
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 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 okResultB;
|
|
|
|
|
+ public static JButton ngResultB;
|
|
|
|
|
|
|
|
|
|
|
|
|
public static JTable table;
|
|
public static JTable table;
|
|
@@ -169,15 +181,15 @@ public class MesClient extends JFrame {
|
|
|
welcomeWin = new LoginFarme();
|
|
welcomeWin = new LoginFarme();
|
|
|
welcomeWin.setVisible(true);
|
|
welcomeWin.setVisible(true);
|
|
|
|
|
|
|
|
-// getPlcParam();
|
|
|
|
|
|
|
+ getPlcParam();
|
|
|
|
|
|
|
|
-// upParams();
|
|
|
|
|
-//
|
|
|
|
|
-// setDeviceStart();
|
|
|
|
|
|
|
+ upParams();
|
|
|
|
|
+
|
|
|
|
|
+ setDeviceStart();
|
|
|
|
|
|
|
|
getMaterailData();
|
|
getMaterailData();
|
|
|
|
|
|
|
|
-// deviceOnline();
|
|
|
|
|
|
|
+ deviceOnline();
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
log.error("系统初始化异常: ", e);
|
|
log.error("系统初始化异常: ", e);
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -195,10 +207,17 @@ public class MesClient extends JFrame {
|
|
|
cjTimer4.schedule(new TimerTask() {
|
|
cjTimer4.schedule(new TimerTask() {
|
|
|
public void run() {
|
|
public void run() {
|
|
|
try{
|
|
try{
|
|
|
|
|
+ // NG中断锁枪期间不自动开机,避免冲掉锁枪
|
|
|
if(work_status == 1 && zdStatusA == 0){
|
|
if(work_status == 1 && zdStatusA == 0){
|
|
|
List<Boolean> yxstatus = plcA.readCoil(456,1);
|
|
List<Boolean> yxstatus = plcA.readCoil(456,1);
|
|
|
if(yxstatus.size() >= 1 && !yxstatus.get(0)){
|
|
if(yxstatus.size() >= 1 && !yxstatus.get(0)){
|
|
|
- ModbusUtil.setPowerOn(MesClient.plcA); // 远程关机
|
|
|
|
|
|
|
+ ModbusUtil.setPowerOn(MesClient.plcA);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(work_status == 1 && zdStatusB == 0){
|
|
|
|
|
+ List<Boolean> yxstatusb = plcB.readCoil(456,1);
|
|
|
|
|
+ if(yxstatusb.size() >= 1 && !yxstatusb.get(0)){
|
|
|
|
|
+ ModbusUtil.setPowerOn(MesClient.plcB);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -238,16 +257,20 @@ public class MesClient extends JFrame {
|
|
|
cjTimer.schedule(new TimerTask() {
|
|
cjTimer.schedule(new TimerTask() {
|
|
|
public void run() {
|
|
public void run() {
|
|
|
try{
|
|
try{
|
|
|
- ModbusUtil.getDataA(plcA);
|
|
|
|
|
|
|
+ if(work_status == 1){
|
|
|
|
|
+ ModbusUtil.getDataA(plcA);
|
|
|
|
|
+ }
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// try{
|
|
|
|
|
-// ModbusUtil.getDataB(plcB);
|
|
|
|
|
-// }catch (Exception e){
|
|
|
|
|
-// e.printStackTrace();
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ if(work_status == 1){
|
|
|
|
|
+ ModbusUtil.getDataB(plcB);
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}, 1000,500);
|
|
}, 1000,500);
|
|
|
}
|
|
}
|
|
@@ -262,29 +285,50 @@ public class MesClient extends JFrame {
|
|
|
public void run() {
|
|
public void run() {
|
|
|
try{
|
|
try{
|
|
|
|
|
|
|
|
- boolean lamaoret = ModbusUtil.getOnOff(plcA);
|
|
|
|
|
- if(lamaoret){
|
|
|
|
|
- lblNewLabel.setText("A枪:在线");
|
|
|
|
|
|
|
+ boolean lamaoretA = ModbusUtil.getOnOff(plcA);
|
|
|
|
|
+ boolean lamaoretB = ModbusUtil.getOnOff(plcB);
|
|
|
|
|
+ if(lamaoretA && lamaoretB){
|
|
|
|
|
+ lblNewLabel.setText("A/B枪:在线");
|
|
|
lblNewLabel.setForeground(Color.GREEN);
|
|
lblNewLabel.setForeground(Color.GREEN);
|
|
|
|
|
+ }else if(lamaoretA){
|
|
|
|
|
+ lblNewLabel.setText("A在线/B离线");
|
|
|
|
|
+ lblNewLabel.setForeground(Color.ORANGE);
|
|
|
|
|
+ }else if(lamaoretB){
|
|
|
|
|
+ lblNewLabel.setText("A离线/B在线");
|
|
|
|
|
+ lblNewLabel.setForeground(Color.ORANGE);
|
|
|
}else{
|
|
}else{
|
|
|
- lblNewLabel.setText("A枪:离线");
|
|
|
|
|
|
|
+ lblNewLabel.setText("A/B枪:离线");
|
|
|
lblNewLabel.setForeground(Color.RED);
|
|
lblNewLabel.setForeground(Color.RED);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(work_status == 1){
|
|
if(work_status == 1){
|
|
|
|
|
+ // A枪:任务未完成且无NG中断时保持开机;完成或NG中断则锁枪
|
|
|
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(zdStatusA != 0 || (!MesClient.curSn.isEmpty() && MesClient.aMax > 0 && MesClient.aMax == MesClient.sortA)){
|
|
|
ModbusUtil.setPowerOff(plcA);
|
|
ModbusUtil.setPowerOff(plcA);
|
|
|
}else{
|
|
}else{
|
|
|
ModbusUtil.setPowerOn(plcA);
|
|
ModbusUtil.setPowerOn(plcA);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // B枪
|
|
|
|
|
+ List<Boolean> yxstatusb = plcB.readCoil(3128,1);
|
|
|
|
|
+ if(yxstatusb.size() >= 1 && !yxstatusb.get(0)){
|
|
|
|
|
+ if(zdStatusB != 0 || (!MesClient.curSn.isEmpty() && MesClient.bMax > 0 && MesClient.bMax == MesClient.sortB)){
|
|
|
|
|
+ ModbusUtil.setPowerOff(plcB);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcB);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}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)){
|
|
|
ModbusUtil.setPowerOff(plcA);
|
|
ModbusUtil.setPowerOff(plcA);
|
|
|
}
|
|
}
|
|
|
|
|
+ List<Boolean> yxstatusb = plcB.readCoil(3128,1);
|
|
|
|
|
+ if(yxstatusb.size() >= 1 && yxstatusb.get(0)){
|
|
|
|
|
+ ModbusUtil.setPowerOff(plcB);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -441,6 +485,7 @@ public class MesClient extends JFrame {
|
|
|
MesClient.aMax = 0;
|
|
MesClient.aMax = 0;
|
|
|
MesClient.aFinish = 0;
|
|
MesClient.aFinish = 0;
|
|
|
MesClient.bMax = 0;
|
|
MesClient.bMax = 0;
|
|
|
|
|
+ MesClient.bFinish = 0;
|
|
|
MesClient.alist = new ArrayList<>();
|
|
MesClient.alist = new ArrayList<>();
|
|
|
MesClient.blist = new ArrayList<>();
|
|
MesClient.blist = new ArrayList<>();
|
|
|
MesClient.sortB = 0;
|
|
MesClient.sortB = 0;
|
|
@@ -450,9 +495,6 @@ public class MesClient extends JFrame {
|
|
|
MesClient.param3.setText("");
|
|
MesClient.param3.setText("");
|
|
|
MesClient.param4.setText("");
|
|
MesClient.param4.setText("");
|
|
|
|
|
|
|
|
- MesClient.param3.setVisible(false);
|
|
|
|
|
- MesClient.param4.setVisible(false);
|
|
|
|
|
-
|
|
|
|
|
fxModeVal = false;
|
|
fxModeVal = false;
|
|
|
fxMaxNum.setEditable(false);
|
|
fxMaxNum.setEditable(false);
|
|
|
fxMaxNum.setText("");
|
|
fxMaxNum.setText("");
|
|
@@ -460,16 +502,21 @@ public class MesClient extends JFrame {
|
|
|
fxMode.setBackground(null);
|
|
fxMode.setBackground(null);
|
|
|
fxMode.setForeground(null);
|
|
fxMode.setForeground(null);
|
|
|
|
|
|
|
|
- ModbusUtil.setPowerOff(MesClient.plcA); // 远程关机
|
|
|
|
|
-// ModbusUtil.setMesUnAllow(MesClient.plcA, MesClient.deviceHeartTimer);
|
|
|
|
|
|
|
+ ModbusUtil.setPowerOff(MesClient.plcA); // 远程关机锁枪
|
|
|
|
|
+ ModbusUtil.setPowerOff(MesClient.plcB); // 远程关机锁枪
|
|
|
ModbusUtil.setTask(MesClient.plcA,aSetNum);
|
|
ModbusUtil.setTask(MesClient.plcA,aSetNum);
|
|
|
|
|
+ ModbusUtil.setTask(MesClient.plcB,bSetNum);
|
|
|
|
|
|
|
|
updateMaterailData();
|
|
updateMaterailData();
|
|
|
|
|
|
|
|
zdStatusA = 0;
|
|
zdStatusA = 0;
|
|
|
|
|
+ zdStatusB = 0;
|
|
|
resetResultA.setEnabled(false);
|
|
resetResultA.setEnabled(false);
|
|
|
okResultA.setEnabled(false);
|
|
okResultA.setEnabled(false);
|
|
|
ngResultA.setEnabled(false);
|
|
ngResultA.setEnabled(false);
|
|
|
|
|
+ resetResultB.setEnabled(false);
|
|
|
|
|
+ okResultB.setEnabled(false);
|
|
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
|
|
|
|
|
// shiftUserCheck();
|
|
// shiftUserCheck();
|
|
|
|
|
|
|
@@ -842,8 +889,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, 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);
|
|
|
|
|
|
|
@@ -862,7 +908,6 @@ public class MesClient extends JFrame {
|
|
|
log.info("【判定上传】发送结果: {}", sendret);
|
|
log.info("【判定上传】发送结果: {}", sendret);
|
|
|
if(!sendret){
|
|
if(!sendret){
|
|
|
MesClient.setMenuStatus("消息发送失败,请重试",-1);
|
|
MesClient.setMenuStatus("消息发送失败,请重试",-1);
|
|
|
-// JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -870,21 +915,19 @@ 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);
|
|
|
|
|
|
|
|
lblNewLabel = new JLabel("A枪");
|
|
lblNewLabel = new JLabel("A枪");
|
|
|
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(304, 186, 166, 28);
|
|
|
|
|
|
|
+ lblNewLabel.setBounds(204, 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(185, 241, 83, 34);
|
|
|
|
|
|
|
+ lblNewLabel_1.setBounds(204, 241, 83, 34);
|
|
|
indexPanelA.add(lblNewLabel_1);
|
|
indexPanelA.add(lblNewLabel_1);
|
|
|
|
|
|
|
|
param1 = new JTextField();
|
|
param1 = new JTextField();
|
|
@@ -892,15 +935,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(269, 241, 83, 34);
|
|
|
|
|
|
|
+ param1.setBounds(288, 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(185, 285, 83, 34);
|
|
|
|
|
|
|
+ lblNewLabel_1_1.setBounds(204, 285, 83, 34);
|
|
|
indexPanelA.add(lblNewLabel_1_1);
|
|
indexPanelA.add(lblNewLabel_1_1);
|
|
|
|
|
|
|
|
param2 = new JTextField();
|
|
param2 = new JTextField();
|
|
@@ -909,20 +950,19 @@ 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(269, 285, 83, 34);
|
|
|
|
|
|
|
+ param2.setBounds(288, 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(525, 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(525, 241, 83, 34);
|
|
|
-// indexPanelA.add(lblNewLabel_1_2);
|
|
|
|
|
|
|
+ indexPanelA.add(lblNewLabel_1_2);
|
|
|
|
|
|
|
|
param3 = new JTextField();
|
|
param3 = new JTextField();
|
|
|
param3.setText("0");
|
|
param3.setText("0");
|
|
@@ -932,13 +972,11 @@ public class MesClient extends JFrame {
|
|
|
param3.setColumns(10);
|
|
param3.setColumns(10);
|
|
|
param3.setBounds(608, 241, 83, 34);
|
|
param3.setBounds(608, 241, 83, 34);
|
|
|
indexPanelA.add(param3);
|
|
indexPanelA.add(param3);
|
|
|
- MesClient.param3.setVisible(false);
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
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(525, 285, 83, 34);
|
|
|
-// indexPanelA.add(lblNewLabel_1_1_1);
|
|
|
|
|
|
|
+ indexPanelA.add(lblNewLabel_1_1_1);
|
|
|
|
|
|
|
|
param4 = new JTextField();
|
|
param4 = new JTextField();
|
|
|
param4.setText("0");
|
|
param4.setText("0");
|
|
@@ -948,8 +986,16 @@ public class MesClient extends JFrame {
|
|
|
param4.setColumns(10);
|
|
param4.setColumns(10);
|
|
|
param4.setBounds(608, 285, 83, 34);
|
|
param4.setBounds(608, 285, 83, 34);
|
|
|
indexPanelA.add(param4);
|
|
indexPanelA.add(param4);
|
|
|
- MesClient.param4.setVisible(false);
|
|
|
|
|
|
|
|
|
|
|
|
+ JLabel lblNgJudgeA = new JLabel("NG\u590d\u5224");
|
|
|
|
|
+ lblNgJudgeA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ lblNgJudgeA.setBounds(204, 322, 167, 22);
|
|
|
|
|
+ indexPanelA.add(lblNgJudgeA);
|
|
|
|
|
+
|
|
|
|
|
+ JLabel lblNgJudgeB = new JLabel("NG\u590d\u5224");
|
|
|
|
|
+ lblNgJudgeB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ lblNgJudgeB.setBounds(525, 322, 167, 22);
|
|
|
|
|
+ indexPanelA.add(lblNgJudgeB);
|
|
|
|
|
|
|
|
resetResultA = new JButton("重拉");
|
|
resetResultA = new JButton("重拉");
|
|
|
resetResultA.addActionListener(new ActionListener() {
|
|
resetResultA.addActionListener(new ActionListener() {
|
|
@@ -984,8 +1030,8 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
resetResultA.setEnabled(false);
|
|
resetResultA.setEnabled(false);
|
|
|
- resetResultA.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
|
|
- resetResultA.setBounds(508, 285, 100, 40);
|
|
|
|
|
|
|
+ resetResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ resetResultA.setBounds(204, 348, 70, 36);
|
|
|
indexPanelA.add(resetResultA);
|
|
indexPanelA.add(resetResultA);
|
|
|
|
|
|
|
|
okResultA = new JButton("OK");
|
|
okResultA = new JButton("OK");
|
|
@@ -1024,8 +1070,8 @@ 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, 16));
|
|
|
|
|
- okResultA.setBounds(632, 285, 100, 40);
|
|
|
|
|
|
|
+ okResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ okResultA.setBounds(281, 348, 70, 36);
|
|
|
indexPanelA.add(okResultA);
|
|
indexPanelA.add(okResultA);
|
|
|
|
|
|
|
|
ngResultA = new JButton("NG");
|
|
ngResultA = new JButton("NG");
|
|
@@ -1064,9 +1110,124 @@ 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, 16));
|
|
|
|
|
- ngResultA.setBounds(759, 285, 100, 40);
|
|
|
|
|
|
|
+ ngResultA.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ ngResultA.setBounds(358, 348, 70, 36);
|
|
|
indexPanelA.add(ngResultA);
|
|
indexPanelA.add(ngResultA);
|
|
|
|
|
+
|
|
|
|
|
+ resetResultB = new JButton("重拉");
|
|
|
|
|
+ resetResultB.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【B枪操作】点击了 [重拉] 按钮,当前产品SN: {}", product_sn.getText());
|
|
|
|
|
+ if(zdStatusB == 1){
|
|
|
|
|
+ log.info("【NG审核检查】准备校验 B枪 NG中断数据, SN: {}", product_sn.getText());
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"B");
|
|
|
|
|
+ log.info("【NG审核检查】校验返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ MesClient.zdStatusB = 0;
|
|
|
|
|
+ MesClient.resetResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.okResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.ngResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.sortB = (short) (MesClient.sortB - 1);
|
|
|
|
|
+ MesClient.param4.setText(MesClient.sortB+"");
|
|
|
|
|
+ plcB.writeInt16(1136,MesClient.sortB);
|
|
|
|
|
+ MesClient.foutB = "";
|
|
|
|
|
+ MesClient.soutB = "";
|
|
|
|
|
+ MesClient.fmaxB = "";
|
|
|
|
|
+ MesClient.fminB = "";
|
|
|
|
|
+ MesClient.smaxB = "";
|
|
|
|
|
+ MesClient.sminB = "";
|
|
|
|
|
+ MesClient.curB = "";
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcB);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ MesClient.setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ resetResultB.setEnabled(false);
|
|
|
|
|
+ resetResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ resetResultB.setBounds(525, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(resetResultB);
|
|
|
|
|
+
|
|
|
|
|
+ okResultB = new JButton("OK");
|
|
|
|
|
+ okResultB.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【B枪操作】点击了 [OK] 按钮,当前产品SN: {}", product_sn.getText());
|
|
|
|
|
+ if(zdStatusB == 1){
|
|
|
|
|
+ log.info("【NG审核检查】准备校验 B枪 NG中断数据, SN: {}", product_sn.getText());
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"B");
|
|
|
|
|
+ log.info("【NG审核检查】校验返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ if(!MesClient.product_sn.getText().isEmpty()){
|
|
|
|
|
+ MesClient.bFinish++;
|
|
|
|
|
+ JdbcUtils.insertProdData(MesClient.mes_gw, MesClient.mes_line_sn, MesClient.product_sn.getText(),"B",foutB,soutB,fminB,sminB,fmaxB,smaxB,"1",curB+"", MesClient.user_menu.getText());
|
|
|
|
|
+ }
|
|
|
|
|
+ MesClient.zdStatusB = 0;
|
|
|
|
|
+ MesClient.resetResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.okResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.ngResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.foutB = "";
|
|
|
|
|
+ MesClient.soutB = "";
|
|
|
|
|
+ MesClient.fmaxB = "";
|
|
|
|
|
+ MesClient.fminB = "";
|
|
|
|
|
+ MesClient.smaxB = "";
|
|
|
|
|
+ MesClient.sminB = "";
|
|
|
|
|
+ MesClient.curB = "";
|
|
|
|
|
+
|
|
|
|
|
+ ModbusUtil.upResult();
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcB);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ MesClient.setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ okResultB.setEnabled(false);
|
|
|
|
|
+ okResultB.setForeground(new Color(0, 128, 0));
|
|
|
|
|
+ okResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ okResultB.setBounds(602, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(okResultB);
|
|
|
|
|
+
|
|
|
|
|
+ ngResultB = new JButton("NG");
|
|
|
|
|
+ ngResultB.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【B枪操作】点击了 [NG] 按钮,当前产品SN: {}", product_sn.getText());
|
|
|
|
|
+ if(zdStatusB == 1){
|
|
|
|
|
+ log.info("【NG审核检查】准备校验 B枪 NG中断数据, SN: {}", product_sn.getText());
|
|
|
|
|
+ JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"B");
|
|
|
|
|
+ log.info("【NG审核检查】校验返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
|
|
+ if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
|
|
+ if(!MesClient.product_sn.getText().isEmpty()){
|
|
|
|
|
+ JdbcUtils.insertProdData(MesClient.mes_gw, MesClient.mes_line_sn, MesClient.product_sn.getText(),"B",foutB,soutB,fminB,sminB,fmaxB,smaxB,"0",curB+"", MesClient.user_menu.getText());
|
|
|
|
|
+ }
|
|
|
|
|
+ MesClient.zdStatusB = 0;
|
|
|
|
|
+ MesClient.resetResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.okResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.ngResultB.setEnabled(false);
|
|
|
|
|
+ MesClient.foutB = "";
|
|
|
|
|
+ MesClient.soutB = "";
|
|
|
|
|
+ MesClient.fmaxB = "";
|
|
|
|
|
+ MesClient.fminB = "";
|
|
|
|
|
+ MesClient.smaxB = "";
|
|
|
|
|
+ MesClient.sminB = "";
|
|
|
|
|
+ MesClient.curB = "";
|
|
|
|
|
+ ModbusUtil.upResult();
|
|
|
|
|
+ ModbusUtil.setPowerOn(plcB);
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+ MesClient.setMenuStatus("NG中断未审核",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
|
|
+ ngResultB.setForeground(new Color(255, 0, 0));
|
|
|
|
|
+ ngResultB.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
+ ngResultB.setBounds(679, 348, 70, 36);
|
|
|
|
|
+ indexPanelA.add(ngResultB);
|
|
|
|
|
|
|
|
fxMode = new JButton("返修模式");
|
|
fxMode = new JButton("返修模式");
|
|
|
fxMode.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
fxMode.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
@@ -1105,6 +1266,7 @@ public class MesClient extends JFrame {
|
|
|
int maxNum = Integer.parseInt(fxMaxNum.getText());
|
|
int maxNum = Integer.parseInt(fxMaxNum.getText());
|
|
|
if(maxNum > 0){
|
|
if(maxNum > 0){
|
|
|
ModbusUtil.setTask(MesClient.plcA,(short)maxNum);
|
|
ModbusUtil.setTask(MesClient.plcA,(short)maxNum);
|
|
|
|
|
+ ModbusUtil.setTask(MesClient.plcB,(short)maxNum);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|