|
@@ -2,6 +2,7 @@
|
|
#include "common_api.h"
|
|
#include "common_api.h"
|
|
#include "DICOMImageHeadKey.h"
|
|
#include "DICOMImageHeadKey.h"
|
|
#include "Detector_TiRayDR.h"
|
|
#include "Detector_TiRayDR.h"
|
|
|
|
+#include "LogLocalHelper.h"
|
|
#include "Log4CPP.h"
|
|
#include "Log4CPP.h"
|
|
|
|
|
|
namespace nsFPD = CCOS::Dev::Detail::Detector;
|
|
namespace nsFPD = CCOS::Dev::Detail::Detector;
|
|
@@ -44,12 +45,21 @@ nsFPD::TiRayDriver::~TiRayDriver()
|
|
|
|
|
|
void nsFPD::TiRayDriver::Prepare()
|
|
void nsFPD::TiRayDriver::Prepare()
|
|
{
|
|
{
|
|
- string strLogPath = GetProcessDirectory() + R"(\Conf\log_config.xml)";
|
|
|
|
// 初始化日志系统
|
|
// 初始化日志系统
|
|
- if (!Log4CPP::init("DevTiRay", "FPD.TiRay", strLogPath, true)) {
|
|
|
|
- std::cerr << "Failed to initialize log system! Using default configuration." << std::endl;
|
|
|
|
- // 即使配置文件加载失败,也可以继续使用默认配置
|
|
|
|
- }
|
|
|
|
|
|
+ std::string strLogPath = GetProcessDirectory() + R"(/Conf/log_config.xml)";
|
|
|
|
+ std::string LogHost = "DevTiRay"; // 确保这是正确的值
|
|
|
|
+ std::string moduleName = "DevTiRay";
|
|
|
|
+ bool ret = initLogModule(
|
|
|
|
+ LogHost, // 主机名(用于日志路径中的{host}占位符)
|
|
|
|
+ moduleName, // 唯一模块名
|
|
|
|
+ strLogPath, // 配置文件路径
|
|
|
|
+ true // 是否输出到控制台(可选)
|
|
|
|
+ );
|
|
|
|
+ if (!ret) {
|
|
|
|
+ std::cerr << "Log init failed!" << std::endl;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ TiRaySetLocalModuleName(moduleName);
|
|
|
|
|
|
FINFO("Code Build datetime [{$} {$}]", __DATE__, __TIME__);
|
|
FINFO("Code Build datetime [{$} {$}]", __DATE__, __TIME__);
|
|
}
|
|
}
|
|
@@ -528,7 +538,6 @@ nsFPD::FPDDeviceTiRay::FPDDeviceTiRay(std::shared_ptr<IOEventCenter> center, std
|
|
m_CalibUnit.reset(new OemCalib(center, this));
|
|
m_CalibUnit.reset(new OemCalib(center, this));
|
|
m_DetectorConfiguration.reset(new DetectorConfiguration(strConfigPath));
|
|
m_DetectorConfiguration.reset(new DetectorConfiguration(strConfigPath));
|
|
|
|
|
|
- logHostName = "DevTiRay";
|
|
|
|
std::string strErrorInfoPath = m_strWorkPath + "\\OEMDrivers\\Detector\\Conf\\";
|
|
std::string strErrorInfoPath = m_strWorkPath + "\\OEMDrivers\\Detector\\Conf\\";
|
|
//m_WarnAndError.reset(new FPDErrorWarning(center, DetectorUnitType, strErrorInfoPath));
|
|
//m_WarnAndError.reset(new FPDErrorWarning(center, DetectorUnitType, strErrorInfoPath));
|
|
|
|
|