eis/RICS/RICS_icei.cc

47 lines
1.6 KiB
C++
Raw Normal View History

#include <RICS/RICS_icei.h>
#include <RICS/utility.h>
#include <common/L2Event.h>
#include <dao/DbStandardDBAX.h>
#include <log4cplus/LOG.h>
#include <nlohmann/json.hpp>
#include <string>
#include <thread>
RICSICEI::RICSICEI() {
this->logger_ = std::make_unique<LOG>("RICS_icei");
RICS_alg_ = std::make_unique<RICSAlg>();
RICS_alg_->timed_task();
}
RICSICEI::~RICSICEI() { logger_->Info() << "RICSICEI::~RICSICEI()" << endl; }
void baosight::RICSICEI::SendDataShort(::Ice::Int eventNo,
const ::Ice::ByteSeq &seq,
::Ice::Int length,
const Ice::Current &current) {
logger_->Info() << "event no:" << eventNo << endl; /* ALARM! */
string str(seq.begin(), seq.end());
logger_->Debug() << "seq str:" << str << std::endl;
// 根据电文号调用,执行分派任务操作
switch (eventNo) {
case 99999:
logger_->Debug() << "test" << std::endl;
RICS_alg_->dispose(eventNo, seq);
break;
default:
logger_->Error() << "wrong event No.!" << endl;
break;
}
}
void baosight::RICSICEI::SendDataLong(
::Ice::Int eventNo, const ::Ice::ByteSeq &seq, ::Ice::Int length,
const ::std::string &sender, const ::std::string &receiver,
const ::std::string &additional, const Ice::Current &current) {}
void baosight::RICSICEI::TimeNotify(::Ice::Int eventNo,
const ::Ice::ByteSeq &seq,
const Ice::Current &current) {
RICS_alg_->timed_task();
logger_->Debug() << " RICS_alg_->timed_task()" << std::endl;
}