From bfa1a4c7bead5cb05337b719e046e030c07b0ee0 Mon Sep 17 00:00:00 2001 From: rex-schilasky <49162693+rex-schilasky@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:43:13 +0100 Subject: [PATCH] capnproto and raw_data monitoring plugins updated/fixed --- .../capnproto_reflection/src/plugin_widget.cpp | 8 ++++---- .../raw_data_reflection/src/plugin_widget.cpp | 12 ++++++------ .../raw_data_reflection/src/plugin_widget.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/mon/mon_plugins/capnproto_reflection/src/plugin_widget.cpp b/app/mon/mon_plugins/capnproto_reflection/src/plugin_widget.cpp index 77dd0f0124..73cb8ccac3 100644 --- a/app/mon/mon_plugins/capnproto_reflection/src/plugin_widget.cpp +++ b/app/mon/mon_plugins/capnproto_reflection/src/plugin_widget.cpp @@ -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. @@ -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() diff --git a/app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.cpp b/app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.cpp index 31c3d1afb3..0d86abbf38 100644 --- a/app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.cpp +++ b/app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.cpp @@ -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. @@ -59,7 +59,7 @@ 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() @@ -67,12 +67,12 @@ PluginWidget::~PluginWidget() subscriber_.RemReceiveCallback(); } -void PluginWidget::ecalMessageReceivedCallback(const struct eCAL::SReceiveCallbackData* callback_data) +void PluginWidget::ecalMessageReceivedCallback(const eCAL::SReceiveCallbackData& callback_data) { std::lock_guard message_lock(message_mutex_); - last_message_ = QByteArray(static_cast(callback_data->buf), callback_data->size); + last_message_ = QByteArray(static_cast(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; @@ -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() diff --git a/app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.h b/app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.h index d2491849d4..72bd872525 100644 --- a/app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.h +++ b/app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.h @@ -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. @@ -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');