67 lines
1.6 KiB
C++
67 lines
1.6 KiB
C++
/**
|
||
* 处理RFID获取的数据
|
||
* */
|
||
|
||
#ifndef SELECTBESTENGINE_H
|
||
#define SELECTBESTENGINE_H
|
||
|
||
#include "AppCommon.h"
|
||
#include "Config.h"
|
||
#include "EngineBase.h"
|
||
#include "EngineFactory.h"
|
||
#include "CommandParser.h"
|
||
#include "TimeUtil.h"
|
||
#include "StringUtil.h"
|
||
#include "Utils.h"
|
||
#include "BlockingQueue.h"
|
||
|
||
class DealRfidEngine : public ai_matrix::EngineBase
|
||
{
|
||
public:
|
||
DealRfidEngine();
|
||
~DealRfidEngine();
|
||
|
||
APP_ERROR Init() override;
|
||
APP_ERROR DeInit() override;
|
||
APP_ERROR Process() override;
|
||
|
||
private:
|
||
|
||
std::string strPort0_;
|
||
std::string strPort1_;
|
||
std::string strPort2_;
|
||
|
||
// 来车的时间
|
||
std::string trainTime_;
|
||
|
||
// 核心配置
|
||
ai_matrix::BaseConfig baseConfig_;
|
||
// 视频辅助来车状态检测配置
|
||
ai_matrix::VideoAuxiliaryConfig videoAuxiliaryConfig_;
|
||
// 临时存储的接收数据
|
||
std::string tmpRfid_;
|
||
// 识别方向正确标志
|
||
bool needIdentify_;
|
||
// 视频识别有火车标志(使用socket服务时才有用)
|
||
bool videoHasTrain_;
|
||
// RFID识别有火车标志
|
||
bool rfidHasTrain_;
|
||
// 视频识别判定的方向 0:暂未确认方向 1:需要识别 -1 不需要识别
|
||
int iVDirection_;
|
||
// RFID源数据
|
||
std::string rfidSourceInfo_;
|
||
// 本列车识别结果(临时存储)
|
||
std::vector<std::string> vecTrain_;
|
||
// 本列车识别结果临时队列
|
||
BlockingQueue<std::shared_ptr<TrainInfo>> queueTmpTrainInfo_;
|
||
|
||
void identifyFlagUpdate();
|
||
void initParam();
|
||
|
||
void makeTrainInfo(const std::string rfidinfo, std::shared_ptr<TrainInfo> pTrainInfo);
|
||
};
|
||
|
||
ENGINE_REGIST(DealRfidEngine)
|
||
|
||
#endif
|