|
@@ -10,8 +10,6 @@ import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
import javax.swing.*;
|
|
|
import java.awt.*;
|
|
import java.awt.*;
|
|
|
-import java.awt.event.MouseAdapter;
|
|
|
|
|
-import java.awt.event.MouseEvent;
|
|
|
|
|
import java.awt.event.WindowAdapter;
|
|
import java.awt.event.WindowAdapter;
|
|
|
import java.awt.event.WindowEvent;
|
|
import java.awt.event.WindowEvent;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@@ -19,8 +17,6 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Properties;
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
-import static com.mes.ui.MesClient.mes_server_ip;
|
|
|
|
|
-import static com.mes.ui.MesClient.resetScanA;
|
|
|
|
|
import static com.mes.ui.WorkStationPanel.*;
|
|
import static com.mes.ui.WorkStationPanel.*;
|
|
|
|
|
|
|
|
public class MultiStationClient extends JFrame {
|
|
public class MultiStationClient extends JFrame {
|
|
@@ -119,90 +115,6 @@ public class MultiStationClient extends JFrame {
|
|
|
settingMenu.setIcon(new ImageIcon(getClass().getResource("/bg/menu_setting.png")));
|
|
settingMenu.setIcon(new ImageIcon(getClass().getResource("/bg/menu_setting.png")));
|
|
|
settingMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
settingMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
menuBar.add(settingMenu);
|
|
menuBar.add(settingMenu);
|
|
|
- JMenuItem resetTcpMenu_1 = new JMenuItem("刷新OP050A工件");
|
|
|
|
|
- resetTcpMenu_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
- resetTcpMenu_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
|
|
- resetTcpMenu_1.addMouseListener(new MouseAdapter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void mousePressed(MouseEvent e) {
|
|
|
|
|
- super.mouseClicked(e);
|
|
|
|
|
- if (!MultiStationClient.mainFrame.stationPanels.isEmpty()) {
|
|
|
|
|
- MultiStationClient.mainFrame.stationPanels.get(0).resetScanA();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- settingMenu.add(resetTcpMenu_1);
|
|
|
|
|
-
|
|
|
|
|
- JMenuItem resetTcpMenu_2 = new JMenuItem("刷新OP060A工件");
|
|
|
|
|
- resetTcpMenu_2.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
- resetTcpMenu_2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
|
|
- resetTcpMenu_2.addMouseListener(new MouseAdapter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void mousePressed(MouseEvent e) {
|
|
|
|
|
- super.mouseClicked(e);
|
|
|
|
|
- if (!MultiStationClient.mainFrame.stationPanels.isEmpty()) {
|
|
|
|
|
- MultiStationClient.mainFrame.stationPanels.get(1).resetScanA();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- settingMenu.add(resetTcpMenu_2);
|
|
|
|
|
-
|
|
|
|
|
- JMenuItem resetTcpMenu_3 = new JMenuItem("刷新OP070A工件");
|
|
|
|
|
- resetTcpMenu_3.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
- resetTcpMenu_3.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
|
|
- resetTcpMenu_3.addMouseListener(new MouseAdapter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void mousePressed(MouseEvent e) {
|
|
|
|
|
- super.mouseClicked(e);
|
|
|
|
|
- if (!MultiStationClient.mainFrame.stationPanels.isEmpty()) {
|
|
|
|
|
- MultiStationClient.mainFrame.stationPanels.get(2).resetScanA();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- settingMenu.add(resetTcpMenu_3);
|
|
|
|
|
-
|
|
|
|
|
- JMenuItem resetTcpMenu_4 = new JMenuItem("刷新OP080A工件");
|
|
|
|
|
- resetTcpMenu_4.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
- resetTcpMenu_4.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
|
|
- resetTcpMenu_4.addMouseListener(new MouseAdapter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void mousePressed(MouseEvent e) {
|
|
|
|
|
- super.mouseClicked(e);
|
|
|
|
|
- if (!MultiStationClient.mainFrame.stationPanels.isEmpty()) {
|
|
|
|
|
- MultiStationClient.mainFrame.stationPanels.get(3).resetScanA();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- settingMenu.add(resetTcpMenu_4);
|
|
|
|
|
-
|
|
|
|
|
- JMenuItem resetTcpMenu_5 = new JMenuItem("刷新OP090A工件");
|
|
|
|
|
- resetTcpMenu_5.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
- resetTcpMenu_5.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
|
|
- resetTcpMenu_5.addMouseListener(new MouseAdapter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void mousePressed(MouseEvent e) {
|
|
|
|
|
- super.mouseClicked(e);
|
|
|
|
|
- if (!MultiStationClient.mainFrame.stationPanels.isEmpty()) {
|
|
|
|
|
- MultiStationClient.mainFrame.stationPanels.get(4).resetScanA();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- settingMenu.add(resetTcpMenu_5);
|
|
|
|
|
-
|
|
|
|
|
- JMenuItem resetTcpMenu_6 = new JMenuItem("刷新OP160A工件");
|
|
|
|
|
- resetTcpMenu_6.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
- resetTcpMenu_6.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
|
|
- resetTcpMenu_6.addMouseListener(new MouseAdapter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void mousePressed(MouseEvent e) {
|
|
|
|
|
- super.mouseClicked(e);
|
|
|
|
|
- if (!MultiStationClient.mainFrame.stationPanels.isEmpty()) {
|
|
|
|
|
- MultiStationClient.mainFrame.stationPanels.get(5).resetScanA();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- settingMenu.add(resetTcpMenu_6);
|
|
|
|
|
-
|
|
|
|
|
JToolBar toolBar = new JToolBar();
|
|
JToolBar toolBar = new JToolBar();
|
|
|
toolBar.setFloatable(false);
|
|
toolBar.setFloatable(false);
|
|
|
|
|
|
|
@@ -257,6 +169,7 @@ public class MultiStationClient extends JFrame {
|
|
|
WorkStationPanel panel = new WorkStationPanel(config);
|
|
WorkStationPanel panel = new WorkStationPanel(config);
|
|
|
stationPanels.add(panel);
|
|
stationPanels.add(panel);
|
|
|
mainPanel.add(panel);
|
|
mainPanel.add(panel);
|
|
|
|
|
+ addResetMenuItem(settingMenu, panel, config);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
tabbedPane.addTab("工作面板",new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), new JScrollPane(mainPanel));
|
|
tabbedPane.addTab("工作面板",new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), new JScrollPane(mainPanel));
|
|
@@ -286,4 +199,12 @@ public class MultiStationClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private void addResetMenuItem(JMenu settingMenu, WorkStationPanel panel, StationConfig config) {
|
|
|
|
|
+ JMenuItem resetMenu = new JMenuItem("刷新" + config.getGw() + "工件");
|
|
|
|
|
+ resetMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
+ resetMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
|
|
+ resetMenu.addActionListener(e -> panel.resetScanA());
|
|
|
|
|
+ settingMenu.add(resetMenu);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|