OpenCurves  0.9
realtimecommspec.h
1 //
2 // author Kazys Stepanas
3 //
4 // Copyright (c) CSIRO 2015
5 //
6 #ifndef REALTIMECOMMSPEC_H_
7 #define REALTIMECOMMSPEC_H_
8 
9 #include "ocurvesconfig.h"
10 
11 class RealTimeConnection;
12 class RTMessage;
13 
38 {
39 public:
42 
45 
49 
53 
59  void setConnectMessage(RTMessage *msg);
60 
63  const RTMessage *connectMessage() const;
64 
73 
76  const RTMessage *disconnectMessage() const;
77 
84  void setIncomingMessage(RTMessage *msg);
85 
88  RTMessage *incomingMessage() const;
89 
97  void setBufferSize(unsigned size);
98 
101  unsigned bufferSize() const;
102 
109  void setTimeColumn(unsigned columnNumber);
110 
113  unsigned timeColumn() const;
114 
122  void setTimeScale(double scale);
123 
127  double timeScale() const;
128 
138  void disconnect();
139 
140 private:
141  RealTimeConnection *_connection;
142  RTMessage *_connectMsg;
143  RTMessage *_disconnectMsg;
144  RTMessage *_incomingMsg;
145  unsigned _bufferSize;
146  unsigned _timeColumn;
147  double _timeScale;
148 };
149 
151 {
152  return _connection;
153 }
154 
155 
157 {
158  return _connectMsg;
159 }
160 
161 
163 {
164  return _disconnectMsg;
165 }
166 
167 
169 {
170  return _incomingMsg;
171 }
172 
173 
174 inline void RealTimeCommSpec::setBufferSize(unsigned size)
175 {
176  _bufferSize = size;
177 }
178 
179 
180 inline unsigned RealTimeCommSpec::bufferSize() const
181 {
182  return _bufferSize;
183 }
184 
185 
186 inline void RealTimeCommSpec::setTimeColumn(unsigned columnNumber)
187 {
188  _timeColumn = columnNumber;
189 }
190 
191 
192 inline unsigned RealTimeCommSpec::timeColumn() const
193 {
194  return _timeColumn;
195 }
196 
197 
198 inline void RealTimeCommSpec::setTimeScale(double scale)
199 {
200  _timeScale = scale;
201 }
202 
203 
204 inline double RealTimeCommSpec::timeScale() const
205 {
206  return _timeScale;
207 }
208 
209 #endif // REALTIMECOMMSPEC_H_
Base message handling for real time data plot communications.
Definition: rtmessage.h:29
const RTMessage * connectMessage() const
Access the current connection message.
Definition: realtimecommspec.h:156
double timeScale() const
Access the time scale value.
Definition: realtimecommspec.h:204
unsigned bufferSize() const
Access the requested buffer size for incoming sample data buffering.
Definition: realtimecommspec.h:180
void setBufferSize(unsigned size)
Set the requested plot buffer size for incoming data.
Definition: realtimecommspec.h:174
void setConnectMessage(RTMessage *msg)
Set the connection message, deleting and replacing any existing connection message.
~RealTimeCommSpec()
Destroy the comm-spec. Only deletes the wrapped classes (no disconnect).
void disconnect()
Send disconnect message and disconnect the connection.
RealTimeConnection * connection() const
Access the connection.
Definition: realtimecommspec.h:150
void setTimeScale(double scale)
Sets the time scaling value.
Definition: realtimecommspec.h:198
const RTMessage * disconnectMessage() const
Access the current disconnect message.
Definition: realtimecommspec.h:162
This is the base class for data source which provides data in real time.
Definition: realtimeconnection.h:16
Specifies a real time communication specification, messaging and buffer setup.
Definition: realtimecommspec.h:37
void setTimeColumn(unsigned columnNumber)
Set the expected time column number.
Definition: realtimecommspec.h:186
RTMessage * incomingMessage() const
Access the current disconnect message.
Definition: realtimecommspec.h:168
void setIncomingMessage(RTMessage *msg)
Set details of the expected incoming messages deleting and replacing any such existing specification...
unsigned timeColumn() const
Access the time column.
Definition: realtimecommspec.h:192
void setConnection(RealTimeConnection *connection)
Set the connection details, deleting and replacing any existing connection.
void setDisconnectMessage(RTMessage *msg)
Set the disconnect message, deleting and replacing any existing disconnect message.
RealTimeCommSpec()
Create an empty comm-spec.