META_crystal_cfg.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:28k
- /*****************************************************************************
- * 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_crystal_cfg.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Crystal configuration 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 <Classes.hpp>
- #include <inifiles.hpp>
- #include <dialogs.hpp>
- #pragma hdrstop
- #include "meta_const.h"
- #include "meta_utils.h"
- #include "META_crystal_cfg.h"
- //----------------------------------------------------------------------------
- __fastcall TMETA_crystal_cfg::TMETA_crystal_cfg()
- {
- }
- //----------------------------------------------------------------------------
- __fastcall TMETA_crystal_cfg::~TMETA_crystal_cfg()
- {
- // Agilent 8960 initialization
- as_8960_GPIB_Addr.~AnsiString();
- // CMU 200 initialization
- as_CMU200_GPIB_Addr.~AnsiString();
- as_FreqBank.~AnsiString();
- as_GSM400_PCL.~AnsiString();
- as_GSM400_MAX_P.~AnsiString();
- as_GSM400_WANTED_P.~AnsiString();
- as_GSM400_MIN_P.~AnsiString();
- as_GSM400_C.~AnsiString();
- as_GSM850_PCL.~AnsiString();
- as_GSM850_MAX_P.~AnsiString();
- as_GSM850_WANTED_P.~AnsiString();
- as_GSM850_MIN_P.~AnsiString();
- as_GSM850_C.~AnsiString();
- as_GSM900_PCL.~AnsiString();
- as_GSM900_MAX_P.~AnsiString();
- as_GSM900_WANTED_P.~AnsiString();
- as_GSM900_MIN_P.~AnsiString();
- as_GSM900_C.~AnsiString();
- as_DCS1800_PCL.~AnsiString();
- as_DCS1800_MAX_P.~AnsiString();
- as_DCS1800_WANTED_P.~AnsiString();
- as_DCS1800_MIN_P.~AnsiString();
- as_DCS1800_C.~AnsiString();
- as_PCS1900_PCL.~AnsiString();
- as_PCS1900_MAX_P.~AnsiString();
- as_PCS1900_WANTED_P.~AnsiString();
- as_PCS1900_MIN_P.~AnsiString();
- as_PCS1900_C.~AnsiString();
- }
- //----------------------------------------------------------------------------
- bool TMETA_crystal_cfg::getGPIB_Addr(AnsiString &as)
- {
- as = as_8960_GPIB_Addr;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getTimeOut(int &i)
- {
- i = i_TimeOut;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM400_CableLoss( double &d) // dB
- {
- d = d_GSM400_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM850_CableLoss( double &d) // dB
- {
- d = d_GSM850_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM900_CableLoss( double &d) // dB
- {
- d = d_GSM900_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getDCS1800_CableLoss( double &d) // dB
- {
- d = d_DCS1800_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getPCS1900_CableLoss( double &d) // dB
- {
- d = d_PCS1900_CL;
- return true;
- }
- //***************************************************************************
- // CMU200 Initialization
- //----------------------------------------------------------------------------
- bool TMETA_crystal_cfg::getCMU200_GPIB_Addr(AnsiString &as)
- {
- as = as_CMU200_GPIB_Addr;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_TimeOut(int &i)
- {
- i = i_CMU200_TimeOut;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_INPUT_GSM400_CableLoss( double &d) // dB
- {
- d = d_CMU200_INPUT_GSM400_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_INPUT_GSM850_CableLoss( double &d) // dB
- {
- d = d_CMU200_INPUT_GSM850_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_INPUT_GSM900_CableLoss( double &d) // dB
- {
- d = d_CMU200_INPUT_GSM900_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_INPUT_DCS1800_CableLoss( double &d) // dB
- {
- d = d_CMU200_INPUT_DCS1800_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_INPUT_PCS1900_CableLoss( double &d) // dB
- {
- d = d_CMU200_INPUT_PCS1900_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_OUTPUT_GSM400_CableLoss( double &d) // dB
- {
- d = d_CMU200_OUTPUT_GSM400_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_OUTPUT_GSM850_CableLoss( double &d) // dB
- {
- d = d_CMU200_OUTPUT_GSM850_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_OUTPUT_GSM900_CableLoss( double &d) // dB
- {
- d = d_CMU200_OUTPUT_GSM900_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_OUTPUT_DCS1800_CableLoss( double &d) // dB
- {
- d = d_CMU200_OUTPUT_DCS1800_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getCMU200_OUTPUT_PCS1900_CableLoss( double &d) // dB
- {
- d = d_CMU200_OUTPUT_PCS1900_CL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getFreqBank(AnsiString &as)
- {
- as = as_FreqBank;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getARFCN_C0_GSM850(short &s)
- {
- s = m_sARFCN_C0_GSM850;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getARFCN_C0_GSM(short &s)
- {
- s = m_sARFCN_C0_GSM;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getARFCN_C0_DCS(short &s)
- {
- s = m_sARFCN_C0_DCS;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getARFCN_C0_PCS(short &s)
- {
- s = m_sARFCN_C0_PCS;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getP_DL(double &d)
- {
- d = d_P_DL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getN_PM(short &i)
- {
- i = i_N_PM;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getM_PM(char &c)
- {
- c = c_M_PM;
- return true;
- }
- //=============================================================================
- /////////////////////////////// AFC /////////////////////////////////////
- //=============================================================================
- //=============================================================================
- bool TMETA_crystal_cfg::getAFC_BAND(AnsiString &as)
- {
- as = as_AFC_BAND;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getAFC_ARFCN(short &s)
- {
- s = m_sAFC_ARFCN;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getN_AFC(short &s)
- {
- s = m_sN_AFC;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getDAC1(int &i)
- {
- i = i_DAC1;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getDAC2( int &i)
- {
- i = i_DAC2;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM400_PCL( AnsiString &as)
- {
- as = as_GSM400_PCL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM400_MAX_P( AnsiString &as)
- {
- as = as_GSM400_MAX_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM400_WANTED_P( AnsiString &as)
- {
- as = as_GSM400_WANTED_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM400_MIN_P( AnsiString &as)
- {
- as = as_GSM400_MIN_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM400_C( AnsiString &as)
- {
- as = as_GSM400_C;
- return true;
- }
- //=============================================================================
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM850_PCL( AnsiString &as)
- {
- as = as_GSM850_PCL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM850_MAX_P( AnsiString &as)
- {
- as = as_GSM850_MAX_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM850_WANTED_P( AnsiString &as)
- {
- as = as_GSM850_WANTED_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM850_MIN_P( AnsiString &as)
- {
- as = as_GSM850_MIN_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM850_C( AnsiString &as)
- {
- as = as_GSM850_C;
- return true;
- }
- //=============================================================================
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM900_PCL( AnsiString &as)
- {
- as = as_GSM900_PCL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM900_MAX_P( AnsiString &as)
- {
- as = as_GSM900_MAX_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM900_WANTED_P( AnsiString &as)
- {
- as = as_GSM900_WANTED_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM900_MIN_P( AnsiString &as)
- {
- as = as_GSM900_MIN_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getGSM900_C( AnsiString &as)
- {
- as = as_GSM900_C;
- return true;
- }
- //=============================================================================
- //=============================================================================
- bool TMETA_crystal_cfg::getDCS1800_PCL( AnsiString &as)
- {
- as = as_DCS1800_PCL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getDCS1800_MAX_P( AnsiString &as)
- {
- as = as_DCS1800_MAX_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getDCS1800_WANTED_P( AnsiString &as)
- {
- as = as_DCS1800_WANTED_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getDCS1800_MIN_P( AnsiString &as)
- {
- as = as_DCS1800_MIN_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getDCS1800_C( AnsiString &as)
- {
- as = as_DCS1800_C;
- return true;
- }
- //=============================================================================
- //=============================================================================
- bool TMETA_crystal_cfg::getPCS1900_PCL( AnsiString &as)
- {
- as = as_PCS1900_PCL;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getPCS1900_MAX_P( AnsiString &as)
- {
- as = as_PCS1900_MAX_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getPCS1900_WANTED_P( AnsiString &as)
- {
- as = as_PCS1900_WANTED_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getPCS1900_MIN_P( AnsiString &as)
- {
- as = as_PCS1900_MIN_P;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getPCS1900_C( AnsiString &as)
- {
- as = as_PCS1900_C;
- return true;
- }
- //=============================================================================
- //=============================================================================
- bool TMETA_crystal_cfg::getTSC( char &c)
- {
- c = c_TSC;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getN_TX(int &i)
- {
- i = i_N_TX;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getTXlevelRecursiveTimes(int &i)
- {
- i = i_RecursiveTimes;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::getAPC_Delta(double &d)
- {
- d = d_APC_Delta;
- return true;
- }
- //=============================================================================
- bool TMETA_crystal_cfg::ReadFromIniFile(AnsiString as)
- {
- TIniFile *ini;
- ini = new TIniFile(as);
- if (NULL == ini)
- {
- return false;
- }
- // Agilent 8960
- as_8960_GPIB_Addr = ini->ReadString("8960 Initialization",
- "8960 GPIB Address",
- "GPIB0::15::INSTR"
- );
- i_TimeOut = ini->ReadInteger("8960 Initialization",
- "Time Out",
- 10000
- );
- // dB
- AnsiString as_loss;
- as_loss = ini->ReadString("8960 Initialization",
- "GSM400 cable loss",
- "-0.5"
- );
- d_GSM400_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("8960 Initialization",
- "GSM850 cable loss",
- "-0.5"
- );
- d_GSM850_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("8960 Initialization",
- "GSM900 cable loss",
- "-0.5"
- );
- d_GSM900_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("8960 Initialization",
- "DCS1800 cable loss",
- "-1.0"
- );
- d_DCS1800_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("8960 Initialization",
- "PCS1900 cable loss",
- "-1.0"
- );
- d_PCS1900_CL = atof(as_loss.c_str());
-
- // CMU200 Initialization
- as_CMU200_GPIB_Addr = ini->ReadString("CMU200 Initialization",
- "CMU200 GPIB Address",
- "GPIB0::20::INSTR"
- );
- i_CMU200_TimeOut = ini->ReadInteger("CMU200 Initialization",
- "Time Out",
- 7000
- );
- // cable loss
- as_loss = ini->ReadString("CMU200 Initialization",
- "GSM400 input cable loss",
- "1.0"
- );
- d_CMU200_INPUT_GSM400_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "GSM850 input cable loss",
- "1.0"
- );
- d_CMU200_INPUT_GSM850_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "GSM900 input cable loss",
- "1.2"
- );
- d_CMU200_INPUT_GSM900_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "DCS1800 input cable loss",
- "1.8"
- );
- d_CMU200_INPUT_DCS1800_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "PCS1900 input cable loss",
- "1.8"
- );
- d_CMU200_INPUT_PCS1900_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "GSM400 output cable loss",
- "1.0"
- );
- d_CMU200_OUTPUT_GSM400_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "GSM850 output cable loss",
- "1.0"
- );
- d_CMU200_OUTPUT_GSM850_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "GSM900 output cable loss",
- "1.2"
- );
- d_CMU200_OUTPUT_GSM900_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "DCS1800 output cable loss",
- "1.8"
- );
- d_CMU200_OUTPUT_DCS1800_CL = atof(as_loss.c_str());
- as_loss = ini->ReadString("CMU200 Initialization",
- "PCS1900 output cable loss",
- "1.8"
- );
- d_CMU200_OUTPUT_PCS1900_CL = atof(as_loss.c_str());
- AnsiString as_P_DL = ini->ReadString("Downlink power",
- "P_DL",
- "-60"
- );
- d_P_DL = atof(as_P_DL.c_str());
- delete ini;
- return true;
- } // function
- //=============================================================================
- //------------------------------------------------------------------------------
- bool TMETA_crystal_cfg::is_MAX_WANTED_MIN_P_valid()
- {
- // PCL: GSM450,850,900 5~19 // total:15
- // PCL: DCS1800,PCS1900 0~15 // total:16
- AnsiString sub_max_p, sub_wanted_p, sub_min_p;
- ///////////////////////////////////////////////////////////////////////////
- if (IsFreqBankSupported( as_FreqBank, FrequencyBand850))
- {
- for (int I=1; I<=15; I++)
- {
- if(! getAnsiStrSubItem( as_GSM850_MAX_P, I,
- DEFAULT_SEP_CHAR, sub_max_p ))
- {
- ShowMessage("Config file read GSM850_MAX_P fail.");
- return false;
- }
- if(! getAnsiStrSubItem( as_GSM850_MIN_P, I,
- DEFAULT_SEP_CHAR, sub_min_p ))
- {
- ShowMessage("Config file read GSM850_MIN_P fail.");
- return false;
- }
- if(! getAnsiStrSubItem( as_GSM850_WANTED_P, I,
- DEFAULT_SEP_CHAR, sub_wanted_p ))
- {
- ShowMessage("Config file read GSM850_WANTED_P fail.");
- return false;
- }
- if (atof(sub_min_p.c_str()) > atof(sub_max_p.c_str()))
- {
- ShowMessage("Config file: GSM850_MIN_P must <= GSM850_MAX_P.");
- return false;
- }
- if (atof(sub_wanted_p.c_str()) > atof(sub_max_p.c_str()))
- {
- ShowMessage("Config file: GSM850_WANTED_P must <= GSM850_MAX_P.");
- return false;
- }
- if (atof(sub_wanted_p.c_str()) < atof(sub_min_p.c_str()))
- {
- ShowMessage("Config file: GSM850_WANTED_P must >= GSM850_MIN_P.");
- return false;
- }
- } // for
- } // if
- ////////////////////////////////////////////////////////////////////////////
- if ( IsFreqBankSupported( as_FreqBank, FrequencyBand900))
- {
- for (int I=1; I<=15; I++)
- {
- if(! getAnsiStrSubItem( as_GSM900_MAX_P, I,
- DEFAULT_SEP_CHAR, sub_max_p ))
- {
- ShowMessage("Config file read GSM900_MAX_P fail.");
- return false;
- }
- if(! getAnsiStrSubItem( as_GSM900_MIN_P, I,
- DEFAULT_SEP_CHAR, sub_min_p ))
- {
- ShowMessage("Config file read GSM900_MIN_P fail.");
- return false;
- }
- if(! getAnsiStrSubItem( as_GSM900_WANTED_P, I,
- DEFAULT_SEP_CHAR, sub_wanted_p ))
- {
- ShowMessage("Config file read GSM900_WANTED_P fail.");
- return false;
- }
- if (atof(sub_min_p.c_str()) > atof(sub_max_p.c_str()))
- {
- ShowMessage("Config file: GSM900_MIN_P must < GSM900_MAX_P.");
- return false;
- }
- if (atof(sub_wanted_p.c_str()) > atof(sub_max_p.c_str()))
- {
- ShowMessage("Config file: GSM900_WANTED_P must <= GSM900_MAX_P.");
- return false;
- }
- if (atof(sub_wanted_p.c_str()) < atof(sub_min_p.c_str()))
- {
- ShowMessage("Config file: GSM900_WANTED_P must >= GSM900_MIN_P.");
- return false;
- }
- } // for
- } // if
- ////////////////////////////////////////////////////////////////////////////
- if ( IsFreqBankSupported( as_FreqBank, FrequencyBand1800))
- {
- for (int I=1; I<=16; I++)
- {
- if(! getAnsiStrSubItem( as_DCS1800_MAX_P, I,
- DEFAULT_SEP_CHAR, sub_max_p ))
- {
- ShowMessage("Config file read DCS1800_MAX_P fail.");
- return false;
- }
- if(! getAnsiStrSubItem( as_DCS1800_MIN_P, I,
- DEFAULT_SEP_CHAR, sub_min_p ))
- {
- ShowMessage("Config file read DCS1800_MIN_P fail.");
- return false;
- }
- if(! getAnsiStrSubItem( as_DCS1800_WANTED_P, I,
- DEFAULT_SEP_CHAR, sub_wanted_p ))
- {
- ShowMessage("Config file read DCS1800_WANTED_P fail.");
- return false;
- }
- if (atof(sub_min_p.c_str()) > atof(sub_max_p.c_str()))
- {
- ShowMessage("Config file: DCS1800_MIN_P must < DCS1800_MAX_P.");
- return false;
- }
- if (atof(sub_wanted_p.c_str()) > atof(sub_max_p.c_str()))
- {
- ShowMessage("Config file: DCS1800_WANTED_P must <= DCS1800_MAX_P.");
- return false;
- }
- if (atof(sub_wanted_p.c_str()) < atof(sub_min_p.c_str()))
- {
- ShowMessage("Config file: DCS1800_WANTED_P must >= DCS1800_MIN_P.");
- return false;
- }
- } // for
- } // if
- ////////////////////////////////////////////////////////////////////////////
- if ( IsFreqBankSupported( as_FreqBank, FrequencyBand1900))
- {
- for (int I=1; I<=16; I++)
- {
- if(! getAnsiStrSubItem( as_PCS1900_MAX_P, I,
- DEFAULT_SEP_CHAR, sub_max_p ))
- {
- ShowMessage("Config file read PCS1900_MAX_P fail.");
- return false;
- }
- if(! getAnsiStrSubItem( as_PCS1900_MIN_P, I,
- DEFAULT_SEP_CHAR, sub_min_p ))
- {
- ShowMessage("Config file read PCS1900_MIN_P fail.");
- return false;
- }
- if(! getAnsiStrSubItem( as_PCS1900_WANTED_P, I,
- DEFAULT_SEP_CHAR, sub_wanted_p ))
- {
- ShowMessage("Config file read PCS1900_WANTED_P fail.");
- return false;
- }
- if (atof(sub_min_p.c_str()) > atof(sub_max_p.c_str()))
- {
- ShowMessage("Config file: PCS1900_MIN_P must < PCS1900_MAX_P.");
- return false;
- }
- if (atof(sub_wanted_p.c_str()) > atof(sub_max_p.c_str()))
- {
- ShowMessage("Config file: PCS1900_WANTED_P must <= PCS1900_MAX_P.");
- return false;
- }
- if (atof(sub_wanted_p.c_str()) < atof(sub_min_p.c_str()))
- {
- ShowMessage("Config file: PCS1900_WANTED_P must >= PCS1900_MIN_P.");
- return false;
- }
- } // for
- } // if
- ////////////////////////////////////////////////////////////////////////////
- return true;
- }
- //------------------------------------------------------------------------------