/** * 处理RFID获取的数据 * */ #ifndef DEALRFIDENGINE_H #define DEALRFIDENGINE_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 strPort3_; // 来车的时间 std::string trainTime_; // 核心配置 ai_matrix::BaseConfig baseConfig_; // 视频辅助来车状态检测配置 ai_matrix::VideoAuxiliaryConfig videoAuxiliaryConfig_; // 设备报警参数 ai_matrix::DeviceWarnConfig deviceWarnConfig_; // 临时存储的接收数据 std::string tmpRfid_; // 识别方向正确标志 bool needIdentify_; // 视频识别有火车标志(使用socket服务时才有用) bool videoHasTrain_; // RFID识别有火车标志 bool rfidHasTrain_; // 视频识别判定的方向 0:暂未确认方向 1:需要识别 -1 不需要识别 int iVDirection_; // RFID源数据 std::string rfidSourceInfo_; // 本列车识别结果(临时存储) std::vector vecTrain_; // 上列车识别结果(临时存储) std::vector vecLastTrain_; // 本列车识别结果临时队列 BlockingQueue> queueTmpTrainInfo_; void identifyFlagUpdate(); void initParam(); void makeTrainInfo(const std::string rfidinfo, std::shared_ptr pTrainInfo); }; ENGINE_REGIST(DealRfidEngine) #endif