Crystal_Sweep_RX.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:18k
源码类别:

MTK

开发平台:

C++ Builder

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  *   Crystal_Sweep_RX.cpp
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   Maui META APP
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *  Crystal sweep RX source
  48.  *
  49.  * Author:
  50.  * -------
  51.  *  Andy Ueng (mtk00490)
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * $Revision$
  58.  * $Modtime$
  59.  * $Log$
  60.  * 
  61.  *------------------------------------------------------------------------------
  62.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  63.  *============================================================================
  64.  ****************************************************************************/
  65. //---------------------------------------------------------------------------
  66. #include <vcl.h>
  67. #include <assert.h>
  68. #pragma hdrstop
  69. #include "form_RFTool.h"
  70. #ifndef _CRYSTAL_SWEEP_RX_H_
  71. #include "Crystal_Sweep_RX.h"
  72. #endif
  73. #ifndef  _META_UTILS_H_
  74. #include "meta_utils.h"
  75. #endif
  76. #ifndef _CRYSTAL_INIFILEHANDLE_H_
  77. #include "Crystal_INIFileHandle.h"
  78. #endif
  79. #ifndef  _MAN_DLL_H_
  80. #include "man_dll.h"
  81. #endif
  82. #ifndef _META_CONST_H_
  83. #include "meta_const.h"
  84. #endif
  85. // equipment
  86. #ifndef _AGECOMMON_H_
  87. #include "agecommon.h"
  88. #endif
  89. #ifndef _AGE1968A_H_
  90. #include "age1968a.h"
  91. #endif
  92. #ifndef  _CMU200_H_
  93. #include "cmu200.h"
  94. #endif
  95. #ifndef  _RCT_COMMON_H_
  96. #include "rct_common.h"
  97. #endif
  98. // form
  99. //#ifndef _FORM_MAIN_H_
  100. //#include "form_main.h"
  101. //#endif
  102. // misc
  103. #ifndef  _BAND_UTILS_H_
  104. #include "band_utils.h"
  105. #endif
  106. //---------------------------------------------------------------------------
  107. #define ONE_SECOND 1
  108. //extern TfrmMainSel *frmMainSel;  // for GSM 850
  109. //------------------------------------------------------------------------------
  110. static RfAfc_Cnf  MF_rf_afc_cnf;
  111. CMU_VAR cmu_crystal_r;
  112. //==============================================================================
  113. static void CNF_CASR(void)
  114. {
  115.     if (frmRFTool->pt_Age8960_Crystal_Sweep_RX != NULL)
  116.     {
  117.         frmRFTool->pt_Age8960_Crystal_Sweep_RX->Resume();
  118.     }
  119. }
  120. //------------------------------------------------------------------------------
  121. static void cb_write_CrystalAFC_to_nvram()
  122. {
  123.     if(frmRFTool->pt_Age8960_Crystal_Sweep_RX != NULL )
  124.     {
  125.         frmRFTool->pt_Age8960_Crystal_Sweep_RX->Resume();
  126.     }
  127. }
  128. //------------------------------------------------------------------------------
  129. void __stdcall cb_rf_afc(const RfAfc_Cnf *cnf, const short token, void *usrData)
  130. {
  131.     MF_rf_afc_cnf.deviation  = cnf->deviation;
  132.     MF_rf_afc_cnf.fcb_ok_number     = cnf->fcb_ok_number;
  133.     MF_rf_afc_cnf.freqOffset = cnf->freqOffset;
  134.     MF_rf_afc_cnf.ok  = cnf->ok;
  135.     if(frmRFTool->pt_Age8960_Crystal_Sweep_RX != NULL )
  136.     {
  137.         frmRFTool->pt_Age8960_Crystal_Sweep_RX->Resume();
  138.     }
  139. }
  140. //------------------------------------------------------------------------------
  141. static void cb_rf_stop_rx()
  142. {
  143.     if(frmRFTool->pt_Age8960_Crystal_Sweep_RX != NULL )
  144.     {
  145.         frmRFTool->pt_Age8960_Crystal_Sweep_RX->Resume();
  146.     }
  147. }
  148. //==============================================================================
  149. void _fastcall Crystal_Sweep_RX::ShowMsg()
  150. {
  151.     ShowMessage(as_Msg);
  152. }
  153. //------------------------------------------------------------------------------
  154. void _fastcall Crystal_Sweep_RX::SyncShowMsg(AnsiString as)
  155. {
  156.     as_Msg = as;
  157.     Synchronize(ShowMsg);
  158. }
  159. //=========================================================================================
  160. __fastcall Crystal_Sweep_RX::Crystal_Sweep_RX(bool CreateSuspended, S_CAS_T *cas)
  161.         : TThread(CreateSuspended)
  162. {
  163.     m_pCAS = cas;
  164. }
  165. //---------------------------------------------------------------------------
  166. void __fastcall Crystal_Sweep_RX::Execute()
  167. {
  168.     ViInt16 vi_Band;
  169.     m_rct.device_type = m_pCAS->e_device_type;
  170.     if (AGILENT_8960 == m_pCAS->e_device_type)
  171.     {
  172.         if ((! m_pCAS->crystal_cfg->getGSM400_CableLoss( m_rct.age.d400 ))   ||
  173.             (! m_pCAS->crystal_cfg->getGSM850_CableLoss( m_rct.age.d850 ))   ||
  174.             (! m_pCAS->crystal_cfg->getGSM900_CableLoss( m_rct.age.d900 ))   ||
  175.             (! m_pCAS->crystal_cfg->getDCS1800_CableLoss( m_rct.age.d1800 )) ||
  176.             (! m_pCAS->crystal_cfg->getPCS1900_CableLoss( m_rct.age.d1900 ))
  177.           )
  178.         {
  179.             SyncShowMsg(" Agilent 8960 read config file (cable loss) fail ");
  180.             return;
  181.         }
  182.         if (!m_pCAS->crystal_cfg->getTimeOut(m_rct.age.TMO))
  183.         {
  184.             SyncShowMsg("Get Time Out from file fail");
  185.             return;
  186.         }
  187.         if (!m_pCAS->crystal_cfg->getGPIB_Addr(m_rct.age.ADD))
  188.         {
  189.             SyncShowMsg("Get GPIB address from file fail");
  190.             return;
  191.         }
  192.     }
  193.     else // CMU 200
  194.     {
  195.         if(
  196.              (! m_pCAS->crystal_cfg->getCMU200_INPUT_GSM850_CableLoss( m_rct.cmu.loss_gsm850_i )) ||
  197.              (! m_pCAS->crystal_cfg->getCMU200_INPUT_GSM900_CableLoss( m_rct.cmu.loss_gsm_i    )) ||
  198.              (! m_pCAS->crystal_cfg->getCMU200_INPUT_DCS1800_CableLoss( m_rct.cmu.loss_dcs_i   )) ||
  199.              (! m_pCAS->crystal_cfg->getCMU200_INPUT_PCS1900_CableLoss( m_rct.cmu.loss_pcs_i   ))
  200.           )
  201.         {
  202.              SyncShowMsg(  " CMU200 read config file (input cable loss) fail " );
  203.              return;
  204.         }
  205.         //************************************************************
  206.         if(
  207.                (! m_pCAS->crystal_cfg->getCMU200_OUTPUT_GSM850_CableLoss( m_rct.cmu.loss_gsm850_o )) ||
  208.                (! m_pCAS->crystal_cfg->getCMU200_OUTPUT_GSM900_CableLoss( m_rct.cmu.loss_gsm_o ))    ||
  209.                (! m_pCAS->crystal_cfg->getCMU200_OUTPUT_DCS1800_CableLoss( m_rct.cmu.loss_dcs_o ))   ||
  210.                (! m_pCAS->crystal_cfg->getCMU200_OUTPUT_PCS1900_CableLoss( m_rct.cmu.loss_pcs_o ))
  211.                                                       )
  212.         {
  213.              SyncShowMsg(  " CMU200 read config file (output cable loss) fail " );
  214.              return;
  215.         }
  216.         if(! m_pCAS->crystal_cfg->getCMU200_TimeOut( m_rct.cmu.TMO ) )
  217.         {
  218.             SyncShowMsg( "Get Time Out from file fail" );
  219.             return;
  220.         }
  221.         if(! m_pCAS->crystal_cfg->getCMU200_GPIB_Addr( m_rct.cmu.ADD ) )
  222.         {
  223.             SyncShowMsg( "Get GPIB address from file fail" );
  224.             return;
  225.         }
  226.         m_rct.cmu.ADD = m_rct.cmu.ADD.SubString(0, m_rct.cmu.ADD.Pos("::INSTR")-1);
  227.     }
  228.     if (m_pCAS->b_temp_sweep)
  229.     {
  230.         if (!m_cts_ctrl.CTS_Init(m_pCAS->com_port))
  231.         {
  232.             SyncShowMsg("Initialize CTS fail");
  233.             return;
  234.         }
  235.         m_pCAS->hCOM = m_cts_ctrl.CTS_GetComHandle();
  236.         m_pCAS->original_dcb = m_cts_ctrl.Get_OriginalDCB();
  237.         if( ! m_cts_ctrl.CTS_Start() )
  238.         {
  239.             SyncShowMsg( "Start CTS fail" );
  240.             return;
  241.         }
  242.     }
  243.     if (!m_rct_ctrl.RCT_Init(&m_rct, BandIdx_To_FreqBandString(m_pCAS->e_band)))
  244.     {
  245.         SyncShowMsg("Initialize equipment fail");
  246.         return;
  247.     }
  248.     E_AGE_OPERATING_MODE mode = m_pCAS->b_cont_sine_wave ? OPERATING_MODE_GSM_CW : OPERATING_MODE_GSM_BCH_TCH;
  249.     if (!m_rct_ctrl.RCT_operatingMode(&m_rct, mode))
  250.     {
  251.         SyncShowMsg("Set operation mode fail");
  252.         return;
  253.     }
  254.     AnsiString as_RCT = m_rct_ctrl.RCT_DeviceTypeToString(m_pCAS->e_device_type);
  255.    //********************************************************************
  256.     /////////////////////////////////////////////////////////////////////////////
  257.     switch (m_pCAS->e_band)
  258.     {
  259.         case BANDSEL_GSM900:
  260.         {
  261.             vi_Band = age1960_EGSM_BAND;
  262.             cmu_crystal_r.BAND = "GSM";
  263.         }
  264.         break;
  265.         case BANDSEL_DCS1800:
  266.         {
  267.             vi_Band = age1960_DCS1800_BAND;
  268.             cmu_crystal_r.BAND = "DCS";
  269.         }
  270.         break;
  271.         case BANDSEL_PCS1900:
  272.         {
  273.             vi_Band = age1960_PCS1900_BAND;
  274.             cmu_crystal_r.BAND = "PCS";
  275.         }
  276.         break;
  277.         case BANDSEL_GSM850:
  278.         {
  279.             vi_Band = age1960_GSM850_BAND;
  280.             cmu_crystal_r.BAND = "GSM850";
  281.         }
  282.         break;
  283.         default:
  284.         {
  285.             assert(false);
  286.         }
  287.         break;
  288.     } // switch
  289.     FrequencyBand FreqBand = BandIdx_To_FreqBand(m_pCAS->e_band);
  290.     if (!m_rct_ctrl.RCT_cellBand(&m_rct, vi_Band))
  291.     {
  292.         AnsiString as_msg = as_RCT + " set cell band fail";
  293.         SyncShowMsg(as_msg);
  294.         return;
  295.     }
  296.     if (m_pCAS->b_cont_sine_wave)
  297.     {
  298.         if (!m_rct_ctrl.RCT_GenFreqOffset(&m_rct, 67.7))
  299.         {
  300.             AnsiString as_msg = as_RCT + " set frequency offset fail";
  301.             SyncShowMsg(as_msg);
  302.             return;
  303.         }
  304.         if (!m_rct_ctrl.RCT_PowTranCont(&m_rct))
  305.         {
  306.             AnsiString as_msg = as_RCT + " set cell band fail";
  307.             SyncShowMsg(as_msg);
  308.             return;
  309.         }
  310.         if (!m_rct_ctrl.RCT_GenBitMod(&m_rct, CMU200_GEN_BIT_MODU_OFF))
  311.         {
  312.             AnsiString as_msg = as_RCT + " set cell band fail";
  313.             SyncShowMsg(as_msg);
  314.             return;
  315.         }
  316.     }
  317.     else
  318.     {
  319.         if (!m_rct_ctrl.RCT_PowTranBurst(&m_rct))
  320.         {
  321.             AnsiString as_msg = as_RCT + " set cell band fail";
  322.             SyncShowMsg(as_msg);
  323.             return;
  324.         }
  325.         if (!m_rct_ctrl.RCT_GenBitMod(&m_rct, CMU200_GEN_BIT_MODU_ALL_ZERO))
  326.         {
  327.             AnsiString as_msg = as_RCT + " set cell band fail";
  328.             SyncShowMsg(as_msg);
  329.             return;
  330.         }
  331.         if ((MT6205    == m_pCAS->e_bb_chip) ||
  332.             (MT6205B   == m_pCAS->e_bb_chip) ||
  333.             (MT6223    == m_pCAS->e_bb_chip) ||
  334.             (MT6223P   == m_pCAS->e_bb_chip) ||
  335.             (MT6225    == m_pCAS->e_bb_chip) ||
  336.             (MT6229    == m_pCAS->e_bb_chip) ||
  337.             (MT6230    == m_pCAS->e_bb_chip) ||
  338.             (MT6235    == m_pCAS->e_bb_chip) ||
  339.             (MT6238    == m_pCAS->e_bb_chip) ||
  340.             (TK6516_MD == m_pCAS->e_bb_chip)
  341.            )
  342.         {
  343.             if (!m_rct_ctrl.RCT_GenTsc(&m_rct, CMU200_GEN_TSC_ALL_ZERO))
  344.             {
  345.                 AnsiString as_msg = as_RCT + " Generate TSC fail";
  346.                 SyncShowMsg(as_msg);
  347.                 return;
  348.             }
  349.         }
  350.         else
  351.         {
  352.             if (!m_rct_ctrl.RCT_GenTsc(&m_rct, CMU200_GEN_TSC_GSM_5))
  353.             {
  354.                 AnsiString as_msg = as_RCT + " Generate TSC fail";
  355.                 SyncShowMsg(as_msg);
  356.                 return;
  357.             }
  358.         }
  359.     }
  360.     if (!m_rct_ctrl.RCT_InitRfg(&m_rct))
  361.     {
  362.         AnsiString as_msg = as_RCT + " initialize generator fail";
  363.         SyncShowMsg(as_msg);
  364.         return;
  365.     }
  366.     /////////////////////////////////////////////////////////////////////////////
  367.     if (m_pCAS->b_cont_sine_wave && (AGILENT_8960 == m_pCAS->e_device_type))
  368.     {
  369.         if (!m_rct_ctrl.RCT_GenFreq_CW(&m_rct, FreqBand, m_pCAS->s_arfcn))
  370.         {
  371.             AnsiString as_msg = as_RCT + " set ARFCN fail";
  372.             SyncShowMsg(as_msg);
  373.             return;
  374.         }
  375.     }
  376.     else
  377.     {
  378.         if (!m_rct_ctrl.RCT_BCHARFCN(&m_rct, m_pCAS->s_arfcn))
  379.         {
  380.             AnsiString as_msg = as_RCT + " set BCCH ARFCN fail";
  381.             SyncShowMsg(as_msg);
  382.             return;
  383.         }
  384.     }
  385.     CRFAFC RF_AFC_Obj;
  386.     RF_AFC_Obj.ConfirmCallback = ::CNF_CASR;
  387.     RF_AFC_Obj.REQ_SetAfcSinWaveDetection_Start(m_pCAS->b_cont_sine_wave);
  388.     this->Suspend();
  389.     if (RF_AFC_Obj.Get_ConfirmState() != METAAPP_SUCCESS)
  390.     {
  391.         SyncShowMsg("Execution Failure : set continuous sine wave");
  392.         return;
  393.     }
  394.     double d_P_DL;
  395.     /////////////////////////////////////////////////////////////////////////////
  396.     if(!m_pCAS->crystal_cfg->getP_DL(d_P_DL))
  397.     {
  398.         SyncShowMsg("Get P_DL from file fail");
  399.         return;
  400.     }
  401.     if (m_pCAS->b_cont_sine_wave && (AGILENT_8960 == m_pCAS->e_device_type))
  402.     {
  403.         if (!m_rct_ctrl.RCT_cellPower_CW(&m_rct, d_P_DL))
  404.         {
  405.             AnsiString as_msg = as_RCT + " set downlink power fail";
  406.             SyncShowMsg(as_msg);
  407.             return;
  408.         }
  409.     }
  410.     else
  411.     {
  412.         if (!m_rct_ctrl.RCT_cellPower(&m_rct, d_P_DL))
  413.         {
  414.             AnsiString as_msg = as_RCT + " set downlink power fail";
  415.             SyncShowMsg(as_msg);
  416.             return;
  417.         }    
  418.     }
  419.    /////////////////////////////////////////////////////////////////////////////
  420.     Sleep(50);
  421.     // save header to log
  422.     buf[0]='';
  423.     for (int j=m_pCAS->s_min_afc_dac; j<=m_pCAS->s_max_afc_dac; j=j+m_pCAS->s_afc_dac_step)
  424.     {
  425.         sprintf(buf1, "%15d", j );
  426.         strcat(buf, buf1);
  427.     }
  428.     m_pCAS->st_Log->Add(buf);
  429.     frmRFTool->write_CAS_log();
  430.     if( ! m_pCAS->b_temp_sweep )  m_pCAS->max_temp = m_pCAS->min_temp;
  431.     for(float temp=m_pCAS->min_temp; temp<=m_pCAS->max_temp; temp+=m_pCAS->temp_step)
  432.     {
  433.         if( m_pCAS->b_temp_sweep )
  434.         {
  435.             if( ! m_cts_ctrl.CTS_SetTemp( temp ) )
  436.             {
  437.                 SyncShowMsg("CTS set temp fail");
  438.                 return;
  439.             }
  440.             double  current_temp, setting_temp;
  441.             do
  442.             {
  443.                 if (this->Terminated)
  444.                 {
  445.                     this->OnTerminate = m_pCAS->ne_onTermByUser;
  446.                     return;
  447.                 }
  448.                 if (!m_cts_ctrl.CTS_GetTemp(current_temp, setting_temp))
  449.                 {
  450.                    continue;
  451.                 }
  452.             }
  453.             while(temp != current_temp);
  454.         }
  455.         for (int i = m_pCAS->min_cap_id; i <= m_pCAS->max_cap_id; i = i+m_pCAS->cap_id_step)
  456.         {
  457.             CRYSTAL_AFC_Object.ConfirmCallback = ::CNF_CASR;
  458.             CRYSTAL_AFC_Object.REQ_SetCapID_Start(i);
  459.             this->Suspend();
  460.             buf[0]='';
  461.             if( m_pCAS->b_temp_sweep )
  462.             {
  463.                 sprintf(buf0, "%3.1f %3d", temp, i);
  464.             }
  465.             else
  466.             {
  467.                 sprintf(buf0, "    %3d", i);
  468.             }
  469.             strcat(buf, buf0);
  470.             if(CRYSTAL_AFC_Object.Get_ConfirmState() !=  METAAPP_SUCCESS)
  471.             {
  472.                 SyncShowMsg("Execution Failure : read crystal AFC from NVRAM ");
  473.                 return;
  474.             }
  475.             for (int j = m_pCAS->s_min_afc_dac; j <= m_pCAS->s_max_afc_dac; j = j + m_pCAS->s_afc_dac_step)
  476.             {
  477.                 if (this->Terminated)
  478.                 {
  479.                     this->OnTerminate = m_pCAS->ne_onTermByUser;
  480.                     return;
  481.                 }
  482.                 Sleep(50);
  483.                 MF_rf_afc_req.arfcn = m_pCAS->s_arfcn;
  484.                 MF_rf_afc_req.dacValue = j;
  485.                 MF_rf_afc_req.gain = (MF_RF_GAIN_TO_BE_SUB - d_P_DL) * GAIN_REQUEST_PC_SIDE_MULTIPLY;
  486.                 MF_rf_afc_req.testNumber = m_pCAS->test_count;
  487.                 if ( META_Rf_AFC_r( m_META_HANDLE_Obj.Get_MainHandle(),
  488.                     &MF_rf_afc_req,
  489.                     ::cb_rf_afc,
  490.                     &MF_rf_afc_token,
  491. NULL
  492.                            ) != META_SUCCESS)
  493.                 {
  494.                     return;
  495.                 }
  496.                 this->Suspend();
  497.                 FreqError = MF_rf_afc_cnf.freqOffset;
  498.                 sprintf(buf1, "%12.4f", FreqError );
  499.                 strcat(buf, buf1);
  500.                 strcat(buf, "   ");
  501.             }
  502.             m_pCAS->st_Log->Add(buf);
  503.             frmRFTool->write_CAS_log();
  504.         }
  505.     }
  506.     this->OnTerminate = m_pCAS->ne_onTermSuccess;
  507. }