|
|
@@ -64,10 +64,12 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
public static String user20 = "";
|
|
|
|
|
|
- // 产品PN号(195/196/198),决定长码前缀 F95621032519X
|
|
|
- public static final String[] PN_LIST = {"195", "196", "198"};
|
|
|
- public static JComboBox<String> pnCombo;
|
|
|
- public static String pnCacheKey = "pn_";
|
|
|
+ // 当前加工产品PN号,由服务端按生产计划下发
|
|
|
+ public static String currentPn = "";
|
|
|
+ public static JLabel pnLabel;
|
|
|
+ // 计划已完成/无计划时停止自动取码;失败后的下次重试时间
|
|
|
+ public static boolean planStop = false;
|
|
|
+ public static long nextRetryTime = 0;
|
|
|
|
|
|
public static JFrame welcomeWin;
|
|
|
|
|
|
@@ -146,7 +148,6 @@ public class MesClient extends JFrame {
|
|
|
mes_server_ip = pro.getProperty("mes.server_ip");
|
|
|
mes_line_sn = pro.getProperty("mes.line_sn");
|
|
|
mes_gw_des = OprnoUtil.getGwDes(mes_line_sn,mes_gw);
|
|
|
- pnCacheKey = "pn_" + mes_gw; // 产品PN按工位缓存
|
|
|
log.info(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + ";");
|
|
|
}
|
|
|
|
|
|
@@ -193,6 +194,8 @@ public class MesClient extends JFrame {
|
|
|
public static void resetScanA() {
|
|
|
work_status = 0;
|
|
|
check_quality_result = false;
|
|
|
+ planStop = false;
|
|
|
+ nextRetryTime = 0;
|
|
|
MesClient.finish_ok_bt.setEnabled(false);
|
|
|
MesClient.finish_ng_bt.setEnabled(false);
|
|
|
product_sn.setText("");
|
|
|
@@ -229,11 +232,6 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
}
|
|
|
|
|
|
- // 当前选中的产品PN号,未选择时默认195
|
|
|
- public static String getPn() {
|
|
|
- return pnCombo == null ? PN_LIST[0] : String.valueOf(pnCombo.getSelectedItem());
|
|
|
- }
|
|
|
-
|
|
|
//获取用户20位
|
|
|
public static void getUser() {
|
|
|
user20 = user_menu.getText().toString();
|
|
|
@@ -480,27 +478,17 @@ public class MesClient extends JFrame {
|
|
|
indexPanelA.add(product_sn);
|
|
|
product_sn.setColumns(10);
|
|
|
|
|
|
- // 产品PN选择:决定长码前缀,选择后存本地,重启保持
|
|
|
- JLabel pnLabel = new JLabel("产品PN:");
|
|
|
+ // 产品PN号:由服务端按生产计划下发,界面只读显示
|
|
|
+ JLabel pnTitle = new JLabel("产品PN:");
|
|
|
+ pnTitle.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
+ pnTitle.setBounds(81, 15, 100, 40);
|
|
|
+ indexPanelA.add(pnTitle);
|
|
|
+
|
|
|
+ pnLabel = new JLabel("-");
|
|
|
pnLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
- pnLabel.setBounds(81, 15, 100, 40);
|
|
|
+ pnLabel.setBounds(185, 15, 140, 40);
|
|
|
indexPanelA.add(pnLabel);
|
|
|
|
|
|
- pnCombo = new JComboBox<>(PN_LIST);
|
|
|
- pnCombo.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
- pnCombo.setBounds(185, 15, 140, 40);
|
|
|
- String cachePn = JdbcUtils.getCacheValue(pnCacheKey);
|
|
|
- pnCombo.setSelectedItem(cachePn.isEmpty() ? PN_LIST[0] : cachePn);
|
|
|
- pnCombo.addActionListener(new ActionListener() {
|
|
|
- public void actionPerformed(ActionEvent e) {
|
|
|
- String pn = getPn();
|
|
|
- JdbcUtils.setCacheValue(pnCacheKey, pn);
|
|
|
- setMenuStatus("当前产品:" + pn, 0);
|
|
|
- log.info("切换产品PN: {}", pn);
|
|
|
- }
|
|
|
- });
|
|
|
- indexPanelA.add(pnCombo);
|
|
|
-
|
|
|
f_scan_data_bt_1 = new JButton("扫码");
|
|
|
f_scan_data_bt_1.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|