form_Main.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:19k
- /*****************************************************************************
- * 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_Main.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Main selection 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_MAIN_H_
- #define _FORM_MAIN_H_
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <Buttons.hpp>
- #include <ExtCtrls.hpp>
- #include <Dialogs.hpp>
- #include <Menus.hpp>
- #include <ActnList.hpp>
- #include <ComCtrls.hpp>
- #include <Classes.hpp>
- //#include "meta.h"
- #include "NVRAMEditor.h"
- #include "form_melody.h"
- #include "form_imelody.h"
- #include "form_ringComposer.h"
- #include "MfSetupUtil.h"
- #include "com_enum.h"
- #include "META_factory_ADC_type.h"
- #ifndef _MAN_HANDLE_H_
- #include "man_handle.h"
- #endif
- #ifndef _RF_ID_H_
- #include "rf_id.h"
- #endif
- #ifndef _RF_BAND_H_
- #include "rf_band.h"
- #endif
- #ifndef _RF_APC_H_
- #include "rf_apc.h"
- #endif
- // BT
- #ifndef _BT_ID_H_
- #include "bt_id.h"
- #endif
- // WiFi
- #ifndef _WIFI_GNRL_H_
- #include "wifi_gnrl.h"
- #endif
- // thread
- #ifndef _GNRL_MSCAP_THRD_H_
- #include "gnrl_mscap_thrd.h"
- #endif
- #ifndef _RF_ID_THRD_H_
- #include "rf_id_thrd.h"
- #endif
- // equipment
- #ifndef _DCS_CTRL_H_
- #include "dcs_ctrl.h"
- #endif
- // audio
- //#ifndef _SP_COEF_H_
- //#include "sp_coef.h"
- //#endif
- // security
- #ifndef _SLA_H_
- #include "sla.h"
- #endif
- // EGDE card
- #ifndef _PCMCIA_POWER_H_
- #include "pcmcia_power.h"
- #endif
- //---------------------------------------------------------------------------
- //#define MSEL_MAIN_MENU -1
- typedef enum
- {
- BAUD_RATE_AUTO_INDEX=0,
- BAUD_RATE_57600_INDEX,
- BAUD_RATE_115200_INDEX,
- BAUD_RATE_230400_INDEX,
- BAUD_RATE_460800_INDEX,
- BAUD_RATE_921600_INDEX
- }E_BAUD_RATE_INDEX;
- #define MAX_WAIT_FOR_TARGET_READY_COUNT 150
- //---------------------------------------------------------------------------
- class TfrmMainSel : public TForm
- {
- __published: // IDE-managed Components
- TTimer *glbTimer;
- TComboBox *cbxOperation;
- TComboBox *cbxCOM;
- TShape *shpConnect;
- TMainMenu *MainMenu1;
- TMenuItem *Action1;
- TMenuItem *mnuOpenFDMDatabase;
- TMenuItem *N1;
- TMenuItem *mnuHelp;
- TMenuItem *mnuAbout;
- TPanel *pnlResetTarget;
- TMenuItem *mnu12193Convert;
- TGroupBox *GroupBox3;
- TRadioButton *rbSoftware;
- TRadioButton *rbHardware;
- TActionList *ActionList1;
- TAction *ToggleBromDebug;
- TAction *ToggleMETADebug;
- TButton *btnReconnect;
- TComboBox *cbBaudrate;
- TLabel *Label1;
- TTimer *HintTimer;
- TStaticText *lblHint;
- TMenuItem *Option1;
- TMenuItem *Basebandchip1;
- TMenuItem *Externalclock1;
- TMenuItem *miAutodetectBB;
- TMenuItem *miMT6205;
- TMenuItem *miMT6205B;
- TMenuItem *miMT6217;
- TMenuItem *miMT6218;
- TMenuItem *miMT6218B;
- TMenuItem *miMT6219;
- TMenuItem *mi13MHz;
- TMenuItem *mi26MHz;
- TMenuItem *mi39MHz;
- TMenuItem *mi52MHz;
- TLabel *Label2;
- TStaticText *stBasebandChip;
- TLabel *Label3;
- TStaticText *stExtClock;
- TStaticText *stRFID;
- TLabel *lblRFID;
- TStaticText *stGSM850;
- TStaticText *stGSM900;
- TStaticText *stDCS1800;
- TStaticText *stPCS1900;
- TMenuItem *miMT6228;
- TGroupBox *GroupBox4;
- TCheckBox *cbGSM850;
- TCheckBox *cbAutoControlPowerSupply;
- TMenuItem *miMT6227;
- TMenuItem *miMT6229;
- TMenuItem *miMT6226;
- TMenuItem *miMT6226M;
- TStaticText *st802_11a;
- TStaticText *st802_11b;
- TStaticText *st802_11g;
- TLabel *lblWiFiBbChip;
- TStaticText *stWiFiBbChip;
- TLabel *lblWiFiRfChip;
- TAction *LogClear;
- TStaticText *stMETALog;
- TStaticText *stBROMLog;
- TMenuItem *miAutodetectExt;
- TMenuItem *miOpenAuthenticationfile;
- TAction *ToggleHide;
- TMenuItem *miUnitTest;
- TOpenDialog *dlgOpenAuth;
- TStaticText *stSingleBankFlash;
- TMenuItem *miMT6225;
- TOpenDialog *OpenDialog;
- TStaticText *stWiFiRfChip;
- TMenuItem *m_miMT6223;
- TMenuItem *m_miMT6227D;
- TMenuItem *m_miMT6230;
- TMenuItem *m_miMT6268T;
- TLabel *m_lblBTBbChip;
- TStaticText *m_stBTBbChip;
- TLabel *m_lblTargetBaudrate;
- TStaticText *m_stTargetBaudrate;
- TStaticText *m_stFM;
- TLabel *m_lblFM;
- TMenuItem *miMT6226D;
- TMenuItem *m_miMT6223P;
- TMenuItem *m_miMT6235;
- TMenuItem *m_miMT6238;
- TButton *m_btnDisconnect;
- TMenuItem *m_miTK6516AP;
- TMenuItem *m_miTK6516MD;
- TMenuItem *m_miConInMetaMode;
- void __fastcall cbxOperationChange(TObject *Sender);
- void __fastcall btnConnectClick(TObject *Sender);
- void __fastcall cbxCOMChange(TObject *Sender);
- void __fastcall FormShow(TObject *Sender);
- void __fastcall mnuFDMDatabaseClick(TObject *Sender);
- void __fastcall mnuResetL1Click(TObject *Sender);
- void __fastcall mnuCOMClick(TObject *Sender);
- void __fastcall mnuExitClick(TObject *Sender);
- void __fastcall mnuAboutClick(TObject *Sender);
- void __fastcall FormDestroy(TObject *Sender);
- void __fastcall mnu12193ConvertClick(TObject *Sender);
- // void __fastcall rb6205BClick(TObject *Sender);
- // void __fastcall rb6205Click(TObject *Sender);
- /// void __fastcall rb13MHzClick(TObject *Sender);
- // void __fastcall rb26MHzClick(TObject *Sender);
- // void __fastcall rb6218Click(TObject *Sender);
- void __fastcall ToggleBromDebugExecute(TObject *Sender);
- void __fastcall ToggleMETADebugExecute(TObject *Sender);
- // void __fastcall rb6218BClick(TObject *Sender);
- void __fastcall rbSoftwareClick(TObject *Sender);
- void __fastcall rbHardwareClick(TObject *Sender);
- void __fastcall btnReconnectClick(TObject *Sender);
- void __fastcall cbSyncWithTargetClick(TObject *Sender);
- void __fastcall cbBaudrateChange(TObject *Sender);
- // void __fastcall rb6219Click(TObject *Sender);
- void __fastcall HintTimerTimer(TObject *Sender);
- void __fastcall Button1Click(TObject *Sender);
- void __fastcall cbAutoControlPowerSupplyClick(TObject *Sender);
- void __fastcall glbTimerTimer(TObject *Sender);
- void __fastcall FormCreate(TObject *Sender);
- void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
- // void __fastcall rb6217Click(TObject *Sender);
- void __fastcall miAutodetectBBClick(TObject *Sender);
- void __fastcall miMT6205Click(TObject *Sender);
- void __fastcall miMT6217Click(TObject *Sender);
- void __fastcall miMT6218Click(TObject *Sender);
- void __fastcall miMT6218BClick(TObject *Sender);
- void __fastcall miMT6219Click(TObject *Sender);
- void __fastcall mi13MHzClick(TObject *Sender);
- void __fastcall mi26MHzClick(TObject *Sender);
- void __fastcall miMT6205BClick(TObject *Sender);
- void __fastcall miMT6208Click(TObject *Sender);
- void __fastcall mi39MHzClick(TObject *Sender);
- void __fastcall mi52MHzClick(TObject *Sender);
- void __fastcall cbGSM850Click(TObject *Sender);
- void __fastcall miMT6228Click(TObject *Sender);
- void __fastcall miMT6227Click(TObject *Sender);
- void __fastcall miMT6229Click(TObject *Sender);
- void __fastcall miMT6226Click(TObject *Sender);
- void __fastcall miMT6226MClick(TObject *Sender);
- void __fastcall LogClearExecute(TObject *Sender);
- void __fastcall miOpenAuthenticationfileClick(TObject *Sender);
- void __fastcall miAutodetectExtClick(TObject *Sender);
- void __fastcall ToggleHideExecute(TObject *Sender);
- void __fastcall miUnitTestClick(TObject *Sender);
- void __fastcall miMT6225Click(TObject *Sender);
- void __fastcall m_miMT6223Click(TObject *Sender);
- void __fastcall m_miMT6227DClick(TObject *Sender);
- void __fastcall m_miMT6230Click(TObject *Sender);
- void __fastcall m_miMT6268TClick(TObject *Sender);
- void __fastcall miMT6226DClick(TObject *Sender);
- void __fastcall m_miMT6223PClick(TObject *Sender);
- void __fastcall m_miMT6235Click(TObject *Sender);
- void __fastcall m_miMT6238Click(TObject *Sender);
- void __fastcall m_btnDisconnectClick(TObject *Sender);
- void __fastcall m_miTK6516APClick(TObject *Sender);
- void __fastcall m_miTK6516MDClick(TObject *Sender);
- void __fastcall m_miConInMetaModeClick(TObject *Sender);
- private: // User declarations
- int m_iComPort;
- TForm *m_ActForm[TOTAL_MENU_ITEMS];
- int m_iActFormCount;
- // initilization
- bool m_bInit;
- CMETAHANDLE m_META_HANDLE_Obj;
- bool b_open_NVRAM_database;
- AnsiString as_DELAY_TIME_BEFORE_ACCESS_NVRAM;
- // debug
- bool m_bMetaDebugOn;
- bool m_bBRomDebugOn;
- // Main menu item
- AnsiString m_asMenuSelection;
- AnsiString m_asCOM;
- AnsiString m_asBaseband_chip;
- AnsiString m_asClock_rate;
- AnsiString m_asDisable_HW_flow_control;
- AnsiString m_asFlow_control;
- AnsiString m_asTstMsgFormat;
- AnsiString m_asGSM850_support;
- AnsiString m_asAuto_control_power_supply;
- AnsiString m_asBaudrate;
- // UI setting
- bool m_lastMenuItemAutoDetectBBCheck;
- bool m_lastMenuItem6205Check;
- bool m_lastMenuItem6205BCheck;
- bool m_lastMenuItem6208Check;
- bool m_lastMenuItem6218Check;
- bool m_lastMenuItem6218BCheck;
- bool m_lastMenuItem6219Check;
- bool m_lastMenuItem6217Check;
- bool m_lastMenuItem6223Check;
- bool m_lastMenuItem6223PCheck;
- bool m_lastMenuItem6225Check;
- bool m_lastMenuItem6226Check;
- bool m_lastMenuItem6226DCheck;
- bool m_lastMenuItem6226MCheck;
- bool m_lastMenuItem6227Check;
- bool m_lastMenuItem6227DCheck;
- bool m_lastMenuItem6228Check;
- bool m_lastMenuItem6229Check;
- bool m_lastMenuItem6230Check;
- bool m_lastMenuItem6235Check;
- bool m_lastMenuItem6238Check;
- bool m_lastMenuItem6268TCheck;
- bool m_lastMenuItemTK6516APCheck;
- bool m_lastMenuItemTK6516MDCheck;
- bool m_lastMenuItem13MHzCheck;
- bool m_lastMenuItem26MHzCheck;
- bool m_lastMenuItem39MHzCheck;
- bool m_lastMenuItem52MHzCheck;
- bool m_lastMenuItemAutodetectExtCheck;
- bool m_lastrbHardwareCheck;
- bool m_lastrbSoftwareCheck;
- // syn with target
- unsigned short ComPortArray[MAX_SUPPORT_COM_NUM];
- unsigned short ComPortCount;
- unsigned int meta_ver_required_by_target;
- int currentBaudRateIndex;
- // Power supply control
- // AnsiString as_Power_Supply_GPIB_Addr;
- int m_iPowerSupplyOnCount;
- int m_iPowerSupplyOffCount;
- int m_iPowerSupplyTriggerTime;
- int m_iPower_on_off_count;
- S_DCS m_dcs;
- CDCSCTRL m_dcs_ctrl;
-
- //bool result;
- TYPE_META_FACTORY_ADC_CONTROL MF_ADC_ctrl;
- int i_NORMAL_VOLTAGE;
- int i_CURRENT_LIMIT;
- int i_OFF_VOLTAGE;
- int isUserPress;
- // RF ID
- CRFID RF_ID_Obj;
- unsigned int m_uiFinalRFID;
- // band
- // CRFBAND RF_BAND_Obj;
- // RFBandSupport_S final_band_support;
- // capability
- // RfMsCapability_S final_ms_cap;
- RfMsCapabilityEx_S m_sFinalMSCAP;
- CWIFIGNRL WIFI_GNRL_Obj;
- sTGnrlMscap t_gnrl_mscap;
- bool m_bWiFiSupport;
- WiFi_ChipCapability_S m_sWiFiCap;
- unsigned char m_ucPmSupportNum;
- // two APC DC offset
- bool m_bTadoSupport;
- CRFAPC RF_APC_Obj;
- // BT
- CBTID m_BT_ID_Obj;
- BT_ModuleID_S m_sBTModuleID;
- // FM
- bool m_bFMSupport;
- FM_CHIP_ID_CNF_T m_FMChipId;
- // audio
- // security
- CSLA SLA_Obj;
- AnsiString m_asAuthFileName;
- // Power supply
- bool is_PowerSupply_open;
- // EDGE card
- CPCMCIAPOWER m_cPCMCIA_POWER_Obj;
- protected:
- public:
- // syn with target
- int BootResult;
- int BootStop;
- int iCOM;
- META_Connect_Req META_connect_req;
- META_Connect_Report META_connect_report;
- META_RESULT META_connect_result;
- int NeedToReboot;
- bool isReconnect;
- int ResetCount;
- META_COMM_BAUDRATE META_baudrate;
- AnsiString as_NVRAM_database_file_name;
- // initialization
- void Init( void );
- // function
- __fastcall TfrmMainSel(TComponent* Owner);
- void SetTSTMessageFormat(void);
- void __fastcall FDMDatabaseInit(AnsiString asFileName);
- void ChangeComPort( int com_port );
- void UartDisconnect( void );
- void __fastcall tb_Init_NVRAMClick(TObject *Sender);
- // timer
- void TimerStart( int timeout_count );
- void TimerStop();
- void ExitMainMenu( void );
- // sync with target
- void DisableGlbTimer(void);
- void SetConnectReqType(void);
- void SetMetaConnectReq(void);
- void SetConnectInMETAModeReq(void);
- void get_META_baudrate(void);
- void RestartBootPolling(void);
- void RestartCommStart(void);
- AnsiString getBBChipWarningMsg(void);
- // query
- void QuerySingleBankFlash(void);
- void QueryRfMsCap(void);
- void QueryRfId(void);
- void Query_TwoApcDcOffset_Support(void);
- void QueryWiFiSupport(void);
- void QueryWiFiCapbility(void);
- void QueryBTMoudleID(void);
- void QueryPmSupportNum(void);
- void QueryFMInfo(void);
- // UI
- void _fastcall SubClassWndProc( Messages::TMessage &Message);
- void ApplyHideProperty( void );
- // void ShowMainMenuSetting( void );
- void EnableComponents( bool enable );
- void ShowHintLabel( TControl *sender, char* hint );
- void getMenuPopupLocation( int menu_index, int* left, int* top );
- void ReDisplayBaudRate( void );
- bool RestartCOMMPolling( void );
- void DisplayMainMenuSetting( void );
- void DisplayBaseBandChip( void );
- void DisplayExternalClockRate( void );
- void DisplayFinalRFID(int rf_id);
- void DisplayFinalBaseBandChip(BBCHIP_TYPE bbchip);
- void DisplayFinalExternalClock(EXT_CLOCK ext_clock);
- void DisplayFinalTargetBaudrate(META_COMM_BAUDRATE baudrate);
- void DisplayFinalBandSupport(void);
- void DisplayWiFiCapbility(WiFi_ChipCapability_S &wifi_cap);
- void DisplayBTBbChip(void);
- void DisplayFMChip(void);
- void SaveMainMenuSetting(void);
- void ReconnectButtonClick(void);
- void __fastcall miBBChipClickCommon(void);
- //CDCSCTRL dcs_ctrl;
- //sDCS dcs;
- AnsiString getPowerSupplyGPIBAddr( void );
- bool InitPowerSupply( void );
- bool SetPowerSupplyNormalVoltage( void );
- bool SetPowerSupplyOffVoltage( void );
- bool ClosePowerSupply( void );
- // global information
- BBCHIP_TYPE Get_FinalBBChip( void );
- RfMsCapabilityEx_S Get_FinalMSCap(void);
- WiFi_ChipCapability_S Get_FinalWiFiCap(void);
- bool Get_TADO_Support( void );
- BT_ModuleID_S* Get_BTMoudleID(void);
- AnsiString Get_NVRAMDBFileName(void);
- BBCHIP_TYPE Get_CurBBChipType(void);
- BBCHIP_TYPE Get_BBChipType(AnsiString as_BBChip);
- RfMsBandSupportBits Get_FinalBandSupport(void);
- EXT_CLOCK Get_CurExternalClockType(void);
- EXT_CLOCK Get_ExternalClockType(AnsiString as_ExtClock);
- META_FLOWCTRL GetFlowControlType(void);
- unsigned int Get_FinalRFID(void);
- unsigned char Get_PmSupportNum(void);
- META_FLOWCTRL GetCurFlowControlType(void);
- META_FLOWCTRL GetFlowControlType( AnsiString as_flow_ctrl );
- bool Get_METADebug(void);
- bool Get_BRomDebug(void);
- // call back
- void CNF_NVRAMInitial( void );
- void __fastcall on_QueryRfMsCap_Fail(TObject *Sender);
- void __fastcall on_QueryRfMsCap_TerminateSuccess(TObject *Sender);
- void __fastcall on_QueryRFID_Fail(TObject *Sender);
- void __fastcall on_QueryRFID_TerminateSuccess(TObject *Sender);
- CSLA* Get_SLA_Object( void );
- AnsiString Get_AuthFileName( void );
- };
- //---------------------------------------------------------------------------
- extern PACKAGE TfrmMainSel *frmMainSel;
- //---------------------------------------------------------------------------
- #endif