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

MTK

开发平台:

C++ Builder

  1. //---------------------------------------------------------------------------
  2. #ifndef _FORM_TDMB_H_
  3. #define _FORM_TDMB_H_
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <ExtCtrls.hpp>
  10. #include <ComCtrls.hpp>
  11. #include <Dialogs.hpp>
  12. #ifndef  _TDMB_RF_H_
  13. #include "tdmb_rf.h"
  14. #endif
  15. //---------------------------------------------------------------------------
  16. typedef enum
  17. {
  18.     TDMB_DRAW_MASK_CHANNEL       = 0x01,
  19.     TDMB_DRAW_MASK_FREQ_SERVICES = 0x02,
  20.     TDMB_DRAW_MASK_SCAN_SERVICES = 0x04,
  21.     TDMB_DRAW_MASK_SIGNAL        = 0x08
  22. }E_TDMB_DRAW_MASK;
  23. //---------------------------------------------------------------------------
  24. class TfrmTDMB : public TForm
  25. {
  26. __published: // IDE-managed Components
  27.         TPanel *Panel1;
  28.         TLabel *Label1;
  29.         TComboBox *m_cbBand;
  30.         TLabel *Label2;
  31.         TComboBox *m_cbChannel;
  32.         TTreeView *m_tvServices;
  33.         TStaticText *StaticText1;
  34.         TButton *m_btnSetChannel;
  35.         TButton *m_btnAutoScan;
  36.         TStatusBar *m_sbTDMB;
  37.         TPanel *Panel2;
  38.         TLabel *Label3;
  39.         TLabel *Label5;
  40.         TLabel *Label6;
  41.         TStaticText *m_stSNR;
  42.         TStaticText *m_stPreBER;
  43.         TStaticText *m_stRSSI;
  44.         TTimer *m_tmSingal;
  45.         TLabel *Label7;
  46.         TLabel *Label8;
  47.         TSaveDialog *m_dlgService;
  48.         TButton *m_btnStop;
  49.         TProgressBar *m_pbService;
  50.         TTimer *m_tmService;
  51.         TTimer *m_tmGetFile;
  52.         TLabel *Label4;
  53.         TButton *m_btnStartRS;
  54.         TButton *m_btnSelectService;
  55.         void __fastcall m_cbBandChange(TObject *Sender);
  56.         void __fastcall FormShow(TObject *Sender);
  57.         void __fastcall m_btnSetChannelClick(TObject *Sender);
  58.         void __fastcall m_btnAutoScanClick(TObject *Sender);
  59.         void __fastcall FormActivate(TObject *Sender);
  60.         void __fastcall m_tmSingalTimer(TObject *Sender);
  61.         void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  62.         void __fastcall FormHide(TObject *Sender);
  63.         void __fastcall m_btnStopClick(TObject *Sender);
  64.         void __fastcall m_tmGetFileTimer(TObject *Sender);
  65.         void __fastcall m_tmServiceTimer(TObject *Sender);
  66.         void __fastcall m_btnSelectServiceClick(TObject *Sender);
  67.         void __fastcall m_btnStartRSClick(TObject *Sender);
  68. private: // User declarations
  69.         // common
  70.         CTDMBRF m_TDMB_RF_Obj;
  71.         bool m_bInit;
  72.         //HANDLE m_hSemaphore;
  73.         bool m_bAction;
  74.         // service
  75.         bool m_bService;
  76.         bool m_bRecordStream;
  77.         TDMB_SET_FREQ_CNF_T m_sFreqEnsemble;
  78.         TDMB_GET_ENSM_INFO_BY_AUTO_SCAN_CNF_T m_sScanEnsemble;
  79.         // signal quality
  80.         TDMB_GET_SIGNAL_CNF_T m_sSignal;
  81. //        bool m_bSignalQEnable;
  82. public: // User declarations
  83.         __fastcall TfrmTDMB(TComponent* Owner);
  84.         void Init(void);
  85.         // UI
  86.         void Disable_AllTimer(void);
  87.         void CurrentPageReset(void);
  88.         void CurrentPageLock(void);
  89.         void ReDrawFields(E_TDMB_DRAW_MASK mask);
  90.         void Display_Channel(E_TDMB_BAND_T band);
  91.         void Display_FreqEnsembleDB(void);
  92.         void Display_ScanEnsembleDB(void);
  93.         unsigned int Get_TDMBFreqKHz(void);
  94.         bool Get_ServiceID(unsigned int &ch_kHz, unsigned int &ui_ServiceId, unsigned int &ui_SubChnId);
  95.         // callback
  96.         void CNF_TDMB_PowerOn(void);
  97.         void CNF_TDMB_SetFreq(void);
  98.         void CNF_TDMB_AutoScan(void);
  99.         void CNF_TDMB_GetSignal(void);
  100.         void CNF_TDMB_SelServiceOnly(void);
  101.         void CNF_TDMB_RecordStream(void);
  102.         void CNF_TDMB_StopService(void);
  103. };
  104. //---------------------------------------------------------------------------
  105. extern PACKAGE TfrmTDMB *frmTDMB;
  106. //---------------------------------------------------------------------------
  107. #endif