diff --git a/app/play/play_core/include/ecal_play.h b/app/play/play_core/include/ecal_play.h index ad07a767e2..95e8823b9d 100644 --- a/app/play/play_core/include/ecal_play.h +++ b/app/play/play_core/include/ecal_play.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. @@ -298,6 +298,15 @@ class EcalPlay **/ std::string GetChannelType(const std::string& channel_name) const; + /** + * @brief Gets the encoding of the given channel + * + * @param channel_name channel name + * + * @return channel type +**/ + std::string GetChannelEncoding(const std::string& channel_name) const; + void CalculateEstimatedSizeForChannels() const; /** diff --git a/app/play/play_core/src/ecal_play.cpp b/app/play/play_core/src/ecal_play.cpp index 9bda0456c8..7a11b9c819 100644 --- a/app/play/play_core/src/ecal_play.cpp +++ b/app/play/play_core/src/ecal_play.cpp @@ -224,6 +224,11 @@ std::string EcalPlay::GetChannelType(const std::string& channel_name) const return play_thread_->GetChannelType(channel_name); } +std::string EcalPlay::GetChannelEncoding(const std::string& channel_name) const +{ + return play_thread_->GetChannelEncoding(channel_name); +} + void EcalPlay::CalculateEstimatedSizeForChannels() const { play_thread_->CalculateEstimatedSizeForChannels(); diff --git a/app/play/play_core/src/measurement_container.cpp b/app/play/play_core/src/measurement_container.cpp index 71df78431a..4909d5cef9 100644 --- a/app/play/play_core/src/measurement_container.cpp +++ b/app/play/play_core/src/measurement_container.cpp @@ -311,9 +311,12 @@ double MeasurementContainer::GetMaxTimestampOfChannel(const std::string& channel std::string MeasurementContainer::GetChannelType(const std::string& channel_name) const { - // This function needs to also return the proper datatypes information! To clean up. - auto datatype_information = hdf5_meas_->GetChannelDataTypeInformation(channel_name); - return eCAL::Util::CombinedTopicEncodingAndType(datatype_information.encoding, datatype_information.name); + return hdf5_meas_->GetChannelDataTypeInformation(channel_name).name; +} + +std::string MeasurementContainer::GetChannelEncoding(const std::string& channel_name) const +{ + return hdf5_meas_->GetChannelDataTypeInformation(channel_name).encoding; } size_t MeasurementContainer::GetChannelCumulativeEstimatedSize(const std::string& channel_name) const diff --git a/app/play/play_core/src/measurement_container.h b/app/play/play_core/src/measurement_container.h index abc07936f1..1925da8ce8 100644 --- a/app/play/play_core/src/measurement_container.h +++ b/app/play/play_core/src/measurement_container.h @@ -60,6 +60,7 @@ class MeasurementContainer double GetMinTimestampOfChannel(const std::string& channel_name) const; double GetMaxTimestampOfChannel(const std::string& channel_name) const; std::string GetChannelType(const std::string& channel_name) const; + std::string GetChannelEncoding(const std::string& channel_name) const; size_t GetChannelCumulativeEstimatedSize(const std::string& channel_name) const; std::map GetChannelMapping() const; diff --git a/app/play/play_core/src/play_thread.cpp b/app/play/play_core/src/play_thread.cpp index e4a00b0127..6e4de55d9a 100644 --- a/app/play/play_core/src/play_thread.cpp +++ b/app/play/play_core/src/play_thread.cpp @@ -763,6 +763,19 @@ std::string PlayThread::GetChannelType(const std::string& channel_name) } } +std::string PlayThread::GetChannelEncoding(const std::string& channel_name) +{ + std::shared_lock measurement_lock(measurement_mutex_); + if (measurement_container_) + { + return measurement_container_->GetChannelEncoding(channel_name); + } + else + { + return std::string(""); + } +} + void PlayThread::CalculateEstimatedSizeForChannels() { std::shared_lock measurement_lock(measurement_mutex_); diff --git a/app/play/play_core/src/play_thread.h b/app/play/play_core/src/play_thread.h index f789421270..23c2d34342 100644 --- a/app/play/play_core/src/play_thread.h +++ b/app/play/play_core/src/play_thread.h @@ -157,6 +157,15 @@ class PlayThread : public InterruptibleThread **/ std::string GetChannelType(const std::string& channel_name); + /** + * @brief Gets the data type of the given channel + * + * @param channel_name channel name + * + * @return channel type + **/ + std::string GetChannelEncoding(const std::string& channel_name); + void CalculateEstimatedSizeForChannels(); /** diff --git a/app/play/play_gui/src/q_ecal_play.cpp b/app/play/play_gui/src/q_ecal_play.cpp index b9c87383a5..7cf7084a94 100644 --- a/app/play/play_gui/src/q_ecal_play.cpp +++ b/app/play/play_gui/src/q_ecal_play.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. @@ -128,6 +128,11 @@ std::string QEcalPlay::channelType(const std::string& channel_name) const return ecal_play_.GetChannelType(channel_name); } +std::string QEcalPlay::channelEncoding(const std::string& channel_name) const +{ + return ecal_play_.GetChannelEncoding(channel_name); +} + size_t QEcalPlay::channelCumulativeEstimatedSize(const std::string& channel_name) const { return ecal_play_.GetChannelCumulativeEstimatedSize(channel_name); diff --git a/app/play/play_gui/src/q_ecal_play.h b/app/play/play_gui/src/q_ecal_play.h index a47210984e..c078ff7913 100644 --- a/app/play/play_gui/src/q_ecal_play.h +++ b/app/play/play_gui/src/q_ecal_play.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. @@ -59,6 +59,7 @@ class QEcalPlay : public QObject double minTimestampOfChannel(const std::string& channel_name) const; double maxTimestampOfChannel(const std::string& channel_name) const; std::string channelType(const std::string& channel_name) const; + std::string channelEncoding(const std::string& channel_name) const; size_t channelCumulativeEstimatedSize(const std::string& channel_name) const; std::map createContinuityReport() const; std::map messageCounters() const; diff --git a/app/play/play_gui/src/widgets/channel_widget/channel_widget.cpp b/app/play/play_gui/src/widgets/channel_widget/channel_widget.cpp index c7564a8262..33ea84048b 100644 --- a/app/play/play_gui/src/widgets/channel_widget/channel_widget.cpp +++ b/app/play/play_gui/src/widgets/channel_widget/channel_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. @@ -600,7 +600,7 @@ void ChannelWidget::setInitButtonToDeInit() void ChannelWidget::autoSizeColumns() { - ChannelTreeItem* dummy_item = new ChannelTreeItem("CameraSensorMapFusionCAF___", "Dummy_type", 99999999, 99999999.0, 99999999.0, 99999999, 99999999, 99999999); + ChannelTreeItem* dummy_item = new ChannelTreeItem("CameraSensorMapFusionCAF___", "proto", "Dummy_type", 99999999, 99999999.0, 99999999.0, 99999999, 99999999, 99999999); channel_model_->insertItem(dummy_item); for (int i = 0; i < channel_model_->columnCount(); i++) diff --git a/app/play/play_gui/src/widgets/models/channel_tree_item.cpp b/app/play/play_gui/src/widgets/models/channel_tree_item.cpp index 04bc8aa871..9dd3acfed0 100644 --- a/app/play/play_gui/src/widgets/models/channel_tree_item.cpp +++ b/app/play/play_gui/src/widgets/models/channel_tree_item.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. @@ -40,12 +40,13 @@ ChannelTreeItem::ChannelTreeItem(const QString& source_name) , duration_(0) {} -ChannelTreeItem::ChannelTreeItem(const QString& source_name, const QString& channel_type, size_t total_channel_size, +ChannelTreeItem::ChannelTreeItem(const QString& source_name, const QString& channel_encoding, const QString& channel_type, size_t total_channel_size, double min_channel_timestamp, double max_channel_timestamp, long long expected_frames, long long existing_frames, double duration) : QAbstractTreeItem() , enabled_(true) , source_name_(source_name) , target_name_(source_name) + , channel_encoding_(channel_encoding) , channel_type_(channel_type) , total_channel_size_(total_channel_size) , min_channel_timestamp_(min_channel_timestamp) @@ -76,6 +77,8 @@ QVariant ChannelTreeItem::data(Columns column, Qt::ItemDataRole role) const return source_name_; case ChannelTreeItem::Columns::TARGET_CHANNEL_NAME: return target_name_; + case ChannelTreeItem::Columns::CHANNEL_ENCODING: + return channel_encoding_; case ChannelTreeItem::Columns::CHANNEL_TYPE: return channel_type_; case ChannelTreeItem::Columns::TOTAL_CHANNEL_SIZE: diff --git a/app/play/play_gui/src/widgets/models/channel_tree_item.h b/app/play/play_gui/src/widgets/models/channel_tree_item.h index eb143bf37f..95d987444f 100644 --- a/app/play/play_gui/src/widgets/models/channel_tree_item.h +++ b/app/play/play_gui/src/widgets/models/channel_tree_item.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. @@ -32,6 +32,7 @@ class ChannelTreeItem : public QAbstractTreeItem SOURCE_CHANNEL_NAME, TARGET_CHANNEL_NAME, + CHANNEL_ENCODING, CHANNEL_TYPE, TOTAL_CHANNEL_SIZE, @@ -47,7 +48,7 @@ class ChannelTreeItem : public QAbstractTreeItem }; ChannelTreeItem(const QString& source_name); - ChannelTreeItem(const QString& source_name, const QString& channel_type, size_t total_channel_size, + ChannelTreeItem(const QString& source_name, const QString& channel_encoding, const QString& channel_type, size_t total_channel_size, double min_channel_timestamp, double max_channel_timestamp, long long expected_frames, long long existing_frames, double duration); ~ChannelTreeItem(); @@ -76,6 +77,7 @@ class ChannelTreeItem : public QAbstractTreeItem QString source_name_; QString target_name_; + QString channel_encoding_; QString channel_type_; size_t total_channel_size_; diff --git a/app/play/play_gui/src/widgets/models/channel_tree_model.cpp b/app/play/play_gui/src/widgets/models/channel_tree_model.cpp index 0be7a1cee7..42f8c1fc88 100644 --- a/app/play/play_gui/src/widgets/models/channel_tree_model.cpp +++ b/app/play/play_gui/src/widgets/models/channel_tree_model.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. @@ -237,9 +237,10 @@ void ChannelTreeModel::reload() double minTimestamp = QEcalPlay::instance()->minTimestampOfChannel(name); double maxTimestamp = QEcalPlay::instance()->maxTimestampOfChannel(name); std::string channel_type = QEcalPlay::instance()->channelType(name); + std::string channel_encoding = QEcalPlay::instance()->channelEncoding(name); size_t total_channel_size = QEcalPlay::instance()->channelCumulativeEstimatedSize(name); - ChannelTreeItem* channel_item = new ChannelTreeItem(name.c_str(), channel_type.c_str(), total_channel_size, + ChannelTreeItem* channel_item = new ChannelTreeItem(name.c_str(), channel_encoding.c_str(), channel_type.c_str(), total_channel_size, minTimestamp, maxTimestamp, expected_frames, existing_frames, duration); new_channel_list.push_back(channel_item); } diff --git a/app/play/play_gui/src/widgets/models/channel_tree_model.h b/app/play/play_gui/src/widgets/models/channel_tree_model.h index 12a62c5df4..abb06b6277 100644 --- a/app/play/play_gui/src/widgets/models/channel_tree_model.h +++ b/app/play/play_gui/src/widgets/models/channel_tree_model.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. @@ -33,6 +33,7 @@ class ChannelTreeModel : public QAbstractTreeModel { ENABLED, CHANNEL_NAME, + CHANNEL_ENCODING, CHANNEL_TYPE, TOTAL_CHANNEL_SIZE, @@ -82,6 +83,7 @@ class ChannelTreeModel : public QAbstractTreeModel { { Columns::ENABLED, ""} , { Columns::CHANNEL_NAME, "Channel" } , + { Columns::CHANNEL_ENCODING, "Channel encoding"}, { Columns::CHANNEL_TYPE, "Channel type"}, { Columns::MESSAGE_COUNTER, "Published messages" } , { Columns::TOTAL_CHANNEL_SIZE, "Total estimated channel size" } , @@ -98,6 +100,7 @@ class ChannelTreeModel : public QAbstractTreeModel { { Columns::ENABLED, (int)ChannelTreeItem::Columns::ENABLED }, { Columns::CHANNEL_NAME, (int)ChannelTreeItem::Columns::SOURCE_CHANNEL_NAME }, + { Columns::CHANNEL_ENCODING, (int)ChannelTreeItem::Columns::CHANNEL_ENCODING}, { Columns::CHANNEL_TYPE, (int)ChannelTreeItem::Columns::CHANNEL_TYPE}, { Columns::TOTAL_CHANNEL_SIZE, (int)ChannelTreeItem::Columns::TOTAL_CHANNEL_SIZE}, { Columns::MESSAGE_COUNTER, -1 },