LAPTOP-SNT8I5JK\Boounion
2025-01-09 4656e074123feced4aa1691c53a4aff85514cffa
SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
@@ -9,12 +9,15 @@
#include "Common.h"
#include "PlcView.h"
#include "AlarmMonitor.h"
#include "Log.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#define LOG_WND_HEIGHT      258
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
@@ -63,6 +66,7 @@
   m_hbrBkgnd = nullptr;
   m_pActiveView = nullptr;
   m_pPageLogcat = nullptr;
   m_bShowLogWnd = TRUE;
}
void CBoounionPLCDlg::DoDataExchange(CDataExchange* pDX)
@@ -81,6 +85,8 @@
   ON_UPDATE_COMMAND_UI(ID_MENU_FILE_EXIT, &CBoounionPLCDlg::OnUpdateMenuFileExit)
   ON_COMMAND(ID_MENU_FILE_SETTINGS, &CBoounionPLCDlg::OnMenuFileSettings)
   ON_UPDATE_COMMAND_UI(ID_MENU_FILE_SETTINGS, &CBoounionPLCDlg::OnUpdateMenuFileSettings)
   ON_COMMAND(ID_MENU_WND_LOG, &CBoounionPLCDlg::OnMenuWndLog)
   ON_UPDATE_COMMAND_UI(ID_MENU_WND_LOG, &CBoounionPLCDlg::OnUpdateMenuWndLog)
   ON_COMMAND(ID_MENU_HELP_ABOUT, &CBoounionPLCDlg::OnMenuHelpAbout)
   ON_WM_INITMENUPOPUP()
   ON_MESSAGE(ID_MSG_TOOLBAR_BTN_CLICKED, &CBoounionPLCDlg::OnToolbarBtnClicked)
@@ -199,7 +205,7 @@
   m_pPageLogcat = new CPageLogcat();
   m_pPageLogcat->Create(IDD_PAGE_LOGCAT, m_pMainContainer);
   m_pPageLogcat->ShowWindow(SW_SHOW);
   m_pMainContainer->SetBottomWnd(m_pPageLogcat, 220);
   m_pMainContainer->SetBottomWnd(m_pPageLogcat, LOG_WND_HEIGHT);
   // 菜单
@@ -436,6 +442,31 @@
   pCmdUI->Enable(TRUE);
}
void CBoounionPLCDlg::OnMenuWndLog()
{
   m_bShowLogWnd = !m_bShowLogWnd;
   if (m_bShowLogWnd) {
      LOGD("显示日志窗口");
      m_pPageLogcat->ShowWindow(SW_SHOW);
      m_pPageLogcat->SetParent(m_pMainContainer);
      m_pMainContainer->SetBottomWnd(m_pPageLogcat, LOG_WND_HEIGHT);
      m_pMainContainer->Resize();
   }
   else {
      LOGD("隐藏日志窗口");
      m_pPageLogcat->ShowWindow(SW_HIDE);
      m_pPageLogcat->SetParent(this);
      m_pMainContainer->SetBottomWnd(nullptr, 0);
      m_pMainContainer->Resize();
   }
}
void CBoounionPLCDlg::OnUpdateMenuWndLog(CCmdUI* pCmdUI)
{
   pCmdUI->SetCheck(m_bShowLogWnd);
}
void CBoounionPLCDlg::OnMenuHelpAbout()
{
   CAboutDlg dlgAbout;