2024-04-08 02:38:51 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* 处理RFID获取的数据
|
|
|
|
|
|
* */
|
|
|
|
|
|
|
2024-07-27 08:12:26 +00:00
|
|
|
|
#ifndef DEALRFIDENGINE_H
|
|
|
|
|
|
#define DEALRFIDENGINE_H
|
2024-04-08 02:38:51 +00:00
|
|
|
|
|
|
|
|
|
|
#include "AppCommon.h"
|
|
|
|
|
|
#include "Config.h"
|
|
|
|
|
|
#include "EngineBase.h"
|
|
|
|
|
|
#include "EngineFactory.h"
|
2024-04-25 09:53:34 +00:00
|
|
|
|
#include "CommandParser.h"
|
2024-04-08 02:38:51 +00:00
|
|
|
|
#include "TimeUtil.h"
|
|
|
|
|
|
#include "StringUtil.h"
|
|
|
|
|
|
#include "Utils.h"
|
2024-04-25 09:53:34 +00:00
|
|
|
|
#include "BlockingQueue.h"
|
2024-04-08 02:38:51 +00:00
|
|
|
|
|
|
|
|
|
|
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_;
|
2024-07-27 08:12:26 +00:00
|
|
|
|
std::string strPort3_;
|
2024-04-08 02:38:51 +00:00
|
|
|
|
|
|
|
|
|
|
// 来车的时间
|
|
|
|
|
|
std::string trainTime_;
|
|
|
|
|
|
|
|
|
|
|
|
// 核心配置
|
|
|
|
|
|
ai_matrix::BaseConfig baseConfig_;
|
2024-04-25 09:53:34 +00:00
|
|
|
|
// 视频辅助来车状态检测配置
|
|
|
|
|
|
ai_matrix::VideoAuxiliaryConfig videoAuxiliaryConfig_;
|
2024-07-27 08:12:26 +00:00
|
|
|
|
// 设备报警参数
|
|
|
|
|
|
ai_matrix::DeviceWarnConfig deviceWarnConfig_;
|
2024-04-08 02:38:51 +00:00
|
|
|
|
// 临时存储的接收数据
|
|
|
|
|
|
std::string tmpRfid_;
|
|
|
|
|
|
// 识别方向正确标志
|
|
|
|
|
|
bool needIdentify_;
|
|
|
|
|
|
// 视频识别有火车标志(使用socket服务时才有用)
|
|
|
|
|
|
bool videoHasTrain_;
|
|
|
|
|
|
// RFID识别有火车标志
|
|
|
|
|
|
bool rfidHasTrain_;
|
2024-04-25 09:53:34 +00:00
|
|
|
|
// 视频识别判定的方向 0:暂未确认方向 1:需要识别 -1 不需要识别
|
|
|
|
|
|
int iVDirection_;
|
2024-04-08 02:38:51 +00:00
|
|
|
|
// RFID源数据
|
|
|
|
|
|
std::string rfidSourceInfo_;
|
|
|
|
|
|
// 本列车识别结果(临时存储)
|
|
|
|
|
|
std::vector<std::string> vecTrain_;
|
2024-07-27 08:12:26 +00:00
|
|
|
|
// 上列车识别结果(临时存储)
|
|
|
|
|
|
std::vector<std::string> vecLastTrain_;
|
2024-04-25 09:53:34 +00:00
|
|
|
|
// 本列车识别结果临时队列
|
|
|
|
|
|
BlockingQueue<std::shared_ptr<TrainInfo>> queueTmpTrainInfo_;
|
2024-04-08 02:38:51 +00:00
|
|
|
|
|
|
|
|
|
|
void identifyFlagUpdate();
|
|
|
|
|
|
void initParam();
|
|
|
|
|
|
|
|
|
|
|
|
void makeTrainInfo(const std::string rfidinfo, std::shared_ptr<TrainInfo> pTrainInfo);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ENGINE_REGIST(DealRfidEngine)
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|