Skip to content
Snippets Groups Projects
Commit 95ed1d25 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #4315: Slightly improved interface

parent 8fcd79af
No related branches found
No related tags found
No related merge requests found
...@@ -46,9 +46,13 @@ namespace LOFAR ...@@ -46,9 +46,13 @@ namespace LOFAR
//##---------------- Public methods ----------------##// //##---------------- Public methods ----------------##//
Delays::Delays(const Parset &parset, const std::string &stationName, const TimeStamp &startTime) Delays::Delays(const Parset &parset, const std::string &stationName, const TimeStamp &startTime, size_t blockSize)
: :
parset(parset), parset(parset),
itsStationName(stationName),
itsStartTime(startTime),
blockSize(blockSize),
stop(false), stop(false),
// we need an extra entry for the central beam // we need an extra entry for the central beam
itsBuffer(bufferSize), itsBuffer(bufferSize),
...@@ -56,9 +60,6 @@ namespace LOFAR ...@@ -56,9 +60,6 @@ namespace LOFAR
tail(0), tail(0),
bufferFree(bufferSize), bufferFree(bufferSize),
bufferUsed(0), bufferUsed(0),
itsStartTime(startTime),
blockSize(parset.nrSamplesPerSubband()),
itsStationName(stationName),
itsDelayTimer("delay producer", true, true) itsDelayTimer("delay producer", true, true)
{ {
} }
......
...@@ -85,7 +85,7 @@ namespace LOFAR ...@@ -85,7 +85,7 @@ namespace LOFAR
class Delays class Delays
{ {
public: public:
Delays(const Parset &ps, const std::string &stationName, const TimeStamp &startTime); Delays(const Parset &ps, const std::string &stationName, const TimeStamp &startTime, size_t blockSize);
~Delays(); ~Delays();
void start(); void start();
...@@ -107,6 +107,11 @@ namespace LOFAR ...@@ -107,6 +107,11 @@ namespace LOFAR
void getNextDelays( AllDelays &result ); void getNextDelays( AllDelays &result );
private: private:
const Parset &parset;
const std::string itsStationName;
const TimeStamp itsStartTime;
const size_t blockSize;
casa::MVEpoch toUTC( const TimeStamp &timeStamp ) const; casa::MVEpoch toUTC( const TimeStamp &timeStamp ) const;
void init(); void init();
...@@ -115,8 +120,6 @@ namespace LOFAR ...@@ -115,8 +120,6 @@ namespace LOFAR
// calculations and to avoid blocking other threads // calculations and to avoid blocking other threads
void mainLoop(); void mainLoop();
const Parset &parset;
volatile bool stop; volatile bool stop;
// the number of seconds to maintain in the buffer, must be a multiple of // the number of seconds to maintain in the buffer, must be a multiple of
...@@ -141,12 +144,6 @@ namespace LOFAR ...@@ -141,12 +144,6 @@ namespace LOFAR
// another to trigger the consumer that data is available. // another to trigger the consumer that data is available.
Semaphore bufferFree, bufferUsed; Semaphore bufferFree, bufferUsed;
// Sample timings.
const TimeStamp itsStartTime;
const size_t blockSize;
// Station Name.
const std::string itsStationName;
casa::MeasFrame itsFrame; casa::MeasFrame itsFrame;
std::vector<casa::MDirection::Types> itsDirectionTypes; // [sap] std::vector<casa::MDirection::Types> itsDirectionTypes; // [sap]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment