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

MTK

开发平台:

C++ Builder

  1. {
  2.     m_dTX_IQ_GAIN_IMBALANCE_MAX = d;
  3. }
  4. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. void  TMETA_factory_cfg::get_TX_IQ_BAND_HIGH(AnsiString &as)
  6. {
  7.     as = m_asTX_IQ_BAND_HIGH;
  8. }
  9. //-----------------------------------------------------------------------------
  10. void  TMETA_factory_cfg::set_TX_IQ_BAND_HIGH(AnsiString as)
  11. {
  12.     m_asTX_IQ_BAND_HIGH = as;
  13. }
  14. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. void TMETA_factory_cfg::get_TX_IQ_ARFCN_HIGH(short &s)
  16. {
  17.     s = m_sTX_IQ_ARFCN_HIGH;
  18. }
  19. //-----------------------------------------------------------------------------
  20. void  TMETA_factory_cfg::set_TX_IQ_ARFCN_HIGH(short s)
  21. {
  22.     m_sTX_IQ_ARFCN_HIGH = s;
  23. }
  24. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. void TMETA_factory_cfg::get_TX_IQ_PCL_HIGH(short &s)
  26. {
  27.     s = m_sTX_IQ_PCL_HIGH;
  28. }
  29. //-----------------------------------------------------------------------------
  30. void TMETA_factory_cfg::set_TX_IQ_PCL_HIGH(short s)
  31. {
  32.     m_sTX_IQ_PCL_HIGH = s;
  33. }
  34. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. void  TMETA_factory_cfg::get_TX_IQ_DC_OFFSET_MAX_HIGH(double &d)
  36. {
  37.     d = m_dTX_IQ_DC_OFFSET_MAX_HIGH;
  38. }
  39. //-----------------------------------------------------------------------------
  40. void  TMETA_factory_cfg::set_TX_IQ_DC_OFFSET_MAX_HIGH(double d)
  41. {
  42.     m_dTX_IQ_DC_OFFSET_MAX_HIGH = d;
  43. }
  44. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45. void  TMETA_factory_cfg::get_TX_IQ_GAIN_IMBALANCE_MAX_HIGH(double &d)
  46. {
  47.     d = m_dTX_IQ_GAIN_IMBALANCE_MAX_HIGH;
  48. }
  49. //-----------------------------------------------------------------------------
  50. void  TMETA_factory_cfg::set_TX_IQ_GAIN_IMBALANCE_MAX_HIGH(double d)
  51. {
  52.     m_dTX_IQ_GAIN_IMBALANCE_MAX_HIGH = d;
  53. }
  54. //==============================================================================
  55. /////////////////////////  TX IQ imbalance calibration   ///////////////////////
  56. //==============================================================================
  57. //void  TMETA_factory_cfg::get_TX_IQ_IMBALANCE_BAND(AnsiString &as)
  58. //{
  59. //    as = as_TX_IQ_IMBALANCE_BAND;
  60. //}
  61. //-----------------------------------------------------------------------------
  62. //void  TMETA_factory_cfg::set_TX_IQ_IMBALANCE_BAND(AnsiString as)
  63. //{
  64. //    as_TX_IQ_IMBALANCE_BAND = as;
  65. //}
  66. //==============================================================================
  67. //void  TMETA_factory_cfg::get_TX_IQ_IMBALANCE_ARFCN(short &s)
  68. //{
  69. //    s = m_sTX_IQ_IMBALANCE_ARFCN;
  70. //}
  71. //-----------------------------------------------------------------------------
  72. //void  TMETA_factory_cfg::set_TX_IQ_IMBALANCE_ARFCN(short s)
  73. //{
  74. //    m_sTX_IQ_IMBALANCE_ARFCN = s;
  75. //}
  76. //==============================================================================
  77. //void  TMETA_factory_cfg::get_TX_IQ_IMBALANCE_PCL(int &i)
  78. //{
  79. //    i = i_TX_IQ_IMBALANCE_PCL;
  80. //}
  81. //-----------------------------------------------------------------------------
  82. //void  TMETA_factory_cfg::set_TX_IQ_IMBALANCE_PCL(int i)
  83. //{
  84. //    i_TX_IQ_IMBALANCE_PCL = i;
  85. //}
  86. //==============================================================================
  87. //void  TMETA_factory_cfg::get_TX_IQ_IMBALANCE_MAX(double &d)
  88. //{
  89. //    d = d_TX_IQ_IMBALANCE_MAX;
  90. //}
  91. //-----------------------------------------------------------------------------
  92. //void  TMETA_factory_cfg::set_TX_IQ_IMBALANCE_MAX(double d)
  93. //{
  94. //    d_TX_IQ_IMBALANCE_MAX = d;
  95. //}
  96. //=============================================================================
  97. unsigned short TMETA_factory_cfg::getFreqBankNum( AnsiString as)
  98. {
  99.     unsigned short IntFreqBank = StrToInt(as);
  100.     unsigned short IntFreqBankNum = 0;
  101.     for(int i=0; i < sizeof(unsigned short)*8; i++)
  102.     {
  103.         if((IntFreqBank & 0x01) == 0x01)
  104.         {
  105.             IntFreqBankNum++;
  106.         }
  107.         IntFreqBank = IntFreqBank >> 1;
  108.         if(IntFreqBank == 0)
  109.             break;
  110.     }
  111.     return IntFreqBankNum;
  112. }
  113. //=============================================================================
  114. void  TMETA_factory_cfg::get663x2_GPIB_Addr(AnsiString &as)
  115. {
  116.     as = as_663x2_GPIB_Addr;
  117. }
  118. //----------------------------------------------------------------------------
  119. void  TMETA_factory_cfg::set663x2_GPIB_Addr(AnsiString as)
  120. {
  121.     as_663x2_GPIB_Addr = as;
  122. }
  123. //=============================================================================
  124. void  TMETA_factory_cfg::getADC_V1(int &i)
  125. {
  126.     i = i_ADC_V1;
  127. }
  128. //----------------------------------------------------------------------------
  129. void  TMETA_factory_cfg::setADC_V1(int i)
  130. {
  131.     i_ADC_V1 = i;
  132. }
  133. //=============================================================================
  134. void  TMETA_factory_cfg::getADC_V2(int &i)
  135. {
  136.     i = i_ADC_V2;
  137. }
  138. //----------------------------------------------------------------------------
  139. void  TMETA_factory_cfg::setADC_V2(int i)
  140. {
  141.     i_ADC_V2 = i;
  142. }
  143. //=============================================================================
  144. void  TMETA_factory_cfg::getADC_CHECK_VOLTAGE(int &i)
  145. {
  146.     i = i_ADC_CHECK_VOLTAGE;
  147. }
  148. //----------------------------------------------------------------------------
  149. void  TMETA_factory_cfg::setADC_CHECK_VOLTAGE(int i)
  150. {
  151.     i_ADC_CHECK_VOLTAGE = i;
  152. }
  153. //=============================================================================
  154. void  TMETA_factory_cfg::get_NORMAL_VOLTAGE(int &i)
  155. {
  156.     i = i_NORMAL_VOLTAGE;
  157. }
  158. //----------------------------------------------------------------------------
  159. void  TMETA_factory_cfg::set_NORMAL_VOLTAGE(int i)
  160. {
  161.     i_NORMAL_VOLTAGE = i;
  162. }
  163. //=============================================================================
  164. void  TMETA_factory_cfg::get_CURRENT_LIMIT(int &i)
  165. {
  166.     i = i_CURRENT_LIMIT;
  167. }
  168. //----------------------------------------------------------------------------
  169. void  TMETA_factory_cfg::set_CURRENT_LIMIT(int i)
  170. {
  171.     i_CURRENT_LIMIT = i;
  172. }
  173. //=============================================================================
  174. void  TMETA_factory_cfg::get_MAX_BATTERY_ADC_SLOPE(int &i)
  175. {
  176.     i = i_MAX_BATTERY_ADC_SLOPE;
  177. }
  178. //----------------------------------------------------------------------------
  179. void  TMETA_factory_cfg::set_MAX_BATTERY_ADC_SLOPE(int i)
  180. {
  181.     i_MAX_BATTERY_ADC_SLOPE = i;
  182. }
  183. //=============================================================================
  184. void TMETA_factory_cfg::get_MIN_BATTERY_ADC_SLOPE(int &i)
  185. {
  186.     i = i_MIN_BATTERY_ADC_SLOPE;
  187. }
  188. //----------------------------------------------------------------------------
  189. void  TMETA_factory_cfg::set_MIN_BATTERY_ADC_SLOPE(int i)
  190. {
  191.     i_MIN_BATTERY_ADC_SLOPE = i;
  192. }
  193. //=============================================================================
  194. void  TMETA_factory_cfg::get_MAX_BATTERY_ADC_OFFSET(int &i)
  195. {
  196.     i = i_MAX_BATTERY_ADC_OFFSET;
  197. }
  198. //----------------------------------------------------------------------------
  199. void  TMETA_factory_cfg::set_MAX_BATTERY_ADC_OFFSET(int i)
  200. {
  201.     i_MAX_BATTERY_ADC_OFFSET = i;
  202. }
  203. //=============================================================================
  204. void  TMETA_factory_cfg::get_MIN_BATTERY_ADC_OFFSET(int &i)
  205. {
  206.     i = i_MIN_BATTERY_ADC_OFFSET;
  207. }
  208. //----------------------------------------------------------------------------
  209. void  TMETA_factory_cfg::set_MIN_BATTERY_ADC_OFFSET(int i)
  210. {
  211.     i_MIN_BATTERY_ADC_OFFSET = i;
  212. }
  213. //=============================================================================
  214. void  TMETA_factory_cfg::get_BATTERY_CHANNEL(int &i)
  215. {
  216.     i = i_BATTERY_CHANNEL;
  217. }
  218. //----------------------------------------------------------------------------
  219. void  TMETA_factory_cfg::set_BATTERY_CHANNEL(int i)
  220. {
  221.     i_BATTERY_CHANNEL = i;
  222. }
  223. //=============================================================================
  224. void  TMETA_factory_cfg::get_CHARGER_CHANNEL(int &i)
  225. {
  226.     i = i_CHARGER_CHANNEL;
  227. }
  228. //----------------------------------------------------------------------------
  229. void  TMETA_factory_cfg::set_CHARGER_CHANNEL(int i)
  230. {
  231.     i_CHARGER_CHANNEL = i;
  232. }
  233. //=============================================================================
  234. void  TMETA_factory_cfg::get_ADC_RESISTANCE(double &d)
  235. {
  236.     d = d_ADC_RESISTANCE;
  237. }
  238. //----------------------------------------------------------------------------
  239. void  TMETA_factory_cfg::set_ADC_RESISTANCE(double d)
  240. {
  241.     d_ADC_RESISTANCE = d;
  242. }
  243. //=============================================================================
  244. void  TMETA_factory_cfg::get_MAX_VOLTAGE_DIFFERENCE(double &d)
  245. {
  246.     d = d_MAX_VOLTAGE_DIFFERENCE;
  247. }
  248. //----------------------------------------------------------------------------
  249. void  TMETA_factory_cfg::set_MAX_VOLTAGE_DIFFERENCE(double d)
  250. {
  251.     d_MAX_VOLTAGE_DIFFERENCE = d;
  252. }
  253. //=============================================================================
  254. void  TMETA_factory_cfg::get_MAX_CURRENT_DIFFERENCE(double &d)
  255. {
  256.     d = d_MAX_CURRENT_DIFFERENCE;
  257. }
  258. //----------------------------------------------------------------------------
  259. void  TMETA_factory_cfg::set_MAX_CURRENT_DIFFERENCE(double d)
  260. {
  261.     d_MAX_CURRENT_DIFFERENCE = d;
  262. }
  263. //=============================================================================
  264. void  TMETA_factory_cfg::get_ADC_MEASUREMENT_COUNT(int &i)
  265. {
  266.     i = i_ADC_MEASUREMENT_COUNT;
  267. }
  268. //----------------------------------------------------------------------------
  269. void  TMETA_factory_cfg::set_ADC_MEASUREMENT_COUNT(int i)
  270. {
  271.     i_ADC_MEASUREMENT_COUNT = i;
  272. }
  273. //===========================================================================
  274. ///////////////////////////             CV              /////////////////////
  275. //===========================================================================
  276. void TMETA_factory_cfg::get_MAX_CV_STEP(char &c)
  277. {
  278.     c = m_cMAX_CV_STEP;
  279. }
  280. //----------------------------------------------------------------------------
  281. void TMETA_factory_cfg::set_MAX_CV_STEP(char c)
  282. {
  283.     m_cMAX_CV_STEP = c;
  284. }
  285. //============================================================================
  286. void TMETA_factory_cfg::get_MIN_CV_STEP(char &c)
  287. {
  288.     c = m_cMIN_CV_STEP;
  289. }
  290. //----------------------------------------------------------------------------
  291. void TMETA_factory_cfg::set_MIN_CV_STEP(char c)
  292. {
  293.     m_cMIN_CV_STEP = c;
  294. }
  295. //===========================================================================
  296. ///////////////////////////        WiFi common          /////////////////////
  297. //===========================================================================
  298. void TMETA_factory_cfg::get_WiFi_Support(AnsiString &as)
  299. {
  300.     as = m_asWiFi_Support;
  301. }
  302. //---------------------------------------------------------------------------
  303. void TMETA_factory_cfg::set_WiFi_Support(AnsiString as)
  304. {
  305.     m_asWiFi_Support = as;
  306. }
  307. //===========================================================================
  308. ///////////////////////////  WiFi TX power calibration  /////////////////////
  309. //===========================================================================
  310. void TMETA_factory_cfg::get_CCK_MAX_P(double &d)
  311. {   d = m_dCCK_MAX_P;
  312. }
  313. //---------------------------------------------------------------------------
  314. void TMETA_factory_cfg::set_CCK_MAX_P(double d)
  315. {   m_dCCK_MAX_P = d;
  316. }
  317. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  318. void TMETA_factory_cfg::get_CCK_WANTED_P(double &d)
  319. {   d = m_dCCK_WANTED_P;
  320. }
  321. //---------------------------------------------------------------------------
  322. void TMETA_factory_cfg::set_CCK_WANTED_P(double d)
  323. {   m_dCCK_WANTED_P = d;
  324. }
  325. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  326. void TMETA_factory_cfg::get_CCK_MIN_P(double &d)
  327. {   d = m_dCCK_MIN_P;
  328. }
  329. //----------------------------------------------------------------------------
  330. void TMETA_factory_cfg::set_CCK_MIN_P(double d)
  331. {   m_dCCK_MIN_P = d;
  332. }
  333. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  334. void TMETA_factory_cfg::get_CCK_Delta(double &d)
  335. {   d = m_dCCK_Delta;
  336. }
  337. //----------------------------------------------------------------------------
  338. void TMETA_factory_cfg::set_CCK_Delta(double d)
  339. {   m_dCCK_Delta = d;
  340. }
  341. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  342. void TMETA_factory_cfg::get_CCK_C(int &i)
  343. {   i = m_iCCK_C;
  344. }
  345. //----------------------------------------------------------------------------
  346. void TMETA_factory_cfg::set_CCK_C(int i)
  347. {   m_iCCK_C = i;
  348. }
  349. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  350. void TMETA_factory_cfg::get_802_11B_CAL_CHANNEL(AnsiString &as)
  351. {
  352.     as = m_as802_11B_CAL_CHANNEL;
  353. }
  354. //----------------------------------------------------------------------------
  355. void TMETA_factory_cfg::set_802_11B_CAL_CHANNEL(AnsiString as)
  356. {
  357.     m_as802_11B_CAL_CHANNEL = as;
  358. }
  359. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  360. void TMETA_factory_cfg::get_802_11B_CHECK_CHANNEL(AnsiString &as)
  361. {
  362.     as = m_as802_11B_CHECK_CHANNEL;
  363. }
  364. //----------------------------------------------------------------------------
  365. void TMETA_factory_cfg::set_802_11B_CHECK_CHANNEL(AnsiString as)
  366. {
  367.     m_as802_11B_CHECK_CHANNEL = as;
  368. }
  369. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  370. void TMETA_factory_cfg::get_CCK_CAL_RATE(double &d)
  371. {
  372.     d = m_dCCK_CAL_RATE;
  373. }
  374. //----------------------------------------------------------------------------
  375. void TMETA_factory_cfg::set_CCK_CAL_RATE(double d)
  376. {
  377.     m_dCCK_CAL_RATE = d;
  378. }
  379. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  380. void TMETA_factory_cfg::get_CCK_CHECK_RATE(double &d)
  381. {
  382.     d = m_dCCK_CHECK_RATE;
  383. }
  384. //----------------------------------------------------------------------------
  385. void TMETA_factory_cfg::set_CCK_CHECK_RATE(double d)
  386. {
  387.     m_dCCK_CHECK_RATE = d;
  388. }
  389. void TMETA_factory_cfg::get_OFDM_MAX_P(double &d)
  390. {   d = m_dOFDM_MAX_P;
  391. }
  392. //----------------------------------------------------------------------------
  393. void TMETA_factory_cfg::set_OFDM_MAX_P(double d)
  394. {   m_dOFDM_MAX_P = d;
  395. }
  396. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  397. void TMETA_factory_cfg::get_OFDM_WANTED_P(double &d)
  398. {   d = m_dOFDM_WANTED_P;
  399. }
  400. //----------------------------------------------------------------------------
  401. void TMETA_factory_cfg::set_OFDM_WANTED_P(double d)
  402. {   m_dOFDM_WANTED_P = d;
  403. }
  404. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  405. void TMETA_factory_cfg::get_OFDM_MIN_P(double &d)
  406. {   d = m_dOFDM_MIN_P;
  407. }
  408. //----------------------------------------------------------------------------
  409. void TMETA_factory_cfg::set_OFDM_MIN_P(double d)
  410. {   m_dOFDM_MIN_P = d;
  411. }
  412. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  413. void TMETA_factory_cfg::get_OFDM_Delta(double &d)
  414. {   d = m_dOFDM_Delta;
  415. }
  416. //----------------------------------------------------------------------------
  417. void TMETA_factory_cfg::set_OFDM_Delta(double d)
  418. {   m_dOFDM_Delta = d;
  419. }
  420. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  421. void TMETA_factory_cfg::get_OFDM_C(int &i)
  422. {   i = m_iOFDM_C;
  423. }
  424. //----------------------------------------------------------------------------
  425. void TMETA_factory_cfg::set_OFDM_C(int i)
  426. {   m_iOFDM_C = i;
  427. }
  428. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  429. void TMETA_factory_cfg::get_802_11G_CAL_CHANNEL(AnsiString &as)
  430. {
  431.     as = m_as802_11G_CAL_CHANNEL;
  432. }
  433. //----------------------------------------------------------------------------
  434. void TMETA_factory_cfg::set_802_11G_CAL_CHANNEL(AnsiString as)
  435. {
  436.     m_as802_11G_CAL_CHANNEL = as;
  437. }
  438. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  439. void TMETA_factory_cfg::get_802_11G_CHECK_CHANNEL(AnsiString &as)
  440. {
  441.     as = m_as802_11G_CHECK_CHANNEL;
  442. }
  443. //----------------------------------------------------------------------------
  444. void TMETA_factory_cfg::set_802_11G_CHECK_CHANNEL(AnsiString as)
  445. {
  446.     m_as802_11G_CHECK_CHANNEL = as;
  447. }
  448. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  449. void TMETA_factory_cfg::get_OFDM_CAL_RATE(double &d)
  450. {
  451.     d = m_dOFDM_CAL_RATE;
  452. }
  453. //----------------------------------------------------------------------------
  454. void TMETA_factory_cfg::set_OFDM_CAL_RATE(double d)
  455. {
  456.     m_dOFDM_CAL_RATE = d;
  457. }
  458. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  459. void TMETA_factory_cfg::get_OFDM_CHECK_RATE(double &d)
  460. {
  461.     d = m_dOFDM_CHECK_RATE;
  462. }
  463. //----------------------------------------------------------------------------
  464. void TMETA_factory_cfg::set_OFDM_CHECK_RATE(double d)
  465. {
  466.     m_dOFDM_CHECK_RATE = d;
  467. }
  468. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  469. void TMETA_factory_cfg::get_WiFiTxPRecursive_Times(int &i)
  470. {   i = m_iWiFiTxPRecursive_Times;
  471. }
  472. //----------------------------------------------------------------------------
  473. void TMETA_factory_cfg::set_WiFiTxPRecursive_Times(int i)
  474. {   m_iWiFiTxPRecursive_Times = i;
  475. }
  476. //============================================================================
  477. /////////////////////////////////////   BT  //////////////////////////////////
  478. //============================================================================
  479. void TMETA_factory_cfg::get_BD_Address(AnsiString &as)
  480. {
  481.     as = m_asBD_Address;
  482. }
  483. //---------------------------------------------------------------------------
  484. void TMETA_factory_cfg::set_BD_Address(AnsiString as)
  485. {
  486.     m_asBD_Address = as;
  487. }
  488. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  489. void TMETA_factory_cfg::get_Inquiry_Enable(AnsiString &as)
  490. {
  491.     as = m_asInquiry_Enable;
  492. }
  493. //---------------------------------------------------------------------------
  494. void TMETA_factory_cfg::set_Inquiry_Enable(AnsiString as)
  495. {
  496.     m_asInquiry_Enable = as;
  497. }
  498. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  499. void TMETA_factory_cfg::get_BT_DOWNLINK_POWER(double &d)
  500. {
  501.     d = m_dBT_DOWNLINK_POWER;
  502. }
  503. //----------------------------------------------------------------------------
  504. void TMETA_factory_cfg::set_BT_DOWNLINK_POWER(double d)
  505. {
  506.     m_dBT_DOWNLINK_POWER = d;
  507. }
  508. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  509. void TMETA_factory_cfg::get_BT_CRYSTAL_CAP_ID1(unsigned char &uc)
  510. {
  511.     uc = m_ucBT_CRYSTAL_CAP_ID1;
  512. }
  513. //----------------------------------------------------------------------------
  514. void TMETA_factory_cfg::set_BT_CRYSTAL_CAP_ID1(unsigned char uc)
  515. {
  516.     m_ucBT_CRYSTAL_CAP_ID1 = uc;
  517. }
  518. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  519. void TMETA_factory_cfg::get_BT_CRYSTAL_CAP_ID2(unsigned char &uc)
  520. {
  521.     uc = m_ucBT_CRYSTAL_CAP_ID2;
  522. }
  523. //----------------------------------------------------------------------------
  524. void TMETA_factory_cfg::set_BT_CRYSTAL_CAP_ID2(unsigned char uc)
  525. {
  526.     m_ucBT_CRYSTAL_CAP_ID2 = uc;
  527. }
  528. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  529. void TMETA_factory_cfg::get_BT_CRYSTAL_CHANNEL(unsigned short &us)
  530. {
  531.     us = m_usBT_CRYSTAL_CHANNEL;
  532. }
  533. //----------------------------------------------------------------------------
  534. void TMETA_factory_cfg::set_BT_CRYSTAL_CHANNEL(unsigned short us)
  535. {
  536.     m_usBT_CRYSTAL_CHANNEL = us;
  537. }
  538. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  539. void TMETA_factory_cfg::get_BT_CRYSTAL_MAX_FREQ_ACCURACY(double &d)
  540. {
  541.     d = m_dBT_CRYSTAL_MAX_FREQ_ACCURACY;
  542. }
  543. //----------------------------------------------------------------------------
  544. void TMETA_factory_cfg::set_BT_CRYSTAL_MAX_FREQ_ACCURACY(double d)
  545. {
  546.     m_dBT_CRYSTAL_MAX_FREQ_ACCURACY = d;
  547. }
  548. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  549. void TMETA_factory_cfg::get_MIN_POLL_COUNT(unsigned int &ui)
  550. {
  551.     ui = m_uiMIN_POLL_COUNT;
  552. }
  553. //----------------------------------------------------------------------------
  554. void TMETA_factory_cfg::set_MIN_POLL_COUNT(unsigned int ui)
  555. {
  556.     m_uiMIN_POLL_COUNT = ui;
  557. }
  558. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  559. void TMETA_factory_cfg::get_MAX_POLL_COUNT(unsigned int &ui)
  560. {
  561.      ui = m_uiMAX_POLL_COUNT;
  562. }
  563. //----------------------------------------------------------------------------
  564. void TMETA_factory_cfg::set_MAX_POLL_COUNT(unsigned int ui)
  565. {
  566.     m_uiMIN_POLL_COUNT = ui;
  567. }
  568. //=============================================================================
  569. bool TMETA_factory_cfg::ReadFromIniFile(AnsiString as)
  570. {
  571.     TIniFile *ini;
  572.     ini = new TIniFile(as);
  573.     if (NULL == ini)
  574.     {
  575.         return false;
  576.     }
  577.     // Equipment initialization
  578.     ReadAge8960InitFromIniFile(ini);
  579.     ReadCmu200InitFromIniFile(ini);
  580.     ReadCBTInitFromIniFile(ini);
  581.     ReadIQviewInitFromIniFile(ini);
  582.     ReadAgilentN4010aInitFromIniFile(ini);
  583.     ReadCommonFromIniFile(ini);
  584.     ReadIP2FromIniFile(ini);
  585.     ReadAfcFromIniFile(ini);
  586.     ReadRxPathLossFromIniFile(ini);
  587.     ReadTxIqFromIniFile(ini);
  588.     ReadTxPclFromIniFile(ini);
  589.     ReadAdcFromIniFile(ini);
  590.     ReadCVFromIniFile(ini);
  591.     ReadWiFiCommonFromIniFile(ini);
  592.     ReadWiFiTxPowerFromIniFile(ini);
  593.     ReadBTCommonFromIniFile(ini);
  594.     ReadBTCrystalCAPIDFromIniFile(ini);
  595.     delete ini;
  596.     return true;
  597. }
  598. //=============================================================================
  599. void TMETA_factory_cfg::ReadCommonFromIniFile(TIniFile *ini)
  600. {
  601.    // if( ini->SectionExists( "Frequency Bank" ) == false )
  602.    //     return false;
  603.     as_FreqBank = ini->ReadString("Frequency Bank",
  604.                                          "bank",
  605.                                         "0x0C"
  606.                                        );
  607.     //if( ini->SectionExists( "C0 for each Bank" ) == false )
  608.     //    return false;
  609.     m_sARFCN_C0_GSM400 = ini->ReadInteger("C0 for each Bank",
  610.                                             "arfcn_C0_GSM400",
  611.                                             276
  612.                                            );
  613.     m_sARFCN_C0_GSM850 = ini->ReadInteger("C0 for each Bank",
  614.                                             "arfcn_C0_GSM850",
  615.                                             190
  616.                                            );
  617.     m_sARFCN_C0_GSM = ini->ReadInteger("C0 for each Bank",
  618.                                             "arfcn_C0_GSM",
  619.                                             70
  620.                                            );
  621.     m_sARFCN_C0_DCS = ini->ReadInteger("C0 for each Bank",
  622.                                             "arfcn_C0_DCS",
  623.                                             700
  624.                                            );
  625.     m_sARFCN_C0_PCS = ini->ReadInteger("C0 for each Bank",
  626.                                             "arfcn_C0_PCS",
  627.                                             660
  628.                                            );
  629.     //if( ini->SectionExists( "Downlink power" ) == false )
  630.     //    return false;
  631.     AnsiString as_P_DL = ini->ReadString("Downlink power",
  632.                                          "P_DL",
  633.                                          "-60"
  634.                                         );
  635.     d_P_DL = atof(as_P_DL.c_str());
  636. }
  637. //---------------------------------------------------------------------------
  638. void TMETA_factory_cfg::ReadIP2FromIniFile(TIniFile *ini)
  639. {
  640.     ////////////////////////////////   IP2    //////////////////////////////////
  641.     m_sIP2_arfcn_C0_GSM = ini->ReadInteger("IP2 table", "IP2_arfcn_C0_GSM", 100);
  642.     m_sIP2_arfcn_C0_DCS = ini->ReadInteger("IP2 table", "IP2_arfcn_C0_DCS", 730);
  643.     m_sIP2_arfcn_C0_PCS = ini->ReadInteger("IP2 table", "IP2_arfcn_C0_PCS", 690);
  644.     m_sIP2_arfcn_C0_GSM850 = ini->ReadInteger("IP2 table", "IP2_arfcn_C0_GSM850", 220);
  645.     //m_sIP2_arfcn_TCH_GSM = ini->ReadInteger("IP2 table", "IP2_arfcn_TCH_GSM", 0);
  646.     //m_sIP2_arfcn_TCH_DCS = ini->ReadInteger("IP2 table", "IP2_arfcn_TCH_DCS", 512);
  647.     //m_sIP2_arfcn_TCH_PCS = ini->ReadInteger("IP2 table", "IP2_arfcn_TCH_PCS", 512);
  648.     //m_sIP2_arfcn_TCH_GSM850 = ini->ReadInteger("IP2 table", "IP2_arfcn_TCH_GSM850", 128);
  649.     d_IP2_CAL_P_DL_ON_SKY = ini->ReadInteger("IP2 table", "IP2_CAL_P_DL_ON_SKY", -30);
  650.     d_IP2_CAL_P_DL_OFF_SKY = ini->ReadInteger("IP2 table", "IP2_CAL_P_DL_OFF_SKY", -120);
  651.     d_IP2_CAL_P_DL_ON_MT = ini->ReadInteger("IP2 table", "IP2_CAL_P_DL_ON_MT", -25);
  652.     d_IP2_CAL_P_DL_OFF_MT = ini->ReadInteger("IP2 table", "IP2_CAL_P_DL_OFF_MT", -120);
  653.     d_IP2_CHECK_P_DL_ON = ini->ReadInteger("IP2 table", "IP2_CHECK_P_DL_ON", -30);
  654.     d_IP2_CHECK_P_DL_OFF = ini->ReadInteger("IP2 table", "IP2_CHECK_P_DL_OFF", -120);
  655.     d_IP2_GAIN = ini->ReadInteger("IP2 table", "IP2_GAIN", 65);
  656.     i_IP2_N_PM = ini->ReadInteger("IP2 table", "IP2_N_PM", 200);
  657.     c_IP2_M_PM = ini->ReadInteger("IP2 table", "IP2_M_PM", 1);
  658.   // as_IP2_BAND = ini->ReadString("IP2 table", "IP2_BAND", "GSM");
  659.   //  m_sIP2_ARFCN = ini->ReadInteger("IP2 table", "IP2_ARFCN", 70);
  660.     i_IP2_ICORRECTION1_SKY74045 = ini->ReadInteger("IP2 table", "IP2_ICORRECTION1_SKY74045", -63);
  661.     i_IP2_QCORRECTION1_SKY74045 = ini->ReadInteger("IP2 table", "IP2_QCORRECTION1_SKY74045", -63);
  662.     i_IP2_ICORRECTION2_SKY74045 = ini->ReadInteger("IP2 table", "IP2_ICORRECTION2_SKY74045",  63);
  663.     i_IP2_QCORRECTION2_SKY74045 = ini->ReadInteger("IP2 table", "IP2_QCORRECTION2_SKY74045",  63);
  664.     i_IP2_ICORRECTION1_SKY74117 = ini->ReadInteger("IP2 table", "IP2_ICORRECTION1_SKY74117", -16);
  665.     i_IP2_QCORRECTION1_SKY74117 = ini->ReadInteger("IP2 table", "IP2_QCORRECTION1_SKY74117", -16);
  666.     i_IP2_ICORRECTION2_SKY74117 = ini->ReadInteger("IP2 table", "IP2_ICORRECTION2_SKY74117",  16);
  667.     i_IP2_QCORRECTION2_SKY74117 = ini->ReadInteger("IP2 table", "IP2_QCORRECTION2_SKY74117",  16);
  668.     i_IP2_AMCODEI1 = ini->ReadInteger("IP2 table", "IP2_AMCODEI1",  64);
  669.     i_IP2_AMCODEQ1 = ini->ReadInteger("IP2 table", "IP2_AMCODEQ1",  64);
  670.     i_IP2_AMCODEI2 = ini->ReadInteger("IP2 table", "IP2_AMCODEI2",  191);
  671.     i_IP2_AMCODEQ2 = ini->ReadInteger("IP2 table", "IP2_AMCODEQ2",  191);
  672.     m_iIP2_MAX_IDC_SKY74045 = ini->ReadInteger("IP2 table", "IP2_MAX_IDC_SKY74045",  0);
  673.     m_iIP2_MAX_QDC_SKY74045 = ini->ReadInteger("IP2 table", "IP2_MAX_QDC_SKY74045",  0);
  674.     m_iIP2_MAX_IDC_SKY74117 = ini->ReadInteger("IP2 table", "IP2_MAX_IDC_SKY74117",  0);
  675.     m_iIP2_MAX_QDC_SKY74117 = ini->ReadInteger("IP2 table", "IP2_MAX_QDC_SKY74117",  0);
  676.     m_iIP2_MAX_IDC_MT6139   = ini->ReadInteger("IP2 table", "IP2_MAX_IDC_MT6139",  0);
  677.     m_iIP2_MAX_QDC_MT6139   = ini->ReadInteger("IP2 table", "IP2_MAX_QDC_MT6139",  0);
  678. }
  679. //----------------------------------------------------------------------------
  680. void TMETA_factory_cfg::ReadAfcFromIniFile(TIniFile *ini)
  681. {
  682.     // AFC
  683.     AnsiString as_CRYSTAL_AFC_MIN_FREQ_ERR_PPM;
  684.     AnsiString as_CRYSTAL_AFC_MAX_FREQ_ERR_PPM;
  685.     AnsiString as_CRYSTAL_AFC_MAX_AFC_TRACK_INIT_FREQ_ERR;
  686.     AnsiString as_MAX_INIT_AFC_DAC;
  687.     AnsiString as_MAX_AFC_SLOPE;
  688.     AnsiString as_MIN_AFC_SLOPE;
  689.     //////////////////////////   AFC   ////////////////////////////////////////
  690.     as_AFC_BAND = ini->ReadString("AFC Calibration",
  691.                                      "AFC_BAND",
  692.                                      "GSM"
  693.                                     );
  694.     m_sAFC_ARFCN = ini->ReadInteger("AFC Calibration",
  695.                                      "AFC_ARFCN",
  696.                                      70
  697.                                     );
  698.     m_sN_AFC = ini->ReadInteger("AFC Calibration",
  699.                                      "N_AFC",
  700.                                      10
  701.                                     );
  702.     m_sDAC1 = ini->ReadInteger("AFC Calibration",
  703.                                     "DAC1",
  704.                                     4000
  705.                                    );
  706.     m_sDAC2 = ini->ReadInteger("AFC Calibration",
  707.                                     "DAC2",
  708.                                     5000
  709.                                    );
  710.     m_sCRYSTAL_DAC1 = ini->ReadInteger("AFC Calibration",
  711.                                        "CRYSTAL_DAC1",
  712.                                        3800
  713.                                        );
  714.     m_sCRYSTAL_DAC2 = ini->ReadInteger("AFC Calibration",
  715.                                        "CRYSTAL_DAC2",
  716.                                        4200
  717.                                        );
  718.     m_sMAX_INIT_AFC_DAC = ini->ReadInteger("AFC table",
  719.                                                 "MAX_INIT_AFC_DAC",
  720.                                                 65535
  721.                                                );
  722.     m_sMIN_INIT_AFC_DAC = ini->ReadInteger("AFC table",
  723.                                                 "MIN_INIT_AFC_DAC",
  724.                                                 0
  725.                                                );
  726.     as_MAX_AFC_SLOPE = ini->ReadString("AFC table",
  727.                                              "MAX_AFC_SLOPE",
  728.                                              "5.0"
  729.                                             );
  730.     d_MAX_AFC_SLOPE = atof(as_MAX_AFC_SLOPE.c_str());
  731.     as_MIN_AFC_SLOPE = ini->ReadString("AFC table",
  732.                                              "MIN_AFC_SLOPE",
  733.                                              "0.0"
  734.                                              );
  735.     d_MIN_AFC_SLOPE = atof(as_MIN_AFC_SLOPE.c_str());
  736.     /////////////////////////////// crystal AFC  //////////////////////////////
  737.     as_CRYSTAL_AFC_BAND = ini->ReadString("Crystal AFC Calibration",
  738.                                            "CRYSTAL_AFC_BAND",
  739.                                            "GSM"
  740.                                           );
  741.     m_sCRYSTAL_AFC_ARFCN = ini->ReadInteger("Crystal AFC Calibration",
  742.                                            "CRYSTAL_AFC_ARFCN",
  743.                                            65
  744.                                           );
  745.     d_CRYSTAL_AFC_TCH_P_DL = ini->ReadInteger("Crystal AFC Calibration",
  746.                                            "CRYSTAL_AFC_TCH_P_DL",
  747.                                            -70
  748.                                           );
  749.     i_CRYSTAL_AFC_GSM850_PCL = ini->ReadInteger("Crystal AFC Calibration",
  750.                                            "CRYSTAL_AFC_GSM850_PCL",
  751.                                            12
  752.                                           );
  753.     i_CRYSTAL_AFC_GSM900_PCL = ini->ReadInteger("Crystal AFC Calibration",
  754.                                            "CRYSTAL_AFC_GSM900_PCL",
  755.                                            12
  756.                                           );
  757.     i_CRYSTAL_AFC_DCS1800_PCL = ini->ReadInteger("Crystal AFC Calibration",
  758.                                            "CRYSTAL_AFC_DCS1800_PCL",
  759.                                            12
  760.                                           );
  761.     i_CRYSTAL_AFC_PCS1900_PCL = ini->ReadInteger("Crystal AFC Calibration",
  762.                                            "CRYSTAL_AFC_PCS1900_PCL",
  763.                                            12
  764.                                           );
  765.     m_sCRYSTAL_AFC_CAL_DAC = ini->ReadInteger("Crystal AFC Calibration",
  766.                                        "CRYSTAL_AFC_CAL_DAC",
  767.                                         4100
  768.                                        );
  769.     m_sCRYSTAL_AFC_CHECK_DAC1 = ini->ReadInteger("Crystal AFC Calibration",
  770.                                              "CRYSTAL_AFC_CHECK_DAC1",
  771.                                              0
  772.                                             );
  773.     m_sCRYSTAL_AFC_CHECK_DAC2 = ini->ReadInteger("Crystal AFC Calibration",
  774.                                              "CRYSTAL_AFC_CHECK_DAC2",
  775.                                              8000
  776.                                             );
  777.     as_CRYSTAL_AFC_MIN_FREQ_ERR_PPM = ini->ReadString("Crystal AFC Calibration",
  778.                                                  "CRYSTAL_AFC_MIN_FREQ_ERR_PPM",
  779.                                                  "-17.0"
  780.                                                 );
  781.     d_CRYSTAL_AFC_MIN_FREQ_ERR_PPM = atof(as_CRYSTAL_AFC_MIN_FREQ_ERR_PPM.c_str());
  782.     as_CRYSTAL_AFC_MAX_FREQ_ERR_PPM = ini->ReadString("Crystal AFC Calibration",
  783.                                                  "CRYSTAL_AFC_MAX_FREQ_ERR_PPM",
  784.                                                  "17.0"
  785.                                                 );
  786.     d_CRYSTAL_AFC_MAX_FREQ_ERR_PPM = atof(as_CRYSTAL_AFC_MAX_FREQ_ERR_PPM.c_str());
  787.     as_CRYSTAL_AFC_MAX_AFC_TRACK_INIT_FREQ_ERR = ini->ReadString("Crystal AFC Calibration",
  788.                                                  "CRYSTAL_AFC_MAX_AFC_TRACK_INIT_FREQ_ERR",
  789.                                                  "100.0"
  790.                                                 );
  791.     m_dCRYSTAL_AFC_MAX_AFC_TRACK_INIT_FREQ_ERR = atof(as_CRYSTAL_AFC_MAX_AFC_TRACK_INIT_FREQ_ERR.c_str());
  792.     m_sCRYSTAL_AFC_FREQ_ERR_MEASUSE_COUNT = ini->ReadInteger("Crystal AFC Calibration",
  793.                                              "CRYSTAL_AFC_FREQ_ERR_MEASUSE_COUNT",
  794.                                              10
  795.                                             );
  796.     m_sCRYSTAL_AFC_RECURSIVE_TIMES = ini->ReadInteger("Crystal AFC Calibration",
  797.                                              "CRYSTAL_AFC_RECURSIVE_TIMES",
  798.                                              20
  799.                                             );
  800. }
  801. //--------------------------------------------------------------------------
  802. void TMETA_factory_cfg::ReadRxPathLossFromIniFile(TIniFile *ini)
  803. {
  804.     i_N_PM = ini->ReadInteger("RX measurement samples",
  805.                                     "N_PM",
  806.                                     5
  807.                                    );
  808.     c_M_PM = ini->ReadInteger("RX measurement samples",
  809.                                      "M_PM",
  810.                                      4
  811.                                     );
  812.    // unsigned char pm_support_num = frmMainSel->Get_PmSupportNum();
  813.    // if( c_M_PM > pm_support_num )
  814.    // {
  815.    //     PostMessage(
  816.    //                   handle,
  817.    //                   WM_MF_RF_PM_SUPPORT_FAIL,
  818.    //                   c_M_PM,
  819.    //                   pm_support_num
  820.    //                );
  821.    // }
  822.    // if( ini->SectionExists( "RX path loss table" ) == false )
  823.    //     return false;
  824.     as_GSM400_MAX_RX_LOSS = ini->ReadString("RX path loss table",
  825.                                                "GSM400_MAX_RX_LOSS",
  826.                                                "3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.0000,"
  827.                                               );
  828.     as_GSM400_MIN_RX_LOSS = ini->ReadString("RX path loss table",
  829.                                             "GSM400_MIN_RX_LOSS",
  830.                                             "-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.0000,"
  831.                                            );
  832.     as_GSM850_MAX_RX_LOSS = ini->ReadString("RX path loss table",
  833.                                                "GSM850_MAX_RX_LOSS",
  834.                                                "3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.0000,"
  835.                                               );
  836.     as_GSM850_MIN_RX_LOSS = ini->ReadString("RX path loss table",
  837.                                             "GSM850_MIN_RX_LOSS",
  838.                                             "-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.0000,"
  839.                                            );
  840.     as_GSM900_MAX_RX_LOSS = ini->ReadString("RX path loss table",
  841.                                                "GSM900_MAX_RX_LOSS",
  842.                                                "3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.0000,"
  843.                                               );
  844.     as_GSM900_MIN_RX_LOSS = ini->ReadString("RX path loss table",
  845.                                                   "GSM900_MIN_RX_LOSS",
  846.                                                   "-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.0000,"
  847.                                                  );
  848.     as_DCS1800_MAX_RX_LOSS = ini->ReadString("RX path loss table",
  849.                                                    "DCS1800_MAX_RX_LOSS",
  850.                                                    "3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.0000,"
  851.                                                   );
  852.     as_DCS1800_MIN_RX_LOSS = ini->ReadString("RX path loss table",
  853.                                                    "DCS1800_MIN_RX_LOSS",
  854.                                                    "-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.0000,"
  855.                                                   );
  856.                                                                                                    
  857.     as_PCS1900_MAX_RX_LOSS = ini->ReadString("RX path loss table",
  858.                                                    "PCS1900_MAX_RX_LOSS",
  859.                                                    "3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.000,3.0000,"
  860.                                                   );
  861.     as_PCS1900_MIN_RX_LOSS = ini->ReadString("RX path loss table",
  862.                                                    "PCS1900_MIN_RX_LOSS",
  863.                                                    "-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.000,-3.0000,"
  864.                                                   );
  865. }
  866. //--------------------------------------------------------------------------
  867. void TMETA_factory_cfg::ReadTxIqFromIniFile(TIniFile *ini)
  868. {
  869.     AnsiString as;
  870.     //////////////////////// TX DC offset ///////////////////////////////////
  871.     m_uiTX_IQ_MEASUREMENT_COUNT = ini->ReadInteger("TX IQ table",
  872.                                                    "TX_IQ_MEASUREMENT_COUNT",
  873.                                                    20
  874.                                              );
  875.     m_asTX_IQ_BAND = ini->ReadString("TX IQ table",
  876.                                               "TX_IQ_BAND",
  877.                                               "GSM"
  878.                                              );
  879.     m_sTX_IQ_ARFCN = ini->ReadInteger("TX IQ table",
  880.                                               "TX_IQ_ARFCN",
  881.                                               70
  882.                                              );
  883.     m_sTX_IQ_PCL = ini->ReadInteger("TX IQ table",
  884.                                               "TX_IQ_PCL",
  885.                                               10
  886.                                              );
  887.     as = ini->ReadString("TX IQ table",
  888.                          "TX_IQ_DC_OFFSET_MAX",
  889.                          "-40"
  890.                          );
  891.     m_dTX_IQ_DC_OFFSET_MAX = atof(as.c_str());
  892.     as = ini->ReadString("TX IQ table",
  893.                          "TX_IQ_GAIN_IMBALANCE_MAX",
  894.                          "-40"
  895.                          );
  896.     m_dTX_IQ_GAIN_IMBALANCE_MAX = atof(as.c_str());
  897.     m_asTX_IQ_BAND_HIGH = ini->ReadString("TX IQ table",
  898.                                               "TX_IQ_BAND_HIGH",
  899.                                               "DCS"
  900.                                              );
  901.     m_sTX_IQ_ARFCN_HIGH = ini->ReadInteger("TX IQ table",
  902.                                               "TX_IQ_ARFCN_HIGH",
  903.                                               70
  904.                                              );
  905.     m_sTX_IQ_PCL_HIGH = ini->ReadInteger("TX IQ table",
  906.                                               "TX_IQ_PCL_HIGH",
  907.                                               10
  908.                                              );
  909.     as = ini->ReadString("TX IQ table",
  910.                          "TX_IQ_DC_OFFSET_MAX_HIGH",
  911.                          "-40"
  912.                          );
  913.     m_dTX_IQ_DC_OFFSET_MAX_HIGH = atof(as.c_str());
  914.     as = ini->ReadString("TX IQ table",
  915.                          "TX_IQ_GAIN_IMBALANCE_MAX_HIGH",
  916.                          "-40"
  917.                          );
  918.     m_dTX_IQ_GAIN_IMBALANCE_MAX_HIGH = atof(as.c_str());
  919.     //////////////////////// TX IQ imbalance ///////////////////////////////////
  920.  //   as_TX_IQ_IMBALANCE_BAND = ini->ReadString("TX IQ imbalance table",
  921.  //                                             "TX_IQ_IMBALANCE_BAND",
  922.  //                                             "GSM"
  923.  //                                            );
  924.   //  m_sTX_IQ_IMBALANCE_ARFCN = ini->ReadInteger("TX IQ imbalance table",
  925.   //                                            "TX_IQ_IMBALANCE_ARFCN",
  926.   //                                            70
  927.   //                                           );
  928.   //
  929.   //  i_TX_IQ_IMBALANCE_PCL = ini->ReadInteger("TX IQ imbalance table",
  930.   //                                            "TX_IQ_IMBALANCE_PCL",
  931.   //                                            10
  932.   //                                           );
  933.   //
  934.   //
  935.   //  d_TX_IQ_IMBALANCE_MAX = ini->ReadString("TX IQ imbalance table",
  936.   //                                            "TX_IQ_IMBALANCE_MAX",
  937.   //                                                -40
  938.   //                                               );
  939. }
  940. //--------------------------------------------------------------------------
  941. void TMETA_factory_cfg::ReadTxPclFromIniFile(TIniFile *ini)
  942. {
  943.     AnsiString as;
  944.     ////////////////////////////////   APC    //////////////////////////////////
  945.    // if( ini->SectionExists( "TX PCL table" ) == false )
  946.    //     return false;
  947.     m_asGSM400_CAL_PCL = ini->ReadString("TX PCL table",
  948.                                               "GSM400_CAL_PCL",
  949.                                               "17, 12, 5,"
  950.                                              );
  951.     m_asGSM400_2CAL_PCL = ini->ReadString("TX PCL table",
  952.                                               "GSM400_2CAL_PCL",
  953.                                               "19, 5,"
  954.                                              );
  955.     m_asGSM400_4CAL_PCL = ini->ReadString("TX PCL table",
  956.                                               "GSM400_4CAL_PCL",
  957.                                               "15,12,10,6,"
  958.                                              );
  959.     m_asGSM400_PCL = ini->ReadString("TX PCL table",
  960.                                           "GSM400_PCL",
  961.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  962.                                          );
  963.     m_asGSM400_CHECK_PCL = ini->ReadString("TX PCL table",
  964.                                           "GSM400_CHECK_PCL",
  965.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  966.                                          );
  967.     m_asGSM400_MAX_P = ini->ReadString("TX PCL table",
  968.                                             "GSM400_MAX_P",
  969.                                             "6, 8, 10,12,13.8,15.8,17.8,19.8,21.8,23.8,25.8,27.8,29.8,31.8,32.8,"
  970.                                            );
  971.     m_asGSM400_WANTED_P = ini->ReadString("TX PCL table",
  972.                                                "GSM400_WANTED_P",
  973.                                                "5.5,7.5,9.5,11.5,13.5,15.5,17.5,19.5,21.5,23.5,25.5,27.5,29.5,31.5,32.7,"
  974.                                               );
  975.     m_asGSM400_MIN_P = ini->ReadString("TX PCL table",
  976.                                             "GSM400_MIN_P",
  977.                                             "5.3,7.3,9.3,11.3,13.3,15,17,19,21,23,25,26.5,28.5,30.5,32.5,"
  978.                                            );
  979.     m_asGSM400_C = ini->ReadString("TX PCL table",
  980.                                         "GSM400_C",
  981.                                         "3,3,3,3,4,4,6,6,8,8,12,12,15,15,35,40"
  982.                                        );
  983.     m_asGSM400_CORRECTION = ini->ReadString("TX PCL table",
  984.                                             "GSM400_CORRECTION",
  985.                                             "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  986.                                            );
  987.     m_asGSM400_EPSK_CAL_PCL = ini->ReadString("TX PCL table",
  988.                                               "GSM400_EPSK_CAL_PCL",
  989.                                               "17, 12, 5,"
  990.                                              );
  991.     m_asGSM400_EPSK_2CAL_PCL = ini->ReadString("TX PCL table",
  992.                                               "GSM400_EPSK_2CAL_PCL",
  993.                                               "19, 5,"
  994.                                              );
  995.     m_asGSM400_EPSK_PCL = ini->ReadString("TX PCL table",
  996.                                           "GSM400_EPSK_PCL",
  997.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  998.                                          );
  999.     m_asGSM400_EPSK_CHECK_PCL = ini->ReadString("TX PCL table",
  1000.                                           "GSM400_EPSK_CHECK_PCL",
  1001.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  1002.                                          );
  1003.     m_asGSM400_EPSK_MAX_P = ini->ReadString("TX PCL table",
  1004.                                             "GSM400_EPSK_MAX_P",
  1005.                                             "6, 8, 10,12,13.8,15.8,17.8,19.8,21.8,23.8,25.8,27.8,27.8,27.8,27.8,"
  1006.                                            );
  1007.     m_asGSM400_EPSK_WANTED_P = ini->ReadString("TX PCL table",
  1008.                                                "GSM400_EPSK_WANTED_P",
  1009.                                                "5.2,7,9,11,13,15,17,19,21,23,25,27,27,27,27,"
  1010.                                               );
  1011.     m_asGSM400_EPSK_MIN_P = ini->ReadString("TX PCL table",
  1012.                                             "GSM400_EPSK_MIN_P",
  1013.                                             "4,6,8,10,12.5,14.5,16.5,18.5,20.5,22.5,24.5,26.5,26.5,26.5,26.5,"
  1014.                                            );
  1015.     m_asGSM400_EPSK_C = ini->ReadString("TX PCL table",
  1016.                                         "GSM400_EPSK_C",
  1017.                                         "3,3,3,3,4,4,6,6,8,8,12,12,15,15,35,40,"
  1018.                                        );
  1019.     m_asGSM400_EPSK_CORRECTION = ini->ReadString("TX PCL table",
  1020.                                             "GSM400_EPSK_CORRECTION",
  1021.                                             "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1022.                                            );
  1023.     // GSM850
  1024.     m_asGSM850_CAL_PCL = ini->ReadString("TX PCL table",
  1025.                                   "GSM850_CAL_PCL",
  1026.                                   "17, 12, 5,"
  1027.                                              );
  1028.     m_asGSM850_2CAL_PCL = ini->ReadString("TX PCL table",
  1029.                                         "GSM850_2CAL_PCL",
  1030.                                         "19, 5,"
  1031.                                              );
  1032.     m_asGSM850_4CAL_PCL = ini->ReadString("TX PCL table",
  1033.                                           "GSM850_4CAL_PCL",
  1034.                                           "15,12,10,6,"
  1035.                                         );
  1036.     m_asGSM850_6CAL_PCL = ini->ReadString("TX PCL table",
  1037.                                           "GSM850_6CAL_PCL",
  1038.                                           "19,17,15,10,8,6,"
  1039.                                         );
  1040.     m_asGSM850_6CAL_DAC = ini->ReadString("TX PCL table",
  1041.                                           "GSM850_6CAL_DAC",
  1042.                                           "90,160,223,398,493,549,"
  1043.                                         );
  1044.     m_asGSM850_PCL = ini->ReadString("TX PCL table",
  1045.                                           "GSM850_PCL",
  1046.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  1047.                                          );
  1048.     m_asGSM850_CHECK_PCL = ini->ReadString("TX PCL table",
  1049.                                           "GSM850_CHECK_PCL",
  1050.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  1051.                                          );
  1052.     m_asGSM850_MAX_P = ini->ReadString("TX PCL table",
  1053.                                             "GSM850_MAX_P",
  1054.                                             "6, 8, 10,12,13.8,15.8,17.8,19.8,21.8,23.8,25.8,27.8,29.8,31.8,32.8"
  1055.                                            );
  1056.     m_asGSM850_WANTED_P = ini->ReadString("TX PCL table",
  1057.                                                "GSM850_WANTED_P",
  1058.                                                "5.5,7.5,9.5,11.5,13.5,15.5,17.5,19.5,21.5,23.5,25.5,27.5,29.5,31.5,32.7,"
  1059.                                               );
  1060.     m_asGSM850_MIN_P = ini->ReadString("TX PCL table",
  1061.                                             "GSM850_MIN_P",
  1062.                                             "5.3,7.3,9.3,11.3,13.3,15,17,19,21,23,25,26.5,28.5,30.5,32.5,"
  1063.                                            );
  1064.     m_asGSM850_C = ini->ReadString("TX PCL table",
  1065.                                         "GSM850_C",
  1066.                                         "3,3,3,3,4,4,6,6,8,8,12,12,15,15,35,40"
  1067.                                        );
  1068.     m_asGSM850_CORRECTION = ini->ReadString("TX PCL table",
  1069.                                             "GSM850_CORRECTION",
  1070.                                             "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1071.                                            );
  1072.     m_asGSM850_EPSK_CAL_PCL = ini->ReadString("TX PCL table",
  1073.                                   "GSM850_EPSK_CAL_PCL",
  1074.                                   "17, 12, 5,"
  1075.                                              );
  1076.     m_sGSM850_EPSK_1CAL_PCL = ini->ReadInteger("TX PCL table",
  1077.                                                "GSM850_EPSK_1CAL_PCL",
  1078.                                                19
  1079.                                               );
  1080.     m_asGSM850_EPSK_2CAL_PCL = ini->ReadString("TX PCL table",
  1081.                                         "GSM850_EPSK_2CAL_PCL",
  1082.                                         "19, 5,"
  1083.                                              );
  1084.     m_asGSM850_EPSK_4CAL_PCL = ini->ReadString("TX PCL table",
  1085.                                         "GSM850_EPSK_4CAL_PCL",
  1086.                                         "15,12,10,6,"
  1087.                                              );
  1088.     m_asGSM850_EPSK_PCL = ini->ReadString("TX PCL table",
  1089.                                           "GSM850_EPSK_PCL",
  1090.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  1091.                                          );
  1092.     m_asGSM850_EPSK_CHECK_PCL = ini->ReadString("TX PCL table",
  1093.                                           "GSM850_EPSK_CHECK_PCL",
  1094.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  1095.                                          );
  1096.     m_asGSM850_EPSK_MAX_P = ini->ReadString("TX PCL table",
  1097.                                             "GSM850_EPSK_MAX_P",
  1098.                                             "6, 8, 10,12,13.8,15.8,17.8,19.8,21.8,23.8,25.8,27.8,27.8,27.8,27.8,"
  1099.                                            );
  1100.     m_asGSM850_EPSK_WANTED_P = ini->ReadString("TX PCL table",
  1101.                                                "GSM850_EPSK_WANTED_P",
  1102.                                                "5.2,7,9,11,13,15,17,19,21,23,25,27,27,27,27,"
  1103.                                               );
  1104.     m_asGSM850_EPSK_MIN_P = ini->ReadString("TX PCL table",
  1105.                                             "GSM850_EPSK_MIN_P",
  1106.                                             "4,6,8,10,12.5,14.5,16.5,18.5,20.5,22.5,24.5,26.5,26.5,26.5,26.5,"
  1107.                                            );
  1108.     m_asGSM850_EPSK_C = ini->ReadString("TX PCL table",
  1109.                                         "GSM850_EPSK_C",
  1110.                                         "3,3,3,3,4,4,6,6,8,8,12,12,15,15,35,40"
  1111.                                        );
  1112.     m_asGSM850_EPSK_CORRECTION = ini->ReadString("TX PCL table",
  1113.                                             "GSM850_EPSK_CORRECTION",
  1114.                                             "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1115.                                            );
  1116.     // GSM900
  1117.     m_asGSM900_CAL_PCL = ini->ReadString("TX PCL table",
  1118.                                               "GSM900_CAL_PCL",
  1119.                                               "17, 12, 5,"
  1120.                                          );
  1121.     m_asGSM900_2CAL_PCL = ini->ReadString("TX PCL table",
  1122.                                               "GSM900_2CAL_PCL",
  1123.                                               "19, 5,"
  1124.                                          );
  1125.     m_asGSM900_4CAL_PCL = ini->ReadString("TX PCL table",
  1126.                                               "GSM900_4CAL_PCL",
  1127.                                               "15,12,10,6,"
  1128.                                          );
  1129.     m_asGSM900_6CAL_PCL = ini->ReadString("TX PCL table",
  1130.                                               "GSM900_6CAL_PCL",
  1131.                                               "19,17,15,10,8,6,"
  1132.                                          );
  1133.     m_asGSM900_6CAL_DAC = ini->ReadString("TX PCL table",
  1134.                                           "GSM900_6CAL_DAC",
  1135.                                           "90,160,223,398,493,549,"
  1136.                                          );
  1137.     m_asGSM900_PCL = ini->ReadString("TX PCL table",
  1138.                                           "GSM900_PCL",
  1139.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5"
  1140.                                          );
  1141.     m_asGSM900_CHECK_PCL = ini->ReadString("TX PCL table",
  1142.                                           "GSM900_CHECK_PCL",
  1143.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  1144.                                          );
  1145.     m_asGSM900_MAX_P = ini->ReadString("TX PCL table",
  1146.                                             "GSM900_MAX_P",
  1147.                                             "6, 8, 10,12,13.8,15.8,17.8,19.8,21.8,23.8,25.8,27.8,29.8,31.8,32.8,"
  1148.                                            );
  1149.     m_asGSM900_WANTED_P = ini->ReadString("TX PCL table",
  1150.                                                "GSM900_WANTED_P",
  1151.                                                "5.5,7.5,9.5,11.5,13.5,15.5,17.5,19.5,21.5,23.5,25.5,27.5,29.5,31.5,32.7,"
  1152.                                               );
  1153.     m_asGSM900_MIN_P = ini->ReadString("TX PCL table",
  1154.                                             "GSM900_MIN_P",
  1155.                                             "5.3,7.3,9.3,11.3,13.3,15,17,19,21,23,25,26.5,28.5,30.5,32.5,"
  1156.                                            );
  1157.     m_asGSM900_C = ini->ReadString("TX PCL table",
  1158.                                         "GSM900_C",
  1159.                                         "3,3,3,3,4,4,6,6,8,8,12,12,15,15,35,40"
  1160.                                        );
  1161.     m_asGSM900_CORRECTION = ini->ReadString("TX PCL table",
  1162.                                             "GSM900_CORRECTION",
  1163.                                             "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1164.                                            );
  1165.     m_asGSM900_EPSK_CAL_PCL = ini->ReadString("TX PCL table",
  1166.                                               "GSM900_EPSK_CAL_PCL",
  1167.                                               "17, 12, 5,"
  1168.                                          );
  1169.     m_sGSM900_EPSK_1CAL_PCL = ini->ReadInteger("TX PCL table",
  1170.                                               "GSM900_EPSK_1CAL_PCL",
  1171.                                               19
  1172.                                          );
  1173.     m_asGSM900_EPSK_2CAL_PCL = ini->ReadString("TX PCL table",
  1174.                                               "GSM900_EPSK_2CAL_PCL",
  1175.                                               "19, 5,"
  1176.                                          );
  1177.     m_asGSM900_EPSK_4CAL_PCL = ini->ReadString("TX PCL table",
  1178.                                               "GSM900_EPSK_4CAL_PCL",
  1179.                                               "15,12,10,6,"
  1180.                                          );
  1181.     m_asGSM900_EPSK_PCL = ini->ReadString("TX PCL table",
  1182.                                           "GSM900_EPSK_PCL",
  1183.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5"
  1184.                                          );
  1185.     m_asGSM900_EPSK_CHECK_PCL = ini->ReadString("TX PCL table",
  1186.                                           "GSM900_EPSK_CHECK_PCL",
  1187.                                           "19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,"
  1188.                                          );
  1189.     m_asGSM900_EPSK_MAX_P = ini->ReadString("TX PCL table",
  1190.                                             "GSM900_EPSK_MAX_P",
  1191.                                             "6, 8, 10,12,13.8,15.8,17.8,19.8,21.8,23.8,25.8,27.8,27.8,27.8,27.8,"
  1192.                                            );
  1193.     m_asGSM900_EPSK_WANTED_P = ini->ReadString("TX PCL table",
  1194.                                                "GSM900_EPSK_WANTED_P",
  1195.                                                "5.2,7,9,11,13,15,17,19,21,23,25,27,27,27,27,"
  1196.                                               );
  1197.     m_asGSM900_EPSK_MIN_P = ini->ReadString("TX PCL table",
  1198.                                             "GSM900_EPSK_MIN_P",
  1199.                                             "4,6,8,10,12.5,14.5,16.5,18.5,20.5,22.5,24.5,26.5,26.5,26.5,26.5,"
  1200.                                            );
  1201.     m_asGSM900_EPSK_C = ini->ReadString("TX PCL table",
  1202.                                         "GSM900_EPSK_C",
  1203.                                         "3,3,3,3,4,4,6,6,8,8,12,12,15,15,35,40"
  1204.                                        );
  1205.     m_asGSM900_EPSK_CORRECTION = ini->ReadString("TX PCL table",
  1206.                                             "GSM900_EPSK_CORRECTION",
  1207.                                             "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1208.                                            );
  1209.     // DCS1800
  1210.     m_asDCS1800_CAL_PCL = ini->ReadString("TX PCL table",
  1211.                                                "DCS1800_CAL_PCL",
  1212.                                                "13, 8, 1,"
  1213.                                           );
  1214.     m_asDCS1800_2CAL_PCL = ini->ReadString("TX PCL table",
  1215.                                                "DCS1800_2CAL_PCL",
  1216.                                                "15, 0,"
  1217.                                           );
  1218.     m_asDCS1800_4CAL_PCL = ini->ReadString("TX PCL table",
  1219.                                                "DCS1800_4CAL_PCL",
  1220.                                                "14,11,9,5,"
  1221.                                           );
  1222.     m_asDCS1800_6CAL_PCL = ini->ReadString("TX PCL table",
  1223.                                                "DCS1800_6CAL_PCL",
  1224.                                                "13,10,8,5,3,1,"
  1225.                                           );
  1226.     m_asDCS1800_6CAL_DAC = ini->ReadString("TX PCL table",
  1227.                                            "DCS1800_6CAL_DAC",
  1228.                                            "75,178,250,404,495,548,"
  1229.                                           );
  1230.     m_asDCS1800_PCL = ini->ReadString("TX PCL table",
  1231.                                            "DCS1800_PCL",
  1232.                                            "15,14,13,12,11,10, 9, 8, 7, 6, 5,4,3,2,1,0,"
  1233.                                           );
  1234.     m_asDCS1800_CHECK_PCL = ini->ReadString("TX PCL table",
  1235.                                            "DCS1800_CHECK_PCL",
  1236.                                            "15,14,13,12,11,10, 9, 8, 7, 6, 5,4,3,2,1,0,"
  1237.                                           );
  1238.     m_asDCS1800_MAX_P = ini->ReadString("TX PCL table",
  1239.                                              "DCS1800_MAX_P",
  1240.                                              "1.5, 2.5, 4.5,6.5,8.5,10.5,12.5,14.5,16.5,18.5,20.5,22.5,24.5,26.5,28.5,31,"
  1241.                                             );
  1242.     m_asDCS1800_WANTED_P = ini->ReadString("TX PCL table",
  1243.                                                 "DCS1800_WANTED_P",
  1244.                                                 "1.0,2.5,4.5,6.5,8.5,10.5,12,14,16,18,20,22,24,25.5,28.2,29.9,"
  1245.                                                );
  1246.     m_asDCS1800_MIN_P = ini->ReadString("TX PCL table",
  1247.                                              "DCS1800_MIN_P",
  1248.                                              "0.5,2.2,4.2,6.2,8.2,10.2,12,14,16,18,20,22,24,25,28,29.8,"
  1249.                                             );
  1250.     m_asDCS1800_C = ini->ReadString("TX PCL table",
  1251.                                          "DCS1800_C",
  1252.                                          "3,3,3,3,4,4,6,6,8,8,12,12,15,15,35,40"
  1253.                                         );
  1254.     m_asDCS1800_CORRECTION = ini->ReadString("TX PCL table",
  1255.                                             "DCS1800_CORRECTION",
  1256.                                             "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1257.                                            );
  1258.     m_asDCS1800_EPSK_CAL_PCL = ini->ReadString("TX PCL table",
  1259.                                                "DCS1800_EPSK_CAL_PCL",
  1260.                                                "13, 8, 1,"
  1261.                                           );
  1262.     m_sDCS1800_EPSK_1CAL_PCL = ini->ReadInteger("TX PCL table",
  1263.                                                "DCS1800_EPSK_1CAL_PCL",
  1264.                                                 15
  1265.                                           );
  1266.     m_asDCS1800_EPSK_2CAL_PCL = ini->ReadString("TX PCL table",
  1267.                                                "DCS1800_EPSK_2CAL_PCL",
  1268.                                                "15, 0,"
  1269.                                           );
  1270.     m_asDCS1800_EPSK_4CAL_PCL = ini->ReadString("TX PCL table",
  1271.                                                "DCS1800_EPSK_4CAL_PCL",
  1272.                                                "14,11,9,5,"
  1273.                                           );
  1274.     m_asDCS1800_EPSK_PCL = ini->ReadString("TX PCL table",
  1275.                                            "DCS1800_EPSK_PCL",
  1276.                                            "15,14,13,12,11,10, 9, 8, 7, 6, 5,4,3,2,1,0,"
  1277.                                           );
  1278.     m_asDCS1800_EPSK_CHECK_PCL = ini->ReadString("TX PCL table",
  1279.                                            "DCS1800_EPSK_CHECK_PCL",
  1280.                                            "15,14,13,12,11,10, 9, 8, 7, 6, 5,4,3,2,1,0,"
  1281.                                           );
  1282.     m_asDCS1800_EPSK_MAX_P = ini->ReadString("TX PCL table",
  1283.                                              "DCS1800_EPSK_MAX_P",
  1284.                                              "2, 3.5, 5,7,9,11,12.5,14.5,16.5,18.5,20.5,22.5,24.5,26.5,26.5,26.5,"
  1285.                                             );
  1286.     m_asDCS1800_EPSK_WANTED_P = ini->ReadString("TX PCL table",
  1287.                                                 "DCS1800_EPSK_WANTED_P",
  1288.                                                 "1.2,2.5,4.3,6.2,8,10,12,14,16,18,20,22,24,26,26,26,"
  1289.                                                );
  1290.     m_asDCS1800_EPSK_MIN_P = ini->ReadString("TX PCL table",
  1291.                                              "DCS1800_EPSK_MIN_P",
  1292.                                              "-0.5,1.5,3.5,5,7,9,11.5,13.5,15.5,17.5,19.5,21.5,23.5,25,25,25,"
  1293.                                             );
  1294.     m_asDCS1800_EPSK_C = ini->ReadString("TX PCL table",
  1295.                                          "DCS1800_EPSK_C",
  1296.                                          "3,3,3,3,4,4,6,6,8,8,12,12,15,15,35,40"
  1297.                                         );
  1298.     m_asDCS1800_EPSK_CORRECTION = ini->ReadString("TX PCL table",
  1299.                                             "DCS1800_EPSK_CORRECTION",
  1300.                                             "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1301.                                            );
  1302.     // PCS1900
  1303.     m_asPCS1900_CAL_PCL = ini->ReadString("TX PCL table",
  1304.                                "PCS1900_CAL_PCL",
  1305.                                "13, 8, 1,"
  1306.                                           );
  1307.     m_asPCS1900_2CAL_PCL = ini->ReadString("TX PCL table",
  1308.                                "PCS1900_2CAL_PCL",
  1309.                                "15, 0,"
  1310.                                           );
  1311.     m_asPCS1900_4CAL_PCL = ini->ReadString("TX PCL table",
  1312.                                "PCS1900_4CAL_PCL",
  1313.                                "14,11,9,5,"
  1314.                                           );
  1315.     m_asPCS1900_6CAL_PCL = ini->ReadString("TX PCL table",
  1316.                                "PCS1900_6CAL_PCL",
  1317.                                "13,10,8,5,3,1,"
  1318.                                           );
  1319.     m_asPCS1900_6CAL_DAC = ini->ReadString("TX PCL table",
  1320.                                            "PCS1900_6CAL_DAC",
  1321.                                            "75,178,250,404,495,548,"
  1322.                                           );
  1323.     m_asPCS1900_PCL = ini->ReadString("TX PCL table",
  1324.                                            "PCS1900_PCL",
  1325.                                            "15,14,13,12,11,10, 9, 8, 7, 6, 5,4,3,2,1,0,"
  1326.                                           );
  1327.     m_asPCS1900_CHECK_PCL = ini->ReadString("TX PCL table",
  1328.                                                  "PCS1900_CHECK_PCL",
  1329.                                                  "15,14,13,12,11,10, 9, 8, 7, 6, 5,4,3,2,1,0,"
  1330.                                           );
  1331.     m_asPCS1900_MAX_P = ini->ReadString("TX PCL table",
  1332.                                              "PCS1900_MAX_P",
  1333.                                              "0.5, 2.5, 4.5,6.5,8.5,10.5,12.5,14.5,16.5,18.5,20.5,22.5,24.5,26.5,28.5,30.5,"
  1334.                                             );
  1335.     m_asPCS1900_WANTED_P = ini->ReadString("TX PCL table",
  1336.                                                 "PCS1900_WANTED_P",
  1337.                                                 "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,"
  1338.                                                );
  1339.     m_asPCS1900_MIN_P = ini->ReadString("TX PCL table",
  1340.                                              "PCS1900_MIN_P",
  1341.                                              "-0.5,1.5,3.5,5.5,7.5,9.5,11.5,13.5,15.5,17.5,19.5,21.5,23.5,25.5,27.5,29.5,"
  1342.                                             );
  1343.     m_asPCS1900_C = ini->ReadString("TX PCL table",
  1344.                                          "PCS1900_C",
  1345.                                          "1,2,2,3,4,5,7,9,10,13,13,13,14,14,15,20,"
  1346.                                         );
  1347.     m_asPCS1900_CORRECTION = ini->ReadString("TX PCL table",
  1348.                                                   "PCS1900_CORRECTION",
  1349.                                                   "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1350.                                                  );
  1351.     m_asPCS1900_EPSK_CAL_PCL = ini->ReadString("TX PCL table",
  1352.                                "PCS1900_EPSK_CAL_PCL",
  1353.                                "13, 8, 1,"
  1354.                                           );
  1355.     m_sPCS1900_EPSK_1CAL_PCL = ini->ReadInteger("TX PCL table",
  1356.                                "PCS1900_EPSK_1CAL_PCL",
  1357.                                15
  1358.                                           );
  1359.     m_asPCS1900_EPSK_2CAL_PCL = ini->ReadString("TX PCL table",
  1360.                                "PCS1900_EPSK_2CAL_PCL",
  1361.                                "15, 0,"
  1362.                                           );
  1363.     m_asPCS1900_EPSK_4CAL_PCL = ini->ReadString("TX PCL table",
  1364.                                "PCS1900_EPSK_4CAL_PCL",
  1365.                                "14,11,9,5,"
  1366.                                           );
  1367.     m_asPCS1900_EPSK_PCL = ini->ReadString("TX PCL table",
  1368.                                            "PCS1900_EPSK_PCL",
  1369.                                            "15,14,13,12,11,10, 9, 8, 7, 6, 5,4,3,2,1,0,"
  1370.                                           );
  1371.     m_asPCS1900_EPSK_CHECK_PCL = ini->ReadString("TX PCL table",
  1372.                                                  "PCS1900_EPSK_CHECK_PCL",
  1373.                                                  "15,14,13,12,11,10, 9, 8, 7, 6, 5,4,3,2,1,0,"
  1374.                                           );
  1375.                                           
  1376.     m_asPCS1900_EPSK_MAX_P = ini->ReadString("TX PCL table",
  1377.                                              "PCS1900_EPSK_MAX_P",
  1378.                                              "2, 3.5, 5,7,9,11,12.5,14.5,16.5,18.5,20.5,22.5,24.5,26.5,26.5,26.5,"
  1379.                                             );
  1380.     m_asPCS1900_EPSK_WANTED_P = ini->ReadString("TX PCL table",
  1381.                                                 "PCS1900_EPSK_WANTED_P",
  1382.                                                 "1.2,2.5,4.3,6.2,8,10,12,14,16,18,20,22,24,26,26,26,"
  1383.                                                );
  1384.     m_asPCS1900_EPSK_MIN_P = ini->ReadString("TX PCL table",
  1385.                                              "PCS1900_EPSK_MIN_P",
  1386.                                              "-0.5,1.5,3.5,5,7,9,11.5,13.5,15.5,17.5,19.5,21.5,23.5,25,25,25,"
  1387.                                             );
  1388.     m_asPCS1900_EPSK_C = ini->ReadString("TX PCL table",
  1389.                                          "PCS1900_EPSK_C",
  1390.                                          "1,2,2,3,4,5,7,9,10,13,13,13,14,14,15,20,"
  1391.                                         );
  1392.     m_asPCS1900_EPSK_CORRECTION = ini->ReadString("TX PCL table",
  1393.                                                   "PCS1900_EPSK_CORRECTION",
  1394.                                                   "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"
  1395.                                                  );
  1396.     m_sMAX_APC_DAC = ini->ReadInteger("TX PCL table",
  1397.                                       "MAX_APC_DAC",
  1398.                                       1023
  1399.                                      );
  1400.     m_cTSC = ini->ReadInteger("TX PCL table",
  1401.                                    "TSC",
  1402.                                    5
  1403.                                   );
  1404.     m_iRecursiveTimes = ini->ReadInteger("TX PCL table",
  1405.                                               "Recursive Times",
  1406.                                               5
  1407.                                              );
  1408.     as = ini->ReadString("TX PCL table",
  1409.                          "APC Delta",
  1410.                          "0.1"
  1411.                          );
  1412.     m_dAPC_Delta = atof(as.c_str());
  1413.     m_asAPC_Check = ini->ReadString("TX PCL table",
  1414.                                        "APC Check",
  1415.                                        "yes"
  1416.                                       );
  1417.     as = ini->ReadString("TX PCL table",
  1418.                          "SKY77328_GSM850_MAX_HIGH_APC_DC_OFFSET_P",
  1419.                          "-3.5"
  1420.                          );
  1421.     m_dSKY77328_GSM850_MAX_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1422.     as = ini->ReadString("TX PCL table",
  1423.                          "SKY77328_GSM850_WANTED_HIGH_APC_DC_OFFSET_P",
  1424.                          "-4"
  1425.                          );
  1426.     m_dSKY77328_GSM850_WANTED_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1427.     as = ini->ReadString("TX PCL table",
  1428.                          "SKY77328_GSM850_MIN_HIGH_APC_DC_OFFSET_P",
  1429.                          "-4.5"
  1430.                          );
  1431.     m_dSKY77328_GSM850_MIN_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1432.     as = ini->ReadString("TX PCL table",
  1433.                          "SKY77328_GSM850_MAX_LOW_APC_DC_OFFSET_P",
  1434.                          "-3.5"
  1435.                          );
  1436.     m_dSKY77328_GSM850_MAX_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1437.     as = ini->ReadString("TX PCL table",
  1438.                          "SKY77328_GSM850_WANTED_LOW_APC_DC_OFFSET_P",
  1439.                          "-4"
  1440.                          );
  1441.     m_dSKY77328_GSM850_WANTED_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1442.     as = ini->ReadString("TX PCL table",
  1443.                          "SKY77328_GSM850_MIN_LOW_APC_DC_OFFSET_P",
  1444.                          "-4.5"
  1445.                          );
  1446.     m_dSKY77328_GSM850_MIN_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1447.     as = ini->ReadString("TX PCL table",
  1448.                          "SKY77328_GSM900_MAX_HIGH_APC_DC_OFFSET_P",
  1449.                          "-3.5"
  1450.                          );
  1451.     m_dSKY77328_GSM900_MAX_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1452.     as = ini->ReadString("TX PCL table",
  1453.                          "SKY77328_GSM900_WANTED_HIGH_APC_DC_OFFSET_P",
  1454.                          "-4"
  1455.                          );
  1456.     m_dSKY77328_GSM900_WANTED_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1457.     as = ini->ReadString("TX PCL table",
  1458.                          "SKY77328_GSM900_MIN_HIGH_APC_DC_OFFSET_P",
  1459.                          "-4.5"
  1460.                          );
  1461.     m_dSKY77328_GSM900_MIN_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1462.     as = ini->ReadString("TX PCL table",
  1463.                          "SKY77328_GSM900_MAX_LOW_APC_DC_OFFSET_P",
  1464.                          "-3.5"
  1465.                          );
  1466.     m_dSKY77328_GSM900_MAX_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1467.     as = ini->ReadString("TX PCL table",
  1468.                          "SKY77328_GSM900_WANTED_LOW_APC_DC_OFFSET_P",
  1469.                          "-4"
  1470.                          );
  1471.     m_dSKY77328_GSM900_WANTED_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1472.     as = ini->ReadString("TX PCL table",
  1473.                          "SKY77328_GSM900_MIN_LOW_APC_DC_OFFSET_P",
  1474.                          "-4.5"
  1475.                          );
  1476.     m_dSKY77328_GSM900_MIN_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1477.     as = ini->ReadString("TX PCL table",
  1478.                          "SKY77328_DCS1800_MAX_HIGH_APC_DC_OFFSET_P",
  1479.                          "-3.5"
  1480.                          );
  1481.     m_dSKY77328_DCS1800_MAX_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1482.     as = ini->ReadString("TX PCL table",
  1483.                          "SKY77328_DCS1800_WANTED_HIGH_APC_DC_OFFSET_P",
  1484.                          "-4"
  1485.                          );
  1486.     m_dSKY77328_DCS1800_WANTED_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1487.     as = ini->ReadString("TX PCL table",
  1488.                          "SKY77328_DCS1800_MIN_HIGH_APC_DC_OFFSET_P",
  1489.                          "-4.5"
  1490.                          );
  1491.     m_dSKY77328_DCS1800_MIN_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1492.     as = ini->ReadString("TX PCL table",
  1493.                          "SKY77328_DCS1800_MAX_LOW_APC_DC_OFFSET_P",
  1494.                          "-3.5"
  1495.                          );
  1496.     m_dSKY77328_DCS1800_MAX_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1497.     as = ini->ReadString("TX PCL table",
  1498.                          "SKY77328_DCS1800_WANTED_LOW_APC_DC_OFFSET_P",
  1499.                          "-4"
  1500.                          );
  1501.     m_dSKY77328_DCS1800_WANTED_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1502.     as = ini->ReadString("TX PCL table",
  1503.                          "SKY77328_DCS1800_MIN_LOW_APC_DC_OFFSET_P",
  1504.                          "-4.5"
  1505.                          );
  1506.     m_dSKY77328_DCS1800_MIN_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1507.     as = ini->ReadString("TX PCL table",
  1508.                          "SKY77328_PCS1900_MAX_HIGH_APC_DC_OFFSET_P",
  1509.                          "-3.5"
  1510.                          );
  1511.     m_dSKY77328_PCS1900_MAX_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1512.     as = ini->ReadString("TX PCL table",
  1513.                          "SKY77328_PCS1900_WANTED_HIGH_APC_DC_OFFSET_P",
  1514.                          "-4"
  1515.                          );
  1516.     m_dSKY77328_PCS1900_WANTED_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1517.     as = ini->ReadString("TX PCL table",
  1518.                          "SKY77328_PCS1900_MIN_HIGH_APC_DC_OFFSET_P",
  1519.                          "-4"
  1520.                          );
  1521.     m_dSKY77328_PCS1900_MIN_HIGH_APC_DC_OFFSET_P = atof(as.c_str());
  1522.     as = ini->ReadString("TX PCL table",
  1523.                          "SKY77328_PCS1900_MAX_LOW_APC_DC_OFFSET_P",
  1524.                          "-4.5"
  1525.                          );
  1526.     m_dSKY77328_PCS1900_MAX_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1527.     as = ini->ReadString("TX PCL table",
  1528.                          "SKY77328_PCS1900_WANTED_LOW_APC_DC_OFFSET_P",
  1529.                          "-4"
  1530.                          );
  1531.     m_dSKY77328_PCS1900_WANTED_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1532.     as = ini->ReadString("TX PCL table",
  1533.                          "SKY77328_PCS1900_MIN_LOW_APC_DC_OFFSET_P",
  1534.                          "-4.5"
  1535.                          );
  1536.     m_dSKY77328_PCS1900_MIN_LOW_APC_DC_OFFSET_P = atof(as.c_str());
  1537.     m_iSKY77328_DAC_Delta = ini->ReadInteger("TX PCL table",
  1538.                                        "SKY77328_DAC_Delta",
  1539.                                        10
  1540.                                       );
  1541.      as = ini->ReadString("TX PCL table",
  1542.                           "SKY77328_GSM850_M",
  1543.                           "16.8"
  1544.                           );
  1545.     m_dSKY77328_GSM850_M = atof(as.c_str());
  1546.     as = ini->ReadString("TX PCL table",
  1547.                          "SKY77328_GSM900_M",
  1548.                          "16.8"
  1549.                          );
  1550.     m_dSKY77328_GSM900_M = atof(as.c_str());
  1551.     as = ini->ReadString("TX PCL table",
  1552.                          "SKY77328_DCS1800_M",
  1553.                          "17.78"
  1554.                          );
  1555.     m_dSKY77328_DCS1800_M = atof(as.c_str());
  1556.     as = ini->ReadString("TX PCL table",
  1557.                          "SKY77328_PCS1900_M",
  1558.                          17.78
  1559.                          );
  1560.     m_dSKY77328_PCS1900_M = atof(as.c_str());
  1561.     m_iSKY77328_GSM850_TARGET_PCL = ini->ReadInteger("TX PCL table",
  1562.                                        "SKY77328_GSM850_TARGET_PCL",
  1563.                                        19
  1564.                                       );
  1565.     m_iSKY77328_GSM900_TARGET_PCL = ini->ReadInteger("TX PCL table",
  1566.                                        "SKY77328_GSM900_TARGET_PCL",
  1567.                                        19
  1568.                                       );
  1569.     m_iSKY77328_DCS1800_TARGET_PCL = ini->ReadInteger("TX PCL table",
  1570.                                        "SKY77328_DCS1800_TARGET_PCL",
  1571.                                        15
  1572.                                       );
  1573.     m_iSKY77328_PCS1900_TARGET_PCL = ini->ReadInteger("TX PCL table",
  1574.                                        "SKY77328_PCS1900_TARGET_PCL",
  1575.                                        15
  1576.                                       );
  1577.     m_asAXIOM502_GSM850_SWITCH_PCL = ini->ReadString("TX PCL table",
  1578.                                                      "AXIOM502_GSM850_SWITCH_PCL",
  1579.                                                      "16,10,"
  1580.                                                     );
  1581.     m_asAXIOM502_GSM900_SWITCH_PCL = ini->ReadString("TX PCL table",
  1582.                                                      "AXIOM502_GSM900_SWITCH_PCL",
  1583.                                                      "16,10,"
  1584.                                                     );
  1585.     m_asAXIOM502_DCS1800_SWITCH_PCL = ini->ReadString("TX PCL table",
  1586.                                                      "AXIOM502_DCS1800_SWITCH_PCL",
  1587.                                                      "9,4,"
  1588.                                                     );
  1589.     m_asAXIOM502_PCS1900_SWITCH_PCL = ini->ReadString("TX PCL table",
  1590.                                                      "AXIOM502_PCS1900_SWITCH_PCL",
  1591.                                                      "9,4,"
  1592.                                                     );
  1593. }
  1594. //--------------------------------------------------------------------------
  1595. //void TMETA_factory_cfg::ReadPhaseErrFromIniFile(TIniFile *ini)
  1596. //{
  1597. //    //////////////////////// phase error ///////////////////////////////////
  1598. //    as_PHASE_ERROR_BAND = ini->ReadString("Phase error table",
  1599. //                                              "PHASE_ERROR_BAND",
  1600. //                                              "GSM"
  1601. //                                             );
  1602. //
  1603. //    m_sPHASE_ERROR_ARFCN = ini->ReadInteger("Phase error table",
  1604. //                                              "PHASE_ERROR_ARFCN",
  1605. //                                              70
  1606. //                                             );
  1607. //
  1608. //    i_PHASE_ERROR_PCL = ini->ReadInteger("Phase error table",
  1609. //                                              "PHASE_ERROR_PCL",
  1610. //                                              10
  1611. //                                             );
  1612. //
  1613. //    i_PHASE_ERROR_MEASUSE_COUNT = ini->ReadInteger("Phase error table",
  1614. //                                              "PHASE_ERROR_MEASUSE_COUNT",
  1615. //                                              10
  1616. //                                             );
  1617. //
  1618. //    d_PHASE_ERROR_RMS_ERROR = ini->ReadString("Phase error table",
  1619. //                                              "PHASE_ERROR_RMS_ERROR",
  1620. //                                                  1.5
  1621. //                                                 );
  1622. //}
  1623. //--------------------------------------------------------------------------
  1624. void TMETA_factory_cfg::ReadAdcFromIniFile(TIniFile *ini)
  1625. {
  1626.     // ADC
  1627.     AnsiString as_ADC_RESISTANCE;
  1628.     AnsiString as_MAX_VOLTAGE_DIFFERENCE;
  1629.     AnsiString as_MAX_CURRENT_DIFFERENCE;
  1630.     float f_CURRENT_LIMIT;
  1631.     float f_MAX_BATTERY_ADC_SLOPE;
  1632.     float f_MIN_BATTERY_ADC_SLOPE;
  1633.     float f_MAX_BATTERY_ADC_OFFSET;
  1634.     float f_MIN_BATTERY_ADC_OFFSET;
  1635.     i_ADC_V1 = ini->ReadInteger("ADC table",
  1636.                                        "ADC_V1",
  1637.                                        3400
  1638.                                       );
  1639.     i_ADC_V2 = ini->ReadInteger("ADC table",
  1640.                                        "ADC_V2",
  1641.                                        4200
  1642.                                       );
  1643.     i_ADC_CHECK_VOLTAGE = ini->ReadInteger("ADC table",
  1644.                                        "ADC_CHECK_VOLTAGE",
  1645.                                        3600
  1646.                                       );
  1647.     i_NORMAL_VOLTAGE = ini->ReadInteger("ADC table",
  1648.                                        "NORMAL_VOLTAGE",
  1649.                                        3800
  1650.                                       );
  1651.     i_CURRENT_LIMIT = ini->ReadInteger("ADC table",
  1652.                                        "CURRENT_LIMIT",
  1653.                                        3000
  1654.                                       );
  1655.     i_MAX_BATTERY_ADC_SLOPE = ini->ReadInteger("ADC table",
  1656.                                        "MAX_BATTERY_ADC_SLOPE",
  1657.                                        5300
  1658.                                       );
  1659.     i_MIN_BATTERY_ADC_SLOPE = ini->ReadInteger("ADC table",
  1660.                                                      "MIN_BATTERY_ADC_SLOPE",
  1661.                                                      5100
  1662.                                                     );
  1663.     i_MAX_BATTERY_ADC_OFFSET = ini->ReadInteger("ADC table",
  1664.                                        "MAX_BATTERY_ADC_OFFSET",
  1665.                                        1000000
  1666.                                       );
  1667.     i_MIN_BATTERY_ADC_OFFSET = ini->ReadInteger("ADC table",
  1668.                                        "MIN_BATTERY_ADC_OFFSET",
  1669.                                        -1000000
  1670.                                       );
  1671.     i_BATTERY_CHANNEL = ini->ReadInteger("ADC table",
  1672.                                        "BATTERY_CHANNEL",
  1673.                                        0
  1674.                                       );
  1675.     i_CHARGER_CHANNEL = ini->ReadInteger("ADC table",
  1676.                                                "CHARGER_CHANNEL",
  1677.                                                3
  1678.                                               );
  1679.     as_ADC_RESISTANCE = ini->ReadString("ADC table",
  1680.                                        "ADC_RESISTANCE",
  1681.                                        "0.33"
  1682.                                       );
  1683.     d_ADC_RESISTANCE = atof(as_ADC_RESISTANCE.c_str());
  1684.     as_MAX_VOLTAGE_DIFFERENCE = ini->ReadString("ADC table",
  1685.                                        "MAX_VOLTAGE_DIFFERENCE",
  1686.                                        "0.04"
  1687.                                       );
  1688.     d_MAX_VOLTAGE_DIFFERENCE = atof(as_MAX_VOLTAGE_DIFFERENCE.c_str());
  1689.     as_MAX_CURRENT_DIFFERENCE = ini->ReadString("ADC table",
  1690.                                        "MAX_CURRENT_DIFFERENCE",
  1691.                                        "0.04"
  1692.                                       );
  1693.     d_MAX_CURRENT_DIFFERENCE = atof(as_MAX_CURRENT_DIFFERENCE.c_str());
  1694.     i_ADC_MEASUREMENT_COUNT = ini->ReadInteger("ADC table",
  1695.                                                       "ADC_MEASUREMENT_COUNT",
  1696.                                                       1000
  1697.                                                      );
  1698.    
  1699.     //if (! is_MAX_WANTED_MIN_P_valid())
  1700.     //     return false;
  1701.     
  1702. }
  1703. //---------------------------------------------------------------------------
  1704. void TMETA_factory_cfg::ReadCVFromIniFile(TIniFile *ini)
  1705. {
  1706.     m_cMAX_CV_STEP = ini->ReadInteger("CV table",
  1707.                                       "MAX_CV_STEP",
  1708.                                       17);
  1709.     m_cMIN_CV_STEP = ini->ReadInteger("CV table",
  1710.                                       "MIN_CV_STEP",
  1711.                                       11);
  1712. }
  1713. //---------------------------------------------------------------------------
  1714. void TMETA_factory_cfg::ReadAge8960InitFromIniFile(TIniFile *ini)
  1715. {
  1716.     AnsiString as;
  1717.     m_as8960_GPIB_Addr = ini->ReadString("8960 Initialization",
  1718.                                         "8960 GPIB Address",
  1719.                                         "GPIB0::15::INSTR"
  1720.                                         );
  1721.     m_iTimeOut = ini->ReadInteger("8960 Initialization",
  1722.                                  "Time Out",
  1723.                                  7000
  1724.                                  );
  1725.     // dB
  1726.     as = ini->ReadString("8960 Initialization",
  1727.                          "GSM400 cable loss",
  1728.                          "-0.5"
  1729.                          );
  1730.     m_dGSM400_CL = atof(as.c_str());
  1731.     as = ini->ReadString("8960 Initialization",
  1732.                          "GSM850 cable loss",
  1733.                          "-0.5"
  1734.                          );
  1735.     m_dGSM850_CL = atof(as.c_str());
  1736.     as = ini->ReadString("8960 Initialization",
  1737.                          "GSM900 cable loss",
  1738.                          "-0.5"
  1739.                          );
  1740.     m_dGSM900_CL = atof(as.c_str());
  1741.     as = ini->ReadString("8960 Initialization",
  1742.                          "DCS1800 cable loss",
  1743.                          "-1.0"
  1744.                          );
  1745.     m_dDCS1800_CL = atof(as.c_str());
  1746.     as = ini->ReadString("8960 Initialization",
  1747.                                   "PCS1900 cable loss",
  1748.                                   "-1.0"
  1749.                                   );
  1750.     m_dPCS1900_CL = atof(as.c_str());
  1751. }
  1752. //---------------------------------------------------------------------------
  1753. void TMETA_factory_cfg::ReadCmu200InitFromIniFile(TIniFile *ini)
  1754. {
  1755.     AnsiString as;
  1756.     // CMU200 Initialization
  1757.     m_asCMU200_GPIB_Addr = ini->ReadString("CMU200 Initialization",
  1758.                                           "CMU200 GPIB Address",
  1759.                                           "GPIB0::20::INSTR"
  1760.                                           );
  1761.     m_iCMU200_TimeOut = ini->ReadInteger("CMU200 Initialization",
  1762.                                         "Time Out",
  1763.                                         5000
  1764.                                        );
  1765.     // cable loss
  1766.     as = ini->ReadString("CMU200 Initialization",
  1767.                          "GSM400 input cable loss",
  1768.                          "1.0"
  1769.                          );
  1770.     m_dCMU200_INPUT_GSM400_CL = atof(as.c_str());
  1771.     as = ini->ReadString("CMU200 Initialization",
  1772.                          "GSM850 input cable loss",
  1773.                          "1.0"
  1774.                          );
  1775.     m_dCMU200_INPUT_GSM850_CL = atof(as.c_str());
  1776.     as = ini->ReadString("CMU200 Initialization",
  1777.                          "GSM900 input cable loss",
  1778.                          "1.2"
  1779.                          );
  1780.     m_dCMU200_INPUT_GSM900_CL = atof(as.c_str());
  1781.     as = ini->ReadString("CMU200 Initialization",
  1782.                          "DCS1800 input cable loss",
  1783.                          "1.8"
  1784.                          );
  1785.     m_dCMU200_INPUT_DCS1800_CL = atof(as.c_str());
  1786.     as = ini->ReadString("CMU200 Initialization",
  1787.                          "PCS1900 input cable loss",
  1788.                          "1.8"
  1789.                          );
  1790.     m_dCMU200_INPUT_PCS1900_CL = atof(as.c_str());
  1791.     as = ini->ReadString("CMU200 Initialization",
  1792.                          "BT input cable loss",
  1793.                          "1.5"
  1794.                          );
  1795.     m_dCMU200_INPUT_BT_CL = atof(as.c_str());
  1796.     as = ini->ReadString("CMU200 Initialization",
  1797.                          "GSM400 output cable loss",
  1798.                          "1.0"
  1799.                          );
  1800.     m_dCMU200_OUTPUT_GSM400_CL = atof(as.c_str());
  1801.     as = ini->ReadString("CMU200 Initialization",
  1802.                          "GSM850 output cable loss",
  1803.                          "1.0"
  1804.                          );
  1805.     m_dCMU200_OUTPUT_GSM850_CL = atof(as.c_str());
  1806.     as = ini->ReadString("CMU200 Initialization",
  1807.                          "GSM900 output cable loss",
  1808.                          "1.2"
  1809.                          );
  1810.     m_dCMU200_OUTPUT_GSM900_CL = atof(as.c_str());
  1811.     as = ini->ReadString("CMU200 Initialization",
  1812.                          "DCS1800 output cable loss",
  1813.                          "1.8"
  1814.                          );
  1815.     m_dCMU200_OUTPUT_DCS1800_CL = atof(as.c_str());
  1816.     as = ini->ReadString("CMU200 Initialization",
  1817.                          "PCS1900 output cable loss",
  1818.                          "1.8"
  1819.                          );
  1820.     m_dCMU200_OUTPUT_PCS1900_CL = atof(as.c_str());
  1821.     as = ini->ReadString("CMU200 Initialization",
  1822.                          "BT output cable loss",
  1823.                          "1.5"
  1824.                          );
  1825.     m_dCMU200_OUTPUT_BT_CL = atof(as.c_str());
  1826. }
  1827. //---------------------------------------------------------------------------
  1828. void TMETA_factory_cfg::ReadCBTInitFromIniFile(TIniFile *ini)
  1829. {
  1830.     AnsiString as;
  1831.     // CMU200 Initialization
  1832.     m_asCBT_GPIB_Addr = ini->ReadString("CBT Initialization",
  1833.                                           "CBT GPIB Address",
  1834.                                           "GPIB0::20::INSTR"
  1835.                                           );
  1836.     m_iCBT_TimeOut = ini->ReadInteger("CBT Initialization",
  1837.                                         "Time Out",
  1838.                                         5000
  1839.                                        );
  1840.     // cable loss
  1841.     as = ini->ReadString("CBT Initialization",
  1842.                          "BT input cable loss",
  1843.                          "1.5"
  1844.                          );
  1845.     m_dCBT_INPUT_BT_CL = atof(as.c_str());
  1846.     as = ini->ReadString("CBT Initialization",
  1847.                          "BT output cable loss",
  1848.                          "1.5"
  1849.                          );
  1850.     m_dCBT_OUTPUT_BT_CL = atof(as.c_str());
  1851. }
  1852. //---------------------------------------------------------------------------
  1853. void TMETA_factory_cfg::ReadIQviewInitFromIniFile(TIniFile *ini)
  1854. {
  1855.     AnsiString as;
  1856.     m_asIQview_IP_Addr = ini->ReadString("IQview Initialization",
  1857.                                           "IQview IP Address",
  1858.                                           "192.168.100.254"
  1859.                                           );
  1860.     m_iIQview_TimeOut = ini->ReadInteger("IQview Initialization",
  1861.                                         "Time Out",
  1862.                                         5000
  1863.                                        );
  1864.     as = ini->ReadString("IQview Initialization",
  1865.                          "2.4G Cable loss",
  1866.                          "-1.0"
  1867.                          );
  1868.     m_dIQview_2_4G_CL = atof(as.c_str());
  1869.     as = ini->ReadString("IQview Initialization",
  1870.                          "5G Cable loss",
  1871.                          "-1.0"
  1872.                          );
  1873.     m_dIQview_5G_CL = atof(as.c_str());
  1874. }
  1875. //---------------------------------------------------------------------------
  1876. void TMETA_factory_cfg::ReadAgilentN4010aInitFromIniFile(TIniFile *ini)
  1877. {
  1878.     AnsiString as;
  1879.     m_asN4010a_VISA_Alias_Name = ini->ReadString("Agilent N4010A Initialization",
  1880.                                           "VISA Alias Name",
  1881.                                           "UsbDevice1"
  1882.                                           );
  1883.     m_asN4010a_VISA_Address = ini->ReadString("Agilent N4010A Initialization",
  1884.                                           "VISA Address",
  1885.                                           "USB0::2391::4607:: JAGUAR::0::INSTR"
  1886.                                           );
  1887.     m_iN4010a_TimeOut = ini->ReadInteger("Agilent N4010A Initialization",
  1888.                                         "Time Out",
  1889.                                         5000
  1890.                                        );
  1891.     as = ini->ReadString("Agilent N4010A Initialization",
  1892.                          "2.4G Cable loss",
  1893.                          "-1.0"
  1894.                          );
  1895.     m_dN4010a_2_4G_CL = atof(as.c_str());
  1896.     as = ini->ReadString("Agilent N4010A Initialization",
  1897.                          "5G Cable loss",
  1898.                          "-1.0"
  1899.                          );
  1900.     m_dN4010a_5G_CL = atof(as.c_str());
  1901. }
  1902. //---------------------------------------------------------------------------
  1903. void TMETA_factory_cfg::ReadWiFiCommonFromIniFile(TIniFile *ini)
  1904. {
  1905.     m_asWiFi_Support = ini->ReadString( "WiFi common",
  1906.                                         "WiFi_Support",
  1907.                                         "0x06"
  1908.                                        );
  1909. }
  1910. //---------------------------------------------------------------------------
  1911. void TMETA_factory_cfg::ReadWiFiTxPowerFromIniFile(TIniFile *ini)
  1912. {
  1913.     AnsiString as;
  1914.     // WiFi TX power
  1915.     as = ini->ReadString("WiFi TX power table",
  1916.                          "CCK_MAX_P",
  1917.                          "15.0"
  1918.                          );
  1919.     m_dCCK_MAX_P = atof(as.c_str());
  1920.     as = ini->ReadString("WiFi TX power table",
  1921.                          "CCK_WANTED_P",
  1922.                          "14.0"
  1923.                          );
  1924.     m_dCCK_WANTED_P = atof(as.c_str());
  1925.     as = ini->ReadString("WiFi TX power table",
  1926.                          "CCK_MIN_P",
  1927.                          "13.0"
  1928.                          );
  1929.     m_dCCK_MIN_P = atof(as.c_str());
  1930.     as = ini->ReadString("WiFi TX power table",
  1931.                          "CCK_Delta",
  1932.                          "0.1"
  1933.                          );
  1934.     m_dCCK_Delta = atof(as.c_str());
  1935.     m_as802_11B_CAL_CHANNEL = ini->ReadString("WiFi TX power table",
  1936.                                               "802.11B_CAL_CHANNEL",
  1937.                                               "2412,2417,2422,2427,2432,2437,2442,2447,2452,2457,2462,2467,2472,2484,"
  1938.                                               );
  1939.     m_as802_11B_CHECK_CHANNEL = ini->ReadString("WiFi TX power table",
  1940.                                               "802.11B_CHECK_CHANNEL",
  1941.                                               "2412,2417,2422,2427,2432,2437,2442,2447,2452,2457,2462,2467,2472,2484,"
  1942.                                               );
  1943.                                               
  1944.     as = ini->ReadString("WiFi TX power table",
  1945.                          "CCK_CAL_RATE",
  1946.                          "1"
  1947.                          );
  1948.     m_dCCK_CAL_RATE = atof(as.c_str());
  1949.     as = ini->ReadString("WiFi TX power table",
  1950.                          "CCK_CHECK_RATE",
  1951.                          "1");
  1952.     m_dCCK_CHECK_RATE = atof(as.c_str());
  1953.     m_iCCK_C = ini->ReadInteger("WiFi TX power table",
  1954.                                         "CCK_C",
  1955.                                         3
  1956.                                        );
  1957.     as = ini->ReadString("WiFi TX power table",
  1958.                          "OFDM_MAX_P",
  1959.                          "12.0"
  1960.                          );
  1961.     m_dOFDM_MAX_P = atof(as.c_str());
  1962.     as = ini->ReadString("WiFi TX power table",
  1963.                          "OFDM_WANTED_P",
  1964.                          "11.0"
  1965.                          );
  1966.     m_dOFDM_WANTED_P = atof(as.c_str());
  1967.     as = ini->ReadString("WiFi TX power table",
  1968.                          "OFDM_MIN_P",
  1969.                          "10.0"
  1970.                          );
  1971.     m_dOFDM_MIN_P = atof(as.c_str());
  1972.     as = ini->ReadString("WiFi TX power table",
  1973.                          "OFDM_Delta",
  1974.                          "0.1"
  1975.                          );
  1976.     m_dOFDM_Delta = atof(as.c_str());
  1977.     m_iOFDM_C = ini->ReadInteger("WiFi TX power table",
  1978.                                         "OFDM_C",
  1979.                                         3
  1980.                                        );
  1981.     m_as802_11G_CAL_CHANNEL = ini->ReadString("WiFi TX power table",
  1982.                                               "802.11G_CAL_CHANNEL",
  1983.                                               "2412,2417,2422,2427,2432,2437,2442,2447,2452,2457,2462,2467,2472,2484,"
  1984.                                              );
  1985.     m_as802_11G_CHECK_CHANNEL = ini->ReadString("WiFi TX power table",
  1986.                                               "802.11G_CHECK_CHANNEL",
  1987.                                               "2412,2417,2422,2427,2432,2437,2442,2447,2452,2457,2462,2467,2472,2484,"
  1988.                                              );
  1989.     as = ini->ReadString("WiFi TX power table",
  1990.                          "OFDM_CAL_RATE",
  1991.                          "54"
  1992.                          );
  1993.     m_dOFDM_CAL_RATE = atof(as.c_str());
  1994.     as = ini->ReadString("WiFi TX power table",
  1995.                          "OFDM_CHECK_RATE",
  1996.                          "54"
  1997.                          );
  1998.     m_dOFDM_CHECK_RATE = atof(as.c_str());
  1999.     m_iWiFiTxPRecursive_Times = ini->ReadInteger("WiFi TX power table",
  2000.                                         "Recursive Times",
  2001.                                         10
  2002.                                        );
  2003. }
  2004. //----------------------------------------------------------------------------
  2005. void TMETA_factory_cfg::ReadBTCommonFromIniFile(TIniFile *ini)
  2006. {
  2007.     AnsiString as = ini->ReadString("BT common", "BT_DOWNLINK_POWER", "-70");
  2008.     m_dBT_DOWNLINK_POWER = atof(as.c_str());
  2009.     
  2010.     m_asBD_Address = ini->ReadString("BT common", "BD Address", "123456789012");
  2011.     m_asBD_Address = m_asBD_Address.UpperCase();
  2012.     m_asInquiry_Enable = ini->ReadString("BT common", "Inquiry enable", "yes");
  2013. }
  2014. //----------------------------------------------------------------------------
  2015. void TMETA_factory_cfg::ReadBTCrystalCAPIDFromIniFile(TIniFile *ini)
  2016. {
  2017.     m_ucBT_CRYSTAL_CAP_ID1 = ini->ReadInteger("BT crystal CAP ID table", "BT_CRYSTAL_CAP_ID1", 100);
  2018.     m_ucBT_CRYSTAL_CAP_ID2 = ini->ReadInteger("BT crystal CAP ID table", "BT_CRYSTAL_CAP_ID2", 127);
  2019.     m_usBT_CRYSTAL_CHANNEL = ini->ReadInteger("BT crystal CAP ID table", "BT_CRYSTAL_CHANNEL", 48);
  2020.     AnsiString as = ini->ReadString("BT crystal CAP ID table", "BT_CRYSTAL_MAX_FREQ_ACCURACY", 20);
  2021.     m_dBT_CRYSTAL_MAX_FREQ_ACCURACY = atof(as.c_str());
  2022.     m_uiMIN_POLL_COUNT = ini->ReadInteger("BT crystal CAP ID table", "MIN_POLL_COUNT", 399999);
  2023.     m_uiMAX_POLL_COUNT = ini->ReadInteger("BT crystal CAP ID table", "MIN_POLL_COUNT", 400001);
  2024. }
  2025. //=============================================================================
  2026. bool TMETA_factory_cfg::SaveRxPathLossToCfgFile(AnsiString as_filename)
  2027. {
  2028.     TIniFile *ini;
  2029.     ini = new TIniFile( as_filename );
  2030.     if(ini == NULL) return false;
  2031.     ini->WriteString( "RX measurement samples",
  2032.                       "N_PM",
  2033.                       IntToStr(i_N_PM)
  2034.                     );
  2035.     ini->WriteString( "RX measurement samples",
  2036.                       "M_PM",
  2037.                       IntToStr(c_M_PM)
  2038.                     );
  2039.     ini->WriteString( "RX path loss table",
  2040.                       "GSM400_MAX_RX_LOSS",
  2041.                       as_GSM400_MAX_RX_LOSS
  2042.                     );
  2043.     ini->WriteString( "RX path loss table",
  2044.                       "GSM400_MIN_RX_LOSS",
  2045.                       as_GSM400_MIN_RX_LOSS
  2046.                     );
  2047.     ini->WriteString( "RX path loss table",
  2048.                       "GSM850_MAX_RX_LOSS",
  2049.                       as_GSM850_MAX_RX_LOSS
  2050.                     );
  2051.     ini->WriteString( "RX path loss table",
  2052.                       "GSM850_MIN_RX_LOSS",
  2053.                       as_GSM850_MIN_RX_LOSS
  2054.                     );
  2055.     ini->WriteString( "RX path loss table",
  2056.                       "GSM900_MAX_RX_LOSS",
  2057.                       as_GSM900_MAX_RX_LOSS
  2058.                     );
  2059.     ini->WriteString( "RX path loss table",
  2060.                       "GSM900_MIN_RX_LOSS",
  2061.                       as_GSM900_MIN_RX_LOSS
  2062.                     );
  2063.     ini->WriteString( "RX path loss table",
  2064.                       "DCS1800_MAX_RX_LOSS",
  2065.                       as_DCS1800_MAX_RX_LOSS
  2066.                     );
  2067.     ini->WriteString( "RX path loss table",
  2068.                       "DCS1800_MIN_RX_LOSS",
  2069.                       as_DCS1800_MIN_RX_LOSS
  2070.                     );
  2071.     ini->WriteString( "RX path loss table",
  2072.                       "PCS1900_MAX_RX_LOSS",
  2073.                       as_PCS1900_MAX_RX_LOSS
  2074.                     );
  2075.     ini->WriteString( "RX path loss table",
  2076.                       "PCS1900_MIN_RX_LOSS",
  2077.                       as_PCS1900_MIN_RX_LOSS
  2078.                     );
  2079.     delete ini;
  2080.     return true;
  2081. }
  2082. //---------------------------------------------------------------------
  2083. bool TMETA_factory_cfg::SaveCommonToCfgFile(AnsiString as_filename)
  2084. {
  2085.     TIniFile *ini;
  2086.     ini = new TIniFile( as_filename );
  2087.     if(ini == NULL) return false;
  2088.     // 8960 initialization
  2089.     ini->WriteString( "8960 Initialization",
  2090.                       "8960 GPIB Address",
  2091.                       m_as8960_GPIB_Addr
  2092.                     );
  2093.     ini->WriteString( "8960 Initialization",
  2094.                       "Time Out",
  2095.                       IntToStr(m_iTimeOut)
  2096.                     );
  2097.     ini->WriteString( "8960 Initialization",
  2098.                       "GSM400 cable loss",
  2099.                       Double_To_AnsiString(m_dGSM400_CL)
  2100.                     );
  2101.     ini->WriteString( "8960 Initialization",
  2102.                       "GSM850 cable loss",
  2103.                       Double_To_AnsiString(m_dGSM850_CL)
  2104.                     );
  2105.     ini->WriteString( "8960 Initialization",
  2106.                       "GSM900 cable loss",
  2107.                       Double_To_AnsiString(m_dGSM900_CL)
  2108.                     );
  2109.     ini->WriteString( "8960 Initialization",
  2110.                       "DCS1800 cable loss",
  2111.                       Double_To_AnsiString(m_dDCS1800_CL)
  2112.                     );
  2113.     ini->WriteString( "8960 Initialization",
  2114.                       "PCS1900 cable loss",
  2115.                       Double_To_AnsiString(m_dPCS1900_CL)
  2116.                     );
  2117.     // CMU200 Initialization
  2118.     ini->WriteString( "CMU200 Initialization",
  2119.                       "CMU200 GPIB Address",
  2120.                       m_asCMU200_GPIB_Addr
  2121.                     );
  2122.     ini->WriteString( "CMU200 Initialization",
  2123.                       "Time Out",
  2124.                       IntToStr(m_iCMU200_TimeOut)
  2125.                     );
  2126.     ini->WriteString( "CMU200 Initialization",
  2127.                       "GSM400 input cable loss",
  2128.                       Double_To_AnsiString(m_dCMU200_INPUT_GSM400_CL)
  2129.                     );
  2130.     ini->WriteString( "CMU200 Initialization",
  2131.                       "GSM850 input cable loss",
  2132.                       Double_To_AnsiString(m_dCMU200_INPUT_GSM850_CL)
  2133.                     );
  2134.     ini->WriteString( "CMU200 Initialization",
  2135.                       "GSM900 input cable loss",
  2136.                       Double_To_AnsiString(m_dCMU200_INPUT_GSM900_CL)
  2137.                     );
  2138.     ini->WriteString( "CMU200 Initialization",
  2139.                       "DCS1800 input cable loss",
  2140.                       Double_To_AnsiString(m_dCMU200_INPUT_DCS1800_CL)
  2141.                     );
  2142.     ini->WriteString( "CMU200 Initialization",
  2143.                       "PCS1900 input cable loss",
  2144.                       Double_To_AnsiString(m_dCMU200_INPUT_PCS1900_CL)
  2145.                     );
  2146.     ini->WriteString( "CMU200 Initialization",
  2147.                       "GSM400 output cable loss",
  2148.                       Double_To_AnsiString(m_dCMU200_OUTPUT_GSM400_CL)
  2149.                     );
  2150.     ini->WriteString( "CMU200 Initialization",
  2151.                       "GSM850 output cable loss",
  2152.                       Double_To_AnsiString(m_dCMU200_OUTPUT_GSM850_CL)
  2153.                     );
  2154.     ini->WriteString( "CMU200 Initialization",
  2155.                       "GSM900 output cable loss",
  2156.                       Double_To_AnsiString(m_dCMU200_OUTPUT_GSM900_CL)
  2157.                     );
  2158.     ini->WriteString( "CMU200 Initialization",
  2159.                       "DCS1800 output cable loss",
  2160.                       Double_To_AnsiString(m_dCMU200_OUTPUT_DCS1800_CL)
  2161.                     );
  2162.     ini->WriteString( "CMU200 Initialization",
  2163.                       "PCS1900 output cable loss",
  2164.                       Double_To_AnsiString(m_dCMU200_OUTPUT_PCS1900_CL)
  2165.                     );
  2166.     // Frequency Bank
  2167.     ini->WriteString( "Frequency Bank",
  2168.                       "bank",
  2169.                       as_FreqBank
  2170.                     );
  2171.     // C0 for each Bank
  2172.     ini->WriteString( "C0 for each Bank",
  2173.                       "arfcn_C0_GSM",
  2174.                       IntToStr(m_sARFCN_C0_GSM)
  2175.                     );
  2176.     ini->WriteString( "C0 for each Bank",
  2177.                       "arfcn_C0_DCS",
  2178.                       IntToStr(m_sARFCN_C0_DCS)
  2179.                     );
  2180.     ini->WriteString( "C0 for each Bank",
  2181.                       "arfcn_C0_PCS",
  2182.                       IntToStr(m_sARFCN_C0_PCS)
  2183.                     );
  2184.     ini->WriteString( "C0 for each Bank",
  2185.                       "arfcn_C0_GSM850",
  2186.                       IntToStr(m_sARFCN_C0_GSM850)
  2187.                     );
  2188.     ini->WriteString( "C0 for each Bank",
  2189.                       "arfcn_C0_GSM400",
  2190.                       IntToStr(m_sARFCN_C0_GSM400)
  2191.                     );
  2192.     // downlink power                    
  2193.     ini->WriteString( "Downlink power",
  2194.                       "P_DL",
  2195.                       Double_To_AnsiString(d_P_DL)
  2196.                     );
  2197.     delete ini;
  2198.     return true;
  2199. }
  2200. //---------------------------------------------------------------------
  2201. bool TMETA_factory_cfg::SaveAfcToCfgFile(AnsiString as_filename)
  2202. {
  2203.     TIniFile *ini;
  2204.     ini = new TIniFile( as_filename );
  2205.     if(ini == NULL) return false;
  2206.     ini->WriteString( "AFC Calibration",
  2207.                       "AFC_BAND",
  2208.                       as_AFC_BAND
  2209.                     );
  2210.     ini->WriteString( "AFC Calibration",
  2211.                       "AFC_ARFCN",
  2212.                       IntToStr(m_sAFC_ARFCN)
  2213.                     );
  2214.     ini->WriteString( "AFC Calibration",
  2215.                       "N_AFC",
  2216.                       IntToStr(m_sN_AFC)
  2217.                     );
  2218.     ini->WriteString( "AFC Calibration",
  2219.                       "DAC1",
  2220.                       IntToStr(m_sDAC1)
  2221.                     );
  2222.     ini->WriteString( "AFC Calibration",
  2223.                       "DAC2",
  2224.                       IntToStr(m_sDAC2)
  2225.                     );
  2226.     ini->WriteString( "AFC Calibration",
  2227.                       "CRYSTAL_DAC1",
  2228.                       IntToStr(m_sCRYSTAL_DAC1)
  2229.                     );
  2230.     ini->WriteString( "AFC Calibration",
  2231.                       "CRYSTAL_DAC2",
  2232.                       IntToStr(m_sCRYSTAL_DAC2)
  2233.                     );
  2234.     ini->WriteString( "AFC table",
  2235.                       "MAX_INIT_AFC_DAC",
  2236.                       IntToStr(m_sMAX_INIT_AFC_DAC)
  2237.                     );
  2238.     ini->WriteString( "AFC table",
  2239.                       "MIN_INIT_AFC_DAC",
  2240.                       IntToStr(m_sMIN_INIT_AFC_DAC)
  2241.                     );
  2242.     ini->WriteString( "AFC table",
  2243.                       "MAX_AFC_SLOPE",
  2244.                       Double_To_AnsiString(d_MAX_AFC_SLOPE)
  2245.                     );
  2246.     ini->WriteString( "AFC table",
  2247.                       "MIN_AFC_SLOPE",
  2248.                       Double_To_AnsiString(d_MIN_AFC_SLOPE)
  2249.                     );
  2250.     delete ini;
  2251.     return true;
  2252. }
  2253. //---------------------------------------------------------------------
  2254. //bool TMETA_factory_cfg::SavePhErrToCfgFile(AnsiString as_filename)
  2255. //{
  2256. //    TIniFile *ini;
  2257. //    ini = new TIniFile( as_filename );
  2258. //    if(ini == NULL) return false;
  2259. //
  2260. //    ini->WriteString( "Phase error table",
  2261. //                      "PHASE_ERROR_BAND",
  2262. //                      as_PHASE_ERROR_BAND
  2263. //                    );
  2264. //
  2265. //    ini->WriteString( "Phase error table",
  2266. //                      "PHASE_ERROR_ARFCN",
  2267. //                      IntToStr(m_sPHASE_ERROR_ARFCN)
  2268. //                    );
  2269. //
  2270. //    ini->WriteString( "Phase error table",
  2271. //                      "PHASE_ERROR_PCL",
  2272. //                      IntToStr(i_PHASE_ERROR_PCL)
  2273. //                    );
  2274. //
  2275. //    ini->WriteString( "Phase error table",
  2276. //                      "PHASE_ERROR_MEASUSE_COUNT",
  2277. ///                      IntToStr(i_PHASE_ERROR_MEASUSE_COUNT)
  2278. //                    );
  2279. //
  2280. //    ini->WriteString( "Phase error table",
  2281. //                      "PHASE_ERROR_RMS_ERROR",
  2282. //                      Double_To_AnsiString(d_PHASE_ERROR_RMS_ERROR)
  2283. //                    );
  2284. //
  2285. //
  2286. //    delete ini;
  2287. //
  2288. //    return true;
  2289. //}
  2290. //---------------------------------------------------------------------
  2291. bool TMETA_factory_cfg::SaveAdcToCfgFile(AnsiString as_filename)
  2292. {
  2293.     TIniFile *ini;
  2294.     ini = new TIniFile( as_filename );
  2295.     if(ini == NULL) return false;
  2296.     ini->WriteString( "ADC table",
  2297.                       "ADC_V1",
  2298.                       IntToStr(i_ADC_V1)
  2299.                     );
  2300.     ini->WriteString( "ADC table",
  2301.                       "ADC_V2",
  2302.                       IntToStr(i_ADC_V2)
  2303.                     );
  2304.     ini->WriteString( "ADC table",
  2305.                       "ADC_CHECK_VOLTAGE",
  2306.                       IntToStr(i_ADC_CHECK_VOLTAGE)
  2307.                     );
  2308.     ini->WriteString( "ADC table",
  2309.                       "NORMAL_VOLTAGE",
  2310.                       IntToStr(i_NORMAL_VOLTAGE)
  2311.                     );
  2312.     ini->WriteString( "ADC table",
  2313.                       "CURRENT_LIMIT",
  2314.                       IntToStr(i_CURRENT_LIMIT)
  2315.                     );
  2316.     ini->WriteString( "ADC table",
  2317.                       "MAX_BATTERY_ADC_SLOPE",
  2318.                       IntToStr(i_MAX_BATTERY_ADC_SLOPE)
  2319.                     );
  2320.     ini->WriteString( "ADC table",
  2321.                       "MIN_BATTERY_ADC_SLOPE",
  2322.                       IntToStr(i_MIN_BATTERY_ADC_SLOPE)
  2323.                     );
  2324.     ini->WriteString( "ADC table",
  2325.                       "MAX_BATTERY_ADC_OFFSET",
  2326.                       IntToStr(i_MAX_BATTERY_ADC_OFFSET)
  2327.                     );
  2328.     ini->WriteString( "ADC table",
  2329.                       "MIN_BATTERY_ADC_OFFSET",
  2330.                       IntToStr(i_MIN_BATTERY_ADC_OFFSET)
  2331.                     );
  2332.     ini->WriteString( "ADC table",
  2333.                       "BATTERY_CHANNEL",
  2334.                       IntToStr(i_BATTERY_CHANNEL)
  2335.                     );
  2336.     ini->WriteString( "ADC table",
  2337.                       "CHARGER_CHANNEL",
  2338.                       IntToStr(i_CHARGER_CHANNEL)
  2339.                     );
  2340.     ini->WriteString( "ADC table",
  2341.                       "ADC_RESISTANCE",
  2342.                       Double_To_AnsiString(d_ADC_RESISTANCE)
  2343.                     );
  2344.     ini->WriteString( "ADC table",
  2345.                       "MAX_VOLTAGE_DIFFERENCE",
  2346.                       Double_To_AnsiString(d_MAX_VOLTAGE_DIFFERENCE)
  2347.                     );
  2348.     ini->WriteString( "ADC table",
  2349.                       "MAX_CURRENT_DIFFERENCE",
  2350.                       Double_To_AnsiString(d_MAX_CURRENT_DIFFERENCE)
  2351.                     );
  2352.     ini->WriteString( "ADC table",
  2353.                       "ADC_MEASUREMENT_COUNT",
  2354.                       IntToStr(i_ADC_MEASUREMENT_COUNT)
  2355.                     );
  2356.     delete ini;
  2357.     return true;
  2358. }
  2359. //------------------------------------------------------------------------------
  2360. bool TMETA_factory_cfg::SaveCrystalAfcToCfgFile(AnsiString as_filename)
  2361. {
  2362.     TIniFile *ini;
  2363.     ini = new TIniFile( as_filename );
  2364.     if(ini == NULL) return false;
  2365.     ini->WriteString( "Crystal AFC Calibration",
  2366.                       "CRYSTAL_AFC_BAND",
  2367.                       as_CRYSTAL_AFC_BAND
  2368.                     );
  2369.     ini->WriteString( "Crystal AFC Calibration",
  2370.                       "CRYSTAL_AFC_ARFCN",
  2371.                       IntToStr(m_sCRYSTAL_AFC_ARFCN)
  2372.                     );
  2373.     ini->WriteString( "Crystal AFC Calibration",
  2374.                       "CRYSTAL_AFC_TCH_P_DL",
  2375.                       Double_To_AnsiString(d_CRYSTAL_AFC_TCH_P_DL)
  2376.                     );
  2377.     ini->WriteString( "Crystal AFC Calibration",
  2378.                       "CRYSTAL_AFC_GSM850_PCL",
  2379.                       IntToStr(i_CRYSTAL_AFC_GSM850_PCL)
  2380.                     );
  2381.     ini->WriteString( "Crystal AFC Calibration",
  2382.                       "CRYSTAL_AFC_GSM900_PCL",
  2383.                       IntToStr(i_CRYSTAL_AFC_GSM900_PCL)
  2384.                     );
  2385.     ini->WriteString( "Crystal AFC Calibration",
  2386.                       "CRYSTAL_AFC_DCS1800_PCL",
  2387.                       IntToStr(i_CRYSTAL_AFC_DCS1800_PCL)
  2388.                     );
  2389.     ini->WriteString( "Crystal AFC Calibration",
  2390.                       "CRYSTAL_AFC_PCS1900_PCL",
  2391.                       IntToStr(i_CRYSTAL_AFC_PCS1900_PCL)
  2392.                     );
  2393.     ini->WriteString( "Crystal AFC Calibration",
  2394.                       "CRYSTAL_AFC_CAL_DAC",
  2395.                       IntToStr(m_sCRYSTAL_AFC_CAL_DAC)
  2396.                     );
  2397.     ini->WriteString( "Crystal AFC Calibration",
  2398.                       "CRYSTAL_AFC_CHECK_DAC1",
  2399.                       IntToStr(m_sCRYSTAL_AFC_CHECK_DAC1)
  2400.                     );
  2401.     ini->WriteString( "Crystal AFC Calibration",
  2402.                       "CRYSTAL_AFC_CHECK_DAC2",
  2403.                       IntToStr(m_sCRYSTAL_AFC_CHECK_DAC2)
  2404.                     );
  2405.     ini->WriteString( "Crystal AFC Calibration",
  2406.                       "CRYSTAL_AFC_MIN_FREQ_ERR_PPM",
  2407.                       Double_To_AnsiString(d_CRYSTAL_AFC_MIN_FREQ_ERR_PPM)
  2408.                     );
  2409.                     
  2410.     ini->WriteString( "Crystal AFC Calibration",
  2411.                       "CRYSTAL_AFC_MAX_FREQ_ERR_PPM",
  2412.                       Double_To_AnsiString(d_CRYSTAL_AFC_MAX_FREQ_ERR_PPM)
  2413.                     );
  2414.     ini->WriteString( "Crystal AFC Calibration",
  2415.                       "CRYSTAL_AFC_MAX_AFC_TRACK_INIT_FREQ_ERR",
  2416.                       Double_To_AnsiString(m_dCRYSTAL_AFC_MAX_AFC_TRACK_INIT_FREQ_ERR)
  2417.                     );
  2418.     ini->WriteString( "Crystal AFC Calibration",
  2419.                       "CRYSTAL_AFC_FREQ_ERR_MEASUSE_COUNT",
  2420.                       IntToStr(m_sCRYSTAL_AFC_FREQ_ERR_MEASUSE_COUNT)
  2421.                     );
  2422.     ini->WriteString( "Crystal AFC Calibration",
  2423.                       "CRYSTAL_AFC_RECURSIVE_TIMES",
  2424.                       IntToStr(m_sCRYSTAL_AFC_RECURSIVE_TIMES)
  2425.                     );
  2426.     delete ini;
  2427.     return true;
  2428. }
  2429. //------------------------------------------------------------------------------
  2430. bool TMETA_factory_cfg::SaveTxPclToCfgFile(AnsiString as_filename)
  2431. {
  2432.     TIniFile *ini;
  2433.     ini = new TIniFile( as_filename );
  2434.     if(ini == NULL) return false;
  2435.     // GSM 400
  2436.     ini->WriteString( "TX PCL table",
  2437.                       "GSM400_CAL_PCL",
  2438.                       m_asGSM400_CAL_PCL
  2439.                     );
  2440.     ini->WriteString( "TX PCL table",
  2441.                       "GSM400_2CAL_PCL",
  2442.                       m_asGSM400_2CAL_PCL
  2443.                     );
  2444.     ini->WriteString("TX PCL table",
  2445.                       "GSM400_4CAL_PCL",
  2446.                       m_asGSM400_4CAL_PCL
  2447.                     );
  2448.     ini->WriteString( "TX PCL table",
  2449.                       "GSM400_PCL",
  2450.                       m_asGSM400_PCL
  2451.                     );
  2452.     ini->WriteString( "TX PCL table",
  2453.                       "GSM400_CHECK_PCL",
  2454.                       m_asGSM400_CHECK_PCL
  2455.                     );
  2456.     ini->WriteString( "TX PCL table",
  2457.                       "GSM400_MAX_P",
  2458.                       m_asGSM400_MAX_P
  2459.                     );
  2460.     ini->WriteString( "TX PCL table",
  2461.                       "GSM400_WANTED_P",
  2462.                       m_asGSM400_WANTED_P
  2463.                     );
  2464.     ini->WriteString( "TX PCL table",
  2465.                       "GSM400_MIN_P",
  2466.                       m_asGSM400_MIN_P
  2467.                     );
  2468.     ini->WriteString( "TX PCL table",
  2469.                       "GSM400_C",
  2470.                       m_asGSM400_C
  2471.                     );
  2472.     ini->WriteString( "TX PCL table",
  2473.                       "GSM400_CORRECTION",
  2474.                       m_asGSM400_CORRECTION
  2475.                     );
  2476.     // GSM 850
  2477.     ini->WriteString( "TX PCL table",
  2478.                       "GSM850_CAL_PCL",
  2479.                       m_asGSM850_CAL_PCL
  2480.                     );
  2481.     ini->WriteString( "TX PCL table",
  2482.                       "GSM850_2CAL_PCL",
  2483.                       m_asGSM850_2CAL_PCL
  2484.                     );
  2485.     ini->WriteString("TX PCL table",
  2486.                       "GSM850_4CAL_PCL",
  2487.                       m_asGSM850_4CAL_PCL
  2488.                     );
  2489.     ini->WriteString("TX PCL table",
  2490.                       "GSM850_6CAL_PCL",
  2491.                       m_asGSM850_6CAL_PCL
  2492.                     );
  2493.     ini->WriteString("TX PCL table",
  2494.                       "GSM850_6CAL_DAC",
  2495.                       m_asGSM850_6CAL_DAC
  2496.                     );
  2497.     ini->WriteString( "TX PCL table",
  2498.                       "GSM850_PCL",
  2499.                       m_asGSM850_PCL
  2500.                     );
  2501.     ini->WriteString( "TX PCL table",
  2502.                       "GSM850_CHECK_PCL",
  2503.                       m_asGSM850_CHECK_PCL
  2504.                     );
  2505.     ini->WriteString( "TX PCL table",
  2506.                       "GSM850_MAX_P",
  2507.                       m_asGSM850_MAX_P
  2508.                     );
  2509.     ini->WriteString( "TX PCL table",
  2510.                       "GSM850_WANTED_P",
  2511.                       m_asGSM850_WANTED_P
  2512.                     );
  2513.     ini->WriteString( "TX PCL table",
  2514.                       "GSM850_MIN_P",
  2515.                       m_asGSM850_MIN_P
  2516.                     );
  2517.     ini->WriteString( "TX PCL table",
  2518.                       "GSM850_C",
  2519.                       m_asGSM850_C
  2520.                     );
  2521.     ini->WriteString( "TX PCL table",
  2522.                       "GSM850_CORRECTION",
  2523.                       m_asGSM850_CORRECTION
  2524.                     );
  2525.     // GSM 900
  2526.     ini->WriteString( "TX PCL table",
  2527.                       "GSM900_CAL_PCL",
  2528.                       m_asGSM900_CAL_PCL
  2529.                     );
  2530.     ini->WriteString( "TX PCL table",
  2531.                       "GSM900_2CAL_PCL",
  2532.                       m_asGSM900_2CAL_PCL
  2533.                     );
  2534.     ini->WriteString("TX PCL table",
  2535.                       "GSM900_4CAL_PCL",
  2536.                       m_asGSM900_4CAL_PCL
  2537.                     );
  2538.     ini->WriteString("TX PCL table",
  2539.                       "GSM900_6CAL_PCL",
  2540.                       m_asGSM900_6CAL_PCL
  2541.                     );
  2542.     ini->WriteString("TX PCL table",
  2543.                       "GSM900_6CAL_DAC",
  2544.                       m_asGSM900_6CAL_DAC
  2545.                     );
  2546.     ini->WriteString( "TX PCL table",
  2547.                       "GSM900_PCL",
  2548.                       m_asGSM900_PCL
  2549.                     );
  2550.     ini->WriteString( "TX PCL table",
  2551.                       "GSM900_CHECK_PCL",
  2552.                       m_asGSM900_CHECK_PCL
  2553.                     );
  2554.     ini->WriteString( "TX PCL table",
  2555.                       "GSM900_MAX_P",
  2556.                       m_asGSM900_MAX_P
  2557.                     );
  2558.     ini->WriteString( "TX PCL table",
  2559.                       "GSM900_WANTED_P",
  2560.                       m_asGSM900_WANTED_P
  2561.                     );
  2562.     ini->WriteString( "TX PCL table",
  2563.                       "GSM900_MIN_P",
  2564.                       m_asGSM900_MIN_P
  2565.                     );
  2566.     ini->WriteString( "TX PCL table",
  2567.                       "GSM900_C",
  2568.                       m_asGSM900_C
  2569.                     );
  2570.     ini->WriteString( "TX PCL table",
  2571.                       "GSM900_CORRECTION",
  2572.                       m_asGSM900_CORRECTION
  2573.                     );
  2574.     // DCS 1800
  2575.     ini->WriteString( "TX PCL table",
  2576.                       "DCS1800_CAL_PCL",
  2577.                       m_asDCS1800_CAL_PCL
  2578.                     );
  2579.     ini->WriteString( "TX PCL table",
  2580.                       "DCS1800_2CAL_PCL",
  2581.                       m_asDCS1800_2CAL_PCL
  2582.                     );
  2583.     ini->WriteString("TX PCL table",
  2584.                       "DCS1800_4CAL_PCL",
  2585.                       m_asDCS1800_4CAL_PCL
  2586.                     );
  2587.     ini->WriteString("TX PCL table",
  2588.                       "DCS1800_6CAL_PCL",
  2589.                       m_asDCS1800_6CAL_PCL
  2590.                     );
  2591.     ini->WriteString("TX PCL table",
  2592.                       "DCS1800_6CAL_DAC",
  2593.                       m_asDCS1800_6CAL_DAC
  2594.                     );
  2595.     ini->WriteString( "TX PCL table",
  2596.                       "DCS1800_PCL",
  2597.                       m_asDCS1800_PCL
  2598.                     );
  2599.     ini->WriteString( "TX PCL table",
  2600.                       "DCS1800_CHECK_PCL",
  2601.                       m_asDCS1800_CHECK_PCL
  2602.                     );
  2603.     ini->WriteString( "TX PCL table",
  2604.                       "DCS1800_MAX_P",
  2605.                       m_asDCS1800_MAX_P
  2606.                     );
  2607.     ini->WriteString( "TX PCL table",
  2608.                       "DCS1800_WANTED_P",
  2609.                       m_asDCS1800_WANTED_P
  2610.                     );
  2611.     ini->WriteString( "TX PCL table",
  2612.                       "DCS1800_MIN_P",
  2613.                       m_asDCS1800_MIN_P
  2614.                     );
  2615.     ini->WriteString( "TX PCL table",
  2616.                       "DCS1800_C",
  2617.                       m_asDCS1800_C
  2618.                     );
  2619.     ini->WriteString( "TX PCL table",
  2620.                       "DCS1800_CORRECTION",
  2621.                       m_asDCS1800_CORRECTION
  2622.                     );
  2623.     // PCS 1900
  2624.     ini->WriteString( "TX PCL table",
  2625.                       "PCS1900_CAL_PCL",
  2626.                       m_asPCS1900_CAL_PCL
  2627.                     );
  2628.     ini->WriteString( "TX PCL table",
  2629.                       "PCS1900_2CAL_PCL",
  2630.                       m_asPCS1900_2CAL_PCL
  2631.                     );
  2632.     ini->WriteString("TX PCL table",
  2633.                       "PCS1900_4CAL_PCL",
  2634.                       m_asPCS1900_4CAL_PCL
  2635.                     );
  2636.     ini->WriteString("TX PCL table",
  2637.                       "PCS1900_6CAL_PCL",
  2638.                       m_asPCS1900_6CAL_PCL
  2639.                     );
  2640.     ini->WriteString("TX PCL table",
  2641.                       "PCS1900_6CAL_DAC",
  2642.                       m_asPCS1900_6CAL_DAC
  2643.                     );
  2644.     ini->WriteString( "TX PCL table",
  2645.                       "PCS1900_PCL",
  2646.                       m_asPCS1900_PCL
  2647.                     );
  2648.     ini->WriteString( "TX PCL table",
  2649.                       "PCS1900_CHECK_PCL",
  2650.                       m_asPCS1900_CHECK_PCL
  2651.                     );
  2652.     ini->WriteString( "TX PCL table",
  2653.                       "PCS1900_MAX_P",
  2654.                       m_asPCS1900_MAX_P
  2655.                     );
  2656.     ini->WriteString( "TX PCL table",
  2657.                       "PCS1900_WANTED_P",
  2658.                       m_asPCS1900_WANTED_P
  2659.                     );
  2660.     ini->WriteString( "TX PCL table",
  2661.                       "PCS1900_MIN_P",
  2662.                       m_asPCS1900_MIN_P
  2663.                     );
  2664.     ini->WriteString( "TX PCL table",
  2665.                       "PCS1900_C",
  2666.                       m_asPCS1900_C
  2667.                     );
  2668.     ini->WriteString( "TX PCL table",
  2669.                       "PCS1900_CORRECTION",
  2670.                       m_asPCS1900_CORRECTION
  2671.                     );
  2672.     ini->WriteString("TX PCL table",
  2673.                      "MAX_APC_DAC",
  2674.                      IntToStr(m_sMAX_APC_DAC)
  2675.                     );
  2676.     ini->WriteString("TX PCL table",
  2677.                      "TSC",
  2678.                      IntToStr(m_cTSC)
  2679.                     );
  2680.     ini->WriteString( "TX PCL table",
  2681.                       "Recursive Times",
  2682.                       IntToStr( m_iRecursiveTimes )
  2683.                     );
  2684.     ini->WriteString( "TX PCL table",
  2685.                       "APC Delta",
  2686.                       Double_To_AnsiString( m_dAPC_Delta )
  2687.                     );
  2688.     delete ini;
  2689.     return true;
  2690. }
  2691. //------------------------------------------------------------------------------
  2692. bool TMETA_factory_cfg::is_MAX_WANTED_MIN_P_valid()
  2693. {
  2694.     // PCL: GSM450,850,900 5~19  // total:15
  2695.     // PCL: DCS1800,PCS1900 0~15  // total:16
  2696.     AnsiString sub_max_p, sub_wanted_p, sub_min_p;
  2697.     
  2698.     ///////////////////////////////////////////////////////////////////////////
  2699.     if ( IsFreqBankSupported( as_FreqBank, FrequencyBand850))
  2700.     {
  2701.         for (int I=1; I<=15; I++)
  2702.         {
  2703.             if(! getAnsiStrSubItem( m_asGSM850_MAX_P, I,
  2704.                                     DEFAULT_SEP_CHAR, sub_max_p ))
  2705.             {
  2706.                 Application->MessageBox( "Config file: Config file read GSM850_MAX_P fail.", "Fail", MB_OK );
  2707.                 return false;
  2708.             }
  2709.             if(! getAnsiStrSubItem( m_asGSM850_MIN_P, I,
  2710.                                     DEFAULT_SEP_CHAR, sub_min_p ))
  2711.             {
  2712.                 Application->MessageBox( "Config file: Config file read GSM850_MIN_P fail.", "Fail", MB_OK );
  2713.                 return false;
  2714.             }
  2715.             if(! getAnsiStrSubItem( m_asGSM850_WANTED_P, I,
  2716.                                     DEFAULT_SEP_CHAR, sub_wanted_p ))
  2717.             {
  2718.                 Application->MessageBox( "Config file: Config file read GSM850_WANTED_P fail.", "Fail", MB_OK );
  2719.                 return false;
  2720.             }
  2721.             if (atof(sub_min_p.c_str()) > atof(sub_max_p.c_str()))
  2722.             {
  2723.                 Application->MessageBox( "Config file: GSM850_MIN_P must <= GSM850_MAX_P.", "Fail", MB_OK );
  2724.                 return false;
  2725.             }
  2726.             if (atof(sub_wanted_p.c_str()) > atof(sub_max_p.c_str()))
  2727.             {
  2728.                 Application->MessageBox( "Config file: GSM850_WANTED_P must <= GSM850_MAX_P.", "Fail", MB_OK );
  2729.                 return false;
  2730.             }
  2731.             if (atof(sub_wanted_p.c_str()) < atof(sub_min_p.c_str()))
  2732.             {
  2733.                 Application->MessageBox( "Config file: GSM850_WANTED_P must >= GSM850_MIN_P.", "Fail", MB_OK );
  2734.                 return false;
  2735.             }
  2736.         } // for
  2737.     } // if
  2738.     ////////////////////////////////////////////////////////////////////////////
  2739.     if ( IsFreqBankSupported( as_FreqBank, FrequencyBand900))
  2740.     {
  2741.         for (int I=1; I<=15; I++)
  2742.         {
  2743.             if(! getAnsiStrSubItem( m_asGSM900_MAX_P, I,
  2744.                                     DEFAULT_SEP_CHAR, sub_max_p ))
  2745.             {
  2746.                 Application->MessageBox( "Config file read GSM900_MAX_P fail.", "Fail", MB_OK );
  2747.                 return false;
  2748.             }
  2749.             if(! getAnsiStrSubItem( m_asGSM900_MIN_P, I,
  2750.                                     DEFAULT_SEP_CHAR, sub_min_p ))
  2751.             {
  2752.                 Application->MessageBox( "Config file read GSM900_MIN_P fail.", "Fail", MB_OK );
  2753.                 return false;
  2754.             }
  2755.             if(! getAnsiStrSubItem( m_asGSM900_WANTED_P, I,
  2756.                                     DEFAULT_SEP_CHAR, sub_wanted_p ))
  2757.             {
  2758.                 Application->MessageBox( "Config file read GSM900_WANTED_P fail.", "Fail", MB_OK );
  2759.                 return false;
  2760.             }
  2761.             if (atof(sub_min_p.c_str()) > atof(sub_max_p.c_str()))
  2762.             {
  2763.                 Application->MessageBox( "Config file: GSM900_MIN_P must < GSM900_MAX_P.", "Fail", MB_OK );
  2764.                 return false;
  2765.             }
  2766.             if (atof(sub_wanted_p.c_str()) > atof(sub_max_p.c_str()))
  2767.             {
  2768.                 Application->MessageBox( "Config file: GSM900_WANTED_P must <= GSM900_MAX_P.", "Fail", MB_OK );
  2769.                 return false;
  2770.             }
  2771.             if (atof(sub_wanted_p.c_str()) < atof(sub_min_p.c_str()))
  2772.             {
  2773.                 Application->MessageBox( "Config file: GSM900_WANTED_P must >= GSM900_MIN_P.", "Fail", MB_OK );
  2774.                 return false;
  2775.             }
  2776.         } // for
  2777.     } // if
  2778.     ////////////////////////////////////////////////////////////////////////////
  2779.     if ( IsFreqBankSupported( as_FreqBank, FrequencyBand1800))
  2780.     {
  2781.         for (int I=1; I<=16; I++)
  2782.         {
  2783.             if(! getAnsiStrSubItem( m_asDCS1800_MAX_P, I,
  2784.                                     DEFAULT_SEP_CHAR, sub_max_p ))
  2785.             {
  2786.                 Application->MessageBox( "Config file read DCS1800_MAX_P fail.", "Fail", MB_OK );
  2787.                 return false;
  2788.             }
  2789.             if(! getAnsiStrSubItem( m_asDCS1800_MIN_P, I,
  2790.                                     DEFAULT_SEP_CHAR, sub_min_p ))
  2791.             {
  2792.                 Application->MessageBox( "Config file read DCS1800_MIN_P fail.", "Fail", MB_OK );
  2793.                 return false;
  2794.             }
  2795.             if(! getAnsiStrSubItem( m_asDCS1800_WANTED_P, I,
  2796.                                     DEFAULT_SEP_CHAR, sub_wanted_p ))
  2797.             {
  2798.                 Application->MessageBox( "Config file read DCS1800_WANTED_P fail.", "Fail", MB_OK );
  2799.                 return false;
  2800.             }
  2801.             if (atof(sub_min_p.c_str()) > atof(sub_max_p.c_str()))
  2802.             {
  2803.                 Application->MessageBox( "Config file: DCS1800_MIN_P must < DCS1800_MAX_P.", "Fail", MB_OK );
  2804.                 return false;
  2805.             }
  2806.             if (atof(sub_wanted_p.c_str()) > atof(sub_max_p.c_str()))
  2807.             {
  2808.                 Application->MessageBox( "Config file: DCS1800_WANTED_P must <= DCS1800_MAX_P.", "Fail", MB_OK );
  2809.                 return false;
  2810.             }
  2811.             if (atof(sub_wanted_p.c_str()) < atof(sub_min_p.c_str()))
  2812.             {
  2813.                 Application->MessageBox( "Config file: DCS1800_WANTED_P must >= DCS1800_MIN_P.", "Fail", MB_OK );
  2814.                 return false;
  2815.             }
  2816.         } // for
  2817.     } // if
  2818.     ////////////////////////////////////////////////////////////////////////////
  2819.     if ( IsFreqBankSupported( as_FreqBank, FrequencyBand1900))
  2820.     {
  2821.         for (int I=1; I<=16; I++)
  2822.         {
  2823.             if(! getAnsiStrSubItem( m_asPCS1900_MAX_P, I,
  2824.                                     DEFAULT_SEP_CHAR, sub_max_p ))
  2825.             {
  2826.                 Application->MessageBox( "Config file read PCS1900_MAX_P fail.", "Fail", MB_OK );
  2827.                 return false;
  2828.             }
  2829.             if(! getAnsiStrSubItem( m_asPCS1900_MIN_P, I,
  2830.                                     DEFAULT_SEP_CHAR, sub_min_p ))
  2831.             {
  2832.                 Application->MessageBox( "Config file read PCS1900_MIN_P fail.", "Fail", MB_OK );
  2833.                 return false;
  2834.             }
  2835.             if(! getAnsiStrSubItem( m_asPCS1900_WANTED_P, I,
  2836.                                     DEFAULT_SEP_CHAR, sub_wanted_p ))
  2837.             {
  2838.                 Application->MessageBox( "Config file read PCS1900_WANTED_P fail.", "Fail", MB_OK );
  2839.                 return false;
  2840.             }
  2841.             if (atof(sub_min_p.c_str()) > atof(sub_max_p.c_str()))
  2842.             {
  2843.                 Application->MessageBox( "Config file: PCS1900_MIN_P must < PCS1900_MAX_P.", "Fail", MB_OK );
  2844.                 return false;
  2845.             }
  2846.             if (atof(sub_wanted_p.c_str()) > atof(sub_max_p.c_str()))
  2847.             {
  2848.                 Application->MessageBox( "Config file: PCS1900_WANTED_P must <= PCS1900_MAX_P.", "Fail", MB_OK );
  2849.                 return false;
  2850.             }
  2851.             if (atof(sub_wanted_p.c_str()) < atof(sub_min_p.c_str()))
  2852.             {
  2853.                 Application->MessageBox( "Config file: PCS1900_WANTED_P must >= PCS1900_MIN_P.", "Fail", MB_OK );
  2854.                 return false;
  2855.             }
  2856.         } // for
  2857.     } // if
  2858.     ////////////////////////////////////////////////////////////////////////////
  2859.     return true;
  2860. }
  2861. //------------------------------------------------------------------------------
  2862. // added by Andy Ueng
  2863. //------------------------------------------------------------------------------
  2864. bool TMETA_factory_cfg::is_MAX_MIN_PX_PATH_LOSS_valid()
  2865. {
  2866.     // PCL: GSM450,850,900 5~19  // total:15
  2867.     // PCL: DCS1800,PCS1900 0~15  // total:16
  2868.     AnsiString sub_max_rx_path_loss, sub_min_rx_path_loss;
  2869.     
  2870.     ///////////////////////////////////////////////////////////////////////////
  2871.     if ( IsFreqBankSupported( as_FreqBank, FrequencyBand850))
  2872.     {
  2873.         for (int I=1; I<PLTABLE_SIZE; I++)
  2874.         {
  2875.             if(! getAnsiStrSubItem( as_GSM850_MAX_RX_LOSS, I,
  2876.                                     DEFAULT_SEP_CHAR, sub_max_rx_path_loss ))
  2877.             {
  2878.                 ShowMessage("Config file read GSM850_MAX_RX_LOSS fail.");
  2879.                 return false;
  2880.             }
  2881.             if(! getAnsiStrSubItem( as_GSM850_MIN_RX_LOSS, I,
  2882.                                     DEFAULT_SEP_CHAR, sub_min_rx_path_loss ))
  2883.             {
  2884.                 ShowMessage("Config file read GSM850_MIN_RX_LOSS fail.");
  2885.                 return false;
  2886.             }
  2887.             if( sub_min_rx_path_loss != NULL && sub_max_rx_path_loss != NULL)
  2888.             {
  2889.                 if (atof(sub_min_rx_path_loss.c_str()) > atof(sub_max_rx_path_loss.c_str()))
  2890.                 {
  2891.                     ShowMessage("Config file: GSM850_MIN_RX_LOSS must <= GSM850_MAX_RX_LOSS.");
  2892.                     return false;
  2893.                 }
  2894.             }
  2895.         } // for
  2896.     } // if
  2897.     ////////////////////////////////////////////////////////////////////////////
  2898.     if ( IsFreqBankSupported( as_FreqBank, FrequencyBand900))
  2899.     {
  2900.         for (int I=1; I<PLTABLE_SIZE; I++)
  2901.         {
  2902.             if(! getAnsiStrSubItem( as_GSM900_MAX_RX_LOSS, I,
  2903.                                     DEFAULT_SEP_CHAR, sub_max_rx_path_loss ))
  2904.             {
  2905.                 ShowMessage("Config file read GSM900_MAX_RX_LOSS fail.");
  2906.                 return false;
  2907.             }
  2908.             if(! getAnsiStrSubItem( as_GSM900_MIN_RX_LOSS, I,
  2909.                                     DEFAULT_SEP_CHAR, sub_min_rx_path_loss ))
  2910.             {
  2911.                 ShowMessage("Config file read GSM900_MIN_RX_LOSS fail.");
  2912.                 return false;
  2913.             }
  2914.             if( sub_min_rx_path_loss != NULL && sub_max_rx_path_loss != NULL)
  2915.             {
  2916.                 if (atof(sub_min_rx_path_loss.c_str()) > atof(sub_max_rx_path_loss.c_str()))
  2917.                 {
  2918.                     ShowMessage("Config file: GSM900_MIN_RX_LOSS must < GSM900_MAX_RX_LOSS.");
  2919.                     return false;
  2920.                 }
  2921.             }
  2922.         } // for
  2923.     } // if
  2924.     ////////////////////////////////////////////////////////////////////////////
  2925.     if ( IsFreqBankSupported( as_FreqBank, FrequencyBand1800))
  2926.     {
  2927.         for (int I=1; I<PLTABLE_SIZE; I++)
  2928.         {
  2929.             if(! getAnsiStrSubItem( as_DCS1800_MAX_RX_LOSS, I,
  2930.                                     DEFAULT_SEP_CHAR, sub_max_rx_path_loss ))
  2931.             {
  2932.                 ShowMessage("Config file read DCS1800_MAX_RX_LOSS fail.");
  2933.                 return false;
  2934.             }
  2935.             if(! getAnsiStrSubItem( as_DCS1800_MIN_RX_LOSS, I,
  2936.                                     DEFAULT_SEP_CHAR, sub_min_rx_path_loss ))
  2937.             {
  2938.                 ShowMessage("Config file read DCS1800_MIN_RX_LOSS fail.");
  2939.                 return false;
  2940.             }
  2941.             if( sub_min_rx_path_loss != NULL && sub_max_rx_path_loss != NULL)
  2942.             {
  2943.                 if (atof(sub_min_rx_path_loss.c_str()) > atof(sub_max_rx_path_loss.c_str()))
  2944.                 {
  2945.                     ShowMessage("Config file: DCS1800_MIN_RX_LOSS must < DCS1800_MAX_RX_LOSS.");
  2946.                     return false;
  2947.                 }
  2948.             }
  2949.         } // for
  2950.     } // if
  2951.     ////////////////////////////////////////////////////////////////////////////
  2952.     if ( IsFreqBankSupported( as_FreqBank, FrequencyBand1900))
  2953.     {
  2954.        for (int I=1; I<PLTABLE_SIZE; I++)
  2955.        {
  2956.           if(! getAnsiStrSubItem( as_PCS1900_MAX_RX_LOSS, I,
  2957.                                   DEFAULT_SEP_CHAR, sub_max_rx_path_loss ))
  2958.           {
  2959.              ShowMessage("Config file read PCS1900_MAX_RX_LOSS fail.");
  2960.              return false;
  2961.           }
  2962.           if(! getAnsiStrSubItem( as_PCS1900_MIN_RX_LOSS, I,
  2963.                                   DEFAULT_SEP_CHAR, sub_min_rx_path_loss ))
  2964.           {
  2965.              ShowMessage("Config file read PCS1900_MIN_RX_LOSS fail.");
  2966.              return false;
  2967.           }
  2968.           if (sub_min_rx_path_loss != NULL && sub_max_rx_path_loss != NULL)
  2969.           {
  2970.               if (atof(sub_min_rx_path_loss.c_str()) > atof(sub_max_rx_path_loss.c_str()))
  2971.               {
  2972.                 ShowMessage("Config file: PCS1900_MIN_RX_LOSS must < PCS1900_MAX_RX_LOSS.");
  2973.                 return false;
  2974.               }
  2975.           }
  2976.        } // for
  2977.     } // if
  2978.     ////////////////////////////////////////////////////////////////////////////
  2979.     return true;
  2980.  }
  2981. //------------------------------------------------------------------------------
  2982. //------------------------------------------------------------------------------
  2983. int TMETA_factory_cfg::getTXCheckIndex(int band, AnsiString as_PCLString, AnsiString as_CheckPCL)
  2984. {
  2985.     int i;
  2986.     AnsiString as_sub_PCL;
  2987.     int int_sub_PCL, int_CheckPCL;
  2988.     int CheckIndex = -1; // set initial value to not found
  2989.     int_CheckPCL = as_CheckPCL.ToInt();
  2990.     if ( band == GSM400_BAND || band == GSM850_BAND || band == GSM900_BAND )
  2991.     {
  2992.         for (i=1; i<=TOTAL_GSM_PCL_NUM; i++)
  2993.         {
  2994.             getAnsiStrSubItem( as_PCLString, i, DEFAULT_SEP_CHAR, as_sub_PCL );
  2995.             int_sub_PCL = as_sub_PCL.ToInt();
  2996.             if ( int_sub_PCL == int_CheckPCL )
  2997.             {
  2998.                 CheckIndex = i;
  2999.                 break;
  3000.             }
  3001.         }
  3002.     }
  3003.     else // DCS, PCS
  3004.     {
  3005.         for (i=1; i<=TOTAL_DCS_PCL_NUM; i++)
  3006.         {
  3007.             getAnsiStrSubItem( as_PCLString, i, DEFAULT_SEP_CHAR, as_sub_PCL );
  3008.             int_sub_PCL = as_sub_PCL.ToInt();
  3009.             if ( int_sub_PCL == int_CheckPCL )
  3010.             {
  3011.                 CheckIndex = i;
  3012.                 break;
  3013.             }
  3014.         }
  3015.     }
  3016.     return CheckIndex;
  3017. }