rf_offset_iq_Sweep_Init_Age8960.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:8k
源码类别:
MTK
开发平台:
C++ Builder
- /*****************************************************************************
- * 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:
- * ---------
- * rf_offset_iq_sweep_Init_Age8960.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * RF offset IQ sweep Initalize Agilent 8960 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 _RF_OFFSET_IQ_SWEEP_INIT_AGE8960_H_
- #define _RF_OFFSET_IQ_SWEEP_INIT_AGE8960_H_
- #include <Classes.hpp>
- #ifndef _MAN_HANDLE_H_
- #include "man_handle.h"
- #endif
- // equipment
- #ifndef _RCT_COMMON_H_
- #include "rct_common.h"
- #endif
- #include "age1960.h"
- // cfg
- #include "meta_rf_cfg.h"
- // RF
- #ifndef _RF_COMMON_H_
- #include "rf_common.h"
- #endif
- #ifndef _RF_TXIQ_RUN_H_
- #include "rf_txiq_run.h"
- #endif
- #ifndef _RF_STOP_H_
- #include "rf_stop.h"
- #endif
- //----------------------------------------------------------------------------
- typedef enum
- {
- TXIQ_SWEEP_TYPE_TRIM_IQ = 0,
- TXIQ_SWEEP_TYPE_OFFSET_IQ,
- TXIQ_SWEEP_TYPE_PHASESEL
- }E_TXIQ_SWEEP_TYPE_T;
- typedef enum
- {
- TXIQ_OUTPUT_DATA_TYPE_PHERR = 0,
- TXIQ_OUTPUT_DATA_TYPE_OOS,
- TXIQ_OUTPUT_DATA_TYPE_SBS
- }E_TXIQ_SWEEP_OUTPUT_DATA_TYPE_T;
- //----------------------------------------------------------------------------
- typedef struct
- {
- AnsiString as_ADDR;
- int i_TimeOut;
- TNotifyEvent ne_onTermSuccess;
- TNotifyEvent ne_onTermByUser;
- TMETA_rf_cfg *rf_cfg;
- TStringList *st_Log;
- E_TXIQ_SWEEP_TYPE_T e_sweep_type;
- E_TXIQ_SWEEP_OUTPUT_DATA_TYPE_T e_output_data_type;
- E_DEVICE_TYPE e_device_type;
- E_BANDSEL e_band;
- short s_arfcn;
- char tsc;
- int pcl;
- short s_afc_dac;
- int i_measure_count;
- E_MODULATION e_modulation;
- E_BBTXCFG_VER_T e_bbtxcfg_ver;
- signed char trim_i;
- signed char trim_q;
- signed char offset_i;
- signed char offset_q;
- signed char sc_phasesel;
- signed char min_trim_i;
- signed char max_trim_i;
- char trim_i_step;
- signed char min_trim_q;
- signed char max_trim_q;
- char trim_q_step;
- signed char min_offset_i;
- signed char max_offset_i;
- char offset_i_step;
- signed char min_offset_q;
- signed char max_offset_q;
- char offset_q_step;
- signed char sc_min_phasesel;
- signed char sc_max_phasesel;
- char c_phasesel_step;
- APCTxPattern e_burst_type;
- }S_TXIQ_SWEEP_T;
- //---------------------------------------------------------------------------
- class T_TXIQ_SWEEP : public TThread
- {
- private:
- CMETAHANDLE m_META_HANDLE_Obj;
- AnsiString as_AGE8960_ADDR;
- AnsiString as_AGE8960_TimeOut;
- AnsiString as_GSM400_cable_loss, as_GSM850_cable_loss;
- AnsiString as_GSM900_cable_loss, as_DCS1800_cable_loss, as_PCS1900_cable_loss;
- AnsiString as_Msg;
- AnsiString* as_pAgeTaModel;
- int i_AGE8960_TimeOut;
- double d_P_DL;
- signed short ss_CellBand;
- TNotifyEvent ne_OnTerminate;
- ViPSession pvi_Age196x;
- ViStatus vistat;
- ViSession vi;
- ViPSession pvi;
- ViInt16 vi_Band;
- ViInt16 MeasFcnDone;
- int int_band;
- double d400,d850,d900,d1800,d1900;
- double Out400,Out850,Out900,Out1800,Out1900;
- ViChar errmsg[256];
- int i_pm_arfcn, i_ARFCN;
- char c_TSC;
- ViInt32 PFERIntegrity;
- ViReal64 PFERRMSError;
- ViReal64 PFERPeakError;
- ViReal64 PFERFreqError;
- ViReal64 FreqError;
- ViInt32 IQTIntegrity;
- ViReal64 IQTSpurFreq;
- ViReal64 IQTSpurLevel;
- ViReal64 IQTResultsArray[age1960_IQ_ARRAY_MIN];
- ViReal64 IQTFreqsArray[age1960_IQ_ARRAY_MIN];
- ViInt32 IQTTuningCount;
- TMETA_rf_cfg *cfg;
- CRFTXIQRUN m_cTXIQ_RUN_Obj;
- S_TXIQ_SWEEP_T* m_pTxIqSweep;
- RfBBTXCfg4 m_sBbTxCfg;
- RfNbtx_Req rf_tx_level_req;
- CRFSTOP rf_stop;
- short rf_tx_level_token;
- short rf_setbbtx_cfg_token;
- char chTXPowerON[100], chTXPowerOFF[100];
- char buf[40000], buf0[10000], buf1[10000], buf2[10000];
- TStringList *st_Log_OffIQ;
- TNotifyEvent neSuccess, neByUser;
- protected:
- void __fastcall Execute();
- void _fastcall SyncShowMsg(AnsiString as);
- public:
- void _fastcall ShowMsg();
- __fastcall T_TXIQ_SWEEP(
- bool CreateSuspended,
- S_TXIQ_SWEEP_T *p_txiq_sweep,
- ViSession &vs_Age196x,
- AnsiString &as_TaModel
- );
- bool __fastcall Initialize_Equipment(void);
- bool __fastcall CheckError(ViStatus ErrorStatus);
- bool __fastcall Trim_IQ_Sweep(void);
- bool __fastcall Offset_IQ_Sweep(void);
- bool __fastcall Phasesel_Sweep(void);
- AnsiString __fastcall Get_DataTypeStr(void);
- // callback
- void CNF_TXIQ_Sweep(void);
- };
- #endif