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/BondEq/BondEqDlg.cpp |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/SourceCode/Bond/BondEq/BondEqDlg.cpp b/SourceCode/Bond/BondEq/BondEqDlg.cpp
index 4f29b69..cabcaf7 100644
--- a/SourceCode/Bond/BondEq/BondEqDlg.cpp
+++ b/SourceCode/Bond/BondEq/BondEqDlg.cpp
@@ -16,6 +16,8 @@
 #include "UserManagerDlg.h"
 #include "SystemLogManagerDlg.h"
 
+// 测试
+#include "RecipeListDlg.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -233,12 +235,30 @@
 		return FALSE;
 	}
 
+	// 初始化报警模块
+	AlarmManager& alarmManager = AlarmManager::getInstance();
+	alarmManager.setDatabase(db.get());
+	try {
+		if (!alarmManager.initializeAlarmTable()) {
+			AfxMessageBox("初始化报警模块失败!");
+			return FALSE;
+		}
+	}
+	catch (const std::exception& ex) {
+		CString errorMsg;
+		errorMsg.Format(_T("初始化报警模块失败:%s"), CString(ex.what()));
+		AfxMessageBox(errorMsg, MB_ICONERROR);
+		return FALSE;
+	}
+
 	// 设置配方文件夹路径
 	RecipeManager& recipeManager = RecipeManager::getInstance();
-	std::string strRecipePath =  CToolUnits::getCurrentExePath() + _T("\\Recipe");
+	std::string strRecipePath =  CToolUnits::getRecipePath();
 	CToolUnits::createDir(strRecipePath.c_str());
 	recipeManager.setRecipeFolder(strRecipePath);
-
+	if (!recipeManager.loadRecipe("Default")) {
+		AfxMessageBox("Default 配方加载失败!");
+	}
 
 	// 菜单
 	CMenu menu;
@@ -284,6 +304,13 @@
 	// 更新登录状态
 	UpdateLoginStatus();
 	logManager.log(SystemLogManager::LogType::Info, _T("BondEq启动..."));
+
+
+	// 自动启动
+	theApp.m_model.getBonder().start();
+	m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(FALSE);
+	m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(TRUE);
+	logManager.log(SystemLogManager::LogType::Operation, _T("运行..."));
 
 
 	return TRUE;  // 除非将焦点设置到控件,否则返回 TRUE
@@ -522,8 +549,11 @@
 
 void CBondEqDlg::OnMenuFileSettings()
 {
-	CSettingsDlg dlg;
+	CRecipeListDlg dlg;
 	dlg.DoModal();
+
+	//CSettingsDlg dlg;
+	//dlg.DoModal();
 }
 
 void CBondEqDlg::OnUpdateMenuFileSettings(CCmdUI* pCmdUI)
@@ -809,6 +839,7 @@
 {
 	if (m_pAlarmWnd == nullptr) {
 		m_pAlarmWnd = new CAlarmPopupDlg();
+		m_pAlarmWnd->SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)"));
 		m_pAlarmWnd->Create(IDD_DIALOG_POPUP_ALARM, this);
 		m_pAlarmWnd->CenterWindow();
 	}
@@ -819,6 +850,7 @@
 {
 	if (m_pAlarmWnd == nullptr) {
 		m_pAlarmWnd = new CAlarmPopupDlg();
+		m_pAlarmWnd->SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)"));
 		m_pAlarmWnd->Create(IDD_DIALOG_POPUP_ALARM, this);
 		m_pAlarmWnd->CenterWindow();
 	}

--
Gitblit v1.9.3