form_RFGUIApcProfile.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:14k
- /*****************************************************************************
- * 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_RFGUIApcProfile.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * RF graphic interface 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_RFGUIAPCPROFILE_H_
- #define _FORM_RFGUIAPCPROFILE_H_
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <ComCtrls.hpp>
- #include <ExtCtrls.hpp>
- #include <Buttons.hpp>
- #include <Dialogs.hpp>
- //----------------------------------------------------------------------------
- // RF
- #ifndef _RF_APC_H_
- #include "rf_apc.h"
- #endif
- #ifndef _RF_TX_H_
- #include "rf_tx.h"
- #endif
- // thread
- #ifndef _RF_TADO_THRD_H_
- #include "rf_tado_thrd.h"
- #endif
- #ifndef _RF_SETRAMP_THRD_H_
- #include "rf_setramp_thrd.h"
- #endif
- // NVRAM
- #ifndef _NVRAM_COMMON_H_
- #include "nvram_common.h"
- #endif
- //---------------------------------------------------------------------------
- class TfrmGUIApcProfile : public TForm
- {
- __published: // IDE-managed Components
- TImage *imRampProfile;
- TPanel *pnlProfileTItle;
- TButton *btnUploadFromFlash;
- TButton *btnDownloadToFlash;
- TButton *btnChangeDB;
- TStatusBar *sbGUIAPCProfile;
- TPanel *pnlRamp;
- TLabel *lblRampUp;
- TLabel *lblRampDown;
- 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 *edtRampUp13;
- TEdit *edtRampUp12;
- TEdit *edtRampUp14;
- TEdit *edtRampUp15;
- 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;
- TButton *btnUpLeft;
- TButton *btnUpRight;
- TButton *btnDnLeft;
- TButton *btnDnRight;
- TPanel *pnlPCL;
- TLabel *lblPclDac;
- TLabel *lblPCL;
- 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 *edtPCLDAC13;
- TEdit *edtPCLDAC12;
- TEdit *edtPCLDAC14;
- TEdit *edtPCLDAC15;
- 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;
- TLabel *lblVertical0;
- TLabel *lblVertical1;
- TLabel *lblVertical2;
- TLabel *lblVertical3;
- TLabel *lblVertical4;
- TLabel *lblVertical5;
- TLabel *lblVertical6;
- TLabel *lblVertical7;
- TLabel *lblVertical8;
- TLabel *lblVertical9;
- TLabel *lblRampUpH0;
- TLabel *lblRampUpH1;
- TLabel *lblRampUpH2;
- TLabel *lblRampUpH3;
- TLabel *lblRampUpH4;
- TLabel *lblRampDownH0;
- TLabel *lblRampDownH1;
- TLabel *lblRampDownH2;
- TLabel *lblRampDownH3;
- TLabel *lblRampDownH4;
- TLabel *Label1;
- TLabel *Label2;
- TLabel *Label3;
- TLabel *Label4;
- TLabel *Label5;
- TLabel *Label6;
- TLabel *Label7;
- TLabel *Label8;
- TLabel *Label9;
- TLabel *Label10;
- TLabel *Label11;
- TLabel *Label12;
- TLabel *Label13;
- TLabel *Label14;
- TLabel *Label15;
- TLabel *Label16;
- TLabel *lblRampUpH5;
- TLabel *lblRampDownH5;
- TLabel *lblRampUpH6;
- TLabel *lblRampUpH7;
- TLabel *lblRampUpH8;
- TLabel *lblRampUpH9;
- TLabel *lblRampUpH10;
- TLabel *lblRampUpH11;
- TLabel *lblRampUpH12;
- TLabel *lblRampUpH13;
- TLabel *lblRampUpH14;
- TLabel *lblRampUpH15;
- TLabel *lblRampDownH6;
- TLabel *lblRampDownH7;
- TLabel *lblRampDownH8;
- TLabel *lblRampDownH9;
- TLabel *lblRampDownH10;
- TLabel *lblRampDownH11;
- TLabel *lblRampDownH12;
- TLabel *lblRampDownH13;
- TLabel *lblRampDownH14;
- TLabel *lblRampDownH15;
- TStaticText *lblHint;
- TTimer *HintTimer;
- TEdit *edtTestArfcn;
- TLabel *lblTestArfcn;
- TBitBtn *btnTXStart;
- TEdit *edtHighApcDcOffset;
- TLabel *lblHighApcDcOffset;
- TTabControl *tctlAPC;
- TButton *btnLoadFromFile;
- TButton *btnSaveToFile;
- TSaveDialog *SaveDialog;
- TOpenDialog *OpenDialog;
- TBitBtn *btnTXStop;
- TLabel *lblLowApcDcOffset;
- TEdit *edtLowApcDcOffset;
- TLabel *lblAPCLowestPower;
- TEdit *edtAPCLowestPower;
- TLabel *Label17;
- TStaticText *m_stNVRAMDB;
- TOpenDialog *m_dlgOpenDB;
- void __fastcall btnUploadFromFlashClick(TObject *Sender);
- void __fastcall FormShow(TObject *Sender);
- void __fastcall imRampProfileDragOver(TObject *Sender,
- TObject *Source, int X, int Y, TDragState State, bool &Accept);
- void __fastcall imRampProfileEndDrag(TObject *Sender,
- TObject *Target, int X, int Y);
- void __fastcall btnUpRightClick(TObject *Sender);
- void __fastcall btnDnRightClick(TObject *Sender);
- void __fastcall btnUpLeftClick(TObject *Sender);
- void __fastcall btnDnLeftClick(TObject *Sender);
- void __fastcall edtRampUpCheck(TObject *Sender);
- void __fastcall edtRampDnCheck(TObject *Sender);
- void __fastcall HintTimerTimer(TObject *Sender);
- void __fastcall btnTXStartClick(TObject *Sender);
- void __fastcall edtHighApcDcOffsetCheck(TObject *Sender);
- void __fastcall OnBtnPclClick(TObject *Sender);
- void __fastcall tctlAPCChange(TObject *Sender);
- void __fastcall edtPCLDACCheck(TObject *Sender);
- void __fastcall edtTestArfcnCheck(TObject *Sender);
- void __fastcall btnDownloadToFlashClick(TObject *Sender);
- void __fastcall btnLoadFromFileClick(TObject *Sender);
- void __fastcall btnSaveToFileClick(TObject *Sender);
- void __fastcall btnTXProfileSettingClick(TObject *Sender);
- void __fastcall FormActivate(TObject *Sender);
- void __fastcall FormHide(TObject *Sender);
- void __fastcall btnChangeDBClick(TObject *Sender);
- void __fastcall btnTXStopClick(TObject *Sender);
- void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
- void __fastcall FormCreate(TObject *Sender);
- void __fastcall edtLowApcDcOffsetCheck(TObject *Sender);
- void __fastcall edtAPCLowestPowerCheck(TObject *Sender);
- private: // User declarations
- // common
- unsigned int m_uiFinalRFID;
- bool m_bInit;
- bool m_bMultiSlotTxExSupport;
- E_NVRAM_TRIGGER m_eNvramTrigger;
- // UI
- TEdit *edtPCLDAC[16];
- TButton *btnPCL[16];
- TEdit *edtRampUp[16];
- TEdit *edtRampDn[16];
- // image
- int max_y_grid, min_y_grid;
- int vStart, hStart, vScale, hScale, vDistance, hDistance, Segments;
- TLabel *lblVertical[RAMP_VERTICAL_LABEL_NUM];
- TLabel *lblRampUpH[16], *lblRampDownH[16];
- bool isRampUpCircleOnDrag, isRampDownCircleOnDrag;
- bool m_bDragTrigger;
- int RampCircleOnDragIndex;
- CRFAPC *RF_APC_Obj;
- CRFTX *RF_TX_Obj;
- E_BANDSEL m_eCurBand;
- short m_sCurPCLIndex;
- int Tsc;
- short m_sAfcDac;
- APCTxPattern m_eBurstType;
- unsigned short m_usHighApcDcOffset[MAX_SUPPORT_BAND_NUM];
- unsigned short m_usLowApcDcOffset[MAX_SUPPORT_BAND_NUM];
- int ApcLowestPower[MAX_SUPPORT_BAND_NUM];
- short m_sTestArfcn[MAX_SUPPORT_BAND_NUM]; // GSM900, DCS1800, PCS1900, GSM 850
- int lastTabIndex;
- l1cal_rampTable_T m_sRFCal_RamTable[MAX_SUPPORT_BAND_NUM];
- l1cal_rampTable_T m_sOldRFCal_RamTable[MAX_SUPPORT_BAND_NUM];
- sRampPoint RampUpPoint, RampDownPoint;
- bool m_bTADOSupport;
- // query
- sTRFTADO t_RfTado;
- sTRFSETRAMP t_RfSetRamp;
- public: // User declarations
- __fastcall TfrmGUIApcProfile(TComponent* Owner);
- void _fastcall SubClassWndProc(Messages::TMessage &Message);
- // initialize
- void Set_RF_APC_Obj(CRFAPC *rf_apc_obj);
- void Set_RF_TX_Obj(CRFTX *rf_tx_obj);
- void Init(void);
- void ReDrawFields(int draw_mask);
- bool CheckFields(void);
- // DB file
- 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 read_db_file(AnsiString asFileName);
- void UpdateDBFileCaption(AnsiString asFileName);
- // image
- void ClearImage(void);
- void PlotGrid(int min_x, int max_x, int min_y, int max_y);
- void PlotRampProfileCurve(void);
- void PlotRampProfileCircle(void);
- void PlotCurve(int plot_mask);
- void UpdateRampdata(int ramp_flag, int idx);
- int ImageRangeCheck(int X, int Y);
- void getImageValidRange(sRfImageRange *p_ImageRange);
- bool RampDataChange(l1cal_rampTable_T *p_RFCal_RamTable1, l1cal_rampTable_T *p_RFCal_RamTable2 );
- // other UI
- void DisplayTADOUI(bool b_tado_support);
- void ShowHintLabel(TControl *sender, char* hint);
- void CurrentPageLock(void );
- void CurrentPageReset(void);
- // 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);
- // NVRAM
- void UploadFromFlash(void);
- void DownloadToFlash(void);
- // callback
- void ConfirmCallback_RfSetRampTable(void);
- void ConfirmCallback_TX(void);
- void CNF_NVRAM_Init(void);
- void CNF_ReadFromNVRAM(void);
- void UploadFromFlashDone(void);
- void DownloadToFlashDone(void);
- };
- //---------------------------------------------------------------------------
- extern PACKAGE TfrmGUIApcProfile *frmGUIApcProfile;
- //---------------------------------------------------------------------------
- #endif