/**
 * 列车信息推理结果转换引擎
 * */

#ifndef TRAINCHARACTERCONVERSIONENGINE_H
#define TRAINCHARACTERCONVERSIONENGINE_H

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

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

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

private:
    void InitParam();
    // 集装箱号转换
    void transContainerNum(Step2ResultData &step2ResultData, std::map<int, std::vector<SingleData>> &mapLine);
    // 集装箱型转换
    void transContainerType(Step2ResultData &step2ResultData, std::map<int, std::vector<SingleData>> &mapLine);
    // 校验码验证
    bool verifyContainerNo(std::string &strContainerNo);

    std::string strPort0_;
    std::string strPort3_;
    ai_matrix::ModelConfig modelConfig_;
    ai_matrix::BaseConfig baseConfig_;
    std::vector<std::string> vecClassNames_;    // 分类名称集合

    //集装箱号转换
    std::map<std::string, int> mapExchange_ = {
            {"A", 10},
            {"B", 12},
            {"C", 13},
            {"D", 14},
            {"E", 15},
            {"F", 16},
            {"G", 17},
            {"H", 18},
            {"I", 19},
            {"J", 20},
            {"K", 21},
            {"L", 23},
            {"M", 24},
            {"N", 25},
            {"O", 26},
            {"P", 27},
            {"Q", 28},
            {"R", 29},
            {"S", 30},
            {"T", 31},
            {"U", 32},
            {"V", 34},
            {"W", 35},
            {"X", 36},
            {"Y", 37},
            {"Z", 38},
            {"0", 0},
            {"1", 1},
            {"2", 2},
            {"3", 3},
            {"4", 4},
            {"5", 5},
            {"6", 6},
            {"7", 7},
            {"8", 8},
            {"9", 9},
    };

};

ENGINE_REGIST(ContainerCharacterConversionEngine)

#endif
