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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = siganchr.cpp
  3. //
  4. #include <stdlib.h>
  5. #include <fstream>
  6. #include "parmfile.h"
  7. #include "siganchr.h"
  8. #include "typedefs.h"
  9. #include "model_graph.h"
  10. #include "syst_graph.h"
  11. extern ParmFile *ParmInput;
  12. extern ofstream *DebugFile;
  13. extern SystemGraph CommSystemGraph;
  14. extern int PassNumber;
  15. //======================================================
  16. SignalAnchor::SignalAnchor( char* instance_name,
  17.                         PracSimModel* outer_model,
  18.                         Signal< std::complex<float> >* complex_signal,
  19.                         double samp_intvl,
  20.                         int block_size )
  21.           :PracSimModel(instance_name,
  22.                         outer_model)
  23. {
  24.   MODEL_NAME(SignalAnchor);
  25.   Complex_Signal = complex_signal;
  26.   MAKE_INPUT(Complex_Signal);
  27.   SET_SAMP_INTVL(Complex_Signal, samp_intvl);
  28.   SET_BLOCK_SIZE(Complex_Signal, block_size);
  29. }
  30. //====================================================
  31. SignalAnchor::SignalAnchor( char* instance_name,
  32.                         PracSimModel* outer_model,
  33.                         Signal<float>* float_signal )
  34.           :PracSimModel(instance_name,
  35.                         outer_model)
  36. {
  37.   MODEL_NAME(SignalAnchor);
  38.   int block_size;
  39.   double samp_intvl;
  40.   
  41.   OPEN_PARM_BLOCK;
  42.   
  43.   GET_DOUBLE_PARM( samp_intvl );
  44.   GET_INT_PARM( block_size );
  45.   Float_Signal = float_signal;
  46.   MAKE_INPUT(Float_Signal);
  47.   SET_SAMP_INTVL(Float_Signal, samp_intvl);
  48.   SET_BLOCK_SIZE(Float_Signal, block_size);
  49. }
  50. //====================================================
  51. SignalAnchor::SignalAnchor( char* instance_name,
  52.                         PracSimModel* outer_model,
  53.                         Signal< std::complex<float> >* complex_signal )
  54.           :PracSimModel(instance_name,
  55.                         outer_model)
  56. {
  57.   MODEL_NAME(SignalAnchor);
  58.   int block_size;
  59.   double samp_intvl;
  60.   
  61.   OPEN_PARM_BLOCK;
  62.   
  63.   GET_DOUBLE_PARM( samp_intvl );
  64.   GET_INT_PARM( block_size );
  65.   Complex_Signal = complex_signal;
  66.   MAKE_INPUT(Complex_Signal);
  67.   SET_SAMP_INTVL(Complex_Signal, samp_intvl);
  68.   SET_BLOCK_SIZE(Complex_Signal, block_size);
  69. }
  70. //====================================================
  71. SignalAnchor::SignalAnchor( char* instance_name,
  72.                         PracSimModel* outer_model,
  73.                         Signal<bit_t>* bit_signal )
  74.           :PracSimModel(instance_name,
  75.                         outer_model)
  76. {
  77.   MODEL_NAME(SignalAnchor);
  78.   int block_size;
  79.   double samp_intvl;
  80.   
  81.   OPEN_PARM_BLOCK;
  82.   
  83.   GET_DOUBLE_PARM( samp_intvl );
  84.   GET_INT_PARM( block_size );
  85.   Bit_Signal = bit_signal;
  86.   MAKE_INPUT(Bit_Signal);
  87.   SET_SAMP_INTVL(Bit_Signal, samp_intvl);
  88.   SET_BLOCK_SIZE(Bit_Signal, block_size);
  89. }
  90. //====================================================
  91. SignalAnchor::SignalAnchor( char* instance_name,
  92.                         PracSimModel* outer_model,
  93.                         Signal<bit_t>* bit_signal,
  94.                         Signal<byte_t>* byte_signal )
  95.           :PracSimModel(instance_name,
  96.                         outer_model)
  97. {
  98.   MODEL_NAME(SignalAnchor);
  99.   int block_size;
  100.   double samp_intvl;
  101.   
  102.   OPEN_PARM_BLOCK;
  103.   
  104.   GET_DOUBLE_PARM( samp_intvl );
  105.   GET_INT_PARM( block_size );
  106.   Bit_Signal = bit_signal;
  107.   Byte_Signal = byte_signal;
  108.   MAKE_INPUT(Bit_Signal);
  109.   MAKE_INPUT(Byte_Signal);
  110.   SET_SAMP_INTVL(Bit_Signal, samp_intvl);
  111.   SET_BLOCK_SIZE(Bit_Signal, block_size);
  112.   SET_SAMP_INTVL(Byte_Signal, samp_intvl);
  113.   SET_BLOCK_SIZE(Byte_Signal, block_size);
  114. }
  115. //====================================================
  116. // float signal
  117. SignalAnchor::SignalAnchor( char* instance_name,
  118.                         PracSimModel* outer_model,
  119.                         Signal<float>* float_signal,
  120.                         double samp_intvl,
  121.                         int block_size )
  122.           :PracSimModel(instance_name,
  123.                         outer_model)
  124. {
  125.   MODEL_NAME(SignalAnchor);
  126.   Float_Signal = float_signal;
  127.   MAKE_INPUT(Float_Signal);
  128.   SET_SAMP_INTVL(Float_Signal, samp_intvl);
  129.   SET_BLOCK_SIZE(Float_Signal, block_size);
  130. }
  131. //====================================================
  132. // Dual float signal
  133. SignalAnchor::SignalAnchor( char* instance_name,
  134.                         PracSimModel* outer_model,
  135.                         Signal<float>* float_signal,
  136.                         Signal<float>* float_signal_2,
  137.                         double samp_intvl,
  138.                         int block_size )
  139.           :PracSimModel(instance_name,
  140.                         outer_model)
  141. {
  142.   MODEL_NAME(SignalAnchor);
  143.   Float_Signal = float_signal;
  144.   Float_Signal_2 = float_signal_2;
  145.   MAKE_INPUT(Float_Signal);
  146.   MAKE_INPUT(Float_Signal_2);
  147.   SET_SAMP_INTVL(Float_Signal, samp_intvl);
  148.   SET_BLOCK_SIZE(Float_Signal, block_size);
  149.   SET_SAMP_INTVL(Float_Signal_2, samp_intvl);
  150.   SET_BLOCK_SIZE(Float_Signal_2, block_size);
  151. }
  152. //====================================================
  153. SignalAnchor::SignalAnchor( char* instance_name,
  154.                         PracSimModel* outer_model,
  155.                         Signal<int>* int_signal,
  156.                         double samp_intvl,
  157.                         int block_size )
  158.           :PracSimModel(instance_name,
  159.                         outer_model)
  160. {
  161.   MODEL_NAME(SignalAnchor);
  162.   Int_Signal = int_signal;
  163.   MAKE_INPUT(Int_Signal);
  164.   SET_SAMP_INTVL(Int_Signal, samp_intvl);
  165.   SET_BLOCK_SIZE(Int_Signal, block_size);
  166. }
  167. //====================================================
  168. SignalAnchor::SignalAnchor( char* instance_name,
  169.                         PracSimModel* outer_model,
  170.                         Signal<bit_t>* bit_signal,
  171.                         double samp_intvl,
  172.                         int block_size )
  173.           :PracSimModel(instance_name,
  174.                         outer_model)
  175. {
  176.   Bit_Signal = bit_signal;
  177.   MAKE_INPUT(Bit_Signal);
  178.   SET_SAMP_INTVL(Bit_Signal, samp_intvl);
  179.   SET_BLOCK_SIZE(Bit_Signal, block_size);
  180. }
  181. //====================================================
  182. // Dual integer signals
  183. SignalAnchor::SignalAnchor( char* instance_name,
  184.                         PracSimModel* outer_model,
  185.                         Signal<int>* int_signal,
  186.                         Signal<int>* int_signal_2,
  187.                         double samp_intvl,
  188.                         int block_size )
  189.           :PracSimModel(instance_name,
  190.                         outer_model)
  191. {
  192.   Int_Signal = int_signal;
  193.   Int_Signal_2 = int_signal_2;
  194.   MAKE_INPUT(Int_Signal);
  195.   MAKE_INPUT(Int_Signal_2);
  196.   SET_SAMP_INTVL(Int_Signal, samp_intvl);
  197.   SET_BLOCK_SIZE(Int_Signal, block_size);
  198.   SET_SAMP_INTVL(Int_Signal_2, samp_intvl);
  199.   SET_BLOCK_SIZE(Int_Signal_2, block_size);
  200. }
  201. //===================================================
  202. SignalAnchor::~SignalAnchor( void ){ };
  203. void SignalAnchor::Initialize(void)
  204. {
  205. };
  206. int SignalAnchor::Execute()
  207. {
  208.   return(_MES_AOK);
  209. }