📄 meta_factory_result_handle.cpp
字号:
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* META_Factory_Result_Handle.cpp
*
* Project:
* --------
* Maui META APP
*
* Description:
* ------------
* META factory result file handle source
*
* Author:
* -------
* Andy Ueng (mtk00490)
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* $Revision$
* $Modtime$
* $Log$
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#include <vcl.h>
#pragma hdrstop
#include "meta_utils.h"
#include "rf_agc.h"
#include "rf_afc.h"
#include "crystal_afc.h"
#ifndef _RF_PM_H_
#include "rf_pm.h"
#endif
#include "rf_apc.h"
#ifndef _RF_TXIQ_H_
#include "rf_txiq.h"
#endif
#include "bb_adc.h"
#include "META_Factory.h"
#pragma package(smart_init)
extern CRFAFC* MF_rf_afc_ptr;
extern CCRYSTALAFC* MF_crystal_afc_ptr;
extern CRFAGC* MF_rf_agc_ptr;
extern CRFPM* MF_rf_pm_ptr;
extern CRFAPC* MF_rf_apc_ptr;
extern CRFAPC8PSK* MF_rf_apc_8psk_ptr;
extern CRFTXIQ* MF_rf_txiq_ptr;
extern CBBADC* MF_BB_ADC_ptr;
//==============================================================================
bool __fastcall T_META_factory_calibration::Get_CalFilePathName(AnsiString asCalFile, AnsiString asExeName, bool b_CalResultPath, AnsiString& asPathName)
{
AnsiString asPath;
if (b_CalResultPath)
{
asPath = m_pCal->as_CalPath + "\\";
}
else
{
getPathFromStr(asExeName, asPath);
}
if (withPath(asPath) && !withPath(asCalFile))
{
asPathName = asPath + asCalFile;
}
else
{
return false;
}
return true;
}
//==============================================================================
bool __fastcall T_META_factory_calibration::WriteIP2CalResultToFile(AnsiString asCalFile, AnsiString asExeName, bool b_CalResultPath, unsigned int rfmod_id, int band)
{
AnsiString asPath;
if (b_CalResultPath)
{
asPath = m_pCal->as_CalPath + "\\";
}
else
{
getPathFromStr(asExeName, asPath);
}
if (withPath(asPath) && !withPath(asCalFile))
{
asCalFile = asPath + asCalFile;
}
else
{
return false;
}
try
{
MF_rf_pm_ptr->REQ_Write_IP2Reg_To_File_Single_Band(asCalFile.c_str(), rfmod_id, band);
return true;
}
catch (...)
{
ShowMessage(" Write : write calibration result file : " + asCalFile + " error ");
}
return true;
}
//==============================================================================
bool __fastcall T_META_factory_calibration::WriteIP2RxAmCalModeToFile(AnsiString asCalFile, AnsiString asExeName, bool b_CalResultPath, unsigned int rfmod_id )
{
AnsiString asPath;
if (b_CalResultPath)
{
asPath = m_pCal->as_CalPath + "\\";
}
else
{
getPathFromStr(asExeName, asPath);
}
if (withPath(asPath) && !withPath(asCalFile))
{
asCalFile = asPath + asCalFile;
}
else
{
return false;
}
try
{
MF_rf_pm_ptr->REQ_Write_IP2Reg_RxAmCalMode_To_File(asCalFile.c_str(), rfmod_id);
return true;
}
catch (...)
{
ShowMessage(" Write : write calibration result file : " + asCalFile + " error ");
}
return true;
}
//==============================================================================
bool __fastcall T_META_factory_calibration::WriteAFCCalResultToFile(AnsiString asCalFile, AnsiString asExeName, bool b_CalResultPath)
{
AnsiString asPath;
if (b_CalResultPath)
{
asPath = m_pCal->as_CalPath + "\\";
}
else
{
getPathFromStr(asExeName, asPath);
}
if (withPath(asPath) && !withPath(asCalFile))
{
asCalFile = asPath + asCalFile;
}
try
{
MF_rf_afc_ptr->REQ_Write_To_File(asCalFile.c_str());
return true;
}
catch (...)
{
ShowMessage(" Write : write calibration result file : " + asCalFile + " error ");
}
return true;
}
//=================================================================================================
bool __fastcall T_META_factory_calibration::WriteCrystalAFCCalResultToFile(AnsiString asCalFile, AnsiString asExeName, bool b_CalResultPath)
{
AnsiString asPath;
if (b_CalResultPath)
{
asPath = m_pCal->as_CalPath + "\\";
}
else
{
getPathFromStr(asExeName, asPath);
}
if ( withPath( asPath) && !withPath( asCalFile) )
{
asCalFile = asPath + asCalFile;
}
else
{
return false;
}
try
{
MF_crystal_afc_ptr->REQ_Write_CAPID_To_File( asCalFile.c_str() );
return true;
}
catch (...)
{
ShowMessage( " Write : write calibration result file : " + asCalFile + " error ");
}
return true;
}
//==============================================================================
bool __fastcall T_META_factory_calibration::WriteAGCCalResultToFile(AnsiString asCalFile, AnsiString asExeName, bool b_CalResultPath, FrequencyBand freqband)
{
AnsiString asPath;
if (b_CalResultPath)
{
asPath = m_pCal->as_CalPath + "\\";
}
else
{
getPathFromStr(asExeName, asPath);
}
if ( withPath( asPath) && !withPath( asCalFile) )
{
asCalFile = asPath + asCalFile;
}
else
{
return false;
}
try
{
MF_rf_agc_ptr->REQ_Write_To_File_Single_Band( asCalFile.c_str(), freqband);
return true;
}
catch (...)
{
ShowMessage( " Write : write calibration result file : " + asCalFile + " error ");
}
return true;
}
//=================================================================================================
bool __fastcall T_META_factory_calibration::WriteTxDcOffsetCalResultToFile(AnsiString asCalFile, AnsiString asExeName, bool b_CalResultPath)
{
AnsiString asPath;
if (b_CalResultPath)
{
asPath = m_pCal->as_CalPath + "\\";
}
else
{
getPathFromStr(asExeName, asPath);
}
if ( withPath( asPath) && !withPath( asCalFile) )
{
asCalFile = asPath + asCalFile;
}
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -