From 2744fe9a2ea0775c0e53f64c4cd05813d5940bcd Mon Sep 17 00:00:00 2001 From: Jonathan Hanks <jonathan.hanks@ligo.org> Date: Thu, 23 Apr 2020 13:00:08 -0700 Subject: [PATCH] Closes #98. Check for dcuids that are not normal and abort. This check can be turned off by setting the parameter "allow_any_dcu" = "1" in the daqdrc. This allows dcuid's in the channel list that are not in the TP group or the MYRICOM group. (We may be able to restrict the TP group as well). Also removed some old code that is specific to the internal edcu, which along with not being used anymore gives a more obscure error message. --- src/daqd/comm_impl.cc | 14 ++++++++++++++ src/daqd/daqd.cc | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/daqd/comm_impl.cc b/src/daqd/comm_impl.cc index 182058f71..44cb7b783 100644 --- a/src/daqd/comm_impl.cc +++ b/src/daqd/comm_impl.cc @@ -22,6 +22,9 @@ namespace comm_impl int i, j, k, offs; int rm_offs = 0; + auto skip_checks = + daqd.parameters( ).get< bool >( "allow_any_dcuid", false ); + // Configure channels from files if ( daqd.configure_channels_files( ) ) exit( 1 ); @@ -37,6 +40,17 @@ namespace comm_impl else t = cur_dcu != -1 && cur_dcu != daqd.channels[ i ].dcu_id; + if ( cur_dcu >= 0 && !skip_checks ) + { + if ( !IS_TP_DCU( cur_dcu ) && !IS_MYRINET_DCU( cur_dcu ) ) + { + std::cerr + << "DCUID found requested not in the standard ranges " + << cur_dcu << std::endl; + exit( 1 ); + } + } + if ( IS_TP_DCU( daqd.channels[ i ].dcu_id ) && t ) { // Remember the offset to start of TP/EXC DCU data diff --git a/src/daqd/daqd.cc b/src/daqd/daqd.cc index d3ba3256e..c53d542f4 100644 --- a/src/daqd/daqd.cc +++ b/src/daqd/daqd.cc @@ -476,18 +476,6 @@ chanConfigCallback( char* channel_name, struct CHAN_PARAM* params, void* user ) if ( IS_GDS_SIGNAL( *ccd ) ) daqd.num_gds_channels++; } - if ( IS_EPICS_DCU( ccd->dcu_id ) ) - { - daqd.num_epics_channels++; - if ( ccd->data_type != DAQ_DATATYPE_FLOAT ) - { - system_log( 1, - "EDCU channel `%s' has unsupported data type %d", - ccd->name, - ccd->data_type ); - return 0; - } - } // assign conversion data ccd->signal_gain = params->gain; -- GitLab