|
|
@@ -107,6 +107,7 @@ public class MesClient extends JFrame {
|
|
|
// public static Short bSetNum = 27;
|
|
|
public static Short sortB = 0;
|
|
|
public static Short bMax = 0;
|
|
|
+ public static Short bFinish = 0;
|
|
|
public static List<Map> blist = new ArrayList<>();
|
|
|
public static Short deviceControl = 0; // 0=本地 1=远程
|
|
|
public static Integer tjStatus = 0; // 1=提交失败
|
|
|
@@ -119,6 +120,35 @@ public class MesClient extends JFrame {
|
|
|
public static Object[] columnNames = { "物料名称", "绑定批次", "剩余次数", "操作" };
|
|
|
public static Object[][] rowData = null;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ public static Integer zdStatusA = 0;
|
|
|
+ public static Integer zdStatusB = 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 JButton resetResultA;
|
|
|
+ public static JButton okResultA;
|
|
|
+ public static JButton ngResultA;
|
|
|
+ public static JButton resetResultB;
|
|
|
+ public static JButton okResultB;
|
|
|
+ public static JButton ngResultB;
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
|
EventQueue.invokeLater(new Runnable() {
|
|
|
@Override
|
|
|
@@ -412,6 +442,7 @@ public class MesClient extends JFrame {
|
|
|
MesClient.aMax = 0;
|
|
|
MesClient.bMax = 0;
|
|
|
MesClient.aFinish = 0;
|
|
|
+ MesClient.bFinish = 0;
|
|
|
MesClient.alist = new ArrayList<>();
|
|
|
MesClient.blist = new ArrayList<>();
|
|
|
MesClient.sortB = 0;
|
|
|
@@ -425,6 +456,13 @@ public class MesClient extends JFrame {
|
|
|
if(deviceControl == 1){
|
|
|
|
|
|
}
|
|
|
+ resetResultA.setEnabled(false);
|
|
|
+ okResultA.setEnabled(false);
|
|
|
+ ngResultA.setEnabled(false);
|
|
|
+
|
|
|
+ resetResultB.setEnabled(false);
|
|
|
+ okResultB.setEnabled(false);
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
|
|
|
// plcA.writeCoil(3128,false);
|
|
|
// plcB.writeCoil(3128,false);
|
|
|
@@ -817,6 +855,222 @@ public class MesClient extends JFrame {
|
|
|
param4.setBounds(608, 285, 83, 34);
|
|
|
indexPanelA.add(param4);
|
|
|
|
|
|
+ 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")) {
|
|
|
+ MesClient.zdStatusA = 0;
|
|
|
+ MesClient.resetResultA.setEnabled(false);
|
|
|
+ MesClient.okResultA.setEnabled(false);
|
|
|
+ MesClient.ngResultA.setEnabled(false);
|
|
|
+ MesClient.sortA = (short) (MesClient.sortA - 1);
|
|
|
+ MesClient.param2.setText(MesClient.sortA+"");
|
|
|
+ plcA.writeInt16(1136,MesClient.sortA);
|
|
|
+ MesClient.foutA = "";
|
|
|
+ MesClient.soutA = "";
|
|
|
+ MesClient.fmaxA = "";
|
|
|
+ MesClient.fminA = "";
|
|
|
+ MesClient.smaxA = "";
|
|
|
+ MesClient.sminA = "";
|
|
|
+ MesClient.curA = "";
|
|
|
+ ModbusUtil.setPowerOn(plcA);
|
|
|
+ }else{
|
|
|
+ MesClient.setMenuStatus("NG中断未审核",-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ resetResultA.setEnabled(false);
|
|
|
+ resetResultA.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
+ resetResultA.setBounds(52, 331, 100, 40);
|
|
|
+ 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(!MesClient.product_sn.getText().isEmpty()){
|
|
|
+ MesClient.aFinish++;
|
|
|
+ JdbcUtils.insertProdData(MesClient.mes_gw, MesClient.mes_line_sn, MesClient.product_sn.getText(),"A",foutA,soutA,fminA,sminA,fmaxA,smaxA,"1",curA+"", MesClient.user_menu.getText());
|
|
|
+ }
|
|
|
+ MesClient.zdStatusA = 0;
|
|
|
+ MesClient.resetResultA.setEnabled(false);
|
|
|
+ MesClient.okResultA.setEnabled(false);
|
|
|
+ MesClient.ngResultA.setEnabled(false);
|
|
|
+ MesClient.foutA = "";
|
|
|
+ MesClient.soutA = "";
|
|
|
+ MesClient.fmaxA = "";
|
|
|
+ MesClient.fminA = "";
|
|
|
+ MesClient.smaxA = "";
|
|
|
+ MesClient.sminA = "";
|
|
|
+ MesClient.curA = "";
|
|
|
+
|
|
|
+ ModbusUtil.upResult();
|
|
|
+ ModbusUtil.setPowerOn(plcA);
|
|
|
+ }else{
|
|
|
+ MesClient.setMenuStatus("NG中断未审核",-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ okResultA.setEnabled(false);
|
|
|
+ okResultA.setForeground(new Color(0, 128, 0));
|
|
|
+ okResultA.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
+ okResultA.setBounds(176, 331, 100, 40);
|
|
|
+ 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(!MesClient.product_sn.getText().isEmpty()){
|
|
|
+ JdbcUtils.insertProdData(MesClient.mes_gw, MesClient.mes_line_sn, MesClient.product_sn.getText(),"A",foutA,soutA,fminA,sminA,fmaxA,smaxA,"0",curA+"", MesClient.user_menu.getText());
|
|
|
+ }
|
|
|
+ MesClient.zdStatusA = 0;
|
|
|
+ MesClient.resetResultA.setEnabled(false);
|
|
|
+ MesClient.okResultA.setEnabled(false);
|
|
|
+ MesClient.ngResultA.setEnabled(false);
|
|
|
+ MesClient.foutA = "";
|
|
|
+ MesClient.soutA = "";
|
|
|
+ MesClient.fmaxA = "";
|
|
|
+ MesClient.fminA = "";
|
|
|
+ MesClient.smaxA = "";
|
|
|
+ MesClient.sminA = "";
|
|
|
+ MesClient.curA = "";
|
|
|
+ ModbusUtil.upResult();
|
|
|
+ ModbusUtil.setPowerOn(plcA);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ MesClient.setMenuStatus("NG中断未审核",-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ngResultA.setEnabled(false);
|
|
|
+ ngResultA.setForeground(new Color(255, 0, 0));
|
|
|
+ ngResultA.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
+ ngResultA.setBounds(303, 331, 100, 40);
|
|
|
+ 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")) {
|
|
|
+ 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, 16));
|
|
|
+ resetResultB.setBounds(595, 331, 100, 40);
|
|
|
+ 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(!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.setPowerOn(plcB);
|
|
|
+
|
|
|
+ ModbusUtil.upResult();
|
|
|
+ }else{
|
|
|
+ MesClient.setMenuStatus("NG中断未审核",-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ okResultB.setEnabled(false);
|
|
|
+ okResultB.setForeground(new Color(0, 128, 0));
|
|
|
+ okResultB.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
+ okResultB.setBounds(718, 331, 100, 40);
|
|
|
+ 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(!MesClient.product_sn.getText().isEmpty()){
|
|
|
+ JdbcUtils.insertProdData(MesClient.mes_gw, MesClient.mes_line_sn, MesClient.product_sn.getText(),"B",foutA,soutA,fminA,sminA,fmaxA,smaxA,"0",curA+"", 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.setPowerOn(plcB);
|
|
|
+
|
|
|
+
|
|
|
+ ModbusUtil.upResult();
|
|
|
+ }else{
|
|
|
+ MesClient.setMenuStatus("NG中断未审核",-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ngResultB.setEnabled(false);
|
|
|
+ ngResultB.setForeground(Color.RED);
|
|
|
+ ngResultB.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
+ ngResultB.setBounds(839, 331, 100, 40);
|
|
|
+ indexPanelA.add(ngResultB);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
|
tabbedPane.setEnabledAt(0, true);
|
|
|
|