|
@@ -74,7 +74,7 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
|
|
|
|
|
public String plcIp = "10.85.10.4";
|
|
public String plcIp = "10.85.10.4";
|
|
|
|
|
|
|
|
- public String deviceIp = "10.85.10.1";
|
|
|
|
|
|
|
+ public String deviceIp = "10.85.10.4";
|
|
|
|
|
|
|
|
public S7Connector s7Connector;
|
|
public S7Connector s7Connector;
|
|
|
|
|
|
|
@@ -137,6 +137,11 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
this.setBackground(Color.WHITE);
|
|
this.setBackground(Color.WHITE);
|
|
|
this.pos = position;
|
|
this.pos = position;
|
|
|
this.oprno = DataUtil.formatOprno(MesClient.mes_gw);
|
|
this.oprno = DataUtil.formatOprno(MesClient.mes_gw);
|
|
|
|
|
+
|
|
|
|
|
+ // 对于 OP140 和 OP150,增大窗口尺寸以占满主界面
|
|
|
|
|
+ int yScale = 1;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
s7PLC = new S7PLC(EPlcType.S1500, plcIp);
|
|
s7PLC = new S7PLC(EPlcType.S1500, plcIp);
|
|
|
s7PLC.setConnectTimeout(500);
|
|
s7PLC.setConnectTimeout(500);
|
|
|
s7PLC.setReceiveTimeout(500);
|
|
s7PLC.setReceiveTimeout(500);
|
|
@@ -147,13 +152,13 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
if(oprno.equals("OP110")){
|
|
if(oprno.equals("OP110")){
|
|
|
if(position.equals("A")){
|
|
if(position.equals("A")){
|
|
|
plcDb = "DB4003";
|
|
plcDb = "DB4003";
|
|
|
- deviceIp = "10.85.10.1";
|
|
|
|
|
|
|
+ deviceIp = "10.85.10.6";
|
|
|
}else if(position.equals("B")){
|
|
}else if(position.equals("B")){
|
|
|
plcDb = "DB4004";
|
|
plcDb = "DB4004";
|
|
|
- deviceIp = "10.85.10.1";
|
|
|
|
|
|
|
+ deviceIp = "10.85.10.6";
|
|
|
} else if (position.equals("C")) {
|
|
} else if (position.equals("C")) {
|
|
|
plcDb = "DB4005";
|
|
plcDb = "DB4005";
|
|
|
- deviceIp = "10.85.10.1";
|
|
|
|
|
|
|
+ deviceIp = "10.85.10.6";
|
|
|
}
|
|
}
|
|
|
}else if(oprno.equals("OP170")){
|
|
}else if(oprno.equals("OP170")){
|
|
|
if(position.equals("A")){
|
|
if(position.equals("A")){
|
|
@@ -169,7 +174,7 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
plcDb = "DB4015";
|
|
plcDb = "DB4015";
|
|
|
deviceIp = "10.85.10.3";
|
|
deviceIp = "10.85.10.3";
|
|
|
}
|
|
}
|
|
|
- }else if(oprno.equals("OP190")){
|
|
|
|
|
|
|
+ }else if(oprno.equals("OP180")){
|
|
|
if(position.equals("A")){
|
|
if(position.equals("A")){
|
|
|
plcDb = "DB4017";
|
|
plcDb = "DB4017";
|
|
|
deviceIp = "10.85.10.4";
|
|
deviceIp = "10.85.10.4";
|
|
@@ -184,6 +189,22 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
if(position.equals("A")){
|
|
if(position.equals("A")){
|
|
|
plcDb = "DB3011";
|
|
plcDb = "DB3011";
|
|
|
}
|
|
}
|
|
|
|
|
+ }else if(oprno.equals("OP140")){
|
|
|
|
|
+ if(position.equals("A")){
|
|
|
|
|
+// workWidth = 940;
|
|
|
|
|
+// workHeight = 600;
|
|
|
|
|
+// yScale = 2;
|
|
|
|
|
+ plcDb = "DB4008";
|
|
|
|
|
+ deviceIp = "10.85.10.2";
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(oprno.equals("OP150")){
|
|
|
|
|
+ if(position.equals("A")){
|
|
|
|
|
+ plcDb = "DB4009";
|
|
|
|
|
+ deviceIp = "10.85.10.2";
|
|
|
|
|
+ }else if(position.equals("B")){
|
|
|
|
|
+ plcDb = "DB4010";
|
|
|
|
|
+ deviceIp = "10.85.10.2";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
modbusTcp = new ModbusTcp(1, deviceIp);
|
|
modbusTcp = new ModbusTcp(1, deviceIp);
|
|
@@ -194,14 +215,14 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
oprnoLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
oprnoLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
oprnoLabel.setForeground(Color.BLACK);
|
|
oprnoLabel.setForeground(Color.BLACK);
|
|
|
oprnoLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
oprnoLabel.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
- oprnoLabel.setBounds(0, -10, workWidth/5, 40);
|
|
|
|
|
|
|
+ oprnoLabel.setBounds(0, -10*yScale, workWidth/5, 40);
|
|
|
this.add(oprnoLabel);
|
|
this.add(oprnoLabel);
|
|
|
|
|
|
|
|
oprnoLabel2 = new JLabel(fswDeviceName);
|
|
oprnoLabel2 = new JLabel(fswDeviceName);
|
|
|
oprnoLabel2.setHorizontalAlignment(SwingConstants.CENTER);
|
|
oprnoLabel2.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
oprnoLabel2.setForeground(Color.BLACK);
|
|
oprnoLabel2.setForeground(Color.BLACK);
|
|
|
oprnoLabel2.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
oprnoLabel2.setFont(new Font("微软雅黑", Font.PLAIN, 14));
|
|
|
- oprnoLabel2.setBounds(0, 12, workWidth / 5, 40);
|
|
|
|
|
|
|
+ oprnoLabel2.setBounds(0, 12*yScale, workWidth / 5, 40);
|
|
|
this.add(oprnoLabel2);
|
|
this.add(oprnoLabel2);
|
|
|
|
|
|
|
|
status_menu = new JButton("等待请求扫码");
|
|
status_menu = new JButton("等待请求扫码");
|
|
@@ -216,7 +237,7 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
oprnoLabelFeeding.setHorizontalAlignment(SwingConstants.CENTER);
|
|
oprnoLabelFeeding.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
oprnoLabelFeeding.setForeground(Color.BLACK);
|
|
oprnoLabelFeeding.setForeground(Color.BLACK);
|
|
|
oprnoLabelFeeding.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
oprnoLabelFeeding.setFont(new Font("微软雅黑", Font.PLAIN, 20));
|
|
|
- oprnoLabelFeeding.setBounds(0, 50, workWidth/5, 40);
|
|
|
|
|
|
|
+ oprnoLabelFeeding.setBounds(0, 50*yScale, workWidth/5, 40);
|
|
|
this.add(oprnoLabelFeeding);
|
|
this.add(oprnoLabelFeeding);
|
|
|
|
|
|
|
|
productSnFeeding = new JTextField("");
|
|
productSnFeeding = new JTextField("");
|
|
@@ -224,7 +245,7 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
productSnFeeding.setForeground(Color.BLACK);
|
|
productSnFeeding.setForeground(Color.BLACK);
|
|
|
productSnFeeding.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
productSnFeeding.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
|
|
productSnFeeding.setEditable(false);
|
|
productSnFeeding.setEditable(false);
|
|
|
- productSnFeeding.setBounds(workWidth/5, 50, workWidth*3/5, 40);
|
|
|
|
|
|
|
+ productSnFeeding.setBounds(workWidth/5, 50*yScale, workWidth*3/5, 40);
|
|
|
productSnFeeding.addMouseListener(new MouseAdapter() {
|
|
productSnFeeding.addMouseListener(new MouseAdapter() {
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
String sn = productSnFeeding.getText().trim();
|
|
String sn = productSnFeeding.getText().trim();
|
|
@@ -247,7 +268,7 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
resetFeedingBtn.setFont(new Font("微软雅黑", Font.PLAIN, 22));
|
|
resetFeedingBtn.setFont(new Font("微软雅黑", Font.PLAIN, 22));
|
|
|
- resetFeedingBtn.setBounds(workWidth*4/5 + 10, 50, workWidth/5 - 10, 40);
|
|
|
|
|
|
|
+ resetFeedingBtn.setBounds(workWidth*4/5 + 10, 50*yScale, workWidth/5 - 10, 40);
|
|
|
this.add(resetFeedingBtn);
|
|
this.add(resetFeedingBtn);
|
|
|
|
|
|
|
|
JLabel oprnoLabelWork = new JLabel("加工");
|
|
JLabel oprnoLabelWork = new JLabel("加工");
|
|
@@ -296,7 +317,7 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
checkBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
checkBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
- checkBtn.setBounds(0, 220, workWidth/4, 35);
|
|
|
|
|
|
|
+ checkBtn.setBounds(0, 220*yScale, workWidth/4, 35);
|
|
|
this.add(checkBtn);
|
|
this.add(checkBtn);
|
|
|
|
|
|
|
|
historyBtn = new JButton("工作记录");
|
|
historyBtn = new JButton("工作记录");
|
|
@@ -306,7 +327,7 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
historyBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
historyBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
- historyBtn.setBounds(workWidth*3/4, 220, workWidth/4, 35);
|
|
|
|
|
|
|
+ historyBtn.setBounds(workWidth*3/4, 220*yScale, workWidth/4, 35);
|
|
|
this.add(historyBtn);
|
|
this.add(historyBtn);
|
|
|
|
|
|
|
|
if(oprno.equals("OP160") || oprno.equals("OP170")){
|
|
if(oprno.equals("OP160") || oprno.equals("OP170")){
|
|
@@ -317,7 +338,7 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
toolBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
toolBtn.setFont(new Font("微软雅黑", Font.PLAIN, 18));
|
|
|
- toolBtn.setBounds(workWidth*1/2 - workWidth/8, 220, workWidth/4, 35);
|
|
|
|
|
|
|
+ toolBtn.setBounds(workWidth*1/2 - workWidth/8, 220*yScale, workWidth/4, 35);
|
|
|
this.add(toolBtn);
|
|
this.add(toolBtn);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -331,14 +352,14 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
feedinglabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
feedinglabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
|
feedinglabel.setIcon(imageGreen);
|
|
feedinglabel.setIcon(imageGreen);
|
|
|
feedinglabel.setForeground(Color.BLACK);
|
|
feedinglabel.setForeground(Color.BLACK);
|
|
|
- feedinglabel.setBounds(0, 120, workWidth/3, 30);
|
|
|
|
|
|
|
+ feedinglabel.setBounds(0, 120*yScale, workWidth/3, 30);
|
|
|
this.add(feedinglabel);
|
|
this.add(feedinglabel);
|
|
|
|
|
|
|
|
feedingmeslabel = new JLabel("MES允许上料");
|
|
feedingmeslabel = new JLabel("MES允许上料");
|
|
|
feedingmeslabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
feedingmeslabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
|
feedingmeslabel.setIcon(imageGreen);
|
|
feedingmeslabel.setIcon(imageGreen);
|
|
|
feedingmeslabel.setForeground(Color.BLACK);
|
|
feedingmeslabel.setForeground(Color.BLACK);
|
|
|
- feedingmeslabel.setBounds(workWidth/3, 120, workWidth/3, 30);
|
|
|
|
|
|
|
+ feedingmeslabel.setBounds(workWidth/3, 120*yScale, workWidth/3, 30);
|
|
|
feedingmeslabel.addMouseListener(new MouseAdapter() {
|
|
feedingmeslabel.addMouseListener(new MouseAdapter() {
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
boolean ret = readAllowFeeding();
|
|
boolean ret = readAllowFeeding();
|
|
@@ -354,21 +375,21 @@ public class WorkJPanelDevice extends JPanel {
|
|
|
runlabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
runlabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
|
runlabel.setIcon(imageGreen);
|
|
runlabel.setIcon(imageGreen);
|
|
|
runlabel.setForeground(Color.BLACK);
|
|
runlabel.setForeground(Color.BLACK);
|
|
|
- runlabel.setBounds(workWidth*2/3, 120, workWidth/3, 30);
|
|
|
|
|
|
|
+ runlabel.setBounds(workWidth*2/3, 120*yScale, workWidth/3, 30);
|
|
|
this.add(runlabel);
|
|
this.add(runlabel);
|
|
|
|
|
|
|
|
blankinglabel = new JLabel("下料请求");
|
|
blankinglabel = new JLabel("下料请求");
|
|
|
blankinglabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
blankinglabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
|
blankinglabel.setIcon(imageGreen);
|
|
blankinglabel.setIcon(imageGreen);
|
|
|
blankinglabel.setForeground(Color.BLACK);
|
|
blankinglabel.setForeground(Color.BLACK);
|
|
|
- blankinglabel.setBounds(0, 160, workWidth/3, 30);
|
|
|
|
|
|
|
+ blankinglabel.setBounds(0, 160*yScale, workWidth/3, 30);
|
|
|
this.add(blankinglabel);
|
|
this.add(blankinglabel);
|
|
|
|
|
|
|
|
blankingmeslabel = new JLabel("MES下料反馈");
|
|
blankingmeslabel = new JLabel("MES下料反馈");
|
|
|
blankingmeslabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
blankingmeslabel.setHorizontalAlignment(SwingConstants.LEFT);
|
|
|
blankingmeslabel.setIcon(imageGreen);
|
|
blankingmeslabel.setIcon(imageGreen);
|
|
|
blankingmeslabel.setForeground(Color.BLACK);
|
|
blankingmeslabel.setForeground(Color.BLACK);
|
|
|
- blankingmeslabel.setBounds(workWidth/3, 160, workWidth/3, 30);
|
|
|
|
|
|
|
+ blankingmeslabel.setBounds(workWidth/3, 160*yScale, workWidth/3, 30);
|
|
|
this.add(blankingmeslabel);
|
|
this.add(blankingmeslabel);
|
|
|
blankingmeslabel.addMouseListener(new MouseAdapter() {
|
|
blankingmeslabel.addMouseListener(new MouseAdapter() {
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
public void mouseClicked(MouseEvent e) {
|