Skip to content
Snippets Groups Projects
Commit b2762545 authored by Jonathan Hanks's avatar Jonathan Hanks
Browse files

Fixed alarm levels around the total chans.

It had counted chans + tp, now it only counts channels.
parent e50b6c5b
No related branches found
No related tags found
1 merge request!170Cps recv to get dc diags
......@@ -194,8 +194,16 @@ DCStats::DCStats( std::vector< SimplePV >& pvs,
chan.bps;
} );
{
data_rate_ = static_cast< int >(
boost::accumulate(
channels_, std::int64_t{ 0 }, accumulate_data_rate ) /
1024 );
}
total_chans_ = boost::accumulate( channels_, 0, count_data_channels );
channel_config_hash_ = static_cast< int >( crc.result( ) );
std::cerr << "Loaded " << channels_.size( ) << " channels" << std::endl;
std::cerr << "Loaded " << channels_.size( ) << " tp + channels" << std::endl;
for_each( dcu_status_, [&pvs]( DCUStats& cur ) {
cur.setup_pv_names( );
......@@ -297,10 +305,10 @@ DCStats::DCStats( std::vector< SimplePV >& pvs,
"TOTAL_CHANS",
SIMPLE_PV_INT,
reinterpret_cast< void* >( &total_chans_ ),
static_cast< int >( channels_.size( ) ) + 1,
static_cast< int >( channels_.size( ) ) - 1,
static_cast< int >( channels_.size( ) ) + 1,
static_cast< int >( channels_.size( ) ) - 1,
total_chans_ + 1,
total_chans_ - 1,
total_chans_ + 1,
total_chans_ - 1,
} );
pvs.emplace_back( SimplePV{
"PRDCR_OPEN_TP_COUNT",
......@@ -339,14 +347,6 @@ DCStats::DCStats( std::vector< SimplePV >& pvs,
-1,
} );
{
data_rate_ = static_cast< int >(
boost::accumulate(
channels_, std::int64_t{ 0 }, accumulate_data_rate ) /
1024 );
}
total_chans_ = boost::accumulate( channels_, 0, count_data_channels );
valid_ = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment