From 35199ad4aaa3f35ff82da77d7108a4e9f136443e Mon Sep 17 00:00:00 2001
From: LAPTOP-T815PCOQ\25526 <mr.liuyang@126.com>
Date: 星期五, 06 十二月 2024 17:49:56 +0800
Subject: [PATCH] 1.修改配方管理模块,定位点等参数有最大值最小值 2.同步修改合并轴管理界面3.IO界面显示16个,16个为一组
---
SourceCode/Bond/BondEq/BondEqDlg.cpp | 96 +++++++++++++++++++++++++++++++++---------------
1 files changed, 66 insertions(+), 30 deletions(-)
diff --git a/SourceCode/Bond/BondEq/BondEqDlg.cpp b/SourceCode/Bond/BondEq/BondEqDlg.cpp
index 0fb1060..498f7af 100644
--- a/SourceCode/Bond/BondEq/BondEqDlg.cpp
+++ b/SourceCode/Bond/BondEq/BondEqDlg.cpp
@@ -8,13 +8,13 @@
#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 "UserManagerDlg.h"
#include "SystemLogManagerDlg.h"
-#include "AxisSettingsDlg.h"
#ifdef _DEBUG
@@ -71,6 +71,7 @@
m_pMainContainer = nullptr;
m_pHomeDialog = nullptr;
m_pActiveView = nullptr;
+ m_pActiveComponentDlg = nullptr;
}
void CBondEqDlg::DoDataExchange(CDataExchange* pDX)
@@ -131,7 +132,26 @@
}
}
}
+ else if (RX_CODE_SELECT_COMPONENT == code) {
+ CComponent* pComponent;
+ if (pAny->getPtrValue("ptr", (void*&)pComponent)) {
+ if (pComponent->getClassName().compare("CPLC") == 0) {
+ if (m_pMainContainer != nullptr) {
+ if (m_pActiveComponentDlg != nullptr) {
+ if (m_pActiveComponentDlg->GetContext() != (void*)pComponent) {
+ m_pActiveComponentDlg->DestroyWindow();
+ delete m_pActiveComponentDlg;
+ m_pActiveComponentDlg = nullptr;
+ }
+ }
+ if (m_pActiveComponentDlg == nullptr) {
+ m_pActiveComponentDlg = CreateComponentPLCDlg(pComponent);
+ }
+ }
+ }
+ }
+ }
pAny->release();
}, [&]() -> void {
// onComplete
@@ -202,28 +222,11 @@
return FALSE;
}
- // 设置轴设定模块的数据库连接
- AxisManager& axisManager = AxisManager::getInstance();
- axisManager.setDatabase(db.get());
-
- // 初始化轴设定表
- try {
- if (!axisManager.initializeTables()) {
- AfxMessageBox("创建轴设定表失败!");
- return FALSE;
- }
-
- if (!axisManager.initializeDefaultData()) {
- 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);
// 菜单
@@ -380,6 +383,12 @@
m_pActiveView = nullptr;
}
+ if (m_pActiveComponentDlg != nullptr) {
+ m_pActiveComponentDlg->DestroyWindow();
+ delete m_pActiveComponentDlg;
+ m_pActiveComponentDlg = nullptr;
+ }
+
if (m_hbrBkgnd != nullptr) {
::DeleteObject(m_hbrBkgnd);
}
@@ -496,14 +505,8 @@
void CBondEqDlg::OnMenuFileSettings()
{
- CAxisSettingsDlg axisDlg;
- axisDlg.SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)"));
- axisDlg.DoModal();
-
- /*
CSettingsDlg dlg;
dlg.DoModal();
- */
}
void CBondEqDlg::OnUpdateMenuFileSettings(CCmdUI* pCmdUI)
@@ -552,7 +555,7 @@
{
int id = (int)lParam;
if (id == VIEW_TOOL_BTN_CLOSE) {
- CloseView((CBaseView*)wParam);
+ CloseView((CComponentDlg*)wParam);
}
return 0;
@@ -662,6 +665,14 @@
m_pMainContainer->Resize();
}
+void CBondEqDlg::CloseView(CComponentDlg* pView)
+{
+ pView->DestroyWindow();
+ delete pView;
+ m_pActiveComponentDlg = nullptr;
+ m_pMainContainer->Resize();
+}
+
CHomeDialog* CBondEqDlg::CreateHomeDlg()
{
CHomeDialog* pDlg = new CHomeDialog(m_pMainContainer);
@@ -745,3 +756,28 @@
m_pTopToolbar->SetOperatorBtnText(_T("未登录"));
}
}
+
+CComponentPLCDlg* CBondEqDlg::CreateComponentPLCDlg(CComponent* pComponent)
+{
+ CComponentPLCDlg* pDlg = new CComponentPLCDlg(m_pMainContainer);
+ pDlg->SetContext(pComponent);
+ pDlg->Create(IDD_COMPONENT_PLC, m_pMainContainer);
+
+
+ CString strIcon0, strIcon1, strIcon2, strIcon3;
+ strIcon0.Format(_T("%s\\Res\\small_close0.ico"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
+ strIcon1.Format(_T("%s\\Res\\small_close1.ico"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
+ strIcon2.Format(_T("%s\\Res\\small_close2.ico"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
+ strIcon3.Format(_T("%s\\Res\\small_close3.ico"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
+ pDlg->AddToolBtn(VIEW_TOOL_BTN_CLOSE,
+ (LPTSTR)(LPCTSTR)strIcon0,
+ (LPTSTR)(LPCTSTR)strIcon1,
+ (LPTSTR)(LPCTSTR)strIcon2,
+ (LPTSTR)(LPCTSTR)strIcon3, "关闭");
+ pDlg->ShowWindow(SW_SHOW);
+ pDlg->SetWindowText(pComponent->getName().c_str());
+ m_pMainContainer->Resize();
+
+ return pDlg;
+}
+
--
Gitblit v1.9.3