Elaboradar  0.1

◆ make_scan()

template<typename T >
PolarScan<T>& radarelab::volume::Scans< T >::make_scan ( unsigned  idx,
unsigned  beam_count,
unsigned  beam_size,
double  elevation,
double  cell_size 
)
inline

Create or reuse a scan at position idx, with the given beam size.

Parametri
[in]idx- index of the PolarScan
[in]beam_count
[in]beam_size
[in]elevation
[in]cell_size
Restituisce
the idx PolarScan

Definizione alla linea 357 del file volume.h.

358  {
359  if (idx < this->size())
360  {
361  if (beam_count != (*this)[idx].beam_count)
362  {
363  LOG_CATEGORY("radar.io");
364  LOG_ERROR("make_scan(idx=%u, beam_count=%u, beam_size=%u) called, but the scan already existed with beam_count=%u", idx, beam_count, beam_size, (*this)[idx].beam_count);
365  throw std::runtime_error("beam_size mismatch");
366  }
367  if (beam_size != (*this)[idx].beam_size)
368  {
369  LOG_CATEGORY("radar.io");
370  LOG_ERROR("make_scan(idx=%u, beam_count=%u, beam_size=%u) called, but the scan already existed with beam_size=%u", idx, beam_count, beam_size, (*this)[idx].beam_size);
371  throw std::runtime_error("beam_size mismatch");
372  }
373  } else {
374  // If some elevation has been skipped, fill in the gap
375  if (idx > this->size())
376  {
377  if (this->empty())
378  this->push_back(PolarScan<T>(beam_count, beam_size));
379  while (this->size() < idx)
380  this->push_back(PolarScan<T>(beam_count, this->back().beam_size));
381  }
382 
383  // Add the new polar scan
384  this->push_back(PolarScan<T>(beam_count, beam_size));
385  this->back().elevation = elevation;
386  this->back().cell_size = cell_size;
387  }
388 
389  // Return it
390  return (*this)[idx];
391  }

Referenzia radarelab::PolarScanBase::beam_count, radarelab::PolarScanBase::beam_size, radarelab::PolarScanBase::cell_size, e radarelab::PolarScanBase::elevation.

Referenziato da radarelab::Volume< T >::make_scan().