|
|
@@ -104,7 +104,6 @@ public class MesClient extends JFrame {
|
|
|
public static JButton finish_ok_bt;
|
|
|
public static JButton finish_ng_bt;
|
|
|
public static JTextField product_sn;
|
|
|
- public static JButton f_scan_data_bt_1;
|
|
|
|
|
|
public static String user20 = "";
|
|
|
|
|
|
@@ -129,7 +128,7 @@ public class MesClient extends JFrame {
|
|
|
// 激光切割设备
|
|
|
public static LaserDevice laserDevice;
|
|
|
public static com.mes.controller.LaserControllerDual laserController;
|
|
|
- public static String laser_device_ip = ""; // 激光设备IP,从配置文件读取
|
|
|
+ public static String laser_device_ip = "192.168.2.199"; // 激光设备IP,从配置文件读取
|
|
|
|
|
|
// 双面UI组件
|
|
|
public static JTextField product_sn2; // B面工件码
|
|
|
@@ -310,13 +309,13 @@ public class MesClient extends JFrame {
|
|
|
public static void resetScanA() {
|
|
|
work_status = 0;
|
|
|
check_quality_result = false;
|
|
|
- MesClient.finish_ok_bt.setEnabled(false);
|
|
|
- MesClient.finish_ng_bt.setEnabled(false);
|
|
|
- product_sn.setText("");
|
|
|
- MesClient.fxlabel.setVisible(false);
|
|
|
|
|
|
- MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
|
- MesClient.status_menu.setText("请扫工件码");
|
|
|
+ // 老版本的隐藏按钮/返修标签 op090 不一定创建,防御式访问
|
|
|
+ if (finish_ok_bt != null) finish_ok_bt.setEnabled(false);
|
|
|
+ if (finish_ng_bt != null) finish_ng_bt.setEnabled(false);
|
|
|
+ if (product_sn != null) product_sn.setText("");
|
|
|
+ if (fxlabel != null) fxlabel.setVisible(false);
|
|
|
+ if (status_menu != null) status_menu.setText("请扫工件码");
|
|
|
|
|
|
// 清空参数显示
|
|
|
if(param1 != null) param1.setText("");
|
|
|
@@ -1195,7 +1194,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
|
}, 1000, 1000);
|
|
|
|
|
|
- // 2.5 转台位置检测(1秒)— 更新顶部标签 + 保持扫码框焦点
|
|
|
+ // 2.5 转台位置检测(1秒)— 更新顶部标签 + 保持扫码框焦点 + 面切换禁用(对齐 OP60)
|
|
|
Timer sideDetectTimer = new Timer();
|
|
|
sideDetectTimer.schedule(new TimerTask() {
|
|
|
public void run() {
|
|
|
@@ -1208,10 +1207,15 @@ public class MesClient extends JFrame {
|
|
|
String side = laserDevice.readSideAtLoad();
|
|
|
SwingUtilities.invokeLater(() -> updateCurSideLabel(side));
|
|
|
|
|
|
- // 记录最近一次上料面(供状态跟踪用;不主动写 #1590,避免跟 checkStatus 打架)
|
|
|
+ // 面切换瞬间 → 写 #1590=0 禁用启动(对齐 OP60 的 changeEnable(false))
|
|
|
+ // 防止转台旋转过程中机床误触发下一次加工循环
|
|
|
if (!side.equals(lastSideAtLoad)) {
|
|
|
+ String prev = lastSideAtLoad;
|
|
|
lastSideAtLoad = side;
|
|
|
- log.info("转台面切换,检测到上料面={}", side.isEmpty() ? "未到位" : side);
|
|
|
+ laserDevice.writeMesEnable(0);
|
|
|
+ log.info("转台面切换 [{} → {}],写#1590=0 禁用启动",
|
|
|
+ prev.isEmpty() ? "未到位" : prev,
|
|
|
+ side.isEmpty() ? "未到位" : side);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("转台位置检测异常", e);
|