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


C++ To::get_ncycsub方法代码示例

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


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

示例1: prepare

void DigitiserStatsPlot::prepare( const Archive *const_arch )
{
  Reference::To<Archive> arch = const_cast<Archive*>( const_arch );

  Reference::To<DigitiserStatistics> ext = arch->get<DigitiserStatistics>();

  if( CheckStats( ext ) )
  {
    ncycsub = ext->get_ncycsub();
    ndigr = ext->get_ndigr();
    npar = ext->get_npar();
    nsub = ext->rows.size();

    AdjustSubRange();

    y_min = FLT_MAX;
    y_max = -FLT_MAX;

    // The data in the file isn't how we would like it. [p1][p2][p3] etc what we want
    // is all the p1 values sequentially, then all the p2 etc. So create an array of
    // profiles [digitiser channel][parameter] then we just pass it to cpgline
    // when we want to draw them. Grab the min and max while we're doing this.

    profiles.resize( ndigr );
    for( int g = 0; g < ndigr; g ++ )
    {
      profiles[g].resize( npar );
      for( int p = 0; p < npar; p ++ )
      {
        profiles[g][p].resize( ncycsub * nsub );
        for( int c = 0; c < ncycsub; c ++ )
        {
          for( int s = srange.first; s <= srange.second; s ++ )
          {
            float next_val = ext->rows[s].data[c*ndigr*npar + g*npar + p];
            if( next_val < y_min )
              y_min = next_val;
            if( next_val > y_max )
              y_max = next_val;
            profiles[g][p][s*ncycsub + c] = next_val;
          }
        }
      }
    }


    if( !(y_min == 0 && y_max == 0) )
    {
      valid_archive = true;

      // adjust the viewport to show all the data, don't overlap the subints, looks crap.

      get_frame()->get_y_scale()->set_minmax( y_min, y_max );
      get_frame()->get_x_scale()->set_minmax( 0, ndigr );
      get_frame()->get_y_scale()->set_buf_norm( .07 );

      get_frame()->hide_axes();
    }
    else
    {
      if( verbose > 1 )
        cerr << "Digitiser Stats values are all zero" << endl;
    }
  }
}
开发者ID:SkyTian13,项目名称:psrchive,代码行数:65,代码来源:DigitiserStatsPlot.C


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