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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = contin_delay2_T.h
  3. //
  4. #ifndef _CONTIN_DELAY2_T_H_
  5. #define _CONTIN_DELAY2_T_H_
  6. #include "signal_T.h"
  7. #include "control_T.h"
  8. #include "delay_modes.h"
  9. #include "interp_modes.h"
  10. #include "psmodel.h"
  11. template <class T>
  12. class ContinuousDelay2 : public PracSimModel
  13. {
  14. public:
  15.   //---------------------------------------------
  16.   // constructor that supports all delay modes
  17.   ContinuousDelay2< T >( char* instance_name,
  18.                     PracSimModel* outer_model,
  19.                     Signal<T>* in_signal,
  20.                     Signal<T>* out_signal,
  21.                     Control<float>* new_delay,
  22.                     Control<bool>* delay_change_enabled);
  23.   //---------------------------------------------------
  24.   //  constructor does not support 'gated' delay mode
  25.   //  (eliminates the need to connect gating control)
  26.   ContinuousDelay2< T >( char* instance_name,
  27.                     PracSimModel* outer_model,
  28.                     Signal<T>* in_signal,
  29.                     Signal<T>* out_signal,
  30.                     Control<float>* new_delay);
  31.   //---------------------------------------------------
  32.   //  constructor does not support 'gated' or 'dynamic'
  33.   //  delay modes (eliminates the need to connect gating
  34.   //  and delay controls)
  35.   ContinuousDelay2< T >( char* instance_name,
  36.                     PracSimModel* outer_model,
  37.                     Signal<T>* in_signal,
  38.                     Signal<T>* out_signal);
  39.   ~ContinuousDelay2<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.   DELAY_MODE_T Delay_Mode;
  52.   INTERP_MODE_T Interp_Mode;
  53.   double Initial_Delay;
  54.   int Max_Delay;
  55.   //--------------------------------------------
  56.   //  state variables and derived parameters
  57.   double Nom_Block_Size;
  58.   double Samp_Intvl;
  59.   double Active_Delay;
  60.   double Longest_Active_Delay;
  61.   float Interp_Weight;
  62.   float One_Minus_Weight;
  63.   int Active_Buffer_Len;
  64.   int Preamble_Backlog;
  65.   int Delay_Ceil;
  66.   int Num_Sidelobes;
  67.   int Preamb_Len;
  68.   int Noncausal_Samps;
  69.   int Longest_Noncausal_Samps;
  70.   int Preamb_Samps_Remaining;
  71.   int Preamb_Blocks_Remaining;
  72.   //int Return_Status;
  73.   //int New_Pass_Number;
  74.   int Blocks_Of_Offset;
  75.   int Num_Blocks_Skipped;
  76.   int Offset_Sum_Start_To_Out_Samp;
  77.   float *Sinc_Val;
  78.   int Max_Buffer_Len;  // numb of locs needed for Max_Delay
  79.   T *Start_Of_Buffer;
  80.   T *End_Of_Buffer;
  81.   T *Rxxead_Ptr;
  82.   T *Read_Ptr_Start;
  83.   T *Write_Ptr;
  84.   //--------------------------
  85.   //  Signals
  86.   Signal<T> *In_Sig;
  87.   Signal<T> *Out_Sig;  
  88.   //-----------------------------------
  89.   //  Controls
  90.   Control<bool> *Delay_Change_Enabled;
  91.   Control<float> *New_Delay;
  92.   static int Instance_Count;
  93.   int Instance_Number;
  94. };
  95. #endif