|
@@ -82,6 +82,8 @@ public class MesClient extends JFrame {
|
|
|
// MES启用/屏蔽状态(true=启用,false=屏蔽)
|
|
// MES启用/屏蔽状态(true=启用,false=屏蔽)
|
|
|
public static boolean mesEnabledWest = true; // 西侧MES启用状态(A-F)
|
|
public static boolean mesEnabledWest = true; // 西侧MES启用状态(A-F)
|
|
|
public static boolean mesEnabledEast = true; // 东侧MES启用状态(G-L)
|
|
public static boolean mesEnabledEast = true; // 东侧MES启用状态(G-L)
|
|
|
|
|
+ // 中转车启用(false=隐藏中转UI并跳过中转业务;扫码逻辑不变)
|
|
|
|
|
+ public static boolean transferEnabled = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
public static WorkJPanelOP40 workJPanelOP40A;
|
|
public static WorkJPanelOP40 workJPanelOP40A;
|
|
@@ -209,6 +211,10 @@ public class MesClient extends JFrame {
|
|
|
// mes_tcp_port = Integer.parseInt(pro.getProperty("mes.tcp_port"));
|
|
// mes_tcp_port = Integer.parseInt(pro.getProperty("mes.tcp_port"));
|
|
|
// mes_heart_beat_cycle = Integer.parseInt(pro.getProperty("mes.heart_beat_cycle"));
|
|
// mes_heart_beat_cycle = Integer.parseInt(pro.getProperty("mes.heart_beat_cycle"));
|
|
|
mes_line_sn = pro.getProperty("mes.line_sn");
|
|
mes_line_sn = pro.getProperty("mes.line_sn");
|
|
|
|
|
+ if (pro.getProperty("mes.transfer_enabled") != null) {
|
|
|
|
|
+ transferEnabled = Boolean.parseBoolean(pro.getProperty("mes.transfer_enabled").trim());
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("中转车启用: {}", transferEnabled);
|
|
|
|
|
|
|
|
// 读取OPC UA配置
|
|
// 读取OPC UA配置
|
|
|
if (pro.getProperty("opcua.user") != null) {
|
|
if (pro.getProperty("opcua.user") != null) {
|
|
@@ -746,7 +752,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 根据工位号获取当前加工的工件码
|
|
* 根据工位号获取当前加工的工件码
|
|
|
- * @param oprno 工位号,如 "OP040A" 或 "OP040L"
|
|
|
|
|
|
|
+ * @param oprno 工位号,如 "OP055A" 或 "OP055L"
|
|
|
* @return 工件码,如果没有则返回空字符串
|
|
* @return 工件码,如果没有则返回空字符串
|
|
|
*/
|
|
*/
|
|
|
public static String getSnByOprno(String oprno) {
|
|
public static String getSnByOprno(String oprno) {
|
|
@@ -965,7 +971,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public MesClient() {
|
|
public MesClient() {
|
|
|
setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
|
|
setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
|
|
|
- setTitle("MES系统客户端:OP40底板组件-CNC");
|
|
|
|
|
|
|
+ setTitle("MES系统客户端:OP055 CNC侧铣");
|
|
|
// setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
// setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
// setBounds(0, 0, 1920, 1080);
|
|
// setBounds(0, 0, 1920, 1080);
|
|
|
setBounds(0, 0, 1024, 768);
|
|
setBounds(0, 0, 1024, 768);
|
|
@@ -1190,7 +1196,7 @@ public class MesClient extends JFrame {
|
|
|
indexPanel40D.add(workJPanelOP40D);
|
|
indexPanel40D.add(workJPanelOP40D);
|
|
|
indexPanel1.add(indexPanel40D);
|
|
indexPanel1.add(indexPanel40D);
|
|
|
|
|
|
|
|
- tabbedPane.addTab("OP40:A-D", null, indexScrollPane1, null);
|
|
|
|
|
|
|
+ tabbedPane.addTab("OP055:A-D", null, indexScrollPane1, null);
|
|
|
tabbedPane.setEnabledAt(0, true);
|
|
tabbedPane.setEnabledAt(0, true);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1232,7 +1238,7 @@ public class MesClient extends JFrame {
|
|
|
indexPanel40H.add(workJPanelOP40H);
|
|
indexPanel40H.add(workJPanelOP40H);
|
|
|
indexPanel2.add(indexPanel40H);
|
|
indexPanel2.add(indexPanel40H);
|
|
|
|
|
|
|
|
- tabbedPane.addTab("OP40:E-H", null, indexScrollPane2, null);
|
|
|
|
|
|
|
+ tabbedPane.addTab("OP055:E-H", null, indexScrollPane2, null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1274,32 +1280,39 @@ public class MesClient extends JFrame {
|
|
|
indexPanel40L.add(workJPanelOP40L);
|
|
indexPanel40L.add(workJPanelOP40L);
|
|
|
indexPanel3.add(indexPanel40L);
|
|
indexPanel3.add(indexPanel40L);
|
|
|
|
|
|
|
|
- tabbedPane.addTab("OP40:I-L", null, indexScrollPane3, null);
|
|
|
|
|
|
|
+ tabbedPane.addTab("OP055:I-L", null, indexScrollPane3, null);
|
|
|
|
|
|
|
|
|
|
|
|
|
- // 中转车 Tab 页
|
|
|
|
|
|
|
+ // 扫码站 Tab(中转车关闭时不创建中转车面板)
|
|
|
JPanel indexPanelTransfer = new JPanel();
|
|
JPanel indexPanelTransfer = new JPanel();
|
|
|
JScrollPane indexScrollPaneTransfer = new JScrollPane(indexPanelTransfer);
|
|
JScrollPane indexScrollPaneTransfer = new JScrollPane(indexPanelTransfer);
|
|
|
- indexPanelTransfer.setLayout(new GridLayout(2, 2, 5, 5));
|
|
|
|
|
indexPanelTransfer.setBackground(Color.LIGHT_GRAY);
|
|
indexPanelTransfer.setBackground(Color.LIGHT_GRAY);
|
|
|
|
|
|
|
|
- // 中转车1 - 连接PLC3(西侧192.168.90.83) DB7005
|
|
|
|
|
- JPanel indexPanelTransfer1 = new JPanel();
|
|
|
|
|
- indexPanelTransfer1.setLayout(null);
|
|
|
|
|
- indexPanelTransfer1.setBackground(Color.WHITE);
|
|
|
|
|
- workJPanelOP40Transfer1 = new WorkJPanelOP40Transfer("A");
|
|
|
|
|
- workJPanelOP40Transfer1.setBounds(10, 10, workJPanelOP40Transfer1.workWidth, workJPanelOP40Transfer1.workHeight);
|
|
|
|
|
- indexPanelTransfer1.add(workJPanelOP40Transfer1);
|
|
|
|
|
- indexPanelTransfer.add(indexPanelTransfer1);
|
|
|
|
|
-
|
|
|
|
|
- // 中转车2 - 连接PLC4(东侧192.168.90.84) DB7005
|
|
|
|
|
- JPanel indexPanelTransfer2 = new JPanel();
|
|
|
|
|
- indexPanelTransfer2.setLayout(null);
|
|
|
|
|
- indexPanelTransfer2.setBackground(Color.WHITE);
|
|
|
|
|
- workJPanelOP40Transfer2 = new WorkJPanelOP40Transfer("B");
|
|
|
|
|
- workJPanelOP40Transfer2.setBounds(10, 10, workJPanelOP40Transfer2.workWidth, workJPanelOP40Transfer2.workHeight);
|
|
|
|
|
- indexPanelTransfer2.add(workJPanelOP40Transfer2);
|
|
|
|
|
- indexPanelTransfer.add(indexPanelTransfer2);
|
|
|
|
|
|
|
+ if (transferEnabled) {
|
|
|
|
|
+ indexPanelTransfer.setLayout(new GridLayout(2, 2, 5, 5));
|
|
|
|
|
+
|
|
|
|
|
+ // 中转车1 - 连接PLC3(西侧192.168.90.83) DB7005
|
|
|
|
|
+ JPanel indexPanelTransfer1 = new JPanel();
|
|
|
|
|
+ indexPanelTransfer1.setLayout(null);
|
|
|
|
|
+ indexPanelTransfer1.setBackground(Color.WHITE);
|
|
|
|
|
+ workJPanelOP40Transfer1 = new WorkJPanelOP40Transfer("A");
|
|
|
|
|
+ workJPanelOP40Transfer1.setBounds(10, 10, workJPanelOP40Transfer1.workWidth, workJPanelOP40Transfer1.workHeight);
|
|
|
|
|
+ indexPanelTransfer1.add(workJPanelOP40Transfer1);
|
|
|
|
|
+ indexPanelTransfer.add(indexPanelTransfer1);
|
|
|
|
|
+
|
|
|
|
|
+ // 中转车2 - 连接PLC4(东侧192.168.90.84) DB7005
|
|
|
|
|
+ JPanel indexPanelTransfer2 = new JPanel();
|
|
|
|
|
+ indexPanelTransfer2.setLayout(null);
|
|
|
|
|
+ indexPanelTransfer2.setBackground(Color.WHITE);
|
|
|
|
|
+ workJPanelOP40Transfer2 = new WorkJPanelOP40Transfer("B");
|
|
|
|
|
+ workJPanelOP40Transfer2.setBounds(10, 10, workJPanelOP40Transfer2.workWidth, workJPanelOP40Transfer2.workHeight);
|
|
|
|
|
+ indexPanelTransfer2.add(workJPanelOP40Transfer2);
|
|
|
|
|
+ indexPanelTransfer.add(indexPanelTransfer2);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ indexPanelTransfer.setLayout(new GridLayout(1, 2, 5, 5));
|
|
|
|
|
+ workJPanelOP40Transfer1 = null;
|
|
|
|
|
+ workJPanelOP40Transfer2 = null;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
JPanel indexPanelScanA = new JPanel();
|
|
JPanel indexPanelScanA = new JPanel();
|
|
|
indexPanelScanA.setLayout(null);
|
|
indexPanelScanA.setLayout(null);
|
|
@@ -1317,27 +1330,27 @@ public class MesClient extends JFrame {
|
|
|
indexPanelScanB.add(workJPanelScanB);
|
|
indexPanelScanB.add(workJPanelScanB);
|
|
|
indexPanelTransfer.add(indexPanelScanB);
|
|
indexPanelTransfer.add(indexPanelScanB);
|
|
|
|
|
|
|
|
- tabbedPane.addTab("中转车", null, indexScrollPaneTransfer, null);
|
|
|
|
|
|
|
+ tabbedPane.addTab(transferEnabled ? "中转车" : "扫码站", null, indexScrollPaneTransfer, null);
|
|
|
|
|
|
|
|
|
|
|
|
|
- // ========== 工作记录 Tab(改造:OP040子工位Tab + 所有工位) ==========
|
|
|
|
|
|
|
+ // ========== 工作记录 Tab(改造:OP055子工位Tab + 所有工位) ==========
|
|
|
// 创建工作记录的子 TabbedPane
|
|
// 创建工作记录的子 TabbedPane
|
|
|
JTabbedPane workRecordTabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
|
JTabbedPane workRecordTabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
|
|
workRecordTabbedPane.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
workRecordTabbedPane.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
|
|
|
|
|
- // 定义OP040子工位(A-L,共12个)
|
|
|
|
|
|
|
+ // 定义OP055子工位(A-L,共12个)
|
|
|
String[] subStations = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"};
|
|
String[] subStations = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"};
|
|
|
WorkRecordPanel[] workRecordPanels = new WorkRecordPanel[subStations.length + 1]; // +1 for "所有工位"
|
|
WorkRecordPanel[] workRecordPanels = new WorkRecordPanel[subStations.length + 1]; // +1 for "所有工位"
|
|
|
|
|
|
|
|
- // 为每个子工位创建 Tab(OP040 基础工位号)
|
|
|
|
|
|
|
+ // 为每个子工位创建 Tab(OP055 基础工位号)
|
|
|
for (int i = 0; i < subStations.length; i++) {
|
|
for (int i = 0; i < subStations.length; i++) {
|
|
|
String station = subStations[i];
|
|
String station = subStations[i];
|
|
|
- String oprno = "OP040" + station; // OP040 基础工位号
|
|
|
|
|
|
|
+ String oprno = "OP055" + station; // OP055 基础工位号
|
|
|
workRecordPanels[i] = new WorkRecordPanel(oprno, mes_line_sn);
|
|
workRecordPanels[i] = new WorkRecordPanel(oprno, mes_line_sn);
|
|
|
workRecordTabbedPane.addTab(oprno, null, workRecordPanels[i], "查询" + oprno + "的工作记录");
|
|
workRecordTabbedPane.addTab(oprno, null, workRecordPanels[i], "查询" + oprno + "的工作记录");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 最后添加"所有工位"Tab(查询整条产线所有工位,不限于OP040)
|
|
|
|
|
|
|
+ // 最后添加"所有工位"Tab(查询整条产线所有工位,不限于OP055)
|
|
|
workRecordPanels[subStations.length] = new WorkRecordPanel(null, mes_line_sn);
|
|
workRecordPanels[subStations.length] = new WorkRecordPanel(null, mes_line_sn);
|
|
|
workRecordTabbedPane.addTab("所有工位", null, workRecordPanels[subStations.length], "查询整条产线所有工位的工作记录");
|
|
workRecordTabbedPane.addTab("所有工位", null, workRecordPanels[subStations.length], "查询整条产线所有工位的工作记录");
|
|
|
|
|
|