From 700ca509ba853d1615ea3e5c470d2532006f0e1e Mon Sep 17 00:00:00 2001
From: darker <mr.darker@163.com>
Date: 星期五, 17 一月 2025 15:21:34 +0800
Subject: [PATCH] 1. 添加报警管理器,新增设备名称
---
SourceCode/Bond/Servo/Servo.cpp | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/Servo.cpp b/SourceCode/Bond/Servo/Servo.cpp
index 550391a..495b5e7 100644
--- a/SourceCode/Bond/Servo/Servo.cpp
+++ b/SourceCode/Bond/Servo/Servo.cpp
@@ -6,6 +6,7 @@
#include "Servo.h"
#include "ServoDlg.h"
#include "ServoGraph.h"
+#include "AlarmManager.h"
// 声明全局变量,用于管理 GDI+ 初始化
ULONG_PTR g_diplusToken;
@@ -101,6 +102,21 @@
InitGDIPlus();
+ // 初始化报警管理器
+ try {
+ if (!AlarmManager::getInstance().initAlarmTable()) {
+ AfxMessageBox("初始化报警管理器失败!");
+ return FALSE;
+ }
+ }
+ catch (const std::exception& ex) {
+ CString errorMsg;
+ errorMsg.Format(_T("初始化报警管理器失败:%s"), CString(ex.what()));
+ AfxMessageBox(errorMsg, MB_ICONERROR);
+ return FALSE;
+ }
+
+
CServoDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
@@ -140,6 +156,9 @@
// 清理 GDI+
TermGDIPlus();
+ // 销毁报警表
+ AlarmManager::getInstance().termAlarmTable();
+
return CWinApp::ExitInstance();
}
--
Gitblit v1.9.3