/**
 * 集装箱信息推理结果转换引擎
 * */

#ifndef TRANSCONTAINERENGINE_H
#define TRANSCONTAINERENGINE_H

#include "AppCommon.h"
#include "MyYaml.h"
#include "EngineBase.h"
#include "EngineFactory.h"

class TransContainerEngine : public ai_matrix::EngineBase
{
public:
    TransContainerEngine();
    ~TransContainerEngine();

    APP_ERROR Init() override;
    APP_ERROR DeInit() override;
    APP_ERROR Process() override;

private:
    //集装箱框内容转换
    void TransContainer(TransSubData &transSubData, std::map<int, std::vector<SingleData>> &mapLine);
    //根据大框位置，重置总得分
    void ReSetScoreSumByPosition(TransSubData &transSubData, std::shared_ptr<ProcessData> pProcessData);
    //push数据到队列，队列满时则休眠一段时间再push
    void PushData(const std::string &strPort, const std::shared_ptr<ProcessData> &pProcessData);

    bool bUseEngine_;
    std::string strPort0_;
    ai_matrix::ModelConfig modelConfig_;
    std::vector<std::string> vecClassNames_;    //分类名称集合
    std::map<int, int> mapModelType_;           //[key-数据源id, value-模型类别(0:侧部模型; 1:顶部模型; 2:对面侧部模型)]
    
};

ENGINE_REGIST(TransContainerEngine)

#endif
