form_RFReg.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:22k
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #ifndef _FORM_MAIN_H_
- #include "form_main.h"
- #endif
- #ifndef _FORM_RFREG_H_
- #include "form_RFReg.h"
- #endif
- // misc
- #ifndef _FILE_UTILS_H_
- #include "file_utils.h"
- #endif
- #ifndef _MISC_H_
- #include "misc.h"
- #endif
- #ifndef _MISC_BB_H_
- #include "misc_bb.h"
- #endif
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TfrmRFReg *frmRFReg;
- //==========================================================================
- static void CNF_RF_ReadRegister( void )
- {
- frmRFReg->RF_ReadRegister_Done();
- }
- //--------------------------------------------------------------------------
- static void CNF_RF_WriteRegister( void )
- {
- frmRFReg->RF_WriteRegister_Done();
- }
- //---------------------------------------------------------------------------
- __fastcall TfrmRFReg::TfrmRFReg(TComponent* Owner)
- : TForm(Owner)
- {
- m_pvRfReg = NULL;
- m_pvRfRegUI = NULL;
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void TfrmRFReg::AllocateVector(void)
- {
- if (NULL == m_pvRfRegUI)
- {
- m_pvRfRegUI = new vector<S_RF_REG_UI_T>;
- }
- }
- //--------------------------------------------------------------------------
- void TfrmRFReg::DeAllocateVector(void)
- {
- if (NULL != m_pvRfRegUI)
- {
- delete m_pvRfRegUI;
- m_pvRfRegUI = NULL;
- }
- }
- //--------------------------------------------------------------------------
- void TfrmRFReg::EraseVector(void)
- {
- if (NULL != m_pvRfRegUI)
- {
- if (! m_pvRfRegUI->empty())
- {
- vector<S_RF_REG_UI_T>:: iterator iter;
- for (iter = m_pvRfRegUI->begin(); iter != m_pvRfRegUI->end(); iter++)
- {
- if (iter->lblRFRegName)
- {
- delete iter->lblRFRegName;
- iter->lblRFRegName = NULL;
- }
- if (iter->stRFRegName)
- {
- delete iter->stRFRegName;
- iter->stRFRegName = NULL;
- }
- // if (iter->lblRFRegValue0X)
- // {
- // delete iter->lblRFRegValue0X;
- // iter->lblRFRegValue0X = NULL;
- // }
- if (iter->edtRFReadBsiData)
- {
- delete iter->edtRFReadBsiData;
- iter->edtRFReadBsiData = NULL;
- }
- if (iter->edtRFReadBsiData)
- {
- delete iter->edtRFReadBsiData;
- iter->edtRFReadBsiData = NULL;
- }
- if (iter->btnRFRegRead)
- {
- delete iter->btnRFRegRead;
- iter->btnRFRegRead = NULL;
- }
- if (iter->btnRFRegWrite)
- {
- delete iter->btnRFRegWrite;
- iter->btnRFRegWrite = NULL;
- }
- }
- m_pvRfRegUI->erase(m_pvRfRegUI->begin(), m_pvRfRegUI->end());
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmRFReg::FormCreate(TObject *Sender)
- {
- m_bInit = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmRFReg::FormActivate(TObject *Sender)
- {
- if (m_bInit)
- {
- m_bInit = false;
- m_ui2GRfId = frmMainSel->Get_FinalRFID();
- if (RF_ID_A60111A == m_ui2GRfId)
- {
- frmRFReg->Caption = "A60111A RF transceiver Register Setting";
- AnsiString as = ::Get_WorkingDirectory();
- as += "\A60111A_reg.ini";
- m_cRF_REG_Obj.REQ_Read_From_File(as.c_str());
- Display_RfRegister();
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmRFReg::FormDestroy(TObject *Sender)
- {
- EraseVector();
- DeAllocateVector();
- }
- //---------------------------------------------------------------------------
- void TfrmRFReg::Init(void)
- {
- }
- //===========================================================================
- void TfrmRFReg::Display_RfRegister(void)
- {
- AllocateVector();
- EraseVector();
- m_pvRfReg = m_cRF_REG_Obj.Get_RfRegVector();
- int i_lblRFRegName_top = 40;
- int i_lblRFRegName_left = 8;
- int i_stRFRegName_top = 60;
- int i_stRFRegName_left = 8;
- int i_lblRFRegAddr_top = 40;
- int i_lblRFRegAddr_left = 40;
- int i_stRFRegAddr_top = 60;
- int i_stRFRegAddr_left = 50;
- //int i_lblRFRegValue0X_top = 60;
- //int i_lblRFRegValue0X_left = 114;
- //int i_lblRFRegValue_top = 40;
- //int i_lblRFRegValue_left = 152;
- int i_lblRFBsiRead_top = 40;
- int i_lblRFBsiRead_left = 80;
- int i_edtRFBsiRead_top = 56;
- int i_edtRFBsiRead_left = 80;
- int i_lblRFBsiWrite_top = 40;
- int i_lblRFBsiWrite_left = 180;
- int i_edtRFBsiWrite_top = 56;
- int i_edtRFBsiWrite_left = 180;
- int i_btnRFRegRead_top = 56;
- int i_btnRFRegRead_left = 276;
- int i_btnRFRegWrite_top = 56;
- int i_btnRFRegWrite_left = 318;
- int i_vertical_offset = 50;
- int i_horizontal_offset = 360;
- vector<S_RF_REG_T>:: iterator iter;
- int i=0;
- for (iter = m_pvRfReg->begin(); iter != m_pvRfReg->end(); iter++)
- {
- S_RF_REG_UI_T rf_reg_ui;
- if (0 == i%2)
- {
- if (0 == i)
- {
- rf_reg_ui.lblRFRegName = new TLabel(this);
- rf_reg_ui.lblRFRegName->Parent = frmRFReg;
- rf_reg_ui.lblRFRegName->Caption = "Name";
- rf_reg_ui.lblRFRegName->Top = i_lblRFRegName_top + i/2 * i_vertical_offset;
- rf_reg_ui.lblRFRegName->Left = i_lblRFRegName_left;
- rf_reg_ui.lblRFRegAddr = new TLabel(this);
- rf_reg_ui.lblRFRegAddr->Parent = frmRFReg;
- rf_reg_ui.lblRFRegAddr->Caption = "Address";
- rf_reg_ui.lblRFRegAddr->Top = i_lblRFRegAddr_top + i/2 * i_vertical_offset;
- rf_reg_ui.lblRFRegAddr->Left = i_lblRFRegAddr_left;
- }
- rf_reg_ui.stRFRegName = new TStaticText(this);
- rf_reg_ui.stRFRegName->Parent = frmRFReg;
- rf_reg_ui.stRFRegName->Caption = iter->as_name;
- rf_reg_ui.stRFRegName->Tag = i;
- rf_reg_ui.stRFRegName->Top = i_stRFRegName_top + i/2 * i_vertical_offset;
- rf_reg_ui.stRFRegName->Left = i_stRFRegName_left;
- rf_reg_ui.stRFRegAddr = new TStaticText(this);
- rf_reg_ui.stRFRegAddr->Parent = frmRFReg;
- char str[5];
- sprintf(str, "0x%X", iter->ui_addr);
- rf_reg_ui.stRFRegAddr->Caption = (AnsiString) str;
- rf_reg_ui.stRFRegAddr->Tag = i;
- rf_reg_ui.stRFRegAddr->Top = i_stRFRegAddr_top + i/2 * i_vertical_offset;
- rf_reg_ui.stRFRegAddr->Left = i_stRFRegAddr_left;
- // rf_reg_ui.lblRFRegValue0X = new TLabel(this);
- // rf_reg_ui.lblRFRegValue0X->Parent = frmRFReg;
- // rf_reg_ui.lblRFRegValue0X->Caption = "0x";
- // rf_reg_ui.lblRFRegValue0X->Tag = i;
- // rf_reg_ui.lblRFRegValue0X->Top = i_lblRFRegValue0X_top + i/2 * i_vertical_offset;
- // rf_reg_ui.lblRFRegValue0X->Left = i_lblRFRegValue0X_left;
- rf_reg_ui.lblRFReadBsiData = new TLabel(this);
- rf_reg_ui.lblRFReadBsiData->Parent = frmRFReg;
- rf_reg_ui.lblRFReadBsiData->Caption = "Read BSI data(Hex)";
- rf_reg_ui.lblRFReadBsiData->Tag = i;
- rf_reg_ui.lblRFReadBsiData->Top = i_lblRFBsiRead_top + i/2 * i_vertical_offset;
- rf_reg_ui.lblRFReadBsiData->Left = i_lblRFBsiRead_left;
- rf_reg_ui.edtRFReadBsiData = new TEdit(this);
- rf_reg_ui.edtRFReadBsiData->Parent = frmRFReg;
- rf_reg_ui.edtRFReadBsiData->Text = iter->ui_read_bsi_data;
- rf_reg_ui.edtRFReadBsiData->Tag = i;
- rf_reg_ui.edtRFReadBsiData->Top = i_edtRFBsiRead_top + i/2 * i_vertical_offset;
- rf_reg_ui.edtRFReadBsiData->Left = i_edtRFBsiRead_left;
- rf_reg_ui.edtRFReadBsiData->Width = 81;
- rf_reg_ui.lblRFWriteBsiData = new TLabel(this);
- rf_reg_ui.lblRFWriteBsiData->Parent = frmRFReg;
- rf_reg_ui.lblRFWriteBsiData->Caption = "Write BSI data(Hex)";
- rf_reg_ui.lblRFWriteBsiData->Tag = i;
- rf_reg_ui.lblRFWriteBsiData->Top = i_lblRFBsiWrite_top + i/2 * i_vertical_offset;
- rf_reg_ui.lblRFWriteBsiData->Left = i_lblRFBsiWrite_left;
- rf_reg_ui.edtRFWriteBsiData = new TEdit(this);
- rf_reg_ui.edtRFWriteBsiData->Parent = frmRFReg;
- rf_reg_ui.edtRFWriteBsiData->Text = iter->ui_write_bsi_data;
- rf_reg_ui.edtRFWriteBsiData->Tag = i;
- rf_reg_ui.edtRFWriteBsiData->Top = i_edtRFBsiWrite_top + i/2 * i_vertical_offset;
- rf_reg_ui.edtRFWriteBsiData->Left = i_edtRFBsiWrite_left;
- rf_reg_ui.edtRFWriteBsiData->Width = 81;
- rf_reg_ui.btnRFRegRead = new TButton(this);
- rf_reg_ui.btnRFRegRead->Parent = frmRFReg;
- rf_reg_ui.btnRFRegRead->Caption = "Read";
- rf_reg_ui.btnRFRegRead->Tag = i;
- rf_reg_ui.btnRFRegRead->Top = i_btnRFRegRead_top + i/2 * i_vertical_offset;
- rf_reg_ui.btnRFRegRead->Left = i_btnRFRegRead_left;
- rf_reg_ui.btnRFRegRead->Width = 40;
- rf_reg_ui.btnRFRegRead->OnClick = btnRfRegReadClick;
- rf_reg_ui.btnRFRegWrite = new TButton(this);
- rf_reg_ui.btnRFRegWrite->Parent = frmRFReg;
- rf_reg_ui.btnRFRegWrite->Caption = "Write";
- rf_reg_ui.btnRFRegWrite->Tag = i;
- rf_reg_ui.btnRFRegWrite->Top = i_btnRFRegWrite_top + i/2 * i_vertical_offset;
- rf_reg_ui.btnRFRegWrite->Left = i_btnRFRegWrite_left;
- rf_reg_ui.btnRFRegWrite->Width = 40;
- rf_reg_ui.btnRFRegWrite->OnClick = btnRfRegWriteClick;
- }
- else
- {
- if (1 == i)
- {
- rf_reg_ui.lblRFRegName = new TLabel(this);
- rf_reg_ui.lblRFRegName->Parent = frmRFReg;
- rf_reg_ui.lblRFRegName->Caption = "Name";
- rf_reg_ui.lblRFRegName->Top = i_lblRFRegName_top + i/2 * i_vertical_offset;
- rf_reg_ui.lblRFRegName->Left = i_lblRFRegName_left + i_horizontal_offset;
- rf_reg_ui.lblRFRegAddr = new TLabel(this);
- rf_reg_ui.lblRFRegAddr->Parent = frmRFReg;
- rf_reg_ui.lblRFRegAddr->Caption = "Address (Hex)";
- rf_reg_ui.lblRFRegAddr->Top = i_lblRFRegAddr_top + i/2 * i_vertical_offset;
- rf_reg_ui.lblRFRegAddr->Left = i_lblRFRegAddr_left + i_horizontal_offset;
- }
- rf_reg_ui.stRFRegName = new TStaticText(this);
- rf_reg_ui.stRFRegName->Parent = frmRFReg;
- rf_reg_ui.stRFRegName->Caption = iter->as_name;
- rf_reg_ui.stRFRegName->Tag = i;
- rf_reg_ui.stRFRegName->Top = i_stRFRegName_top + i/2 * i_vertical_offset;
- rf_reg_ui.stRFRegName->Left = i_stRFRegName_left + i_horizontal_offset;
- rf_reg_ui.stRFRegAddr = new TStaticText(this);
- rf_reg_ui.stRFRegAddr->Parent = frmRFReg;
- char str[5];
- sprintf(str, "0x%X", iter->ui_addr);
- rf_reg_ui.stRFRegAddr->Caption = (AnsiString) str;
- rf_reg_ui.stRFRegAddr->Tag = i;
- rf_reg_ui.stRFRegAddr->Top = i_stRFRegAddr_top + i/2 * i_vertical_offset;
- rf_reg_ui.stRFRegAddr->Left = i_stRFRegAddr_left + i_horizontal_offset;
- // rf_reg_ui.lblRFRegValue0X = new TLabel(this);
- // rf_reg_ui.lblRFRegValue0X->Parent = frmRFReg;
- // rf_reg_ui.lblRFRegValue0X->Caption = "0x";
- // rf_reg_ui.lblRFRegValue0X->Tag = i;
- // rf_reg_ui.lblRFRegValue0X->Top = i_lblRFRegValue0X_top + i/2 * i_vertical_offset;
- // rf_reg_ui.lblRFRegValue0X->Left = i_lblRFRegValue0X_left + i_horizontal_offset;
- rf_reg_ui.lblRFReadBsiData = new TLabel(this);
- rf_reg_ui.lblRFReadBsiData->Parent = frmRFReg;
- rf_reg_ui.lblRFReadBsiData->Caption = "Read BSI data(Hex)";
- rf_reg_ui.lblRFReadBsiData->Tag = i;
- rf_reg_ui.lblRFReadBsiData->Top = i_lblRFBsiRead_top + i/2 * i_vertical_offset;
- rf_reg_ui.lblRFReadBsiData->Left = i_lblRFBsiRead_left + i_horizontal_offset;
- rf_reg_ui.edtRFReadBsiData = new TEdit(this);
- rf_reg_ui.edtRFReadBsiData->Parent = frmRFReg;
- rf_reg_ui.edtRFReadBsiData->Text = iter->ui_read_bsi_data;
- rf_reg_ui.edtRFReadBsiData->Tag = i;
- rf_reg_ui.edtRFReadBsiData->Top = i_edtRFBsiRead_top + i/2 * i_vertical_offset;
- rf_reg_ui.edtRFReadBsiData->Left = i_edtRFBsiRead_left + i_horizontal_offset;
- rf_reg_ui.edtRFReadBsiData->Width = 81;
- rf_reg_ui.lblRFWriteBsiData = new TLabel(this);
- rf_reg_ui.lblRFWriteBsiData->Parent = frmRFReg;
- rf_reg_ui.lblRFWriteBsiData->Caption = "Write BSI data(Hex)";
- rf_reg_ui.lblRFWriteBsiData->Tag = i;
- rf_reg_ui.lblRFWriteBsiData->Top = i_lblRFBsiWrite_top + i/2 * i_vertical_offset;
- rf_reg_ui.lblRFWriteBsiData->Left = i_lblRFBsiWrite_left + i_horizontal_offset;
- rf_reg_ui.edtRFWriteBsiData = new TEdit(this);
- rf_reg_ui.edtRFWriteBsiData->Parent = frmRFReg;
- rf_reg_ui.edtRFWriteBsiData->Text = iter->ui_write_bsi_data;
- rf_reg_ui.edtRFWriteBsiData->Tag = i;
- rf_reg_ui.edtRFWriteBsiData->Top = i_edtRFBsiWrite_top + i/2 * i_vertical_offset;
- rf_reg_ui.edtRFWriteBsiData->Left = i_edtRFBsiWrite_left + i_horizontal_offset;
- rf_reg_ui.edtRFWriteBsiData->Width = 81;
- rf_reg_ui.btnRFRegRead = new TButton(this);
- rf_reg_ui.btnRFRegRead->Parent = frmRFReg;
- rf_reg_ui.btnRFRegRead->Caption = "Read";
- rf_reg_ui.btnRFRegRead->Tag = i;
- rf_reg_ui.btnRFRegRead->Top = i_btnRFRegRead_top + i/2 * i_vertical_offset;
- rf_reg_ui.btnRFRegRead->Left = i_btnRFRegRead_left + i_horizontal_offset;
- rf_reg_ui.btnRFRegRead->Width = 40;
- rf_reg_ui.btnRFRegRead->OnClick = btnRfRegReadClick;
- rf_reg_ui.btnRFRegWrite = new TButton(this);
- rf_reg_ui.btnRFRegWrite->Parent = frmRFReg;
- rf_reg_ui.btnRFRegWrite->Caption = "Write";
- rf_reg_ui.btnRFRegWrite->Tag = i;
- rf_reg_ui.btnRFRegWrite->Top = i_btnRFRegWrite_top + i/2 * i_vertical_offset;
- rf_reg_ui.btnRFRegWrite->Left = i_btnRFRegWrite_left + i_horizontal_offset;
- rf_reg_ui.btnRFRegWrite->Width = 40;
- rf_reg_ui.btnRFRegWrite->OnClick = btnRfRegWriteClick;
- }
- m_pvRfRegUI->push_back(rf_reg_ui);
- i++;
- }
- }
- //---------------------------------------------------------------------------
- bool TfrmRFReg::CheckFields(E_RF_REG_OP_T e_op, int tag)
- {
- AnsiString text;
- unsigned int uidata;
- vector<S_RF_REG_UI_T>:: iterator iter;
- if (RF_REG_OP_READ == e_op)
- {
- for (iter = m_pvRfRegUI->begin(); iter != m_pvRfRegUI->end(); iter++)
- {
- if (iter->edtRFReadBsiData->Tag == tag)
- {
- break;
- }
- }
- m_uiBsiAddr = iter->stRFRegAddr->Caption.ToInt();
- }
- else // write
- {
- for (iter = m_pvRfRegUI->begin(); iter != m_pvRfRegUI->end(); iter++)
- {
- if (iter->edtRFWriteBsiData->Tag == tag)
- {
- break;
- }
- }
- text = iter->edtRFWriteBsiData->Text;
- // text = text.SubString(3, text.Length()-2);
- if (!IsValidHexBsiData(text, uidata))
- {
- return false;
- }
- m_uiBsiData = uidata;
- }
- return true;
- }
- //---------------------------------------------------------------------------
- void TfrmRFReg::ReDrawFields(int tag)
- {
- char str[256];
- vector<S_RF_REG_UI_T>:: iterator iter;
- for (iter = m_pvRfRegUI->begin(); iter != m_pvRfRegUI->end(); iter++)
- {
- if ((int)iter->edtRFReadBsiData->Tag == tag)
- {
- break;
- }
- }
- // if (DEC_FORMAT == btnPMICRegValue->Tag) // Dec
- // {
- // iter->edtRFReadBsiData->Caption = "Value (Dec)";
- // iter->lblRFRegValue0X->Visible = false;
- // iter->edtRFReadBsiData->Text = IntToStr(m_uiBsiData);
- // }
- // else // Hex
- {
- //iter->lblRFReadBsiData->Caption = "Value (Hex)";
- //iter->lblRFRegValue0X->Visible = true;
- sprintf( str, "%X", (int)m_uiBsiData );
- iter->edtRFReadBsiData->Text = str;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmRFReg::edtRfValueCheck(TObject *Sender)
- {
- AnsiString text;
- unsigned int uidata;
- int band;
- TEdit *edit = (TEdit*)Sender;
- char hint[] = " character is not valid ";
- text = edit->Text;
- if (! IsValidHexBsiData(text, uidata))
- {
- ShowHintLabel(edit, hint);
- edit->SetFocus();
- return;
- }
- m_uiBsiData = uidata;
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmRFReg::btnRfRegReadClick(TObject *Sender)
- {
- TButton* btn = (TButton*) Sender;
- m_iTag = btn->Tag;
- if (!CheckFields(RF_REG_OP_READ, btn->Tag))
- {
- Application->MessageBox("Read RF trasceiver register fail", "FAIL", MB_OK);
- Application->MessageBox("Execution Failure : Read RF trasceiver register", "FAILURE", MB_OK );
- return;
- }
- m_cRF_REG_Obj.ConfirmCallback = ::CNF_RF_ReadRegister;
- m_cRF_REG_Obj.REQ_ReadRegister_Start(m_uiBsiAddr);
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Read RF trasceiver register progressing";
- }
- //-----------------------------------------------
- void TfrmRFReg::RF_ReadRegister_Done(void)
- {
- E_METAAPP_RESULT_T state = m_cRF_REG_Obj.Get_ConfirmState();
- switch (state)
- {
- case METAAPP_SUCCESS:
- {
- m_uiBsiData = m_cRF_REG_Obj.Get_BsiData();
- ReDrawFields(m_iTag);
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Read RF trasceiver register successfully";
- }
- break;
- case METAAPP_FAIL:
- {
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Read RF trasceiver register fail";
- Application->MessageBox( "Execution Failure : Read RF trasceiver register", "FAILURE", MB_OK );
- }
- break;
- case METAAPP_TIMEOUT:
- {
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Read RF trasceiver register timeout";
- Application->MessageBox( "Execution Timeout : Read RF trasceiver register", "TIMEOUT", MB_OK );
- }
- break;
- case METAAPP_STOP:
- {
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Read RF trasceiver register stop";
- }
- break;
- default:
- break;
- }
- }
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- void __fastcall TfrmRFReg::btnRfRegWriteClick(TObject *Sender)
- {
- TButton* btn = (TButton*) Sender;
- m_iTag = btn->Tag;
- if (!CheckFields(RF_REG_OP_WRITE, btn->Tag))
- {
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Write RF trasceiver register fail";
- Application->MessageBox("Execution Failure : Write RF trasceiver register", "FAILURE", MB_OK);
- return;
- }
- m_cRF_REG_Obj.ConfirmCallback = ::CNF_RF_WriteRegister;
- m_cRF_REG_Obj.REQ_WriteRegister_Start(m_uiBsiData);
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Write RF trasceiver register progressing";
- }
- //-----------------------------------------------
- void TfrmRFReg::RF_WriteRegister_Done(void)
- {
- E_METAAPP_RESULT_T state = m_cRF_REG_Obj.Get_ConfirmState();
- switch (state)
- {
- case METAAPP_SUCCESS:
- {
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Write baseband register successfully";
- }
- break;
- case METAAPP_FAIL:
- {
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Write baseband register fail";
- Application->MessageBox( "Execution Failure : Write Baseband register", "FAILURE", MB_OK );
- }
- break;
- case METAAPP_TIMEOUT:
- {
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Write baseband register timeout";
- Application->MessageBox( "Execution Timeout : Write Baseband register", "TIMEOUT", MB_OK );
- }
- break;
- case METAAPP_STOP:
- {
- m_sbRfReg->Panels->Items[0]->Text = (AnsiString) " Write baseband register stop";
- }
- break;
- default:
- break;
- }
- }
- //---------------------------------------------------------------------------
- void TfrmRFReg::ShowHintLabel(TControl *sender, char* hint)
- {
- TPoint pt0 = this->ClientOrigin;
- TPoint pt1 = sender->ClientOrigin;
- lblHint->Left = (pt1.x-pt0.x);
- lblHint->Top = (pt1.y-pt0.y)+sender->Height+3;
- lblHint->Caption = hint;
- lblHint->Visible = true;
- HintTimer->Enabled = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmRFReg::HintTimerTimer(TObject *Sender)
- {
- HintTimer->Enabled = false;
- lblHint->Visible = false;
- }
- //---------------------------------------------------------------------------