当前位置: 首页>>代码示例>>C++>>正文


C++ ConfigFile::DDC方法代码示例

本文整理汇总了C++中ConfigFile::DDC方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigFile::DDC方法的具体用法?C++ ConfigFile::DDC怎么用?C++ ConfigFile::DDC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigFile的用法示例。


在下文中一共展示了ConfigFile::DDC方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetSettings

   // pull settings from the configuration file
   GnuRadarSettingsPtr GetSettings( ConfigFile& configuration ) {

      GnuRadarSettingsPtr settings( new GnuRadarSettings() );

      settings->numChannels    = configuration.NumChannels();
      settings->decimationRate = configuration.Decimation();
      settings->fpgaFileName   = configuration.FPGAImage();

      //Program GNURadio
      for ( int i = 0; i < configuration.NumChannels(); ++i ) {
         settings->Tune ( i, configuration.DDC ( i ) );
         settings->Phase( i, configuration.Phase( i ) );
      }

      //change these as needed
      settings->fUsbBlockSize  = 0;
      settings->fUsbNblocks    = 0;
      settings->mux            = 0xf3f2f1f0;

      return settings;
   }
开发者ID:cordic,项目名称:GnuRadar,代码行数:22,代码来源:Start.hpp

示例2: throw

   Hdf5Ptr SetupHDF5( ConfigFile& configuration ) throw( H5::Exception )
   {
      std::string fileSet = configuration.DataFileBaseName();
      Hdf5Ptr h5File_( new HDF5 ( fileSet , hdf5::WRITE ) );

      h5File_->Description ( "GnuRadar Software" + configuration.Version() );
      h5File_->WriteStrAttrib ( "START_TIME", currentTime.GetTime() );
      h5File_->WriteStrAttrib ( "INSTRUMENT", configuration.Receiver() );
      h5File_->WriteAttrib<int> ( "CHANNELS", configuration.NumChannels(),
            H5::PredType::NATIVE_INT, H5::DataSpace() );
      h5File_->WriteAttrib<double> ( "SAMPLE_RATE", configuration.SampleRate(),
            H5::PredType::NATIVE_DOUBLE, H5::DataSpace() );
      h5File_->WriteAttrib<double> ( "BANDWIDTH", configuration.Bandwidth(),
            H5::PredType::NATIVE_DOUBLE, H5::DataSpace() );
      h5File_->WriteAttrib<int> ( "DECIMATION", configuration.Decimation(),
            H5::PredType::NATIVE_INT, H5::DataSpace() );
      h5File_->WriteAttrib<double> ( "OUTPUT_RATE", configuration.OutputRate(),
            H5::PredType::NATIVE_DOUBLE, H5::DataSpace() );
      h5File_->WriteAttrib<double> ( "IPP", configuration.IPP(),
            H5::PredType::NATIVE_DOUBLE, H5::DataSpace() );
      h5File_->WriteAttrib<double> ( "RF", configuration.TxCarrier() , 
            H5::PredType::NATIVE_DOUBLE, H5::DataSpace() );

      for ( int i = 0; i < configuration.NumChannels(); ++i ) {

         h5File_->WriteAttrib<double> ( 
               "DDC" + lexical_cast<string> ( i ),
               configuration.DDC ( i ), 
               H5::PredType::NATIVE_DOUBLE, 
               H5::DataSpace() 
               );

         h5File_->WriteAttrib<double> ( 
               "PHASE" + lexical_cast<string> ( i ),
               configuration.Phase ( i ), 
               H5::PredType::NATIVE_DOUBLE, 
               H5::DataSpace() 
               );
      }

      h5File_->WriteAttrib<int> ( 
            "SAMPLE_WINDOWS", configuration.NumWindows(),
            H5::PredType::NATIVE_INT, H5::DataSpace()
            );

      for ( int i = 0; i < configuration.NumWindows(); ++i ) {

         // TODO: Window Renaming scheme - 10/19/2010
         // Standardize window naming and add the user-defined
         // window name as a separate attribute.

         h5File_->WriteAttrib<int> ( 
               configuration.WindowName ( i ) + "_START", 
               configuration.WindowStart ( i ),
               H5::PredType::NATIVE_INT, H5::DataSpace()
               );

         h5File_->WriteAttrib<int> ( 
               configuration.WindowName ( i ) + "_STOP", 
               configuration.WindowStop ( i ),
               H5::PredType::NATIVE_INT, H5::DataSpace()
               );

         // update gnuradar shared buffer header
         header_->AddWindow( configuration.WindowName(i),
               configuration.WindowStart(i),
               configuration.WindowStop(i)
               );
      }

      return h5File_;
   }
开发者ID:cordic,项目名称:GnuRadar,代码行数:72,代码来源:Start.hpp


注:本文中的ConfigFile::DDC方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。