|
@@ -148,6 +148,10 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static Short curInit = 0; // 初始拉铆数量
|
|
public static Short curInit = 0; // 初始拉铆数量
|
|
|
|
|
|
|
|
|
|
+ public static Boolean fxModeVal = false;
|
|
|
|
|
+ public static JButton fxMode;
|
|
|
|
|
+ public static JButton fxMaxBtn;
|
|
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
EventQueue.invokeLater(new Runnable() {
|
|
EventQueue.invokeLater(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
@@ -464,6 +468,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
public static int userLoginHours;//用户登录所处小时
|
|
public static int userLoginHours;//用户登录所处小时
|
|
|
|
|
+ public static JTextField fxMaxNum;
|
|
|
//换班用户信息检查
|
|
//换班用户信息检查
|
|
|
private static void shiftUserCheck() {
|
|
private static void shiftUserCheck() {
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
@@ -552,15 +557,24 @@ public class MesClient extends JFrame {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 查询工件质量
|
|
|
|
|
- log.info("【质量检查-扫码触发】准备发送扫码质量询问报文, SN: {}, User: {}", barcode36, user20);
|
|
|
|
|
- Boolean sendret = DataUtil.checkQuality(nettyClient,barcode36,user20);
|
|
|
|
|
- log.info("【质量检查-扫码触发】请求发送结果: {}", sendret);
|
|
|
|
|
|
|
+ if(!fxModeVal){
|
|
|
|
|
+ // 查询工件质量
|
|
|
|
|
+ log.info("【质量检查-扫码触发】准备发送扫码质量询问报文, SN: {}, User: {}", barcode36, user20);
|
|
|
|
|
+ Boolean sendret = DataUtil.checkQuality(nettyClient,barcode36,user20);
|
|
|
|
|
+ log.info("【质量检查-扫码触发】请求发送结果: {}", sendret);
|
|
|
|
|
|
|
|
- if(!sendret){
|
|
|
|
|
- JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ if(!sendret){
|
|
|
|
|
+ JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ MesClient.check_quality_result = true;//质量合格,可以绑定加工
|
|
|
|
|
+ MesClient.setMenuStatus("该工件可以加工",0);
|
|
|
|
|
+ MesClient.getUser();
|
|
|
|
|
+ DataUtil.startWork(MesClient.nettyClient,barcode36,MesClient.user20);
|
|
|
|
|
+ MesClient.f_scan_data_bt_2.setEnabled(true);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}else {
|
|
}else {
|
|
|
JOptionPane.showMessageDialog(mesClientFrame,"请扫工件码","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
JOptionPane.showMessageDialog(mesClientFrame,"请扫工件码","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
return;
|
|
return;
|
|
@@ -1044,6 +1058,47 @@ public class MesClient extends JFrame {
|
|
|
ngResultA.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
ngResultA.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
ngResultA.setBounds(759, 285, 100, 40);
|
|
ngResultA.setBounds(759, 285, 100, 40);
|
|
|
indexPanelA.add(ngResultA);
|
|
indexPanelA.add(ngResultA);
|
|
|
|
|
+
|
|
|
|
|
+ fxMode = new JButton("返修模式");
|
|
|
|
|
+ fxMode.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
|
|
+ fxMode.setBounds(161, 10, 107, 40);
|
|
|
|
|
+ indexPanelA.add(fxMode);
|
|
|
|
|
+ fxMode.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ fxModeVal = !fxModeVal;
|
|
|
|
|
+ if(fxModeVal){
|
|
|
|
|
+ fxMode.setBackground(Color.GREEN);
|
|
|
|
|
+ fxMode.setForeground(Color.WHITE);
|
|
|
|
|
+ fxMaxNum.setText("");
|
|
|
|
|
+ fxMaxNum.setEditable(true);
|
|
|
|
|
+ fxMaxBtn.setEnabled(true);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ fxMode.setBackground(null);
|
|
|
|
|
+ fxMode.setForeground(null);
|
|
|
|
|
+ fxMaxNum.setText("");
|
|
|
|
|
+ fxMaxNum.setEditable(false);
|
|
|
|
|
+ fxMaxBtn.setEnabled(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ fxMaxNum = new JTextField();
|
|
|
|
|
+ fxMaxNum.setBounds(286, 10, 83, 40);
|
|
|
|
|
+ indexPanelA.add(fxMaxNum);
|
|
|
|
|
+ fxMaxNum.setColumns(10);
|
|
|
|
|
+
|
|
|
|
|
+ fxMaxBtn = new JButton("确定数量");
|
|
|
|
|
+ fxMaxBtn.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
|
|
+ fxMaxBtn.setBounds(379, 10, 107, 40);
|
|
|
|
|
+ indexPanelA.add(fxMaxBtn);
|
|
|
|
|
+ fxMaxBtn.addActionListener(new ActionListener() {
|
|
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ int maxNum = Integer.parseInt(fxMaxNum.getText());
|
|
|
|
|
+ if(maxNum > 0){
|
|
|
|
|
+ ModbusUtil.setTask(MesClient.plcA,(short)maxNum);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
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);
|
|
@@ -1317,5 +1372,4 @@ public class MesClient extends JFrame {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|