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

Updating the timing of epics broadcasts and the data crcs for cps_recv.

Update the epics more frequently than 1s to allow caget to work w/o timeouts.

Update the data crc on data cycle 0.
parent 9f83477b
No related branches found
No related tags found
1 merge request!170Cps recv to get dc diags
...@@ -582,6 +582,7 @@ DCStats::run( simple_pv_handle epics_server ) ...@@ -582,6 +582,7 @@ DCStats::run( simple_pv_handle epics_server )
for_each( dcu_status_, clear_entries ); for_each( dcu_status_, clear_entries );
for ( std::uint64_t cycles = 1;; ++cycles ) for ( std::uint64_t cycles = 1;; ++cycles )
{ {
unsigned int data_cycle = 0xffffffff;
total_data_crc.reset( ); total_data_crc.reset( );
dc_queue::value_type entry{ get_message( epics_server ) }; dc_queue::value_type entry{ get_message( epics_server ) };
...@@ -633,6 +634,7 @@ DCStats::run( simple_pv_handle epics_server ) ...@@ -633,6 +634,7 @@ DCStats::run( simple_pv_handle epics_server )
if ( first ) if ( first )
{ {
gpstime_ = cur_header.timeSec; gpstime_ = cur_header.timeSec;
data_cycle = cur_header.cycle;
first = false; first = false;
} }
if ( cur_header.fileCrc != cur_status.expected_config_crc ) if ( cur_header.fileCrc != cur_status.expected_config_crc )
...@@ -663,9 +665,18 @@ DCStats::run( simple_pv_handle epics_server ) ...@@ -663,9 +665,18 @@ DCStats::run( simple_pv_handle epics_server )
} }
for_each( dcu_status_, mark_dcu_if_skipped_this_cycle ); for_each( dcu_status_, mark_dcu_if_skipped_this_cycle );
for_each( dcu_status_, clear_seen_last_cycle_if_skipped ); for_each( dcu_status_, clear_seen_last_cycle_if_skipped );
bool alternating_cycle = cycles % 2 == 0;
bool one_sec_update = cycles % 16 == 0;
if ( data_cycle == 0 )
{
data_crc_ = static_cast< int >( total_data_crc.result( ) );
}
// we can either do this off of our counter or off of the // we can either do this off of our counter or off of the
// data cycle counter. // data cycle counter.
if ( cycles % 16 == 0 ) if ( one_sec_update )
{ {
++uptime_; ++uptime_;
tp_data_kb_per_s_ = static_cast< unsigned int >( tp_data / 1024 ); tp_data_kb_per_s_ = static_cast< unsigned int >( tp_data / 1024 );
...@@ -677,7 +688,7 @@ DCStats::run( simple_pv_handle epics_server ) ...@@ -677,7 +688,7 @@ DCStats::run( simple_pv_handle epics_server )
open_tp_count_ = static_cast< int >( tp_count ); open_tp_count_ = static_cast< int >( tp_count );
unique_dcus_per_sec_ = unique_dcus_per_sec_ =
boost::count_if( dcu_status_, entry_was_processed ); boost::count_if( dcu_status_, entry_was_processed );
data_crc_ = static_cast< int >( total_data_crc.result( ) );
simple_pv_server_update( epics_server ); simple_pv_server_update( epics_server );
for_each( dcu_status_, clear_entries ); for_each( dcu_status_, clear_entries );
...@@ -691,5 +702,9 @@ DCStats::run( simple_pv_handle epics_server ) ...@@ -691,5 +702,9 @@ DCStats::run( simple_pv_handle epics_server )
request_clear_crc_ = false; request_clear_crc_ = false;
} }
} }
else if ( alternating_cycle )
{
simple_pv_server_update( epics_server );
}
} }
} }
\ No newline at end of file
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