form_RFApcProfile.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:16k
- /*****************************************************************************
- * 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:
- * ---------
- * form_RFApcProfile.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * RF APC profile form header
- *
- * 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!!
- *============================================================================
- ****************************************************************************/
- //---------------------------------------------------------------------------
- #ifndef _FORM_RFAPCPROFILE_H_
- #define _FORM_RFAPCPROFILE_H_
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <Dialogs.hpp>
- #include <ComCtrls.hpp>
- #include <ExtCtrls.hpp>
- #include <Buttons.hpp>
- #include "rf_common.h"
- #include "rf_tx.h"
- #include "rf_apc.h"
- // thread
- #ifndef _RF_TADO_THRD_H_
- #include "rf_tado_thrd.h"
- #endif
- #ifndef _RF_SETRAMP_THRD_H_
- #include "rf_setramp_thrd.h"
- #endif
- //---------------------------------------------------------------------------
- #define TOTAL_PCL_DAC_NUM 16
- #define TOTAL_RAMP_UP_NUM 16
- #define TOTAL_RAMP_DOWN_NUM 16
- #define TOTAL_SUBBAND_WEIGHT_NUM 11
- #define TOTAL_BATTERY_COMPENSATE_NUM 9
- //---------------------------------------------------------------------------
- extern const int PCL_RANGE[][16];
- //---------------------------------------------------------------------------
- class TfrmApcProfile : public TForm
- {
- __published: // IDE-managed Components
- TBitBtn *btnTXStart;
- TButton *btnDnLeft;
- TButton *btnDnRight;
- TButton *btnDownloadToFlash;
- TButton *btnLoadFromFile;
- TButton *btnPCL00;
- TButton *btnPCL01;
- TButton *btnPCL02;
- TButton *btnPCL03;
- TButton *btnPCL04;
- TButton *btnPCL05;
- TButton *btnPCL06;
- TButton *btnPCL07;
- TButton *btnPCL08;
- TButton *btnPCL09;
- TButton *btnPCL10;
- TButton *btnPCL11;
- TButton *btnPCL12;
- TButton *btnPCL13;
- TButton *btnPCL14;
- TButton *btnPCL15;
- TButton *btnSaveToFile;
- TButton *btnUpLeft;
- TButton *btnUpRight;
- TButton *btnUploadFromFlash;
- TEdit *edtHighApcDcOffset;
- TEdit *edtRampDn00;
- TEdit *edtRampDn01;
- TEdit *edtRampDn02;
- TEdit *edtRampDn03;
- TEdit *edtRampDn04;
- TEdit *edtRampDn05;
- TEdit *edtRampDn06;
- TEdit *edtRampDn07;
- TEdit *edtRampDn08;
- TEdit *edtRampDn09;
- TEdit *edtRampDn10;
- TEdit *edtRampDn11;
- TEdit *edtRampDn12;
- TEdit *edtRampDn13;
- TEdit *edtRampDn14;
- TEdit *edtRampDn15;
- TEdit *edtRampUp00;
- TEdit *edtRampUp01;
- TEdit *edtRampUp02;
- TEdit *edtRampUp03;
- TEdit *edtRampUp04;
- TEdit *edtRampUp05;
- TEdit *edtRampUp06;
- TEdit *edtRampUp07;
- TEdit *edtRampUp08;
- TEdit *edtRampUp09;
- TEdit *edtRampUp10;
- TEdit *edtRampUp11;
- TEdit *edtRampUp12;
- TEdit *edtRampUp13;
- TEdit *edtRampUp14;
- TEdit *edtRampUp15;
- TEdit *edtTestArfcn;
- TEdit *edtWtARFCN00;
- TEdit *edtWtARFCN01;
- TEdit *edtWtARFCN02;
- TEdit *edtWtARFCN03;
- TEdit *edtWtARFCN04;
- TEdit *edtWtARFCN05;
- TEdit *edtWtARFCN06;
- TEdit *edtWtARFCN07;
- TEdit *edtWtARFCN08;
- TEdit *edtWtARFCN09;
- TEdit *edtWtARFCN10;
- TEdit *edtWtHigh00;
- TEdit *edtWtHigh01;
- TEdit *edtWtHigh02;
- TEdit *edtWtHigh03;
- TEdit *edtWtHigh04;
- TEdit *edtWtHigh05;
- TEdit *edtWtHigh06;
- TEdit *edtWtHigh07;
- TEdit *edtWtHigh08;
- TEdit *edtWtHigh09;
- TEdit *edtWtHigh10;
- TEdit *edtWtLow00;
- TEdit *edtWtLow01;
- TEdit *edtWtLow02;
- TEdit *edtWtLow03;
- TEdit *edtWtLow04;
- TEdit *edtWtLow05;
- TEdit *edtWtLow06;
- TEdit *edtWtLow07;
- TEdit *edtWtLow08;
- TEdit *edtWtLow09;
- TEdit *edtWtLow10;
- TEdit *edtWtPCL00;
- TEdit *edtWtPCL01;
- TEdit *edtWtPCL02;
- TEdit *edtWtPCL03;
- TEdit *edtWtPCL04;
- TEdit *edtWtPCL05;
- TEdit *edtWtPCL06;
- TEdit *edtWtPCL07;
- TEdit *edtWtPCL08;
- TEdit *edtWtPCL09;
- TEdit *edtWtPCL10;
- TLabel *lblHighApcDcOffset;
- TLabel *lblHighWt;
- TLabel *lblLowWt;
- TLabel *lblMaxARFCN;
- TLabel *lblMidPCL;
- TLabel *lblPCL;
- TLabel *lblPclDac;
- TLabel *lblRampDown;
- TLabel *lblRampUp;
- TLabel *lblTestArfcn;
- TOpenDialog *OpenDialog;
- TPanel *pnlPCL;
- TPanel *pnlProfileTItle;
- TPanel *pnlRamp;
- TPanel *pnlWeight;
- TPanel *pnlWeightTitle;
- TSaveDialog *SaveDialog;
- TTabControl *tctlAPC;
- TStaticText *lblHint;
- TTimer *HintTimer;
- TPanel *pnlBatteryCompensateTitle;
- TPanel *pnlBatteryCompensate;
- TEdit *edtBatteryCompensate00;
- TEdit *edtBatteryCompensate01;
- TEdit *edtBatteryCompensate02;
- TEdit *edtBatteryCompensate10;
- TEdit *edtBatteryCompensate11;
- TEdit *edtBatteryCompensate12;
- TEdit *edtBatteryCompensate20;
- TEdit *edtBatteryCompensate21;
- TEdit *edtBatteryCompensate22;
- TLabel *Label1;
- TLabel *Label2;
- TLabel *Label3;
- TLabel *Label4;
- TLabel *Label5;
- TLabel *Label6;
- TButton *btnChangeDB;
- TStatusBar *sbAPCProfile;
- TPanel *pnlTxAfcOffsetHeader;
- TPanel *pnlTxAfcOffset;
- TEdit *edtTxAfcOffset;
- TEdit *edtPCLDAC00;
- TEdit *edtPCLDAC01;
- TEdit *edtPCLDAC02;
- TEdit *edtPCLDAC03;
- TEdit *edtPCLDAC04;
- TEdit *edtPCLDAC05;
- TEdit *edtPCLDAC06;
- TEdit *edtPCLDAC07;
- TEdit *edtPCLDAC08;
- TEdit *edtPCLDAC09;
- TEdit *edtPCLDAC10;
- TEdit *edtPCLDAC11;
- TEdit *edtPCLDAC12;
- TEdit *edtPCLDAC13;
- TEdit *edtPCLDAC14;
- TEdit *edtPCLDAC15;
- TBitBtn *btnTXStop;
- TPanel *pnlCAL3Mode;
- TPanel *pnlCAL3ModeHeader;
- TLabel *Label10;
- TEdit *edtAP;
- TLabel *Label11;
- TEdit *edtAS;
- TLabel *Label12;
- TEdit *edtAO;
- TLabel *Label13;
- TEdit *edtBD;
- TLabel *lblBVReg;
- TButton *btnSetCAL3ModeToRegister;
- TLabel *Label7;
- TStaticText *stNVRAMDB;
- TLabel *Label8;
- TStaticText *stBvmode;
- TCheckBox *cbC3ModeEnable;
- TEdit *edtTN;
- TEdit *edtTO;
- TLabel *lblTN;
- TLabel *lblTO;
- TComboBox *cbxTsc;
- TLabel *lblLabel43;
- TEdit *edtAfc;
- TLabel *lblLabel45;
- TLabel *Label9;
- TLabel *lblLowApcDcOffset;
- TEdit *edtLowApcDcOffset;
- TLabel *lblAPCLowestPower;
- TEdit *edtAPCLowestPower;
- TLabel *Label14;
- void __fastcall DownloadToFlashStart(TObject *Sender);
- void __fastcall FormShow(TObject *Sender);
- void __fastcall OnBtnPclClick(TObject *Sender);
- void __fastcall UploadFromFlashStart(TObject *Sender);
- void __fastcall btnLeftClick(TObject *Sender);
- void __fastcall btnLoadFromFileClick(TObject *Sender);
- void __fastcall btnRightClick(TObject *Sender);
- void __fastcall btnSaveToFileClick(TObject *Sender);
- void __fastcall btnTXStartClick(TObject *Sender);
- void __fastcall edtHighApcDcOffsetCheck(TObject *Sender);
- void __fastcall edtPCLDACCheck(TObject *Sender);
- void __fastcall edtRampDnCheck(TObject *Sender);
- void __fastcall edtRampUpCheck(TObject *Sender);
- void __fastcall edtTestArfcnCheck(TObject *Sender);
- void __fastcall edtWtARFCNCheck(TObject *Sender);
- void __fastcall edtWtHighCheck(TObject *Sender);
- void __fastcall edtWtLowCheck(TObject *Sender);
- void __fastcall edtWtPCLCheck(TObject *Sender);
- void __fastcall tctlAPCChange(TObject *Sender);
- void __fastcall FormActivate(TObject *Sender);
- void __fastcall HintTimerTimer(TObject *Sender);
- void __fastcall FormHide(TObject *Sender);
- void __fastcall edtBatteryCompensateCheck(TObject *Sender);
- void __fastcall btnChangeDBClick(TObject *Sender);
- void __fastcall btnGUIRampClick(TObject *Sender);
- void __fastcall edtTxAfcOffsetCheck(TObject *Sender);
- void __fastcall btnTXStopClick(TObject *Sender);
- void __fastcall cbBVClick(TObject *Sender);
- void __fastcall edtAPCheck(TObject *Sender);
- void __fastcall edtASCheck(TObject *Sender);
- void __fastcall edtAOCheck(TObject *Sender);
- void __fastcall edtBDCheck(TObject *Sender);
- void __fastcall edtAOFCheck(TObject *Sender);
- void __fastcall edtBVW12Check(TObject *Sender);
- void __fastcall edtBVW13Check(TObject *Sender);
- void __fastcall edtBVW14Check(TObject *Sender);
- void __fastcall edtTNCheck(TObject *Sender);
- void __fastcall edtTOCheck(TObject *Sender);
- void __fastcall edtPMCheck(TObject *Sender);
- void __fastcall cbC3ModeEnableClick(TObject *Sender);
- void __fastcall edtTCCheck(TObject *Sender);
- void __fastcall edtTBCheck(TObject *Sender);
- void __fastcall btnSetCAL3ModeToRegisterClick(TObject *Sender);
- void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
- void __fastcall FormCreate(TObject *Sender);
- void __fastcall edtAfcDacCheck(TObject *Sender);
- void __fastcall edtLowApcDcOffsetCheck(TObject *Sender);
- void __fastcall edtAPCLowestPowerCheck(TObject *Sender);
- private: // User declarations
- // common
- bool m_bInit;
- bool m_bFirstFormShow;
- TEdit *edtPCLDAC[16];
- TButton *btnPCL[16];
- TEdit *edtRampUp[16];
- TEdit *edtRampDn[16];
- TEdit *edtWtARFCN[12];
- TEdit *edtWtHigh[12];
- TEdit *edtWtLow[12];
- TEdit *edtWtPCL[12];
- TEdit *edtBatteryCompensateArray[3][3];
- int lastTabIndex;
- unsigned int m_uiFinalRFID;
- bool isSetCal3ModeTrigger;
- bool m_bTADOSupport;
- // band
- unsigned int BandSupportArray[MAX_SUPPORT_BAND_NUM];
- // Renesas
- RF_BRIGHT5P_Coef_T b5p_coef;
- sC3Mode c3mode;
- sBVW0 bvw640;
- sBVW0 bvw650;
- sBVW0 bvw660;
- sBVW0 bvw670;
- sBVW2 bvw2[MAX_RENESAS_BV_WORD_NUM];
- bool m_bDownloadTrigger;
- E_BANDSEL m_eCurBand;
- int m_iCurPCLIndex;
- short m_sTestArfcn[MAX_SUPPORT_BAND_NUM]; // GSM900, DCS1800, PCS1900, GSM 850
- unsigned short m_usHighApcDcOffset[MAX_SUPPORT_BAND_NUM];
- unsigned short m_usLowApcDcOffset[MAX_SUPPORT_BAND_NUM];
- int m_iApcLowestPower[MAX_SUPPORT_BAND_NUM];
- short tx_afc_offset[MAX_SUPPORT_BAND_NUM];
- CRFTX *RF_TX_Obj;
- CRFAPC *RF_APC_Obj;
- l1cal_rampTable_T m_sRFCal_RamTable[MAX_SUPPORT_BAND_NUM];
- char m_cTsc;
- short m_sAfcDac;
- APCTxPattern m_eBurstType;
- // query
- sTRFTADO t_RfTado;
- sTRFSETRAMP t_RfSetRamp;
- protected:
- void ShowHintLabel(TControl *sender, char* hint);
- public: // User declarations
- __fastcall TfrmApcProfile(TComponent* Owner);
- void _fastcall SubClassWndProc(Messages::TMessage &Message);
- // common
- bool read_db_file(AnsiString asFileName);
- void UpdateDBFileCaption(AnsiString asFileName);
- // call back
- void ConfirmCallback_RfSetRampTable(void);
- void ConfirmCallback_TX(void);
- void UploadApcFromFlashDone(void);
- void UploadB5PFromFlashDone(void);
- void DownloadApcToFlashDone(void);
- void DownloadB5PToFlashDone(void);
- void CNF_SetB5PToReg(void);
- void CNF_SetW6sImmediateBSI(void);
- // UI
- void DisplayTADOUI(bool b_tado_support);
- void read_APC_files_setup(AnsiString asSetupFile, AnsiString asExeName);
- void read_APC_db_file(AnsiString asFileName);
- void write_APC_files_setup(AnsiString asSetupFile, AnsiString asExeName);
- void CurrentPageLock(void);
- void CurrentPageReset(void);
- void ReDrawFields(int draw_mask);
- bool CheckFields(void);
- // band
- // Renesas
- void Compose_C3Reg(int tn, int to, int pm, int &c3reg);
- void DeCompose_C3Reg(int c3reg, int &tn, int &to, int &pm);
- void Display_RenesasUI(int band_mode);
- void Display_Word3(void);
- void Display_Word6s(int band_mode);
- void Display_C3WordEditor(void);
- void Display_BVW64(void);
- void Display_BVW65(void);
- void Display_BVW66(void);
- void Display_BVW67(void);
- bool ComposeRenesasField(void);
- bool DeComposeRenesasField(void);
- void Get_CurrentWord6s(unsigned int &cur_w6s);
- // query
- void __fastcall on_QueryTwoApcDcOffset_Fail(TObject *Sender);
- void __fastcall on_QueryTwoApcDcOffset_TerminateSuccess(TObject *Sender);
- void Query_TwoApcDcOffset_Support(void);
- void __fastcall on_QueryRfSetRampTableSupport_Fail(TObject *Sender);
- void __fastcall on_QueryRfSetRampTableSupport_TerminateSuccess(TObject *Sender);
- void Query_RfSetRampTable_Support(void);
- // Global information
- void Init(void);
- void Set_RF_APC_Obj(CRFAPC *rf_apc_obj);
- void Set_RF_TX_Obj(CRFTX *rf_tx_obj);
- void Set_Tsc(int tsc);
- void Set_AfcDac(int afc_dac);
- void Set_BurstType(APCTxPattern burst_type);
- };
- //---------------------------------------------------------------------------
- extern PACKAGE TfrmApcProfile *frmApcProfile;
- //---------------------------------------------------------------------------
- #endif