Skip to content

Commit

Permalink
Merge branch 'master' into feature/redesign-client-api
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky authored Dec 6, 2024
2 parents a41504d + a0ffc5a commit 83a4645
Show file tree
Hide file tree
Showing 311 changed files with 4,647 additions and 3,955 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,17 @@ jobs:
# run: ctest -V
# working-directory: ${{ runner.workspace }}/_build

- name: Pack
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
timeout_minutes: 3
command: cd ${{ runner.workspace }}/_build && cpack -G DragNDrop
# Currently (2024-11-28) packing very often fails under macos
# - name: Pack
# uses: nick-fields/retry@v2
# with:
# max_attempts: 3
# retry_on: error
# timeout_minutes: 3
# command: cd ${{ runner.workspace }}/_build && cpack -G DragNDrop

- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: macos-dmg
path: ${{ runner.workspace }}/_build/_deploy/*.dmg
# - name: Upload DMG
# uses: actions/upload-artifact@v4
# with:
# name: macos-dmg
# path: ${{ runner.workspace }}/_build/_deploy/*.dmg
1 change: 0 additions & 1 deletion .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
git submodule deinit thirdparty/hdf5/hdf5
git submodule deinit thirdparty/libssh2/libssh2
git submodule deinit thirdparty/protobuf/protobuf
git submodule deinit thirdparty/zlib/zlib
git submodule update
- name: Create venv for building docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy-review-post-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: ZedThree/clang-tidy-review/post@v0.14.0
- uses: ZedThree/clang-tidy-review/post@v0.20.1
# lgtm_comment_body, max_comments, and annotations need to be set on the posting workflow in a split setup
with:
# adjust options as necessary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0

- name: Run clang-tidy
uses: ZedThree/clang-tidy-review@v0.14.0
uses: ZedThree/clang-tidy-review@v0.20.1
id: review
with:
build_dir: _build
Expand Down Expand Up @@ -75,4 +75,4 @@ jobs:
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu
cmake --build _build
- uses: ZedThree/clang-tidy-review/upload@v0.14.0
- uses: ZedThree/clang-tidy-review/upload@v0.20.1
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
[submodule "thirdparty/curl"]
path = thirdparty/curl/curl
url = https://github.com/curl/curl.git
[submodule "thirdparty/zlib"]
path = thirdparty/zlib/zlib
url = https://github.com/madler/zlib.git
[submodule "thirdparty/libssh2"]
path = thirdparty/libssh2/libssh2
url = https://github.com/libssh2/libssh2.git
Expand Down
2 changes: 1 addition & 1 deletion app/meas_cutter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ target_include_directories(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME} yaml-cpp::yaml-cpp
tclap::tclap
eCAL::ecal-utils
eCAL::measurement_hdf5
eCAL::hdf5
Threads::Threads)

target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
Expand Down
4 changes: 2 additions & 2 deletions app/meas_cutter/src/config_file_parser.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 All @@ -21,7 +21,7 @@
#include <iostream>
#include <ecal_utils/filesystem.h>

#define YAML_CPP_STATIC_DEFINE
//#define YAML_CPP_STATIC_DEFINE // set by CMake
#include <yaml-cpp/yaml.h>

#include "utils.h"
Expand Down
11 changes: 5 additions & 6 deletions app/meas_cutter/src/measurement_exporter.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 All @@ -18,18 +18,17 @@
*/

#include "measurement_exporter.h"
#include <ecal/measurement/hdf5/writer.h>

MeasurementExporter::MeasurementExporter():
_writer(std::make_unique<eCAL::experimental::measurement::hdf5::Writer>())
_writer(std::make_unique<eCAL::eh5::v2::HDF5Meas>())
{
}

void MeasurementExporter::setPath(const std::string& path, const std::string& base_name, const size_t& max_size_per_file)
{
_root_output_path = EcalUtils::Filesystem::CleanPath(path);
_output_path = EcalUtils::Filesystem::CleanPath(_root_output_path + EcalUtils::Filesystem::NativeSeparator(EcalUtils::Filesystem::OsStyle::Current) + eCALMeasCutterUtils::kDefaultFolderOutput, EcalUtils::Filesystem::OsStyle::Current);
if (!_writer->Open(_output_path))
if (!_writer->Open(_output_path, eCAL::eh5::v2::eAccessType::CREATE))
{
throw ExporterException("Unable to create HDF5 protobuf output path " + path + ".");
}
Expand Down Expand Up @@ -76,10 +75,10 @@ void MeasurementExporter::setData(eCALMeasCutterUtils::Timestamp timestamp, cons
const auto sender_timestamp = (iter != meta_data.end()) ? iter->second.sender_timestamp : static_cast<eCALMeasCutterUtils::Timestamp>(0);

iter = meta_data.find(eCALMeasCutterUtils::MetaDatumKey::SENDER_ID);
const auto sender_id = (iter != meta_data.end()) ? iter->second.sender_id : static_cast<uint64_t>(0);
const auto sender_id = (iter != meta_data.end()) ? iter->second.sender_id : 0;

iter = meta_data.find(eCALMeasCutterUtils::MetaDatumKey::SENDER_CLOCK);
const auto sender_clock = (iter != meta_data.end()) ? iter->second.sender_clock : static_cast<uint64_t>(0);
const auto sender_clock = (iter != meta_data.end()) ? iter->second.sender_clock : 0;

if (!_writer->AddEntryToFile(payload.data(), payload.size(), sender_timestamp, timestamp, _current_channel_name, sender_id, sender_clock))
{
Expand Down
11 changes: 7 additions & 4 deletions app/meas_cutter/src/measurement_exporter.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 All @@ -18,11 +18,14 @@
*/

#pragma once

#include <iostream>
#include <unordered_map>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>

#include <ecal/measurement/base/writer.h>
#include <ecalhdf5/eh5_meas.h>
#include <ecal_utils/filesystem.h>
#include "utils.h"

Expand All @@ -43,7 +46,7 @@ class MeasurementExporter
std::string getRootOutputPath() const;

private:
std::unique_ptr<eCAL::experimental::measurement::base::Writer> _writer;
std::unique_ptr<eCAL::eh5::v2::HDF5Meas> _writer;
std::string _current_channel_name;
std::string _output_path;
std::string _root_output_path;
Expand Down
6 changes: 3 additions & 3 deletions app/meas_cutter/src/measurement_importer.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 All @@ -18,10 +18,10 @@
*/

#include "measurement_importer.h"
#include <ecal/measurement/hdf5/reader.h>
#include <ecalhdf5/eh5_meas.h>

MeasurementImporter::MeasurementImporter() :
_reader(std::make_unique<eCAL::experimental::measurement::hdf5::Reader>()),
_reader(std::make_unique<eCAL::eh5::v2::HDF5Meas>()),
_current_opened_channel_data()
{
}
Expand Down
14 changes: 8 additions & 6 deletions app/meas_cutter/src/measurement_importer.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 All @@ -18,14 +18,16 @@
*/

#pragma once
#include <iostream>
#include <algorithm>
#include <regex>
#include <cctype>
#include <array>
#include <iostream>
#include <memory>
#include <list>
#include <regex>
#include <utility>

#include <ecal_utils/filesystem.h>
#include <ecal/measurement/base/reader.h>
#include <ecalhdf5/eh5_meas.h>

#include "utils.h"

Expand Down Expand Up @@ -53,7 +55,7 @@ class MeasurementImporter
private:
bool isEcalMeasFile(const std::string& path);
bool isProtoChannel(const eCAL::experimental::measurement::base::DataTypeInformation& channel_info);
std::unique_ptr<eCAL::experimental::measurement::base::Reader> _reader;
std::unique_ptr<eCAL::eh5::v2::HDF5Meas> _reader;
eCALMeasCutterUtils::ChannelData _current_opened_channel_data;
std::string _loaded_path;
eCALMeasCutterUtils::ChannelNameSet _channel_names;
Expand Down
10 changes: 5 additions & 5 deletions app/meas_cutter/src/utils.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 All @@ -26,7 +26,7 @@
#include <fstream>
#include <algorithm>

#define YAML_CPP_STATIC_DEFINE
//#define YAML_CPP_STATIC_DEFINE // set by CMake
#include "yaml-cpp/yaml.h"

#include <ecal_utils/str_convert.h>
Expand Down Expand Up @@ -312,10 +312,10 @@ namespace eCALMeasCutterUtils
{
Timestamp receiver_timestamp;
Timestamp sender_timestamp;
uint64_t sender_id;
uint64_t sender_clock;
int64_t sender_id;
int64_t sender_clock;

std::array<char,64> __union_size;
std::array<char,64> __union_size;
};

typedef std::unordered_map<MetaDatumKey, MetaDatumValue, MetaDatumHash> MetaData;
Expand Down
11 changes: 1 addition & 10 deletions app/mon/mon_cli/src/ecal_mon_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int main(int argc, char** argv)
}

// initialize eCAL API
eCAL::Initialize(0, nullptr, "eCALMon CLI", eCAL::Init::All);
eCAL::Initialize("eCALMon CLI", eCAL::Init::All);

// set process state
eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running");
Expand Down Expand Up @@ -351,15 +351,6 @@ void ProcProto(const std::string& topic_name, int msg_count)
// sleep 1000 ms
std::this_thread::sleep_for(std::chrono::milliseconds(1000));

// get topic type
eCAL::SDataTypeInformation topic_info;
eCAL::Registration::GetTopicDataTypeInformation(topic_name, topic_info);
if(topic_info.name.empty())
{
std::cout << "could not get type name for topic " << topic_name << std::endl;
return;
}

// create dynamic subscribers for receiving and decoding messages and assign callback
eCAL::protobuf::CDynamicSubscriber sub(topic_name);
std::atomic<int> cnt(msg_count);
Expand Down
2 changes: 1 addition & 1 deletion app/mon/mon_gui/src/ecalmon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Ecalmon::Ecalmon(QWidget *parent)
, monitor_error_counter_(0)
{
// Just make sure that eCAL is initialized
eCAL::Initialize(0, nullptr, "eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring);
eCAL::Initialize("eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring);
eCAL::Monitoring::SetFilterState(false);
eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running");

Expand Down
2 changes: 1 addition & 1 deletion app/mon/mon_gui/src/widgets/about_dialog/about_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ AboutDialog::AboutDialog(QWidget *parent)
ui_.version_label->setText("Version: " + QString(EcalmonGlobals::VERSION_STRING));
ui_.ecalversion_label->setText("eCAL " + QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")");

ui_.ecal_runtime_version_string_label->setText(QString(eCAL::GetVersionString()) + " (" + QString(eCAL::GetVersionDateString()) + ")");
ui_.ecal_runtime_version_string_label->setText(QString::fromStdString(eCAL::GetVersionString()) + " (" + QString::fromStdString(eCAL::GetVersionDateString()) + ")");
ui_.ecal_compiletime_versin_string_label->setText(QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")");
ui_.qt_runtime_version_string_label->setText(QString(qVersion()));
ui_.qt_compiletime_version_string_label->setText(QString(QT_VERSION_STR));
Expand Down
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,7 +59,7 @@ PluginWidget::PluginWidget(const QString& topic_name, const QString& topic_type,

// 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_.AddErrorCallback(std::bind(&PluginWidget::onProtoErrorCallback, this, std::placeholders::_1));

// Button connections
connect(ui_.expand_button, &QPushButton::clicked, [this]() { tree_view_->expandAll(); });
Expand Down Expand Up @@ -323,13 +323,13 @@ 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_.AddErrorCallback(std::bind(&PluginWidget::onProtoErrorCallback, this, std::placeholders::_1));
}

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

QWidget* PluginWidget::getWidget()
Expand Down
23 changes: 17 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,25 @@ 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([this](const eCAL::Registration::STopicId& /*topic_id*/,
const eCAL::SDataTypeInformation& /*data_type_info*/,
const eCAL::SReceiveCallbackData& callback_data)
{
ecalMessageReceivedCallback(callback_data);
});
}

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 +133,13 @@ void PluginWidget::onUpdate()

void PluginWidget::onResume()
{
subscriber_.AddReceiveCallback(std::bind(&PluginWidget::ecalMessageReceivedCallback, this, std::placeholders::_2));
// (Re)Connect the eCAL Subscriber
subscriber_.AddReceiveCallback([this](const eCAL::Registration::STopicId& /*topic_id*/,
const eCAL::SDataTypeInformation& /*data_type_info*/,
const eCAL::SReceiveCallbackData& callback_data)
{
ecalMessageReceivedCallback(callback_data);
});
}

void PluginWidget::onPause()
Expand Down
Loading

0 comments on commit 83a4645

Please sign in to comment.