59 lines
2.2 KiB
C++
59 lines
2.2 KiB
C++
/**
|
|
* 定检期选取最优结果Engine
|
|
* */
|
|
|
|
#ifndef SELECTBESTCHKDATEENGINE_H
|
|
#define SELECTBESTCHKDATEENGINE_H
|
|
|
|
#include "AppCommon.h"
|
|
#include "MyYaml.h"
|
|
#include "EngineBase.h"
|
|
#include "EngineFactory.h"
|
|
|
|
class SelectBestChkDateEngine : public ai_matrix::EngineBase
|
|
{
|
|
public:
|
|
SelectBestChkDateEngine();
|
|
~SelectBestChkDateEngine();
|
|
|
|
APP_ERROR Init() override;
|
|
APP_ERROR DeInit() override;
|
|
APP_ERROR Process() override;
|
|
|
|
private:
|
|
//获取最优长度
|
|
int GetBestLength(std::vector<TransInfo> &vecAllTransInfo, TargetMaxLen iMaxLen);
|
|
//获取最优结果
|
|
std::string GetBest(std::vector<TransInfo> &vecAllTransInfo, TargetMaxLen iMaxLen);
|
|
//校验日期的合理性
|
|
bool ChkValidDate(std::string &strDate);
|
|
//获取定检期截至日期
|
|
std::string GetChkDateDeadLine(std::string &strChkDate);
|
|
//汇总单节车厢-定检期最佳值
|
|
void GetChkDateBest(std::shared_ptr<ChkDate> pChkDate, std::shared_ptr<ProcessData> pProcessData);
|
|
//定检期数据加入到待选优集合中
|
|
void ChkDateAddSelectBestMap(std::shared_ptr<ProcessData> pProcessData, TransSubData &transSubData);
|
|
//初始化车号参数信息
|
|
void InitChkDateParam();
|
|
//初始化参数信息
|
|
void InitParam();
|
|
|
|
std::string strPort0_;
|
|
std::string strPort1_;
|
|
int iSelectBestMode_; //选优模式
|
|
|
|
int iChkDateIndex_ = 1; //定检期序号
|
|
std::map<int, std::vector<TransInfo>> mapChkDateInfo_; //定检期待选优集合 key [0:段修定检期; 1:厂修定检期]
|
|
float fMaxScoreSumChkDate_; //当前车厢定检期最高得分
|
|
Step1Location step1LocationBestChkDate_; //当前车厢定检期最高分对于的大框坐标
|
|
std::string strBestChkDateImg_; //当前车厢定检期最高分的图片名
|
|
uint64_t i64TimeStampChkDate_ = 0; //当前车厢定检期最高分的图片时间戳
|
|
uint32_t iDataSourceChkDate_; //当前车厢定检期最高分的图片数据源id
|
|
|
|
std::map<int, bool> mapDataSourceIsEnd_; //[key-数据源id, value-数据是否结束]
|
|
};
|
|
|
|
ENGINE_REGIST(SelectBestChkDateEngine)
|
|
|
|
#endif
|