From aedb3b85fed48cb2cf0abb5fafa8e7591644c9f4 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 02 十二月 2024 08:53:06 +0800
Subject: [PATCH] Merge branch 'liuyang' into clh
---
SourceCode/Bond/BondEq/BondEqDlg.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/SourceCode/Bond/BondEq/BondEqDlg.cpp b/SourceCode/Bond/BondEq/BondEqDlg.cpp
index 9668aa4..7b3a65b 100644
--- a/SourceCode/Bond/BondEq/BondEqDlg.cpp
+++ b/SourceCode/Bond/BondEq/BondEqDlg.cpp
@@ -8,14 +8,17 @@
#include "afxdialogex.h"
#include "Common.h"
#include "CBonder.h"
+#include "ToolUnits.h"
#include "SettingsDlg.h"
+#include "InputDialog.h"
#include "LoginDlg.h"
#include "ChangePasswordDlg.h"
-#include "InputDialog.h"
#include "UserManagerDlg.h"
+#include "SystemLogManagerDlg.h"
// test
-#include "SystemLogManagerDlg.h"
+#include "AxisSettingsDlg.h"
+#include "IOMonitoringDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -186,13 +189,27 @@
// 设置运行日志模块的数据库连接
SystemLogManager& logManager = SystemLogManager::getInstance();
- logManager.setDatabase(db);
+ logManager.setDatabase(db.get());
// 初始化运行日志表
- if (!logManager.initializeLogTable()) {
- AfxMessageBox("初始化系统日志表失败!");
+ try {
+ if (!logManager.initializeLogTable()) {
+ 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");
+ CToolUnits::createDir(strRecipePath.c_str());
+ recipeManager.setRecipeFolder(strRecipePath);
// 菜单
@@ -465,8 +482,24 @@
void CBondEqDlg::OnMenuFileSettings()
{
+ CAxisSettingsDlg axisDlg;
+ axisDlg.SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)"));
+ axisDlg.DoModal();
+ // Cavity VacuumBake AfterBake AOI
+ CIOMonitoringDlg dlg;
+ dlg.SetIOManager("Cavity");
+ dlg.SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)"));
+ dlg.DoModal();
+
+ //CAxisSettingsDlg dlg;
+ //dlg.SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)"));
+ //dlg.SetRecipeName(_T("Default"));
+ //dlg.DoModal();
+
+ /*
CSettingsDlg dlg;
dlg.DoModal();
+ */
}
void CBondEqDlg::OnUpdateMenuFileSettings(CCmdUI* pCmdUI)
@@ -564,10 +597,6 @@
loginDlg.DoModal();
}
else if (1 == menuId) {
- // test
- CSystemLogManagerDlg dlg;
- dlg.DoModal();
-
CChangePasswordDlg changePasswordDlg;
changePasswordDlg.DoModal();
}
@@ -578,6 +607,10 @@
}
}
else if (3 == menuId) {
+ CSystemLogManagerDlg dlg;
+ dlg.DoModal();
+ }
+ else if (4 == menuId) {
int ret = AfxMessageBox(_T("是否切换用户?切换用户会退出当前账号!"), MB_OKCANCEL | MB_ICONEXCLAMATION);
if (ret != IDOK) {
return 0;
@@ -684,6 +717,7 @@
{
::EnableMenuItem(hMenu, ID_OPEATOR_LOGIN, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
::EnableMenuItem(hMenu, ID_OPERATOR_CHANGE_PASSWORD, MF_BYCOMMAND | MF_ENABLED);
+ ::EnableMenuItem(hMenu, ID_OPERATOR_SYSTEM_LOG, MF_BYCOMMAND | MF_ENABLED);
::EnableMenuItem(hMenu, ID_OPEATOR_SWITCH, MF_BYCOMMAND | MF_ENABLED);
::EnableMenuItem(hMenu, ID_OPERATOR_LOGOUT, MF_BYCOMMAND | MF_ENABLED);
@@ -700,6 +734,7 @@
::EnableMenuItem(hMenu, ID_OPEATOR_LOGIN, MF_BYCOMMAND | MF_ENABLED);
::EnableMenuItem(hMenu, ID_OPERATOR_CHANGE_PASSWORD, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
::EnableMenuItem(hMenu, ID_OPEATOR_USER_MANAGER, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ ::EnableMenuItem(hMenu, ID_OPERATOR_SYSTEM_LOG, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
::EnableMenuItem(hMenu, ID_OPEATOR_SWITCH, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
::EnableMenuItem(hMenu, ID_OPERATOR_LOGOUT, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
--
Gitblit v1.9.3