form_UpdateParameter.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:53k
源码类别:
MTK
开发平台:
C++ Builder
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * form_UpdateParameter.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * RF and ADC parameter update form source
- *
- * Author:
- * -------
- * Andy Ueng (mtk00490)
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision$
- * $Modtime$
- * $Log$
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "form_UpdateParameter.h"
- #include "form_main.h"
- #include "man_fdm.h"
- // message
- #ifndef _META_LAB_MSG_H_
- #include "meta_lab_msg.h"
- #endif
- // query
- #ifndef _RF_ID_THRD_H_
- #include "rf_id_thrd.h"
- #endif
- #ifndef _RF_TXIQ_RUN_H_
- #include "rf_txiq_run.h"
- #endif
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- //---------------------------------------------------------------------------
- TfrmUpdateParameter *frmUpdateParameter;
- extern bool g_bHideEnable;
- // thread
- extern T_RFTADO* pt_rftado;
- extern T_RFID* pt_rfid;
- //---------------------------------------------------------------------------
- static void CNF_ReadFromNVRAM(void)
- {
- frmUpdateParameter->UploadFromFlashDone();
- }
- //---------------------------------------------------------------------------
- static void CNF_WriteToNVRAM(void)
- {
- frmUpdateParameter->DownloadToFlashDone();
- }
- //---------------------------------------------------------------------------
- __fastcall TfrmUpdateParameter::TfrmUpdateParameter(TComponent* Owner)
- : TForm(Owner)
- {
- WindowProc = SubClassWndProc;
- }
- //==============================================================================
- void __fastcall TfrmUpdateParameter::FormCreate(TObject *Sender)
- {
- // m_bDownloadTrigger = false;
- m_bInit = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmUpdateParameter::FormActivate(TObject *Sender)
- {
- if (m_bInit)
- {
- m_bInit = false;
- // baseband
- m_eBbChip = frmMainSel->Get_FinalBBChip();
- // RF
- m_uiFinalRFID = frmMainSel->Get_FinalRFID();
- DisplayIP2Visible(m_uiFinalRFID);
- if ((RF_ID_A60111A == m_uiFinalRFID) ||
- (RF_ID_AERO2 == m_uiFinalRFID) ||
- (RF_ID_AERO2E == m_uiFinalRFID) ||
- (RF_ID_AG2550 == m_uiFinalRFID) ||
- (RF_ID_MT6139B == m_uiFinalRFID) ||
- (RF_ID_MT6139C == m_uiFinalRFID) ||
- (RF_ID_MT6139E == m_uiFinalRFID) ||
- (RF_ID_MT6140A == m_uiFinalRFID) ||
- (RF_ID_MT6140B == m_uiFinalRFID) ||
- (RF_ID_MT6140C == m_uiFinalRFID) ||
- (RF_ID_MT6140D == m_uiFinalRFID)
- )
- {
- rbCrystal->Checked = true;
- cbTxIQ->Checked = true;
- }
- if ((RF_ID_A60111A == m_uiFinalRFID) ||
- (RF_ID_AERO2E == m_uiFinalRFID) ||
- (RF_ID_MT6140A == m_uiFinalRFID) ||
- (RF_ID_MT6140B == m_uiFinalRFID) ||
- (RF_ID_MT6140C == m_uiFinalRFID) ||
- (RF_ID_MT6140D == m_uiFinalRFID)
- )
- {
- cbEpskLevelRamp->Checked = true;
- }
- // EDGE
- RfMsCapabilityEx_S rf_cap = frmMainSel->Get_FinalMSCap();
- cbEpskLevelRamp->Visible = rf_cap.capability.EDGE_8PSK_TX;
- cbEpskLevelRamp->Checked = rf_cap.capability.EDGE_8PSK_TX;
- m_bTADOSupport = frmMainSel->Get_TADO_Support();
- CRFTXIQRUN RF_TXIQRUN_Obj;
- m_eBbTxCfgVer = RF_TXIQRUN_Obj.Query_BBTxCfgVer_Start(m_eBbChip);
- // WiFi
- WiFi_ChipCapability_S sWiFiCap = frmMainSel->Get_FinalWiFiCap();
- if (sWiFiCap.support_802_11b ||
- sWiFiCap.support_802_11a ||
- sWiFiCap.support_802_11g
- )
- {
- cbWiFiTxDcOffset->Visible = true;
- cbWiFiTxDcOffset->Checked = true;
- cbWiFiTxPower->Visible = true;
- cbWiFiTxPower->Checked = true;
- m_bAlcSupport = m_UP_Obj.REQ_Query_ALC_Suppport_Start();
- m_cbWiFiAlc->Visible = m_bAlcSupport;
- m_cbWiFiAlc->Checked = m_bAlcSupport;
- }
- else
- {
- cbWiFiTxDcOffset->Visible = false;
- cbWiFiTxDcOffset->Checked = false;
- cbWiFiTxPower->Visible = false;
- cbWiFiTxPower->Checked = false;
- m_cbWiFiAlc->Visible = false;
- m_cbWiFiAlc->Checked = false;
- }
- // BT
- BT_ModuleID_S* p_bt_id = frmMainSel->Get_BTMoudleID();
- BT_ModuleID_S bt_id = *p_bt_id;
- if ((BTMODULE_MT6601 == bt_id.id) ||
- (BTMODULE_MT6611 == bt_id.id)
- )
- {
- m_cbBtCapId->Visible = true;
- m_cbBtCapId->Checked = true;
- }
- else
- {
- m_cbBtCapId->Visible = false;
- m_cbBtCapId->Checked = false;
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmUpdateParameter::FormShow(TObject *Sender)
- {
- m_uiFinalRFID = frmMainSel->Get_FinalRFID();
- ApplyHideProperty();
- }
- //==============================================================================
- void _fastcall TfrmUpdateParameter::SubClassWndProc(Messages::TMessage &Message)
- {
- switch (Message.Msg)
- {
- // case WM_MF_QUERY_RFTWOAPCDOOFFSET_SUCCESS:
- // m_bTADOSupport = true;
- // break;
- //
- // case WM_MF_QUERY_RFTWOAPCDOOFFSET_FAILED:
- // m_bTADOSupport = false;
- // break;
- // case WM_ML_QUERY_RFID_SUCCESS:
- // {
- // DisplayIP2Visible( m_t_rf_id.rf_id.RfModId.id );
- // m_uiFinalRFID = m_t_rf_id.rf_id.RfModId.id;
- // }
- // break;
- //
- // case WM_ML_QUERY_RFID_FAILED:
- // {
- // cbIP2->Visible = false;
- // cbIP2->Checked = false;
- // m_uiFinalRFID = RF_ID_UNKNOWN;
- // }
- // break;
- default:
- this->WndProc( Message );
- break;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmUpdateParameter::btnUploadFromFlashClick(TObject *Sender)
- {
- if (rbCrystal->Checked && cbAFC->Checked && (!cbGmskLevelRamp->Checked))
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Please also select GMSK Level, Ramp for TRX offset setting";
- Application->MessageBox( "Execution Warning : Please also select GMSK Level, Ramp for TRX offset setting", "WARNING", MB_OK );
- return;
- }
- if (!NVRAMMan->Get_IsInit())
- {
- frmMainSel->mnuFDMDatabaseClick(Sender);
- }
- if (!NVRAMMan->Get_IsInit())
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " NVRAM database file initialization fail";
- Application->MessageBox( "Execution Failure : NVRAM database file initialization", "FAILURE", MB_OK );
- return;
- }
- CurrentPageLock();
- m_ePar = PARAMETER_RX_PATH_LOSS;
- UploadFromFlash();
- }
- //--------------------------------------------------------------------------
- void TfrmUpdateParameter::UploadFromFlash(void)
- {
- m_bAction = false;
- m_UP_Obj.ConfirmCallback = ::CNF_ReadFromNVRAM;
- while ((m_ePar <= PARAMETER_BARCODE) && (!m_bAction))
- {
- switch (m_ePar)
- {
- case PARAMETER_RX_PATH_LOSS:
- {
- m_bAction = cbRXPathLoss->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_AGC_From_NVRAM();
- }
- }
- break;
- case PARAMETER_AFC:
- {
- m_bAction = cbAFC->Checked;
- if (m_bAction)
- {
- if (rbTCVCXO->Checked)
- {
- m_UP_Obj.REQ_Read_AFC_From_NVRAM();
- }
- else // crystal
- {
- m_UP_Obj.REQ_Read_Crystal_AFC_From_NVRAM();
- }
- }
- }
- break;
- case PARAMETER_IP2:
- {
- m_bAction = cbIP2->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_IP2_From_NVRAM(m_uiFinalRFID);
- }
- }
- break;
- case PARAMETER_TXIQ:
- {
- m_bAction = cbTxIQ->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_TxIq_From_NVRAM(m_uiFinalRFID, m_eBbTxCfgVer);
- }
- }
- break;
- case PARAMETER_GMSK_APC:
- {
- m_bAction = cbGmskLevelRamp->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_GMSK_APC_From_NVRAM(m_uiFinalRFID, m_bTADOSupport);
- }
- }
- break;
- case PARAMETER_EPSK_APC:
- {
- m_bAction = cbEpskLevelRamp->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_EPSK_APC_From_NVRAM(m_uiFinalRFID);
- }
- }
- break;
- case PARAMETER_ADC:
- {
- m_bAction = cbADC->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_ADC_From_NVRAM();
- }
- }
- break;
- case PARAMETER_WIFI_TX_DC_OFFSET:
- {
- m_bAction = cbWiFiTxDcOffset->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_WiFiTxDcOffset_From_NVRAM();
- }
- }
- break;
- case PARAMETER_WIFI_TX_POWER:
- {
- m_bAction = cbWiFiTxPower->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_WiFiTxPower_From_NVRAM();
- }
- }
- break;
- case PARAMETER_WIFI_ALC:
- {
- m_bAction = m_cbWiFiAlc->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_WiFiAlc_From_NVRAM();
- }
- }
- break;
- case PARAMETER_BT_CAP_ID:
- {
- m_bAction = m_cbBtCapId->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_BtCapId_From_NVRAM();
- }
- }
- break;
- case PARAMETER_IMEI:
- {
- m_bAction = cbIMEI->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_IMEI_From_NVRAM();
- }
- }
- break;
- case PARAMETER_BARCODE:
- {
- m_bAction = cbBarcode->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Read_Barcode_From_NVRAM();
- }
- }
- break;
- default:
- {
- }
- break;
- }
- if (!m_bAction)
- {
- m_ePar++;
- }
- }
- if (m_ePar > PARAMETER_BARCODE)
- {
- CurrentPageReset();
- }
- }
- //---------------------------------------------------
- void TfrmUpdateParameter::UploadFromFlashDone(void)
- {
- E_METAAPP_RESULT_T state = m_UP_Obj.Get_ConfirmState();
- AnsiString as_msg;
- switch (m_ePar)
- {
- case PARAMETER_RX_PATH_LOSS:
- {
- as_msg = "RX path loss";
- }
- break;
- case PARAMETER_AFC:
- {
- as_msg = "AFC";
- }
- break;
- case PARAMETER_IP2:
- {
- as_msg = "IP2";
- }
- break;
- case PARAMETER_TXIQ:
- {
- as_msg = "TX IQ";
- }
- break;
- case PARAMETER_GMSK_APC:
- {
- as_msg = "GMSK APC";
- }
- break;
- case PARAMETER_EPSK_APC:
- {
- as_msg = "EPSK APC";
- }
- break;
- case PARAMETER_ADC:
- {
- as_msg = "ADC";
- }
- break;
- case PARAMETER_WIFI_TX_DC_OFFSET:
- {
- as_msg = "WiFi TX DC offset";
- }
- break;
- case PARAMETER_WIFI_TX_POWER:
- {
- as_msg = "WiFi TX power";
- }
- break;
- case PARAMETER_BT_CAP_ID:
- {
- as_msg = "BT crystal CAP ID";
- }
- break;
- case PARAMETER_IMEI:
- {
- as_msg = "IMEI";
- }
- break;
- case PARAMETER_BARCODE:
- {
- as_msg = "barcode";
- }
- break;
- default:
- {
- }
- break;
- }
- switch (state)
- {
- case METAAPP_SUCCESS:
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Upload " + as_msg + " setting form flash successfully";
- m_ePar++;
- UploadFromFlash();
- }
- break;
- case METAAPP_FAIL:
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Upload " + as_msg + " setting form flash fail, please check the version of load and NVRAM database are same.";
- AnsiString as_error_msg = "Execution Failure : Upload " + as_msg + " setting form flash";
- Application->MessageBox(as_error_msg.c_str(), "FAILURE", MB_OK );
- CurrentPageReset();
- return;
- }
- // break;
- case METAAPP_TIMEOUT:
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Upload " + as_msg + " setting form flash timeout";
- AnsiString as_error_msg = "Execution Timeout : Upload " + as_msg + " setting form flash";
- Application->MessageBox(as_error_msg.c_str(), "FAILURE", MB_OK );
- CurrentPageReset();
- return;
- }
- // break;
- case METAAPP_STOP:
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Upload " + as_msg + " setting form flash stop";
- CurrentPageReset();
- return;
- }
- // break;
- default:
- {
- }
- break;
- }
- }
- //==========================================================================
- void __fastcall TfrmUpdateParameter::btnDownloadToFlashClick(
- TObject *Sender)
- {
- if (rbCrystal->Checked && cbAFC->Checked && (!cbGmskLevelRamp->Checked))
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Please also select GMSK Level, Ramp for TRX offset setting";
- Application->MessageBox( "Execution Warning : Please also select GMSK Level, Ramp for TRX offset setting", "WARNING", MB_OK );
- return;
- }
- if (!NVRAMMan->Get_IsInit())
- {
- frmMainSel->mnuFDMDatabaseClick(Sender);
- }
- if (!NVRAMMan->Get_IsInit())
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " NVRAM database file initialization fail";
- Application->MessageBox("Execution Failure : NVRAM database file initialization fail", "FAILURE", MB_OK);
- return;
- }
- CurrentPageLock();
- m_ePar = PARAMETER_RX_PATH_LOSS;
- DownloadToFlash();
- }
- //--------------------------------------------------------------------------
- void TfrmUpdateParameter::DownloadToFlash(void)
- {
- m_bAction = false;
- m_UP_Obj.ConfirmCallback = ::CNF_WriteToNVRAM;
- while ((m_ePar <= PARAMETER_BARCODE) && (!m_bAction))
- {
- switch (m_ePar)
- {
- case PARAMETER_RX_PATH_LOSS:
- {
- m_bAction = cbRXPathLoss->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_AGC_To_NVRAM();
- }
- }
- break;
- case PARAMETER_AFC:
- {
- m_bAction = cbAFC->Checked;
- if (m_bAction)
- {
- if (rbTCVCXO->Checked)
- {
- m_UP_Obj.REQ_Write_AFC_To_NVRAM();
- }
- else // crystal
- {
- m_UP_Obj.REQ_Write_Crystal_AFC_To_NVRAM();
- }
- }
- }
- break;
- case PARAMETER_IP2:
- {
- m_bAction = cbIP2->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_IP2_To_NVRAM(m_uiFinalRFID);
- }
- }
- break;
- case PARAMETER_TXIQ:
- {
- m_bAction = cbTxIQ->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_TxIq_To_NVRAM(m_uiFinalRFID, m_eBbTxCfgVer);
- }
- }
- break;
- case PARAMETER_GMSK_APC:
- {
- m_bAction = cbGmskLevelRamp->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_GMSK_APC_To_NVRAM(m_uiFinalRFID, m_bTADOSupport);
- }
- }
- break;
- case PARAMETER_EPSK_APC:
- {
- m_bAction = cbEpskLevelRamp->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_EPSK_APC_To_NVRAM(m_uiFinalRFID);
- }
- }
- break;
- case PARAMETER_ADC:
- {
- m_bAction = cbADC->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_ADC_To_NVRAM();
- }
- }
- break;
- case PARAMETER_WIFI_TX_DC_OFFSET:
- {
- m_bAction = cbWiFiTxDcOffset->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_WiFiTxDcOffset_To_NVRAM();
- }
- }
- break;
- case PARAMETER_WIFI_TX_POWER:
- {
- m_bAction = cbWiFiTxPower->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_WiFiTxPower_To_NVRAM();
- }
- }
- break;
- case PARAMETER_WIFI_ALC:
- {
- m_bAction = m_cbWiFiAlc->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_WiFiAlc_To_NVRAM();
- }
- }
- break;
- case PARAMETER_BT_CAP_ID:
- {
- m_bAction = m_cbBtCapId->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_BtCapId_To_NVRAM();
- }
- }
- break;
- case PARAMETER_IMEI:
- {
- m_bAction = cbIMEI->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_IMEI_To_NVRAM(cbCheckChecksum->Checked);
- }
- }
- break;
- case PARAMETER_BARCODE:
- {
- m_bAction = cbBarcode->Checked;
- if (m_bAction)
- {
- m_UP_Obj.REQ_Write_Barcode_To_NVRAM();
- }
- }
- break;
- default:
- {
- }
- break;
- }
- if (!m_bAction)
- {
- m_ePar++;
- }
- }
- if (m_ePar > PARAMETER_BARCODE)
- {
- CurrentPageReset();
- }
- }
- //------------------------------------------------------------------
- void TfrmUpdateParameter::DownloadToFlashDone(void)
- {
- E_METAAPP_RESULT_T state = m_UP_Obj.Get_ConfirmState();
- AnsiString as_msg;
- switch (m_ePar)
- {
- case PARAMETER_RX_PATH_LOSS:
- {
- as_msg = "RX path loss";
- }
- break;
- case PARAMETER_AFC:
- {
- as_msg = "AFC";
- }
- break;
- case PARAMETER_IP2:
- {
- as_msg = "IP2";
- }
- break;
- case PARAMETER_TXIQ:
- {
- as_msg = "TX IQ";
- }
- break;
- case PARAMETER_GMSK_APC:
- {
- as_msg = "GMSK APC";
- }
- break;
- case PARAMETER_EPSK_APC:
- {
- as_msg = "EPSK APC";
- }
- break;
- case PARAMETER_ADC:
- {
- as_msg = "ADC";
- }
- break;
- case PARAMETER_WIFI_TX_DC_OFFSET:
- {
- as_msg = "WiFi TX DC offset";
- }
- break;
- case PARAMETER_WIFI_TX_POWER:
- {
- as_msg = "WiFi TX power";
- }
- break;
- case PARAMETER_BT_CAP_ID:
- {
- as_msg = "BT crystal CAP ID";
- }
- break;
- case PARAMETER_IMEI:
- {
- as_msg = "IMEI";
- }
- break;
- case PARAMETER_BARCODE:
- {
- as_msg = "barcode";
- }
- break;
- default:
- {
- }
- break;
- }
- switch (state)
- {
- case METAAPP_SUCCESS:
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Download " + as_msg + " setting to flash successfully";
- m_ePar++;
- DownloadToFlash();
- }
- break;
- case METAAPP_FAIL:
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Download " + as_msg + " setting to flash fail, please check the version of load and NVRAM database are same.";
- AnsiString as_error_msg = "Execution Failure : Download " + as_msg + " setting to flash";
- Application->MessageBox(as_error_msg.c_str(), "FAILURE", MB_OK );
- CurrentPageReset();
- return;
- }
- // break;
- case METAAPP_TIMEOUT:
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Download " + as_msg + " setting to flash timeout";
- AnsiString as_error_msg = "Execution Timeout : Download " + as_msg + " setting to flash";
- Application->MessageBox(as_error_msg.c_str(), "FAILURE", MB_OK );
- CurrentPageReset();
- return;
- }
- // break;
- case METAAPP_STOP:
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Download " + as_msg + " setting to flash stop";
- CurrentPageReset();
- return;
- }
- // break;
- default:
- {
- }
- break;
- }
- }
- //===================================================================================================
- void __fastcall TfrmUpdateParameter::btnSaveToFileClick(TObject *Sender)
- {
- if (rbCrystal->Checked && cbAFC->Checked && (!cbGmskLevelRamp->Checked))
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Please also select GMSK Level, Ramp for TRX offset setting";
- Application->MessageBox( "Execution Warning : Please also select GMSK Level, Ramp for TRX offset setting", "WARNING", MB_OK );
- return;
- }
- char str[512];
- bool ok;
- ok = SaveDialog->Execute();
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save parameter to file fail";
- Application->MessageBox( "Execution Failure : Save parameter to file", "FAILURE", MB_OK );
- return;
- }
- strcpy(str, SaveDialog->FileName.c_str());
- //-----------------------------------------------------------
- if (cbRXPathLoss->Checked)
- {
- ok = m_UP_Obj.REQ_Write_AGC_To_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save AGC setting to file fail";
- Application->MessageBox("Execution Failure : Save AGC setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save AGC setting to file successfully";
- }
- //-----------------------------------------------------------
- if (cbAFC->Checked)
- {
- if (rbTCVCXO->Checked)
- {
- ok = m_UP_Obj.REQ_Write_AFC_To_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save AFC setting to file fail";
- Application->MessageBox("Execution Failure : Save AFC setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save AFC setting to file successfully";
- }
- else
- {
- ok = m_UP_Obj.REQ_Write_Crystal_AFC_To_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save crystal AFC setting to file fail";
- Application->MessageBox("Execution Failure : Save crystal AFC setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save crystal AFC setting to file successfully";
- }
- }
- //-----------------------------------------------------------
- if (cbIP2->Checked)
- {
- ok = m_UP_Obj.REQ_Write_IP2_To_File(str, m_uiFinalRFID);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save IP2 setting to file fail";
- Application->MessageBox("Execution Failure : Save IP2 setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save IP2 setting to file successfully";
- }
- //-----------------------------------------------------------
- if (cbTxIQ->Checked)
- {
- ok = m_UP_Obj.REQ_Write_TxIq_To_File(str, m_uiFinalRFID, m_eBbTxCfgVer);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save TX IQ setting to file fail";
- Application->MessageBox("Execution Failure : Save TX IQ setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save TX IQ setting to file successfully";
- }
- //-----------------------------------------------------------
- if (cbGmskLevelRamp->Checked)
- {
- ok = m_UP_Obj.REQ_Write_GMSK_APC_To_File(str, m_uiFinalRFID, m_bTADOSupport);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save GMSK level and ramp setting to file fail";
- Application->MessageBox("Execution Failure : Save GMSK level and ramp setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save GMSK level and ramp setting to file successfully";
- }
- //-----------------------------------------------------------
- if (cbEpskLevelRamp->Checked)
- {
- ok = m_UP_Obj.REQ_Write_EPSK_APC_To_File(str, m_uiFinalRFID);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save EPSK level and ramp setting to file fail";
- Application->MessageBox("Execution Failure : Save EPSK level and ramp setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save EPSK level and ramp setting to file successfully";
- }
- //-----------------------------------------------------------
- if (cbADC->Checked)
- {
- ok = m_UP_Obj.REQ_Write_ADC_To_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save ADC setting to file fail";
- Application->MessageBox("Execution Failure : Save ADC setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save ADC setting to file successfully";
- }
- //-----------------------------------------------------------
- if (cbWiFiTxDcOffset->Checked)
- {
- ok = m_UP_Obj.REQ_Write_WiFiTxDcOffset_To_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save WiFi TX DC offset setting to file fail";
- Application->MessageBox("Execution Failure : Save WiFi WiFi TX DC offset setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save WiFi WiFi TX DC offset setting to file successfully";
- }
- //-----------------------------------------------------------
- if (cbWiFiTxPower->Checked)
- {
- ok = m_UP_Obj.REQ_Write_WiFiTxPower_To_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save WiFi TX power setting to file fail";
- Application->MessageBox("Execution Failure : Save WiFi TX power setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save WiFi TX power setting to file successfully";
- }
- //-----------------------------------------------------------
- if (m_cbWiFiAlc->Checked && m_cbWiFiAlc->Visible)
- {
- ok = m_UP_Obj.REQ_Write_WiFiAlc_To_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save WiFi ALC setting to file fail";
- Application->MessageBox("Execution Failure : Save WiFi ALC setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save WiFi ALC setting to file successfully";
- }
- //-----------------------------------------------------------
- // BT CAP ID
- if (m_cbBtCapId->Checked)
- {
- ok = m_UP_Obj.REQ_Write_BtCapId_To_File(str);
- if( !ok )
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save BT crystal CAP ID setting to file fail";
- Application->MessageBox( "Execution Failure : Save BT crystal CAP ID setting to file", "FAILURE", MB_OK );
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save BT crystal CAP ID setting to file successfully";
- }
- //-----------------------------------------------------------
- if (cbIMEI->Checked)
- {
- ok = m_UP_Obj.REQ_Write_IMEI_To_File(str);
- if( !ok )
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save IMEI setting to file fail";
- Application->MessageBox( "Execution Failure : Save IMEI setting to file", "FAILURE", MB_OK );
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save IMEI setting to file successfully";
- }
- //-----------------------------------------------------------
- if(cbBarcode->Checked )
- {
- ok = m_UP_Obj.REQ_Write_Barcode_To_File(str);
- if( !ok )
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save barcode setting to file fail";
- Application->MessageBox( "Execution Failure : Save barcode setting to file", "FAILURE", MB_OK );
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Save barcode setting to file successfully";
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmUpdateParameter::btnLoadFromFileClick(TObject *Sender)
- {
- if (rbCrystal->Checked && cbAFC->Checked && (!cbGmskLevelRamp->Checked))
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Please also select GMSK Level, Ramp for TRX offset setting";
- Application->MessageBox( "Execution Warning : Please also select GMSK Level, Ramp for TRX offset setting", "WARNING", MB_OK );
- return;
- }
- char str[512];
- bool ok;
- float fdata;
- ok = OpenDialog->Execute();
- if (!ok)
- {
- return;
- }
- strcpy(str, OpenDialog->FileName.c_str());
- //------------------------------------------------------------
- if (cbRXPathLoss->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.AnyRxLossSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No RX path loss setting in file";
- Application->MessageBox("Execution Failure : No RX path loss setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_AGC_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load RX path loss setting from file fail";
- Application->MessageBox("Execution Failure : Load RX path loss setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load RX path loss setting from file successfully";
- }
- //------------------------------
- if (cbAFC->Checked)
- {
- if (rbTCVCXO->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.AfcSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No AFC setting in file";
- Application->MessageBox("Execution Failure : No AFC setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_AFC_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load AFC setting from file fail";
- Application->MessageBox("Execution Failure : Load AFC setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load AFC setting from file successfully";
- }
- else
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.CrystalAfcSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No Crystal AFC setting in file";
- Application->MessageBox("Execution Failure : No Crystal AFC setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_Crystal_AFC_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load crystal AFC setting from file fail";
- Application->MessageBox("Execution Failure : Load crystal AFC setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load crystal AFC setting from file successfully";
- }
- }
- //------------------------------
- if (cbIP2->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.AnyIP2SectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No IP2 setting in file";
- Application->MessageBox( "Execution Failure : No IP2 setting in file", "FAILURE", MB_OK );
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_IP2_From_File(str, m_uiFinalRFID);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load IP2 setting from file fail";
- Application->MessageBox("Execution Failure : Load IP2 setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load IP2 setting from file successfully";
- }
- //------------------------------
- if (cbTxIQ->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.TxIqSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No TX IQ setting in file";
- Application->MessageBox( "Execution Failure : No TX IQ setting in file", "FAILURE", MB_OK );
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_TxIq_From_File(str, m_uiFinalRFID, m_eBbTxCfgVer);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load TX IQ setting from file fail";
- Application->MessageBox( "Execution Failure : Load TX IQ setting to file", "FAILURE", MB_OK );
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load TX IQ setting from file successfully";
- }
- //------------------------------
- if (cbGmskLevelRamp->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.AnyGmskApcSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No GMSK APC setting in file";
- Application->MessageBox( "Execution Failure : No GMSK APC setting in file", "FAILURE", MB_OK );
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_GMSK_APC_From_File(str, m_uiFinalRFID, m_bTADOSupport);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load GMSK APC setting from file fail";
- Application->MessageBox( "Execution Failure : Load GMSK APC setting to file", "FAILURE", MB_OK );
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load GMSK APC setting from file successfully";
- }
- //------------------------------
- if (cbEpskLevelRamp->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.AnyEpskApcSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No EPSK APC setting in file";
- Application->MessageBox("Execution Failure : No EPSK APC setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_EPSK_APC_From_File(str, m_uiFinalRFID);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load EPSK APC setting from file fail";
- Application->MessageBox("Execution Failure : Load EPSK APC setting to file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load EPSK APC setting from file successfully";
- }
- //------------------------------
- if (cbADC->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.AdcSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No ADC setting in file";
- Application->MessageBox("Execution Failure : No ADC setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_ADC_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load ADC setting from file fail";
- Application->MessageBox("Execution Failure : Load ADC setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load ADC setting from file successfully";
- }
- //------------------------------
- if (cbWiFiTxDcOffset->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.WiFiTxDcOffsetSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No WiFi TX DC offset setting in file";
- Application->MessageBox("Execution Failure : No WiFi TX DC offset setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_WiFiTxDcOffset_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load WiFi TX DC offset setting from file fail";
- Application->MessageBox("Execution Failure : Load WiFi TX DC offset setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load WiFi TX DC offset setting from file successfully";
- }
- //------------------------------
- if (cbWiFiTxPower->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.WiFiTxPowerSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No WiFi TX power setting in file";
- Application->MessageBox( "Execution Failure : No WiFi TX power setting in file", "FAILURE", MB_OK );
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_WiFiTxPower_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load WiFi TX power setting from file fail";
- Application->MessageBox("Execution Failure : Load WiFi TX power setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load WiFi TX power setting from file successfully";
- }
- //------------------------------
- // WiFi ALC
- if (m_cbWiFiAlc->Checked && m_cbWiFiAlc->Visible)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.WiFiAlcSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No WiFi ALC setting in file";
- Application->MessageBox( "Execution Failure : No WiFi ALC setting in file", "FAILURE", MB_OK );
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_WiFiAlc_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load WiFi ALC setting from file fail";
- Application->MessageBox("Execution Failure : Load WiFi ALC setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load WiFi ALC setting from file successfully";
- }
- //------------------------------
- // BT CAP ID
- if (m_cbBtCapId->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.BtCapIdSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No BT crystal CAP ID setting in file";
- Application->MessageBox("Execution Failure : No BT crystal CAP ID setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_BtCapId_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load BT crystal CAP ID setting from file fail";
- Application->MessageBox("Execution Failure : Load BT crystal CAP ID setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load BT crystal CAP ID setting from file successfully";
- }
- //------------------------------
- if (cbIMEI->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.ImeiSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No IMEI setting in file";
- Application->MessageBox("Execution Failure : No IMEI setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_IMEI_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load IMEI setting from file fail";
- Application->MessageBox("Execution Failure : Load IMEI setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load IMEI setting from file successfully";
- }
- //------------------------------
- if (cbBarcode->Checked)
- {
- if (cbCheckSectionExist->Checked)
- {
- ok = m_UP_Obj.BarcodeSectionExist(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" No barcode setting in file";
- Application->MessageBox("Execution Failure : No barcode setting in file", "FAILURE", MB_OK);
- return;
- }
- }
- ok = m_UP_Obj.REQ_Read_Barcode_From_File(str);
- if (!ok)
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load barcode setting from file fail";
- Application->MessageBox("Execution Failure : Load barcode setting from file", "FAILURE", MB_OK);
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString)" Load barcode setting from file successfully";
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmUpdateParameter::btnChangeDBClick(TObject *Sender)
- {
- frmMainSel->mnuFDMDatabaseClick(Sender);
- if (!NVRAMMan->Get_IsInit())
- {
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " NVRAM database file initialization fail";
- Application->MessageBox( "Execution Failure : NVRAM database file initialization fail", "FAILURE", MB_OK );
- return;
- }
- sbUpdateParameter->Panels->Items[0]->Text = (AnsiString) " Change NVRAM database file successfully";
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmUpdateParameter::ToggleHideExecute(TObject *Sender)
- {
- if( g_bHideEnable )
- {
- g_bHideEnable = false;
- rbTCVCXO->Checked = true;
- }
- else
- {
- g_bHideEnable = true;
- }
- ApplyHideProperty();
- }
- //---------------------------------------------------------------------------
- void TfrmUpdateParameter::ApplyHideProperty( void )
- {
- if( g_bHideEnable )
- {
- // crystal
- //rbCrystal->Visible = false;
- //rbTCVCXO->Checked = true;
- }
- else
- {
- // crystal
- //rbCrystal->Visible = true;
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void TfrmUpdateParameter::DisplayIP2Visible( int rf_id )
- {
- switch( rf_id )
- {
- case RF_ID_SKY74045:
- case RF_ID_SKY74117:
- case RF_ID_SKY74400:
- // case RF_ID_MT6139B:
- // case RF_ID_MT6139C:
- // case RF_ID_MT6139E:
- // case RF_ID_MT6140A:
- // case RF_ID_MT6140B:
- // case RF_ID_MT6140C:
- {
- cbIP2->Visible = true;
- }
- break;
- default:
- {
- cbIP2->Visible = false;
- cbIP2->Enabled = false;
- }
- break;
- }
- }
- //===========================================================================
- ///////////////////////////// Query ////////////////////////////
- //===========================================================================
- void __fastcall TfrmUpdateParameter::on_QueryTwoApcDcOffset_Fail(TObject *Sender)
- {
- QueryRfId();
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmUpdateParameter::on_QueryTwoApcDcOffset_TerminateSuccess(TObject *Sender)
- {
- QueryRfId();
- }
- //---------------------------------------------------------------------------
- void TfrmUpdateParameter::Query_TwoApcDcOffset_Support( void )
- {
- m_t_RfTado.hPostMsgDestHandle = this->Handle;
- m_t_RfTado.ne_onTermSuccess = on_QueryTwoApcDcOffset_TerminateSuccess;
- pt_rftado = new T_RFTADO(
- true,
- &m_t_RfTado);
- if(pt_rftado != NULL)
- {
- pt_rftado->FreeOnTerminate = true;
- pt_rftado->OnTerminate = on_QueryTwoApcDcOffset_Fail;
- pt_rftado->Priority = tpHighest;
- pt_rftado->Resume();
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void __fastcall TfrmUpdateParameter::on_QueryRFID_Fail(TObject *Sender)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmUpdateParameter::on_QueryRFID_TerminateSuccess(TObject *Sender)
- {
- }
- //-----------------------------------------------------------------------------
- void TfrmUpdateParameter::QueryRfId( void )
- {
- m_t_rf_id.hPostMsgDestHandle = this->Handle;
- m_t_rf_id.ne_onTermSuccess = on_QueryRFID_TerminateSuccess;
- pt_rfid = new T_RFID( true, &m_t_rf_id);
- if(pt_rfid != NULL)
- {
- pt_rfid->FreeOnTerminate = true;
- pt_rfid->OnTerminate = on_QueryRFID_Fail;
- pt_rfid->Priority = tpHighest;
- pt_rfid->Resume();
- }
- }
- //==============================================================================
- void TfrmUpdateParameter::CurrentPageLock( void )
- {
- btnUploadFromFlash->Enabled = false;
- btnDownloadToFlash->Enabled = false;
- btnChangeDB->Enabled = false;
- }
- //----------------------------------------------------------------------------
- void TfrmUpdateParameter::CurrentPageReset( void )
- {
- btnUploadFromFlash->Enabled = true;
- btnDownloadToFlash->Enabled = true;
- btnChangeDB->Enabled = true;
- }
- //===========================================================================
- ///////////////////////// Global information ////////////////////////////
- //===========================================================================
- void TfrmUpdateParameter::Init( void )
- {
- m_bInit = true;
- m_bTADOSupport = false;
- CurrentPageReset();
- }