Skip to content
Snippets Groups Projects
Commit af1783a5 authored by Thomas Jürges's avatar Thomas Jürges
Browse files

SW-546: Introduce MAX_TBB_SPECTRAL_SUBBANDS for error checking

parent 2df2aa54
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,11 @@ namespace LOFAR ...@@ -32,6 +32,11 @@ namespace LOFAR
{ {
namespace Cobalt namespace Cobalt
{ {
/**
* This reflects the fact that LOFAR's TBB boards can produce spectral
* time series for a maximum of 487 frequency bands.
*/
const uint32_t MAX_TBB_SPECTRAL_SUBBANDS{487U};
/* /*
* Incoming UDP frame format. * Incoming UDP frame format.
......
...@@ -74,7 +74,7 @@ namespace LOFAR ...@@ -74,7 +74,7 @@ namespace LOFAR
if (operatingMode == TBB_SPECTRAL_MODE) { if (operatingMode == TBB_SPECTRAL_MODE) {
vector<unsigned> tbbSubbandList(parset.getUint32Vector("Observation.TBB.TBBsetting.subbandList", true)); vector<unsigned> tbbSubbandList(parset.getUint32Vector("Observation.TBB.TBBsetting.subbandList", true));
size_t nrSubbands = tbbSubbandList.size(); size_t nrSubbands = tbbSubbandList.size();
if (nrSubbands == 0 || nrSubbands > MAX_TBB_SPECTRAL_NSAMPLES) { if (nrSubbands == 0 || nrSubbands > MAX_TBB_SPECTRAL_SUBBANDS) {
throw APSException("TBB: spectral mode selected, but empty or too long Observation.TBB.TBBsetting.subbandList"); throw APSException("TBB: spectral mode selected, but empty or too long Observation.TBB.TBBsetting.subbandList");
} }
std::sort (tbbSubbandList.begin(), tbbSubbandList.end()); std::sort (tbbSubbandList.begin(), tbbSubbandList.end());
......
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