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
Operations
-
FrameIStream &
operator>>(std::vector<SeqViewDouble> &rSeqView)¶ Read data from the frame file.
- Return
a reference to the instance of the class
- Parameters
rSeqView: A list of time views to fill with data. Each view contain a single channel.
-
FrameIStream &
operator>>(SeqViewDouble &rSeqView)¶ Read data from the frame file.
- Return
a reference to the instance of the class
- Parameters
rSeqView: A list a time view to fill with data. It contains a single channel.
Getters
-
const std::string &
GetFileName(void) const¶ Get the file name of the frame file used.
- Return
the file name of the frame file
-
const std::vector<std::string> &
GetChannelNames(void) const¶ Get the list of the channel’s names.
- Return
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.
- Return
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.
- Return
the actual end time
-
double
GetSampling(unsigned int cn) const¶ Get the sampling time of a channel
- Return
the channel’s sampling time
- Parameters
cname: the channel’s name
-
double
GetTimeLength()¶ Get the time duration of the next data chunk that will be read.
- Return
the actual time duration.
-
FrameH *
GetFrame()¶ Get a pointer to the current FrameH structure.
- Return
a pointer to the current FrameH
-
bool
GetDataLossFlag()¶ Get the value of the data loss flag. It is true if a data loss event is occurred.
- Return
the data loss flag value
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
-
void
SetDataLossFlag(bool status)¶ Set the value of the data loss flag.
- Parameters
status: new value of the data loss flag
-
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 messagemiss_start: start time for data lossmiss_end: end time for data loss (excluded)channel: channel where the data loss occurred
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 wantTimeLength: time length of requested datachannelNames: a list of channel’s names
-
~FrameIStream()¶ Destructor
-
FrameIStream &