hou 1 неделя назад
Родитель
Сommit
73cb9bcb94

+ 1 - 1
.idea/artifacts/OP010_jar.xml

@@ -3,6 +3,7 @@
     <output-path>$PROJECT_DIR$/out/artifacts/OP010_jar</output-path>
     <root id="archive" name="OP010.jar">
       <element id="module-output" name="OP010" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/classes/artifacts/mesclient_sd_jar/mesclient-sd.jar" path-in-jar="/" />
       <element id="extracted-dir" path="$PROJECT_DIR$/lib/gson-2.10.jar" path-in-jar="/" />
       <element id="extracted-dir" path="$PROJECT_DIR$/lib/okhttp-4.10.0.jar" path-in-jar="/" />
       <element id="extracted-dir" path="$PROJECT_DIR$/lib/okio-jvm-3.3.0.jar" path-in-jar="/" />
@@ -19,7 +20,6 @@
       <element id="extracted-dir" path="$PROJECT_DIR$/lib/netty-all-4.1.48.Final.jar" path-in-jar="/" />
       <element id="extracted-dir" path="$PROJECT_DIR$/lib/iot-communication-1.4.4.jar" path-in-jar="/" />
       <element id="extracted-dir" path="$PROJECT_DIR$/lib/jshortcut-0.4-oberzalek.jar" path-in-jar="/" />
-      <element id="extracted-dir" path="$PROJECT_DIR$/classes/artifacts/mesclient_sd_jar/mesclient-sd.jar" path-in-jar="/" />
     </root>
   </artifact>
 </component>


BIN
out/artifacts/OP010_jar/OP010.jar


BIN
out/production/OP010/com/mes/ui/MesClient$1.class


BIN
out/production/OP010/com/mes/ui/MesClient$10.class


BIN
out/production/OP010/com/mes/ui/MesClient$11.class


BIN
out/production/OP010/com/mes/ui/MesClient$12.class


BIN
out/production/OP010/com/mes/ui/MesClient$2.class


BIN
out/production/OP010/com/mes/ui/MesClient$3.class


BIN
out/production/OP010/com/mes/ui/MesClient$4.class


BIN
out/production/OP010/com/mes/ui/MesClient$5.class


BIN
out/production/OP010/com/mes/ui/MesClient$6.class


BIN
out/production/OP010/com/mes/ui/MesClient$7.class


BIN
out/production/OP010/com/mes/ui/MesClient$8.class


BIN
out/production/OP010/com/mes/ui/MesClient$9.class


BIN
out/production/OP010/com/mes/ui/MesClient.class


+ 2 - 2
out/production/OP010/resources/config/config.properties

@@ -1,4 +1,4 @@
 mes.gw=OP010A
-#mes.server_ip=127.0.0.1
-mes.server_ip=192.168.16.99
+mes.server_ip=127.0.0.1
+#mes.server_ip=192.168.16.99
 mes.line_sn=XT

+ 47 - 37
src/com/mes/ui/MesClient.java

@@ -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);
 

+ 2 - 2
src/resources/config/config.properties

@@ -1,4 +1,4 @@
 mes.gw=OP010A
-#mes.server_ip=127.0.0.1
-mes.server_ip=192.168.16.99
+mes.server_ip=127.0.0.1
+#mes.server_ip=192.168.16.99
 mes.line_sn=XT