|
|
@@ -77,6 +77,7 @@ public class MesClient extends JFrame {
|
|
|
public static final int PRODUCT_SN_LENGTH = 32;
|
|
|
public static final String PREFIX_ZJ = "000020021815-01000016"; //智界
|
|
|
public static final String PREFIX_SJ = "000020022029-01000016"; //尚界
|
|
|
+ public static final boolean PRODUCT_TYPE_SWITCH_ENABLED = false;
|
|
|
public static final String PRODUCT_TYPE_SWITCH_PASSWORD = "503833";
|
|
|
public static final String PRODUCT_TYPE_ZJ = ProductTypePanel.TYPE_ZJ;
|
|
|
public static final String PRODUCT_TYPE_SJ = ProductTypePanel.TYPE_SJ;
|
|
|
@@ -212,7 +213,11 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
|
updateProductTypePanelEnabled(true);
|
|
|
- MesClient.setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码",0);
|
|
|
+ if (PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
+ MesClient.setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码",0);
|
|
|
+ } else {
|
|
|
+ MesClient.setMenuStatus("请扫工件码",0);
|
|
|
+ }
|
|
|
// MesClient.setMenuStatus("开班点检,请先进行OKNG样件测试",-1);
|
|
|
|
|
|
updateMaterailData();
|
|
|
@@ -301,6 +306,9 @@ public class MesClient extends JFrame {
|
|
|
if (sn.length() != PRODUCT_SN_LENGTH) {
|
|
|
return "工件码长度须为32位,当前" + sn.length() + "位";
|
|
|
}
|
|
|
+ if (!PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
String prefix = getProductSnPrefix();
|
|
|
if (!sn.startsWith(prefix)) {
|
|
|
return "工件码前缀与当前类型(" + getProductTypeName() + ")不匹配,当前工件码为" + getProductTypeNameBySn(sn);
|
|
|
@@ -639,44 +647,46 @@ public class MesClient extends JFrame {
|
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
|
tabbedPane.setEnabledAt(0, true);
|
|
|
|
|
|
- JPanel indexPanelProductType = new JPanel();
|
|
|
- indexPanelProductType.setLayout(null);
|
|
|
- JScrollPane productTypeScrollPane = new JScrollPane(indexPanelProductType);
|
|
|
-
|
|
|
- JLabel productTypeTitle = new JLabel("生产类型设置");
|
|
|
- productTypeTitle.setFont(new Font("微软雅黑", Font.BOLD, 28));
|
|
|
- productTypeTitle.setForeground(new Color(64, 64, 64));
|
|
|
- productTypeTitle.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
- productTypeTitle.setBounds(81, 80, 810, 50);
|
|
|
- indexPanelProductType.add(productTypeTitle);
|
|
|
-
|
|
|
- JLabel productTypeHint = new JLabel("请选择当前生产的工件类型,切换后将保存到本地并用于扫码校验");
|
|
|
- productTypeHint.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
- productTypeHint.setForeground(new Color(140, 140, 140));
|
|
|
- productTypeHint.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
- productTypeHint.setBounds(81, 140, 810, 40);
|
|
|
- indexPanelProductType.add(productTypeHint);
|
|
|
-
|
|
|
- productTypePanel = new ProductTypePanel(PRODUCT_TYPE_SWITCH_PASSWORD);
|
|
|
- productTypePanel.setBounds(276, 210, 420, 72);
|
|
|
- productTypePanel.setOnChangeListener(() -> {
|
|
|
- if (work_status == 0) {
|
|
|
- saveProductTypeToDb();
|
|
|
- setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码", 0);
|
|
|
- }
|
|
|
- refreshProductTypeCurrentLabel();
|
|
|
- });
|
|
|
- indexPanelProductType.add(productTypePanel);
|
|
|
+ if (PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
+ JPanel indexPanelProductType = new JPanel();
|
|
|
+ indexPanelProductType.setLayout(null);
|
|
|
+ JScrollPane productTypeScrollPane = new JScrollPane(indexPanelProductType);
|
|
|
+
|
|
|
+ JLabel productTypeTitle = new JLabel("生产类型设置");
|
|
|
+ productTypeTitle.setFont(new Font("微软雅黑", Font.BOLD, 28));
|
|
|
+ productTypeTitle.setForeground(new Color(64, 64, 64));
|
|
|
+ productTypeTitle.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
+ productTypeTitle.setBounds(81, 80, 810, 50);
|
|
|
+ indexPanelProductType.add(productTypeTitle);
|
|
|
+
|
|
|
+ JLabel productTypeHint = new JLabel("请选择当前生产的工件类型,切换后将保存到本地并用于扫码校验");
|
|
|
+ productTypeHint.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
+ productTypeHint.setForeground(new Color(140, 140, 140));
|
|
|
+ productTypeHint.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
+ productTypeHint.setBounds(81, 140, 810, 40);
|
|
|
+ indexPanelProductType.add(productTypeHint);
|
|
|
+
|
|
|
+ productTypePanel = new ProductTypePanel(PRODUCT_TYPE_SWITCH_PASSWORD);
|
|
|
+ productTypePanel.setBounds(276, 210, 420, 72);
|
|
|
+ productTypePanel.setOnChangeListener(() -> {
|
|
|
+ if (work_status == 0) {
|
|
|
+ saveProductTypeToDb();
|
|
|
+ setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码", 0);
|
|
|
+ }
|
|
|
+ refreshProductTypeCurrentLabel();
|
|
|
+ });
|
|
|
+ indexPanelProductType.add(productTypePanel);
|
|
|
|
|
|
- productTypeCurrentLabel = new JLabel();
|
|
|
- productTypeCurrentLabel.setFont(new Font("微软雅黑", Font.PLAIN, 22));
|
|
|
- productTypeCurrentLabel.setForeground(new Color(64, 64, 64));
|
|
|
- productTypeCurrentLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
- productTypeCurrentLabel.setBounds(81, 310, 810, 40);
|
|
|
- refreshProductTypeCurrentLabel();
|
|
|
- indexPanelProductType.add(productTypeCurrentLabel);
|
|
|
+ productTypeCurrentLabel = new JLabel();
|
|
|
+ productTypeCurrentLabel.setFont(new Font("微软雅黑", Font.PLAIN, 22));
|
|
|
+ productTypeCurrentLabel.setForeground(new Color(64, 64, 64));
|
|
|
+ productTypeCurrentLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
+ productTypeCurrentLabel.setBounds(81, 310, 810, 40);
|
|
|
+ refreshProductTypeCurrentLabel();
|
|
|
+ indexPanelProductType.add(productTypeCurrentLabel);
|
|
|
|
|
|
- tabbedPane.addTab("生产类型", new ImageIcon(MesClient.class.getResource("/bg/menu_setting.png")), productTypeScrollPane, null);
|
|
|
+ tabbedPane.addTab("生产类型", new ImageIcon(MesClient.class.getResource("/bg/menu_setting.png")), productTypeScrollPane, null);
|
|
|
+ }
|
|
|
|
|
|
// searchScrollPane = new JScrollPane((Component) null);
|
|
|
|