|
|
@@ -118,6 +118,19 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
public static String curSn = "";
|
|
|
|
|
|
+ public static Integer zdStatusA = 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 JButton resetResultA;
|
|
|
+ public static JButton okResultA;
|
|
|
+ public static JButton ngResultA;
|
|
|
+
|
|
|
+
|
|
|
public static JTable table;
|
|
|
public static Object[] columnNames = { "物料名称", "绑定批次", "剩余次数", "操作" };
|
|
|
public static Object[][] rowData = null;
|
|
|
@@ -173,7 +186,7 @@ public class MesClient extends JFrame {
|
|
|
cjTimer4.schedule(new TimerTask() {
|
|
|
public void run() {
|
|
|
try{
|
|
|
- if(work_status == 1){
|
|
|
+ if(work_status == 1 && zdStatusA == 0){
|
|
|
List<Boolean> yxstatus = plcA.readCoil(456,1);
|
|
|
if(yxstatus.size() >= 1 && !yxstatus.get(0)){
|
|
|
ModbusUtil.setPowerOn(MesClient.plcA); // 远程关机
|
|
|
@@ -430,6 +443,11 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
updateMaterailData();
|
|
|
|
|
|
+ zdStatusA = 0;
|
|
|
+ resetResultA.setEnabled(false);
|
|
|
+ okResultA.setEnabled(false);
|
|
|
+ ngResultA.setEnabled(false);
|
|
|
+
|
|
|
// shiftUserCheck();
|
|
|
|
|
|
}
|
|
|
@@ -815,7 +833,7 @@ public class MesClient extends JFrame {
|
|
|
JLabel lblNewLabel_1 = new JLabel("\u9884\u8BBE\u6570\u91CF");
|
|
|
lblNewLabel_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
// lblNewLabel_1.setBounds(204, 241, 83, 34);
|
|
|
- lblNewLabel_1.setBounds(304, 241, 83, 34);
|
|
|
+ lblNewLabel_1.setBounds(185, 241, 83, 34);
|
|
|
indexPanelA.add(lblNewLabel_1);
|
|
|
|
|
|
param1 = new JTextField();
|
|
|
@@ -824,14 +842,14 @@ public class MesClient extends JFrame {
|
|
|
param1.setText("0");
|
|
|
param1.setEditable(false);
|
|
|
// param1.setBounds(288, 241, 83, 34);
|
|
|
- param1.setBounds(388, 241, 83, 34);
|
|
|
+ param1.setBounds(269, 241, 83, 34);
|
|
|
indexPanelA.add(param1);
|
|
|
param1.setColumns(10);
|
|
|
|
|
|
JLabel lblNewLabel_1_1 = new JLabel("\u5B8C\u6210\u6570\u91CF");
|
|
|
lblNewLabel_1_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
// lblNewLabel_1_1.setBounds(204, 285, 83, 34);
|
|
|
- lblNewLabel_1_1.setBounds(304, 285, 83, 34);
|
|
|
+ lblNewLabel_1_1.setBounds(185, 285, 83, 34);
|
|
|
indexPanelA.add(lblNewLabel_1_1);
|
|
|
|
|
|
param2 = new JTextField();
|
|
|
@@ -841,7 +859,7 @@ public class MesClient extends JFrame {
|
|
|
param2.setEditable(false);
|
|
|
param2.setColumns(10);
|
|
|
// param2.setBounds(288, 285, 83, 34);
|
|
|
- param2.setBounds(388, 285, 83, 34);
|
|
|
+ param2.setBounds(269, 285, 83, 34);
|
|
|
indexPanelA.add(param2);
|
|
|
|
|
|
JLabel lblB = new JLabel("B\u67AA");
|
|
|
@@ -881,6 +899,112 @@ public class MesClient extends JFrame {
|
|
|
indexPanelA.add(param4);
|
|
|
MesClient.param4.setVisible(false);
|
|
|
|
|
|
+
|
|
|
+ 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(508, 285, 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()){
|
|
|
+//
|
|
|
+//// 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.aFinish++;
|
|
|
+ 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(632, 285, 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(759, 285, 100, 40);
|
|
|
+ indexPanelA.add(ngResultA);
|
|
|
+
|
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
|
tabbedPane.setEnabledAt(0, true);
|
|
|
|