2026-05-09 11:23:45 +08:00
|
|
|
#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>
|
2026-05-09 11:23:45 +08:00
|
|
|
#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();
|
2026-05-13 15:46:06 +08:00
|
|
|
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);
|
|
|
|
|
}
|
2026-05-09 11:23:45 +08:00
|
|
|
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);
|