Skip to content

Commit

Permalink
capnproto and raw_data monitoring plugins updated/fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed Dec 4, 2024
1 parent c5929d9 commit bfa1a4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -322,14 +322,14 @@ void PluginWidget::onUpdate()
void PluginWidget::onResume()
{
// Add eCAL Callbacks
subscriber_.AddReceiveCallback(std::bind(&PluginWidget::onProtoMessageCallback, this, std::placeholders::_2, std::placeholders::_3));
//subscriber_.AddErrorCallback(std::bind(&PluginWidget::onProtoErrorCallback, this, std::placeholders::_1));
subscriber_.AddReceiveCallback(std::bind(&PluginWidget::onProtoMessageCallback, this, std::placeholders::_3, std::placeholders::_4));
subscriber_.AddErrorCallback(std::bind(&PluginWidget::onProtoErrorCallback, this, std::placeholders::_1));
}

void PluginWidget::onPause()
{
subscriber_.RemReceiveCallback();
//subscriber_.RemErrorCallback();
subscriber_.RemErrorCallback();
}

QWidget* PluginWidget::getWidget()
Expand Down
12 changes: 6 additions & 6 deletions app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -59,20 +59,20 @@ PluginWidget::PluginWidget(const QString& topic_name, const QString&, QWidget* p
ui_.content_layout->addWidget(frame);

// Connect the eCAL Subscriber
subscriber_.AddReceiveCallback(std::bind(&PluginWidget::ecalMessageReceivedCallback, this, std::placeholders::_2));
subscriber_.AddReceiveCallback(std::bind(&PluginWidget::ecalMessageReceivedCallback, this, std::placeholders::_3));
}

PluginWidget::~PluginWidget()
{
subscriber_.RemReceiveCallback();
}

void PluginWidget::ecalMessageReceivedCallback(const struct eCAL::SReceiveCallbackData* callback_data)
void PluginWidget::ecalMessageReceivedCallback(const eCAL::SReceiveCallbackData& callback_data)
{
std::lock_guard<std::mutex> message_lock(message_mutex_);
last_message_ = QByteArray(static_cast<char*>(callback_data->buf), callback_data->size);
last_message_ = QByteArray(static_cast<char*>(callback_data.buf), callback_data.size);

last_message_publish_timestamp_ = eCAL::Time::ecal_clock::time_point(std::chrono::microseconds(callback_data->time));
last_message_publish_timestamp_ = eCAL::Time::ecal_clock::time_point(std::chrono::microseconds(callback_data.time));

received_message_counter_++;
new_msg_available_ = true;
Expand Down Expand Up @@ -128,7 +128,7 @@ void PluginWidget::onUpdate()

void PluginWidget::onResume()
{
subscriber_.AddReceiveCallback(std::bind(&PluginWidget::ecalMessageReceivedCallback, this, std::placeholders::_2));
subscriber_.AddReceiveCallback(std::bind(&PluginWidget::ecalMessageReceivedCallback, this, std::placeholders::_3));
}

void PluginWidget::onPause()
Expand Down
4 changes: 2 additions & 2 deletions app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,7 +63,7 @@ private slots:
bool new_msg_available_;
int received_message_counter_;

void ecalMessageReceivedCallback(const struct eCAL::SReceiveCallbackData* callback_data);
void ecalMessageReceivedCallback(const eCAL::SReceiveCallbackData& callback_data);

#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
static QString bytesToHex(const QByteArray& byte_array, char separator = '\0');
Expand Down

0 comments on commit bfa1a4c

Please sign in to comment.