|
@@ -57,6 +57,7 @@ public class MesClient extends JFrame {
|
|
|
public static final int PRODUCT_SN_LENGTH = 32;
|
|
public static final int PRODUCT_SN_LENGTH = 32;
|
|
|
public static final String PREFIX_ZJ = "000020021815-01000016"; //智界
|
|
public static final String PREFIX_ZJ = "000020021815-01000016"; //智界
|
|
|
public static final String PREFIX_SJ = "000020022029-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_SWITCH_PASSWORD = "503833";
|
|
|
public static final String PRODUCT_TYPE_ZJ = ProductTypePanel.TYPE_ZJ;
|
|
public static final String PRODUCT_TYPE_ZJ = ProductTypePanel.TYPE_ZJ;
|
|
|
public static final String PRODUCT_TYPE_SJ = ProductTypePanel.TYPE_SJ;
|
|
public static final String PRODUCT_TYPE_SJ = ProductTypePanel.TYPE_SJ;
|
|
@@ -431,7 +432,12 @@ public class MesClient extends JFrame {
|
|
|
MesClient.fxlabel.setVisible(false);
|
|
MesClient.fxlabel.setVisible(false);
|
|
|
|
|
|
|
|
MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
|
- MesClient.setMenuStatus("请扫工件码",0);
|
|
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
|
|
+ if (PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
|
|
+ MesClient.setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码",0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ MesClient.setMenuStatus("请扫工件码",0);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
updateMaterailData();
|
|
updateMaterailData();
|
|
|
}
|
|
}
|
|
@@ -654,12 +660,14 @@ public class MesClient extends JFrame {
|
|
|
updateProductTypePanelEnabled(false);
|
|
updateProductTypePanelEnabled(false);
|
|
|
|
|
|
|
|
if (!PlcService.ensureConnected()) {
|
|
if (!PlcService.ensureConnected()) {
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
MesClient.setMenuStatus("PLC未连接,请检查网络", -1);
|
|
MesClient.setMenuStatus("PLC未连接,请检查网络", -1);
|
|
|
updatePlcStatus(false);
|
|
updatePlcStatus(false);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
updatePlcStatus(true);
|
|
updatePlcStatus(true);
|
|
|
if (!PlcService.setCollectComplete(false)) {
|
|
if (!PlcService.setCollectComplete(false)) {
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
MesClient.setMenuStatus("写入V2800.3=0失败", -1);
|
|
MesClient.setMenuStatus("写入V2800.3=0失败", -1);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -670,6 +678,7 @@ public class MesClient extends JFrame {
|
|
|
MesClient.check_quality_result = false;
|
|
MesClient.check_quality_result = false;
|
|
|
MesClient.work_status = 0;
|
|
MesClient.work_status = 0;
|
|
|
PlcService.setMesConnected(false);
|
|
PlcService.setMesConnected(false);
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -677,12 +686,14 @@ public class MesClient extends JFrame {
|
|
|
if (!PlcService.writeScanCode(scanBarcode)) {
|
|
if (!PlcService.writeScanCode(scanBarcode)) {
|
|
|
MesClient.check_quality_result = false;
|
|
MesClient.check_quality_result = false;
|
|
|
MesClient.work_status = 0;
|
|
MesClient.work_status = 0;
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
MesClient.setMenuStatus("写入VB3500二维码失败", -1);
|
|
MesClient.setMenuStatus("写入VB3500二维码失败", -1);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (!PlcService.setMesConnected(true)) {
|
|
if (!PlcService.setMesConnected(true)) {
|
|
|
MesClient.check_quality_result = false;
|
|
MesClient.check_quality_result = false;
|
|
|
MesClient.work_status = 0;
|
|
MesClient.work_status = 0;
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
MesClient.setMenuStatus("写入V2800.7=1失败", -1);
|
|
MesClient.setMenuStatus("写入V2800.7=1失败", -1);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -699,6 +710,7 @@ public class MesClient extends JFrame {
|
|
|
MesClient.check_quality_result = false;
|
|
MesClient.check_quality_result = false;
|
|
|
MesClient.work_status = 0;
|
|
MesClient.work_status = 0;
|
|
|
PlcService.setMesConnected(false);
|
|
PlcService.setMesConnected(false);
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
if(retObj.get("result")==null){
|
|
if(retObj.get("result")==null){
|
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
|
}else{
|
|
}else{
|
|
@@ -1018,6 +1030,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
indexPanelC = new JPanel(new BorderLayout());
|
|
indexPanelC = new JPanel(new BorderLayout());
|
|
|
|
|
|
|
|
|
|
+ if (PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
//新增的面板
|
|
//新增的面板
|
|
|
JPanel indexPanelProductType = new JPanel();
|
|
JPanel indexPanelProductType = new JPanel();
|
|
|
indexPanelProductType.setLayout(null);
|
|
indexPanelProductType.setLayout(null);
|
|
@@ -1042,7 +1055,11 @@ public class MesClient extends JFrame {
|
|
|
productTypePanel.setOnChangeListener(() -> {
|
|
productTypePanel.setOnChangeListener(() -> {
|
|
|
if (work_status == 0) {
|
|
if (work_status == 0) {
|
|
|
saveProductTypeToDb();
|
|
saveProductTypeToDb();
|
|
|
- setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码", 0);
|
|
|
|
|
|
|
+ if (PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
|
|
+ setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码",0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setMenuStatus("请扫工件码",0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
refreshProductTypeCurrentLabel();
|
|
refreshProductTypeCurrentLabel();
|
|
|
});
|
|
});
|
|
@@ -1057,6 +1074,7 @@ public class MesClient extends JFrame {
|
|
|
indexPanelProductType.add(productTypeCurrentLabel);
|
|
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);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
tabbedPane.addTab("开班点检", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), indexPanelC, null);
|
|
tabbedPane.addTab("开班点检", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), indexPanelC, null);
|
|
@@ -1140,6 +1158,9 @@ public class MesClient extends JFrame {
|
|
|
if (sn.length() != PRODUCT_SN_LENGTH) {
|
|
if (sn.length() != PRODUCT_SN_LENGTH) {
|
|
|
return "工件码长度须为32位,当前" + sn.length() + "位";
|
|
return "工件码长度须为32位,当前" + sn.length() + "位";
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
String prefix = getProductSnPrefix();
|
|
String prefix = getProductSnPrefix();
|
|
|
if (!sn.startsWith(prefix)) {
|
|
if (!sn.startsWith(prefix)) {
|
|
|
return "工件码前缀与当前类型(" + getProductTypeName() + ")不匹配,当前工件码为" + getProductTypeNameBySn(sn);
|
|
return "工件码前缀与当前类型(" + getProductTypeName() + ")不匹配,当前工件码为" + getProductTypeNameBySn(sn);
|