eis/TestProject/RNG/RNG.cc

40 lines
1.1 KiB
C++
Raw Permalink Normal View History

#include <TestProject/RNG/RNG.h>
#include <TestProject/RNG/RNG_icei.h>
#include <glob/GlobDefine.h>
#include <utility/IniProperty.h>
#include <memory>
#include <string>
2026-05-13 15:26:19 +08:00
#include <TestProject/RNG/model/ModelRegistry.h>
#include "mix_cc/debug/pre_define.h"
using namespace baosight;
RNG::RNG() { logger_ = std::make_unique<LOG>("RNG"); }
RNG::~RNG() {}
int RNG::start() {
logger_->Info() << "-------RNG::start-------" << std::endl;
con_mag_ = std::make_shared<ConnectionMag>();
con_mag_->dbLogin();
try {
ModelRegistry::instance().loadModels("/users/dsc/code/TestProject/RNG/json/rng_models.json");
} catch (const std::exception& e) {
logger_->Error() << "Failed to load rng_models.json: " << e.what() << endl;
return (-1);
}
try {
auto module_name = name();
RNG_server = new RNGICEI();
this->add(string("baosight/") + name(), RNG_server);
} catch (::Ice::LocalException& e) {
logger_->Error() << "Can not add baosight/RNG, error: " << e << endl;
return (-1);
}
return 0;
}
// PACE_SERVER_INSTALL(RNG) //应用程序主入口,传入参数为定义的类名
PACE_PLATFORM_SERVER_INSTALL(RNG, APPVERSION);