contin_adv_T.h
上传用户:jtjnyq9001
上传日期:2014-11-21
资源大小:3974k
文件大小:3k
源码类别:

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = contin_adv_T.h
  3. //
  4. #ifndef _CONTIN_ADV_T_H_
  5. #define _CONTIN_ADV_T_H_
  6. #include "signal_T.h"
  7. #include "control_T.h"
  8. #include "adv_modes.h"
  9. #include "interp_modes.h"
  10. #include "psmodel.h"
  11. template <class T>
  12. class ContinuousAdvance : public PracSimModel
  13. {
  14. public:
  15.   //---------------------------------------------
  16.   // constructor that supports all advance modes
  17.   ContinuousAdvance< T >( char* instance_name,
  18.                     PracSimModel* outer_model,
  19.                     Signal<T>* in_signal,
  20.                     Signal<T>* out_signal,
  21.                     Control<float>* new_adv,
  22.                     Control<bool>* advance_change_enabled);
  23.   //---------------------------------------------------
  24.   //  constructor does not support 'gated' advance mode
  25.   //  (eliminates the need to connect gating control)
  26.   ContinuousAdvance< T >( char* instance_name,
  27.                     PracSimModel* outer_model,
  28.                     Signal<T>* in_signal,
  29.                     Signal<T>* out_signal,
  30.                     Control<float>* new_adv);
  31.   //---------------------------------------------------
  32.   //  constructor does not support 'gated' or 'dynamic'
  33.   //  advance modes (eliminates the need to connect gating
  34.   //  and delay controls)
  35.   ContinuousAdvance< T >( char* instance_name,
  36.                     PracSimModel* outer_model,
  37.                     Signal<T>* in_signal,
  38.                     Signal<T>* out_signal);
  39.   ~ContinuousAdvance<T>(void);
  40.   void Initialize(void);
  41.   int Execute(void);
  42. private:
  43.   //------------------------------------------------------
  44.   //  private method that is called by each of the
  45.   //  three different constructors to perform common tasks
  46.   void Constructor_Common_Tasks(  char* instance_name,
  47.                                   Signal<T>* in_signal,
  48.                                   Signal<T>* out_signal);
  49.   //---------------------------------------------
  50.   //  user-specified static parameters
  51.   ADVANCE_MODE_T Advance_Mode;
  52.   INTERP_MODE_T Interp_Mode;
  53.   double Initial_Advance;
  54.   int Max_Advance;
  55.   //--------------------------------------------
  56.   //  state variables and derived parameters
  57.   double Block_Size;
  58.   double Samp_Intvl;
  59.   double Active_Advance;
  60.   float Interp_Weight;
  61.   float One_Minus_Weight;
  62.   int Active_Buffer_Len;
  63.   int Num_Sidelobes;
  64.   int Max_Buffer_Len;  // numb of locs needed for Max_Delay
  65.   T *Start_Of_Buffer;
  66.   T *End_Of_Buffer;
  67.   T *Read_Ptr;
  68.   T *Write_Ptr;
  69.   //--------------------------
  70.   //  Signals
  71.   Signal<T> *In_Sig;
  72.   Signal<T> *Out_Sig;  
  73.   //-----------------------------------
  74.   //  Controls
  75.   Control<bool> *Advance_Change_Enabled;
  76.   Control<float> *New_Advance;
  77. };
  78. #endif