nldd 配置文件在每个芯片里的对应关系

 

3、测试用例

1、DDMIReport
DDMI_UNION Config;   普通变量
        if (FALSE == GetConfigCPE(Config, CONFIG_ADJUST_MODCURRANGE, Desc))
        {
            WriteLog(LOG_INFO, "CDutUX3322::GetBaisModCurValue get Laser R error");
            return FALSE;
        }

2 CRSSISet& RSSI    apd

    if (FALSE == GetRSSIData(RSSI))
    {
        WriteLog(LOG_LANDMARK, "APDCaliBF GetRSSIData error");
        m_Res.SetResultDesc(FALSE, "Check APD Lut Cfg  *.ini");
        return FALSE;
    }

3、                 apc
    SETUP_UNION SetUpConfig;
    if (FALSE == GetConfigSetUp(SetUpConfig, SETUP_BIASMAX_CONFIG, strMsg))


BOOL CDUTSocket::GetConfigSetUp(SETUP_UNION & Config, SETUP_TYPE type, CString &Desc)
{
    BOOL bReturn = FALSE;
    BOOL bTsucc = FALSE;
    SetUpConfig & ConfigVec = GetSetUpConfig();
    
    
    
    


CONFIG_TEST_LOS
CONFIG_ADJUST_LOS


DDMI_UNION Config;
        if (FALSE == GetConfigCPE(Config, CONFIG_ADJUST_MODCURRANGE, Desc))
        {
            WriteLog(LOG_INFO, "CDutUX3322::GetBaisModCurValue get Laser R error");
            return FALSE;
        }
        
        

 

 

2、根据配置文件的意义,把配置文件里的东西都补起来

 

 

1、读的时候通用的放的位置

BOOL CConfigInfo::GetAllConfig_BOSA(CString strConfig, CString Filename, vector<AllConfigItem>& AllConfigItem_vec)//4/3
{
    AllConfigItem_vec.clear();
    AllConfigItem AllConfigItem_by_Product;
    CString file = Filename;
    vector<CString> AllProductName_vector;
    AllProductName_vector.clear();
    vector<CString> AllConfigItem_vector;
    AllConfigItem_vector.clear();
    CString AllProductColumnName = "";
    CString AllConfigItemName = "";
    CString ColumnName = "";
    CString strTmp = "";
    CString Content = "";  
    CString DecodeValue = "";
    int Max_Row = 0;
    int Max_Column = 0;
    int configitem_column = 0;
    WriteLog(LOG_INFO, "CConfigInfo::GetAllConfig_BOSA  开始读取%s的所有配置信息", file);
    //if (-1 == ::GetFileAttributes(file))//获取Windows文件属性
    //{
    //    WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA file:%s can't be read, error", file);
    //    return FALSE;
    //}
    if (FALSE == InitExcelApp())//zhin
    {
        WriteLog(LOG_ERROR, "Init excel app fail");
        return FALSE;
    }
    //file = "D:\\MAT\\MAT_Start\\28433\\DeskSoft\\Products\\MTE_FM_CPE\\MTE_FM_CPE\\CPE_DESK_SOFT\\HT-2in1V01.03.16B2\\ConfigBOB\\NKEY_CONFIG.xlsx";
    if (FALSE == ConfirmParaFile(file))
    {
        WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA ConfirmParaFile: %s , error", file);
        return FALSE;
    }


    SetUpConfig data_SetUpConfig;
    vector<DDMIReport> data_DDMIReport;
    CString           Data_JsonConfig;
    CRSSISet data_CRSSISet;
    RXPowerSet data_RXPowerSet;
    SLosCfg    data_ux3360Los;
    MODLUT data_MODLUT;//279511用
    MODLUT data_Modlut;//Semtech用
    vector<CString> data_SaveReg;

    if (0 == Max_Row)//找excel文件行数
    {
        Max_Row = GetTableLine();
        if (Max_Row <= 0)
        {
            WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA %s Max_Row <= 0", file);
            CloseParaFile();
            ExitExcelApp();
            return FALSE;
        }
        WriteLog(LOG_INFO, "CConfigInfo::GetAllConfig_BOSA  %s的最大行数:%d", file, Max_Row);
    }
    if (0 == Max_Column)//找excel文件列数
    {
        Max_Column = GetTableMaxColumn();
        if (Max_Column <= 0)
        {
            WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA %s Max_Column<=0", file);
            CloseParaFile();
            ExitExcelApp();
            return FALSE;
        }
        WriteLog(LOG_INFO, "CConfigInfo::GetAllConfig_BOSA  %s的最大列数:%d", file, Max_Column);
    }
    if (0 == configitem_column)//找到指标符号所在列
    {
        configitem_column = GetTableColumn_contain("指标符号");//Excel中列号从1开始
        if (-1 == configitem_column)
        {
            WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA %s未找到指标符号列", file);
            CloseParaFile();
            ExitExcelApp();
            return FALSE;
        }
        WriteLog(LOG_INFO, "CConfigInfo::GetAllConfig_BOSA  %s的指标符号所在列:%d", file, configitem_column);
    }
    if (0 == AllProductName_vector.size())//找到所有产品列名
    {     
        for (int j = 7; j <= Max_Column; j++)
        {
            if (FALSE == GetTableColumnName(j, ColumnName))
            {
                WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  获取第%d列列名失败", j);
                CloseParaFile();
                ExitExcelApp();
                return FALSE;
            }
            AllProductName_vector.push_back(ColumnName);
            strTmp.Format("%s; ", ColumnName);
            AllProductColumnName += strTmp;
        }
        WriteLog(LOG_INFO, "CConfigInfo::GetAllConfig_BOSA  %s的所有产品型号为:%s", file, AllProductColumnName);
    }
    if (0 == AllConfigItem_vector.size())//配置文件所有指标符号的集合
    {
        for (int lineno = 2; lineno <= Max_Row; lineno++)
        {
            if (FALSE == ReadConfigNameFromExcel(lineno, configitem_column, Content))
            {
                CloseParaFile();
                ExitExcelApp();
                return FALSE;
            }
            if ("" != Content && TRUE == CDataSet::g_bTWaiXieCALL_FZteCALL)
            {
                if (FALSE == Decode(Content, DecodeValue))
                {
                    return FALSE;
                }
                Content = DecodeValue;
            }
            AllConfigItem_vector.push_back(Content);
            strTmp.Format("%s; ", Content);
            AllConfigItemName += strTmp;
        }
        WriteLog(LOG_INFO, "CConfigInfo::GetAllConfig_BOSA  %s的所有指标符号为:%s", file, AllConfigItemName);
    }
    for (size_t i = 0; i < AllProductName_vector.size(); i++)
    {
        WriteLog(LOG_INFO, "CConfigInfo::GetAllConfig_BOSA  开始读取%s中信息%s产品型号的配置信息", file, AllProductName_vector[i]);
        //获取三温程序或者产线传递的信息,根据三温程序或者产线传递的信息去每个bosa配置文件的所有列中匹配,以找到对应的产品型号
        if (-1 != strConfig.Find("PON"))//三温程序传递ex:XGPON_GN28L95,所内调试根据PonType和ChipType 来在每个bosa的数据中寻找
        {
            AllConfigItem_by_Product.PonType = strConfig.Left(strConfig.Find("_"));
            AllConfigItem_by_Product.ChipType = strConfig.Mid(strConfig.Find("_") + 1);
            WriteLog(LOG_INFO, "当前为所内调试,三温程序传递信息为:%s_%s", AllConfigItem_by_Product.PonType, AllConfigItem_by_Product.ChipType);
        }
        else//产线传递ex://strConfig = "F7610U_GN28L97_127307051002";,产线根据127307051002等关键词来在每个bosa的数据中寻找,并校验ChipType
        {     
            AllConfigItem_by_Product.ProductType = strConfig.Left(strConfig.Find("_"));
            strTmp = strConfig.Mid(strConfig.Find("_") + 1);
            AllConfigItem_by_Product.ChipType = strTmp.Left(strTmp.Find("_"));
            AllConfigItem_by_Product.BoardCode = strTmp.Mid(strTmp.Find("_") + 1);
            WriteLog(LOG_INFO, "当前为产线测试,产线程序传递信息为:%s_%s_%s", AllConfigItem_by_Product.ProductType, AllConfigItem_by_Product.ChipType, AllConfigItem_by_Product.BoardCode);
        }
        //读取该单板型号的单板信息与APC方案
        if (FALSE == ReadSetUpConfig(file, AllConfigItem_vector, i+7, data_SetUpConfig))
        {
            WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  ReadSetUpConfig error");
            CloseParaFile();
            ExitExcelApp();
            return FALSE;
        }
        AllConfigItem_by_Product.BoardInfo_APC_Config = data_SetUpConfig;
        //读取该单板型号的APOLUT信息
        if (FALSE == ReadRSSIRangeVecotr(file, AllConfigItem_vector, i + 7, data_CRSSISet))
        {
            WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  ReadRSSIRangeVecotr error");
            CloseParaFile();
            ExitExcelApp();
            return FALSE;
        }
        AllConfigItem_by_Product.APDLut_Config = data_CRSSISet;
        //读取该单板型号的电流功率等信息
        if (FALSE == ReadCPEConfig(file, AllConfigItem_vector, i + 7, data_DDMIReport, Data_JsonConfig))
        {
            WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  ReadCPEConfig error");
            CloseParaFile();
            ExitExcelApp();
            return FALSE;
        }
        AllConfigItem_by_Product.DDMI_Config = data_DDMIReport;
        AllConfigItem_by_Product.Json_Config = Data_JsonConfig;

      
        int col = i + 7;
        CString strDrive_Type = GetExcelInfoStr(file, AllConfigItem_vector, col, "DRIVER类型", "");//3/7
        DLL_BOB_TYPE eModlutbobtype = getBobType(strDrive_Type);


        if (/*DLL_BOB_ZX279511 == g_bobtype || */DLL_BOB_UX3360 == eModlutbobtype || DLL_BOB_UX3326 == eModlutbobtype 
            || DLL_BOB_UX3361 == eModlutbobtype|| DLL_BOB_UX3322 == eModlutbobtype || DLL_BOB_UX3326S == eModlutbobtype
            || DLL_BOB_UX3368 == eModlutbobtype || DLL_BOB_TSO40201 == eModlutbobtype || DLL_BOB_TSO40402 == eModlutbobtype)//先这样处理吧 DLL_BOB_TSO40201没有modlut
        {
            //读取279511单板型号的MODLUT信息
            if (FALSE == ReadMODLUTConfig(file, AllConfigItem_vector, i + 7, data_MODLUT))
            {
                WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  ReadMODLUTConfig error");
                CloseParaFile();
                ExitExcelApp();
                return FALSE;
            }
            AllConfigItem_by_Product.MODLUT_Config = data_MODLUT;
        }
        else
        {
            //读取Semtech单板型号的Modlut信息
            if (FALSE == ReadModLutConfig(file, AllConfigItem_vector, i + 7, data_Modlut))
            {
                WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  ReadModLutConfig error");
                CloseParaFile();
                ExitExcelApp();
                return FALSE;
            }
            AllConfigItem_by_Product.Modlut_Config = data_Modlut;
        }
        //读取该单板型号的RX标定信息
        if (FALSE == ReadRxStandardConfig(file, AllConfigItem_vector, i + 7, data_RXPowerSet))
        {
            WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  ReadRxStandardConfig error");
            CloseParaFile();
            ExitExcelApp();
            return FALSE;
        }
        AllConfigItem_by_Product.RxStandard_Config = data_RXPowerSet;
        //读取该单板型号的需要保存到LOS步进信息,当前只有3360芯片的单板有
        if (FALSE == ReadLosAdjustCfg(file, AllConfigItem_vector, i + 7, data_ux3360Los))
        {
            WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  ReadLosAdjustCfg error");
            CloseParaFile();
            ExitExcelApp();
            return FALSE;
        }
        AllConfigItem_by_Product.UX3360Los_Config = data_ux3360Los;
        //读取该单板型号的需要保存到寄存器信息
        //if (FALSE == ReadRegBack(file, AllConfigItem_vector, i + 7, data_SaveReg))
        //{
        //    WriteLog(LOG_ERROR, "CConfigInfo::GetAllConfig_BOSA  ReadRegBack error");
        //    return FALSE;
        //}
        //AllConfigItem_by_Product.Save_Reg_Config = data_SaveReg;
 
        //最后将该单板型号的所有配置数据压入vector向量
        AllConfigItem_vec.push_back(AllConfigItem_by_Product);
    }
    CloseParaFile();
    ExitExcelApp();
    return TRUE;
}

 

 

对应于每个芯片处理的

 

posted @ 2025-06-17 16:26  cnchengv  阅读(8)  评论(0)    收藏  举报