OpenCurves
0.9
|
Represents a string based message for real-time data plots. More...
#include <rtstringmessage.h>
Public Member Functions | |
RTStringMessage (const QString &message=QString()) | |
Constructor, sending message() when setMesssage() is called. | |
void | setMessage (QByteArray &buffer) override |
Set the message to send in buffer . More... | |
int | readMessage (const QByteArray &buffer) override |
Read incoming message data. More... | |
void | setHeadings (const QStringList &headings) |
Set the headings. More... | |
QStringList | headings () const override |
Returns the cache headings. More... | |
unsigned | populateValues (std::vector< double > &values) const override |
Data access request for the latest data. More... | |
![]() | |
virtual | ~RTMessage () |
Virtual destructor. | |
Protected Attributes | |
QString | _message |
Message to send, or last read. | |
QStringList | _headings |
Cached headings. | |
Represents a string based message for real-time data plots.
A string message is simply parsed as a delimited value string. Parsing matches that used for file loading; PlotFile::dataLine()
.
A real time source does not expect heading names, and by default simply labels values "Column 1", "Column 2", etc. This can be overridden by calling setHeadings()
, but the number of items must match the incoming data.
As with a data file, each line is expected to have the same number of items.
|
overridevirtual |
Returns the cache headings.
Headings are either set explicitly or determined by the first value populateValues()
call.
Implements RTMessage.
Referenced by setHeadings().
|
overridevirtual |
Data access request for the latest data.
This parses the current message, as read by the last readMessage()
call. The headings are populate, if not set, to a numerical sequence 'Column #' to match the number of incoming values.
values | Populated with the latest data set. |
values
. Implements RTMessage.
|
overridevirtual |
Read incoming message data.
Simply converted to string.
buffer | The buffer to convert. |
Implements RTMessage.
|
inline |
|
overridevirtual |
Set the message to send in buffer
.
Write the message given on construction.
buffer | to populate. |
Implements RTMessage.