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