From da9df9d46ed3fc50e0c03497bd9f76b8aa1a4595 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 14 一月 2026 15:37:48 +0800
Subject: [PATCH] 1.修复以下问题: 作业前置条件不足导致 PJ 验证失败:onPRJobMultiCreate 调 CMaster::setProcessJobs,CProcessJob::validate 要求“当前没有其它 PJ”(issue 1000),且 carrierPresent/slotUsable 必须为真。只要本地还有未结批的 PJ/CJ 或载具/槽位状态未就绪(ID 未绑、Slot 未使能),Host 发送的 CreateMultiPJ 会直接被丢弃(返回 size=0),但当前代码没有向 Host 回 ACK/NAK,Host 会误以为创建成功。

---
 SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp b/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
index 70c30d3..d859bee 100644
--- a/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
@@ -10,6 +10,7 @@
 #include "PlcView.h"
 #include "Log.h"
 #include "InputDialog.h"
+#include "AddPLCInfo.h"
 #include "AxisManager.h"
 #include "IOManager.h"
 
@@ -139,6 +140,9 @@
 
 					theApp.m_model.setCurrentPlc(pPlc);
 				}
+			}
+			else if (RX_PLC_STATE_CHANGED == code) {
+
 			}
 			else if (code == RX_CODE_ALARM_ON) {
 				CPLC* pPlc;
@@ -502,24 +506,25 @@
 {
 	int id = (int)lParam;
 	if (id == IDC_BUTTON_ADD) {
-		CInputDialog inputDialog(_T("新建设备"), _T("请输入设备名称:"));
-		if (inputDialog.DoModal() != IDOK) {
-			AfxMessageBox(_T("取消验证!"));
+		CAddPLCInfo dlgAddPLCInfo;
+		if (dlgAddPLCInfo.DoModal() != IDOK) {
 			return 0;
 		}
 
-		CString strName;
-		strName = inputDialog.GetInputText();
-		if (!strName.IsEmpty()) {
-			theApp.m_model.addPlc((LPTSTR)(LPCTSTR)strName, "192.168.1.188", 1001);
+		CString strPLCName = dlgAddPLCInfo.GetPLCName();
+		CString strIP = dlgAddPLCInfo.GetIP();
+		CString strPort = dlgAddPLCInfo.GetPort();
+
+		if (!strPLCName.IsEmpty() && !strIP.IsEmpty() && !strPort.IsEmpty()) {
+			theApp.m_model.addPlc((LPTSTR)(LPCTSTR)strPLCName, (LPTSTR)(LPCTSTR)strIP, std::stoi((LPTSTR)(LPCTSTR)strPort));
 
 			// 新建轴文件
 			AxisManager axisManager;
-			axisManager.SaveAxis((LPTSTR)(LPCTSTR)strName);
+			axisManager.SaveAxis((LPTSTR)(LPCTSTR)strPLCName);
 
 			// 新建IO文件
 			IOManager ioManager;
-			ioManager.SaveToFile((LPTSTR)(LPCTSTR)strName);
+			ioManager.SaveToFile((LPTSTR)(LPCTSTR)strPLCName);
 		}
 	}
 	else if (id == IDC_BUTTON_DELETE) {

--
Gitblit v1.9.3