| | |
| | | // 初始化运行日志表 |
| | | try { |
| | | if (!logManager.initializeLogTable()) { |
| | | AfxMessageBox("初始化系统日志表失败!"); |
| | | AfxMessageBox("初始化系统日志模块失败!"); |
| | | return FALSE; |
| | | } |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("初始化系统日志表失败:%s"), CString(ex.what())); |
| | | errorMsg.Format(_T("初始化系统日志模块失败:%s"), CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | 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; |
| | | } |