FrameIStream¶
-
class FrameIStream : public tsa::AlgoBase¶
A source of data taken from a Frame file.
This class can be used to read data from a frame file. A set of channels can be specified, which are returned together.
Ser data:
Channel:Parameter:Frequency:Default
Setters
-
void SetChannels(const std::vector<std::string> &channelNames)¶
Set the channels which should be opened
- Parameters:
channelNames – vector of names for the channels
-
void SetTimeLength(double length)¶
Set the length of the data buffer that will be returned from now on
- Parameters:
length – the new length
-
void ResetValidationView()¶
Set to zero the validation view. No validation data are written.
-
void SetValidationView(std::vector<SeqViewDouble> *rValidationView)¶
Set the current validation view. From now on the validation data are written on the given views every time some data is read.
- Parameters:
rValidationView – pointer to a vector of validation views
-
inline void SetDataLossFlag(bool status)¶
Set the value of the data loss flag.
- Parameters:
status – new value of the data loss flag
-
inline void AddException(const std::string &msg, double miss_start, double miss_end, unsigned int channel)¶
Ad an exception to the set of data losses.
- Parameters:
msg – exception textual message
miss_start – start time for data loss
miss_end – end time for data loss (excluded)
channel – channel where the data loss occurred
Operations
-
void Init()¶
-
FrameIStream &operator>>(std::vector<SeqViewDouble> &rSeqView)¶
Read data from the frame file.
- Parameters:
rSeqView – A list of time views to fill with data. Each view contain a single channel.
- Returns:
a reference to the instance of the class
-
FrameIStream &operator>>(SeqViewDouble &rSeqView)¶
Read data from the frame file.
- Parameters:
rSeqView – A list a time view to fill with data. It contains a single channel.
- Returns:
a reference to the instance of the class
-
void FillView(SeqViewDouble &rSeqView, double tstart, double tend)¶
Getters
-
std::string GetInfo(int gtime = 0)¶
-
const std::string &GetFileName(void) const¶
Get the file name of the frame file used.
- Returns:
the file name of the frame file
-
const std::vector<std::string> &GetChannelNames(void) const¶
Get the list of the channel’s names.
- Returns:
a list of channel’s names
-
double GetStartTime(void) const¶
Get the actual start time, which is the start time of the next data chunk that will be read.
- Returns:
the actual start time
-
double GetEndTime(void) const¶
Get the actual end time, which is the end time of the next data chunk that will be read.
- Returns:
the actual end time
-
double GetSampling(unsigned int cn) const¶
Get the sampling time of a channel
- Parameters:
cname – the channel’s name
- Returns:
the channel’s sampling time
-
inline double GetTimeLength()¶
Get the time duration of the next data chunk that will be read.
- Returns:
the actual time duration.
-
inline FrameH *GetFrame()¶
Get a pointer to the current FrameH structure.
- Returns:
a pointer to the current FrameH
-
inline struct FrFile *GetFrameFile()¶
-
inline bool GetDataLossFlag()¶
Get the value of the data loss flag. It is true if a data loss event is occurred.
- Returns:
the data loss flag value
Public Functions
-
FrameIStream(const std::string &fileName, const double &StartTime)¶
Constructor
- Parameters:
fileName – the name of the frame file (or a ffl file)
StartTime – start time of the data chunk we want
-
FrameIStream(const std::string &fileName, const double &StartTime, const double &TimeLength, const std::vector<std::string> &channelNames)¶
Constructor
- Parameters:
fileName – the name of the frame file (or a ffl file)
StartTime – start time of the data chunk we want
TimeLength – time length of requested data
channelNames – a list of channel’s names
-
~FrameIStream()¶
Destructor
-
void SetChannels(const std::vector<std::string> &channelNames)¶