|
|
@@ -466,17 +466,36 @@ public class MesClient extends JFrame {
|
|
|
});
|
|
|
settingMenu.add(resetTcpMenu);
|
|
|
|
|
|
- JMenuItem resetTcpMenu_1 = new JMenuItem("刷新工件");
|
|
|
+ JMenuItem resetTcpMenu_1 = new JMenuItem("重新读码");
|
|
|
resetTcpMenu_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
resetTcpMenu_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
resetTcpMenu_1.addMouseListener(new MouseAdapter() {
|
|
|
@Override
|
|
|
public void mousePressed(MouseEvent e) {
|
|
|
super.mouseClicked(e);
|
|
|
- resetScanA();
|
|
|
+
|
|
|
+ String sn = "";
|
|
|
+ boolean hgA = MesClient.s7PLC.readBoolean("DB503.0.0");
|
|
|
+ boolean hgB = MesClient.s7PLC.readBoolean("DB503.0.1");
|
|
|
+ if (hgA) {
|
|
|
+ sn = MesClient.s7PLC.readString("DB503.270.0");
|
|
|
+ }else if (hgB) {
|
|
|
+ sn = MesClient.s7PLC.readString("DB503.336.0");
|
|
|
+ }else {
|
|
|
+ sn = MesClient.s7PLC.readString("DB503.2.0");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sn == null || sn.trim().isEmpty() || "".equals(sn)) {
|
|
|
+ setMenuStatus("扫码结果为空", -1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ sn = sn.trim();
|
|
|
+
|
|
|
+ DataUtil.checkQuality(MesClient.nettyClient, sn, MesClient.user20);
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
-// settingMenu.add(resetTcpMenu_1);
|
|
|
+ settingMenu.add(resetTcpMenu_1);
|
|
|
|
|
|
//允许上料
|
|
|
JMenuItem allow_up_material = new JMenuItem("允许上料");
|
|
|
@@ -536,6 +555,8 @@ public class MesClient extends JFrame {
|
|
|
settingMenu.add(reset_signal);
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
contentPane = new JPanel();
|
|
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
|
setContentPane(contentPane);
|
|
|
@@ -1003,19 +1024,13 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
|
}else if (index == 2){
|
|
|
// 等待上料完成
|
|
|
- if (MesClient.s7PLC.readBoolean("DB503.0.3")){
|
|
|
+ if (MesClient.s7PLC.readBoolean("DB503.0.3") || MesClient.s7PLC.readBoolean("DB503.0.4")){
|
|
|
// 将允许上料清空·
|
|
|
MesClient.s7PLC.writeBoolean("DB503.0.2", false);
|
|
|
- //发送开始做件
|
|
|
-// Boolean reg = DataUtil.startWork(MesClient.nettyClient, MesClient.product_sn.getText(), MesClient.user20);
|
|
|
-// if (!reg){
|
|
|
-// setMenuStatus("报文发送异常", -1);
|
|
|
-// return;
|
|
|
-// }
|
|
|
}
|
|
|
}else if (index == 3){
|
|
|
// 等待完成信号
|
|
|
- if (MesClient.s7PLC.readBoolean("DB503.0.4")){
|
|
|
+ if (MesClient.s7PLC.readBoolean("DB503.0.4") || (MesClient.s7PLC.readBoolean("DB503.0.0") || MesClient.s7PLC.readBoolean("DB503.0.1"))){
|
|
|
// 冷板为空不允许提交
|
|
|
if (!bind_lb_result){
|
|
|
setMenuStatus("请先绑定冷板", -1);
|
|
|
@@ -1043,7 +1058,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- }, 0, 1500);
|
|
|
+ }, 0, 2000);
|
|
|
}
|
|
|
|
|
|
|