LAPTOP-SNT8I5JK\Boounion
2025-06-21 0de0a72329a77fbf20bc299c542e435a6d47256b
SourceCode/Bond/Servo/Servo.cpp
@@ -7,10 +7,10 @@
#include "ServoDlg.h"
#include "ServoGraph.h"
#include "AlarmManager.h"
#include "SECSRuntimeManager.h"
#include "TransferManager.h"
#include "SystemLogManager.h"
#include "UserManager.h"
#include "RecipeManager.h"
#include "VerticalLine.h"
#include "HorizontalLine.h"
#include "EqsGraphWnd.h"
@@ -134,21 +134,6 @@
      AfxMessageBox(errorMsg, MB_ICONERROR);
      return FALSE;
   }
   AlarmManager::getInstance().insertMockData();
   // 初始化SECS运行设置管理库
   try {
      if (!SECSRuntimeManager::getInstance().initRuntimeSetting()) {
         AfxMessageBox("初始化SECS运行设置失败!");
         return FALSE;
      }
   }
   catch (const std::exception& ex) {
      CString errorMsg;
      errorMsg.Format(_T("初始化SECS运行设置失败:%s"), CString(ex.what()));
      AfxMessageBox(errorMsg, MB_ICONERROR);
      return FALSE;
   }
   // 初始化搬运记录管理库
   try {
@@ -166,7 +151,7 @@
   // 初始化运行日志管理库
   try {
      if (!SystemLogManager::getInstance().initializeLogTable()) {
      if (!SystemLogManager::getInstance().initSystemLogTable()) {
         AfxMessageBox("初始化运行日志管理库失败!");
         return FALSE;
      }
@@ -194,6 +179,19 @@
      return FALSE;
   }
   // 初始化配方管理库
   try {
      if (!RecipeManager::getInstance().initRecipeTable()) {
         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;
@@ -238,12 +236,22 @@
   // 销毁报警表
   AlarmManager::getInstance().termAlarmTable();
   // 销毁SECS运行设置管理库
   SECSRuntimeManager::getInstance().termRuntimeSetting();
   // 销毁搬运记录管理库
   TransferManager::getInstance().termTransferTable();
   // 销毁运行日志
   SystemLogManager::getInstance().termSystemLogTable();
   // 销毁用户表
#if !defined(_DEBUG)
// 清除 UserManager 的无操作检测
   UserManager::getInstance().terminateIdleDetection();
   KillTimer(1);
#endif
   // 销毁配方表
   RecipeManager::getInstance().termRecipeTable();
   return CWinApp::ExitInstance();
}