From 02fb493f0903013e5258c2ff5e2cb27de873378a Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 12 十二月 2024 10:51:43 +0800
Subject: [PATCH] 1.警告性息弹窗; 2.警告性息列表;

---
 SourceCode/Bond/BondEq/BondEqDlg.cpp |   57 ++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 38 insertions(+), 19 deletions(-)

diff --git a/SourceCode/Bond/BondEq/BondEqDlg.cpp b/SourceCode/Bond/BondEq/BondEqDlg.cpp
index 70bde1c..9aa2398 100644
--- a/SourceCode/Bond/BondEq/BondEqDlg.cpp
+++ b/SourceCode/Bond/BondEq/BondEqDlg.cpp
@@ -16,9 +16,6 @@
 #include "UserManagerDlg.h"
 #include "SystemLogManagerDlg.h"
 
-// test
-#include "AxisSettingsDlg.h"
-#include "IOMonitoringDlg.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -75,6 +72,7 @@
 	m_pHomeDialog = nullptr;
 	m_pActiveView = nullptr;
 	m_pActiveComponentDlg = nullptr;
+	m_pAlarmWnd = nullptr;
 }
 
 void CBondEqDlg::DoDataExchange(CDataExchange* pDX)
@@ -154,6 +152,12 @@
 						}
 					}
 				}
+			}
+			else if (code == RX_CODE_ALARM_ON) {
+				AlarmOn();
+			}
+			else if (code == RX_CODE_ALARM_OFF) {
+				AlarmOff();
 			}
 			pAny->release();
 		}, [&]() -> void {
@@ -396,6 +400,11 @@
 		::DeleteObject(m_hbrBkgnd);
 	}
 
+	if (m_pAlarmWnd != nullptr) {
+		m_pAlarmWnd->DestroyWindow();
+		delete m_pAlarmWnd;
+	}
+
 	ASSERT(m_pObserver != NULL);
 	m_pObserver->unsubscribe();
 	m_pObserver = NULL;
@@ -508,23 +517,8 @@
 
 void CBondEqDlg::OnMenuFileSettings()
 {
-	CAxisSettingsDlg axisDlg;
-	axisDlg.SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)"));
-	axisDlg.SetRecipeName(_T("Default"));
-	axisDlg.DoModal();
-
-	// Cavity VacuumBake AfterBake AOI
-	/*
-	CIOMonitoringDlg dlg;
-	dlg.SetIOManager("Cavity");
-	dlg.SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)"));
-	dlg.DoModal();
-	*/
-
-	/*
 	CSettingsDlg dlg;
 	dlg.DoModal();
-	*/
 }
 
 void CBondEqDlg::OnUpdateMenuFileSettings(CCmdUI* pCmdUI)
@@ -591,6 +585,7 @@
 			return 0;
 		}
 
+		/*
 		CString inputText = inputDialog.GetInputText();
 		std::string strPass = UserManager::getInstance().getCurrentPass();
 		if (inputText.Compare(strPass.c_str()) != 0) {
@@ -598,14 +593,17 @@
 			logManager.log(SystemLogManager::LogType::Info, _T("验证时,密码错误!"));
 			return 0;
 		}
+		*/
 	}
 
 	if (id == IDC_BUTTON_RUN) {
+		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("运行..."));
 	}
 	else if (id == IDC_BUTTON_STOP) {
+		theApp.m_model.getBonder().stop();
 		m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(TRUE);
 		m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(FALSE);
 		logManager.log(SystemLogManager::LogType::Operation, _T("停止..."));
@@ -778,8 +776,9 @@
 CComponentPLCDlg* CBondEqDlg::CreateComponentPLCDlg(CComponent* pComponent)
 {
 	CComponentPLCDlg* pDlg = new CComponentPLCDlg(m_pMainContainer);
-	pDlg->Create(IDD_COMPONENT_PLC, 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);
@@ -798,3 +797,23 @@
 	return pDlg;
 }
 
+void CBondEqDlg::AlarmOn()
+{
+	if (m_pAlarmWnd == nullptr) {
+		m_pAlarmWnd = new CAlarmPopupDlg();
+		m_pAlarmWnd->Create(IDD_DIALOG_POPUP_ALARM, this);
+		m_pAlarmWnd->CenterWindow();
+	}
+	m_pAlarmWnd->ShowWindow(SW_SHOW);
+	m_pAlarmWnd->AlarmOn();
+}
+
+void CBondEqDlg::AlarmOff()
+{
+	if (m_pAlarmWnd == nullptr) {
+		m_pAlarmWnd = new CAlarmPopupDlg();
+		m_pAlarmWnd->Create(IDD_DIALOG_POPUP_ALARM, this);
+		m_pAlarmWnd->CenterWindow();
+	}
+	m_pAlarmWnd->AlarmOff();
+}

--
Gitblit v1.9.3