51 disconnect(
config_, SIGNAL(subscriberQueueSizeChanged(
size_t)),
64 connect(config, SIGNAL(subscriberQueueSizeChanged(
size_t)),
86 if (broker && wasSubscribed)
112 QString topic = xAxisConfig->
getTopic();
120 const Message&)), properties)) {
126 QString xTopic = xAxisConfig->
getTopic();
127 QString yTopic = yAxisConfig->
getTopic();
173 variant_topic_tools::BuiltinVariant variant = message.
getVariant().
174 getMember(xAxisConfig->
getField().toStdString());
176 point.setX(variant.getNumericValue());
182 variant_topic_tools::BuiltinVariant variant = message.
getVariant().
183 getMember(yAxisConfig->
getField().toStdString());
185 point.setY(variant.getNumericValue());
205 QStringList fieldParts = axisConfig->
getField().split(
"/");
207 while (!fieldParts.isEmpty()) {
208 fieldParts.removeLast();
210 QString parentField = fieldParts.join(
"/");
211 variant_topic_tools::MessageVariant variant;
213 if (!parentField.isEmpty())
214 variant = message.
getVariant().getMember(fieldParts.join(
"/").
219 variant_topic_tools::MessageDataType type = variant.getType();
221 if (type.hasHeader()) {
232 variant_topic_tools::BuiltinVariant variant = message.
getVariant().
241 variant_topic_tools::BuiltinVariant variant = message.
getVariant().
242 getMember(axisConfig->
getField().toStdString());
244 timeValue.
value_ = variant.getNumericValue();
261 while ((timeValuesX.count() > 1) && (timeValuesY.count() > 1)) {
262 while ((timeValuesX.count() > 1) &&
263 ((++timeValuesX.begin())->time_ < timeValuesY.front().time_))
264 timeValuesX.removeFirst();
266 while ((timeValuesY.count() > 1) &&
267 ((++timeValuesY.begin())->time_ < timeValuesX.front().time_))
268 timeValuesY.removeFirst();
270 if ((timeValuesY.front().time_ >= timeValuesX.front().time_) &&
271 (timeValuesX.count() > 1)) {
274 const TimeValue& firstX = timeValuesX.first();
275 const TimeValue& secondX = *(++timeValuesX.begin());
278 (timeValuesY.front().time_-firstX.
time_).toSec()/
280 point.setY(timeValuesY.front().value_);
282 timeValuesY.removeFirst();
286 else if ((timeValuesX.front().time_ >= timeValuesY.front().time_) &&
287 (timeValuesY.count() > 1)) {
290 const TimeValue& firstY = timeValuesY.first();
291 const TimeValue& secondY = *(++timeValuesY.begin());
293 point.setX(timeValuesX.front().value_);
295 (timeValuesX.front().time_-firstY.
time_).toSec()/
298 timeValuesX.removeFirst();
const QString & getTopic() const
const variant_topic_tools::MessageVariant & getVariant() const
void pointReceived(const QPointF &point)
MessageBroker * getBroker() const
size_t getSubscriberQueueSize() const
void configSubscriberQueueSizeChanged(size_t queueSize)
void subscriberMessageReceived(const QString &topic, const Message &message)
CurveAxisConfig * getAxisConfig(Axis axis) const
QMap< CurveConfig::Axis, QString > timeFields_
QMap< int, QVariant > PropertyMap
void subscriberXAxisMessageReceived(const QString &topic, const Message &message)
FieldType getFieldType() const
void subscriberYAxisMessageReceived(const QString &topic, const Message &message)
virtual bool subscribe(const QString &topic, QObject *receiver, const char *method, const PropertyMap &properties=PropertyMap(), Qt::ConnectionType type=Qt::AutoConnection)=0
void setConfig(CurveConfig *config)
const QString & getField() const
void processMessage(const Message &message)
QMap< CurveConfig::Axis, QString > subscribedTopics_
virtual ~CurveDataSequencer()
QMap< CurveConfig::Axis, TimeValueList > timeValues_
void configAxisConfigChanged()
bool isSubscribed() const
CurveConfig * getConfig() const
virtual bool unsubscribe(const QString &topic, QObject *receiver, const char *method=0)=0
void setBroker(MessageBroker *broker)
QLinkedList< TimeValue > TimeValueList
CurveDataSequencer(QObject *parent=0)
const ros::Time & getReceiptTime() const