|
@@ -185,6 +185,15 @@ public class MesClient extends JFrame {
|
|
|
MesClient.finish_ok_bt_1.setEnabled(false);
|
|
MesClient.finish_ok_bt_1.setEnabled(false);
|
|
|
MesClient.finish_ng_bt_1.setEnabled(false);
|
|
MesClient.finish_ng_bt_1.setEnabled(false);
|
|
|
MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
|
|
|
+ if (product_sn_1 != null) {
|
|
|
|
|
+ product_sn_1.setText("");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (pressureText_1 != null) {
|
|
|
|
|
+ pressureText_1.setText("");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (leakText_1 != null) {
|
|
|
|
|
+ leakText_1.setText("");
|
|
|
|
|
+ }
|
|
|
// setMenuState_1("请扫码", 0);
|
|
// setMenuState_1("请扫码", 0);
|
|
|
work_status1 = 0;
|
|
work_status1 = 0;
|
|
|
check_quality_result1 = false;
|
|
check_quality_result1 = false;
|
|
@@ -325,7 +334,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系统客户端:OP380- 绝缘检测");
|
|
|
|
|
|
|
+ setTitle("MES系统客户端:OP450- 绝缘检测");
|
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
setBounds(0, 0, 1024, 768);
|
|
setBounds(0, 0, 1024, 768);
|
|
|
|
|
|
|
@@ -409,11 +418,9 @@ public class MesClient extends JFrame {
|
|
|
public void mousePressed(MouseEvent e) {
|
|
public void mousePressed(MouseEvent e) {
|
|
|
log.info("<工人操作>:点击 <打开远程> 按钮");
|
|
log.info("<工人操作>:点击 <打开远程> 按钮");
|
|
|
super.mouseClicked(e);
|
|
super.mouseClicked(e);
|
|
|
- String read = WorkTimer.serialUtil.read("TESTok:RETURN?\r");
|
|
|
|
|
- if(read != null && read.trim().equals("OFF")) {
|
|
|
|
|
- WorkTimer.serialUtil.read("TEST:RETURN ON\r");
|
|
|
|
|
- }
|
|
|
|
|
- WorkTimer.serialUtil.read("*RMTOFF\r");
|
|
|
|
|
|
|
+ // 正确指令:TEST:RETURN? → TEST:RETURN ON → *RMTOFF(旧代码误写 TESTok:RETURN?)
|
|
|
|
|
+ TesterRemoteUtil.openRemote(WorkTimer.serialUtil);
|
|
|
|
|
+ setMenuState_1("已发送打开远程指令", 0);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
menu1.add(menuItem1_1);
|
|
menu1.add(menuItem1_1);
|
|
@@ -426,7 +433,7 @@ public class MesClient extends JFrame {
|
|
|
public void mousePressed(MouseEvent e) {
|
|
public void mousePressed(MouseEvent e) {
|
|
|
log.info("<工人操作>:点击 <清除RMT> 按钮");
|
|
log.info("<工人操作>:点击 <清除RMT> 按钮");
|
|
|
super.mouseClicked(e);
|
|
super.mouseClicked(e);
|
|
|
- WorkTimer.serialUtil.read("*RMTOFF\r");
|
|
|
|
|
|
|
+ TesterRemoteUtil.clearRmt(WorkTimer.serialUtil);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
menu1.add(menuItem1_2);
|
|
menu1.add(menuItem1_2);
|
|
@@ -500,7 +507,7 @@ public class MesClient extends JFrame {
|
|
|
indexScrollPaneA = new JScrollPane(indexPanelA);
|
|
indexScrollPaneA = new JScrollPane(indexPanelA);
|
|
|
indexPanelA.setLayout(null);
|
|
indexPanelA.setLayout(null);
|
|
|
|
|
|
|
|
- // OP310A
|
|
|
|
|
|
|
+ // OP450A
|
|
|
product_sn_1 = new JTextField();
|
|
product_sn_1 = new JTextField();
|
|
|
product_sn_1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
product_sn_1.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
product_sn_1.setEditable(false);
|
|
product_sn_1.setEditable(false);
|
|
@@ -555,6 +562,7 @@ public class MesClient extends JFrame {
|
|
|
InsulationParamsDao.insert(Config.gw_1, sn, p1.description, p1.result, p1.state, p1.voltage, p1.testParam, p1.testTime);
|
|
InsulationParamsDao.insert(Config.gw_1, sn, p1.description, p1.result, p1.state, p1.voltage, p1.testParam, p1.testTime);
|
|
|
InsulationParamsDao.insert(Config.gw_1, sn, p2.description, p2.result, p2.state, p2.voltage, p2.testParam, p2.testTime);
|
|
InsulationParamsDao.insert(Config.gw_1, sn, p2.description, p2.result, p2.state, p2.voltage, p2.testParam, p2.testTime);
|
|
|
|
|
|
|
|
|
|
+ TesterRemoteUtil.stopAndPrepareNext(WorkTimer.serialUtil);
|
|
|
S7Utils.writeFinish(true);
|
|
S7Utils.writeFinish(true);
|
|
|
|
|
|
|
|
MesClient.setMenuState_1("结果提交成功,请扫下一件", 0);
|
|
MesClient.setMenuState_1("结果提交成功,请扫下一件", 0);
|
|
@@ -601,8 +609,9 @@ public class MesClient extends JFrame {
|
|
|
log.info("读取参数: {}", p2);
|
|
log.info("读取参数: {}", p2);
|
|
|
|
|
|
|
|
InsulationParamsDao.insert(Config.gw_1, sn, p1.description, p1.result, p1.state, p1.voltage, p1.testParam, p1.testTime);
|
|
InsulationParamsDao.insert(Config.gw_1, sn, p1.description, p1.result, p1.state, p1.voltage, p1.testParam, p1.testTime);
|
|
|
- InsulationParamsDao.insert(Config.gw_1, sn, p2.description, p1.result, p2.state, p2.voltage, p2.testParam, p2.testTime);
|
|
|
|
|
|
|
+ InsulationParamsDao.insert(Config.gw_1, sn, p2.description, p2.result, p2.state, p2.voltage, p2.testParam, p2.testTime);
|
|
|
|
|
|
|
|
|
|
+ TesterRemoteUtil.stopAndPrepareNext(WorkTimer.serialUtil);
|
|
|
S7Utils.writeFinish(true);
|
|
S7Utils.writeFinish(true);
|
|
|
|
|
|
|
|
MesClient.setMenuState_1("结果提交成功,请扫下一件", 0);
|
|
MesClient.setMenuState_1("结果提交成功,请扫下一件", 0);
|
|
@@ -678,13 +687,14 @@ public class MesClient extends JFrame {
|
|
|
int option = JOptionPane.showConfirmDialog(mesClientFrame, "确定切换串口至" + selectedItem + "?", "切换串口", JOptionPane.OK_CANCEL_OPTION);
|
|
int option = JOptionPane.showConfirmDialog(mesClientFrame, "确定切换串口至" + selectedItem + "?", "切换串口", JOptionPane.OK_CANCEL_OPTION);
|
|
|
if (option == JOptionPane.OK_OPTION) {
|
|
if (option == JOptionPane.OK_OPTION) {
|
|
|
// 用户确认切换
|
|
// 用户确认切换
|
|
|
- log.info("用户切换OP310A串口至 {}", selectedItem);
|
|
|
|
|
|
|
+ log.info("用户切换OP450A串口至 {}", selectedItem);
|
|
|
currentSerialPort = selectedItem;
|
|
currentSerialPort = selectedItem;
|
|
|
WorkTimer.serialUtil.serialPort.closePort();
|
|
WorkTimer.serialUtil.serialPort.closePort();
|
|
|
WorkTimer.serialUtil = new SerialUtil(selectedItem);
|
|
WorkTimer.serialUtil = new SerialUtil(selectedItem);
|
|
|
|
|
+ TesterRemoteUtil.openRemote(WorkTimer.serialUtil);
|
|
|
resetScanA();
|
|
resetScanA();
|
|
|
- setMenuState_1("切换OP310A串口至" + selectedItem + ",请扫码", 0);
|
|
|
|
|
- log.info("切换OP310A串口成功");
|
|
|
|
|
|
|
+ setMenuState_1("切换OP450A串口至" + selectedItem + ",请扫码", 0);
|
|
|
|
|
+ log.info("切换OP450A串口成功");
|
|
|
} else {
|
|
} else {
|
|
|
// 用户取消切换,恢复之前的选项
|
|
// 用户取消切换,恢复之前的选项
|
|
|
comboBox1.setSelectedItem(currentSerialPort);
|
|
comboBox1.setSelectedItem(currentSerialPort);
|