Skip to content

Commit

Permalink
[core] Introduce config_file_path as new field in monitoring. (#1909)
Browse files Browse the repository at this point in the history
[mon_gui] Display value in eCALMonGUI (hidden per default)
Nanpb generator changed to 0.4.9.1
  • Loading branch information
KerstinKeller authored Jan 17, 2025
1 parent 6eb2418 commit 1e2e345
Show file tree
Hide file tree
Showing 35 changed files with 65 additions and 33 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 - 2025 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 @@ -138,6 +138,7 @@ void ProcessWidget::autoSizeColumns()
(int)ProcessTreeModel::Columns::TIMESYNC_MOD_NAME,
(int)ProcessTreeModel::Columns::COMPONENT_INIT_INFO,
(int)ProcessTreeModel::Columns::ECAL_RUNTIME_VERSION,
(int)ProcessTreeModel::Columns::CONFIG_FILE_PATH,
};

for (int column : columns_to_resize)
Expand Down
6 changes: 5 additions & 1 deletion app/mon/mon_gui/src/widgets/models/process_tree_item.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 - 2025 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 @@ -105,6 +105,10 @@ QVariant ProcessTreeItem::data(Columns column, Qt::ItemDataRole role) const
{
return process_.ecal_runtime_version().c_str();
}
else if (column == Columns::CONFIG_FILE_PATH)
{
return process_.config_file_path().c_str();
}
else
{
return QVariant();
Expand Down
5 changes: 3 additions & 2 deletions app/mon/mon_gui/src/widgets/models/process_tree_item.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 - 2025 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 @@ -49,7 +49,8 @@ class ProcessTreeItem :
TSYNC_STATE,
TSYNC_MOD_NAME,
COMPONENT_INIT_INFO,
ECAL_RUNTIME_VERSION
ECAL_RUNTIME_VERSION,
CONFIG_FILE_PATH
};

ProcessTreeItem();
Expand Down
5 changes: 4 additions & 1 deletion app/mon/mon_gui/src/widgets/models/process_tree_model.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 - 2025 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,6 +59,7 @@ class ProcessTreeModel : public GroupTreeModel
TIMESYNC_MOD_NAME,
COMPONENT_INIT_INFO,
ECAL_RUNTIME_VERSION,
CONFIG_FILE_PATH,

COLUMN_COUNT
};
Expand Down Expand Up @@ -95,6 +96,7 @@ class ProcessTreeModel : public GroupTreeModel
{ Columns::TIMESYNC_MOD_NAME, "Timesync Mod Name" },
{ Columns::COMPONENT_INIT_INFO, "Component Initialization" },
{ Columns::ECAL_RUNTIME_VERSION, "eCAL Runtime Version" },
{ Columns::CONFIG_FILE_PATH, "Loaded configuration file" },
};

std::map<Columns, int> column_mapping =
Expand All @@ -113,6 +115,7 @@ class ProcessTreeModel : public GroupTreeModel
{ Columns::TIMESYNC_MOD_NAME, (int)ProcessTreeItem::Columns::TSYNC_MOD_NAME },
{ Columns::COMPONENT_INIT_INFO, (int)ProcessTreeItem::Columns::COMPONENT_INIT_INFO },
{ Columns::ECAL_RUNTIME_VERSION, (int)ProcessTreeItem::Columns::ECAL_RUNTIME_VERSION },
{ Columns::CONFIG_FILE_PATH, (int)ProcessTreeItem::Columns::CONFIG_FILE_PATH },
};

std::map<std::string, ProcessTreeItem*> tree_item_map_;
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/include/ecal/config/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ namespace eCAL
ECAL_API std::string GetYamlFilePath() const;

protected:
std::string ecal_yaml_file_path;
std::string ecal_yaml_file_path = "abc";
};
}
1 change: 1 addition & 0 deletions ecal/core/include/ecal/types/monitoring.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ namespace eCAL
std::string component_init_info; //!< like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc)

std::string ecal_runtime_version; //!< loaded / runtime eCAL version of a component
std::string config_file_path; //!< Filepath of the configuration filepath that was loaded
};

struct SMethodMon //<! eCAL Server Method struct
Expand Down
2 changes: 2 additions & 0 deletions ecal/core/src/monitoring/ecal_monitoring_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ namespace eCAL
const int component_init_state = sample_process.component_init_state;
const std::string& component_init_info = sample_process.component_init_info;
const std::string& ecal_runtime_version = sample_process.ecal_runtime_version;
const std::string& config_file_path = sample_process.config_file_path;

// create map key
const auto& process_map_key = sample_.identifier.entity_id;
Expand Down Expand Up @@ -314,6 +315,7 @@ namespace eCAL
ProcessInfo.component_init_state = component_init_state;
ProcessInfo.component_init_info = component_init_info;
ProcessInfo.ecal_runtime_version = ecal_runtime_version;
ProcessInfo.config_file_path = config_file_path;

return(true);
}
Expand Down
1 change: 1 addition & 0 deletions ecal/core/src/registration/ecal_process_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ eCAL::Registration::Sample eCAL::Registration::GetProcessRegisterSample()
process_sample_process.component_init_info = component_info;

process_sample_process.ecal_runtime_version = eCAL::GetVersionString();
process_sample_process.config_file_path = eCAL::GetConfiguration().GetYamlFilePath();

return process_sample;
}
Expand Down
4 changes: 4 additions & 0 deletions ecal/core/src/serialization/ecal_serialize_monitoring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ namespace
eCAL::nanopb::encode_string(pb_process_.component_init_info, process_.component_init_info);
// ecal_runtime_version
eCAL::nanopb::encode_string(pb_process_.ecal_runtime_version, process_.ecal_runtime_version);
// config_file_path
eCAL::nanopb::encode_string(pb_process_.config_file_path, process_.config_file_path);
}

bool encode_mon_message_processes_field(pb_ostream_t* stream, const pb_field_iter_t* field, void* const* arg)
Expand Down Expand Up @@ -512,6 +514,8 @@ namespace
eCAL::nanopb::decode_string(pb_process_.component_init_info, process_.component_init_info);
// ecal_runtime_version
eCAL::nanopb::decode_string(pb_process_.ecal_runtime_version, process_.ecal_runtime_version);
// ecal_config_path
eCAL::nanopb::decode_string(pb_process_.config_file_path, process_.config_file_path);
}

void AssignValues(const eCAL_pb_Process& pb_process_, eCAL::Monitoring::SProcessMon& process_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ namespace
eCAL::nanopb::encode_string(pb_process_.component_init_info, registration_process_.component_init_info);
// ecal_runtime_version
eCAL::nanopb::encode_string(pb_process_.ecal_runtime_version, registration_process_.ecal_runtime_version);
// configuration path
eCAL::nanopb::encode_string(pb_process_.config_file_path, registration_process_.config_file_path);
}

///////////////////////////////////////////////
Expand Down Expand Up @@ -330,6 +332,8 @@ namespace
eCAL::nanopb::decode_string(pb_sample_.process.component_init_info, registration_.process.component_init_info);
// ecal_runtime_version
eCAL::nanopb::decode_string(pb_sample_.process.ecal_runtime_version, registration_.process.ecal_runtime_version);
// config_file_path
eCAL::nanopb::decode_string(pb_sample_.process.config_file_path, registration_.process.config_file_path);

///////////////////////////////////////////////
// service information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ namespace eCAL
int32_t component_init_state = 0; // eCAL component initialization state (eCAL::Initialize(..))
std::string component_init_info; // like comp_init_state as a human-readable string (pub|sub|srv|mon|log|time|proc)
std::string ecal_runtime_version; // loaded/runtime eCAL version of a component
std::string config_file_path; // Path from where the eCAL configuration for this process was loadedloaded/runtime eCAL version of a component

bool operator==(const Process& other) const {
return rclock == other.rclock &&
Expand All @@ -234,7 +235,8 @@ namespace eCAL
tsync_mod_name == other.tsync_mod_name &&
component_init_state == other.component_init_state &&
component_init_info == other.component_init_info &&
ecal_runtime_version == other.ecal_runtime_version;
ecal_runtime_version == other.ecal_runtime_version &&
config_file_path == other.config_file_path;
}

void clear()
Expand All @@ -250,6 +252,7 @@ namespace eCAL
component_init_state = 0;
component_init_info.clear();
ecal_runtime_version.clear();
config_file_path.clear();
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "datatype.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_DATATYPE_NPB_H_INCLUDED
#define PB_ECAL_PB_DATATYPE_NPB_H_INCLUDED
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "ecal.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_ECAL_NPB_H_INCLUDED
#define PB_ECAL_PB_ECAL_NPB_H_INCLUDED
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "host.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_HOST_NPB_H_INCLUDED
#define PB_ECAL_PB_HOST_NPB_H_INCLUDED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "layer.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_LAYER_NPB_H_INCLUDED
#define PB_ECAL_PB_LAYER_NPB_H_INCLUDED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "logging.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_LOGGING_NPB_H_INCLUDED
#define PB_ECAL_PB_LOGGING_NPB_H_INCLUDED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "monitoring.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_MONITORING_NPB_H_INCLUDED
#define PB_ECAL_PB_MONITORING_NPB_H_INCLUDED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "process.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
11 changes: 7 additions & 4 deletions ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_PROCESS_NPB_H_INCLUDED
#define PB_ECAL_PB_PROCESS_NPB_H_INCLUDED
Expand Down Expand Up @@ -58,6 +58,7 @@ typedef struct _eCAL_pb_Process { /* Reserved fields in enums are not supported
pb_callback_t component_init_info; /* like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc) */
pb_callback_t ecal_runtime_version; /* loaded / runtime eCAL version of a component */
pb_callback_t hgname; /* host group name */
pb_callback_t config_file_path; /* Path from where the eCAL configuration for this process was loaded */
} eCAL_pb_Process;


Expand Down Expand Up @@ -86,9 +87,9 @@ extern "C" {

/* Initializer values for message structs */
#define eCAL_pb_ProcessState_init_default {_eCAL_pb_eProcessSeverity_MIN, {{NULL}, NULL}, _eCAL_pb_eProcessSeverityLevel_MIN}
#define eCAL_pb_Process_init_default {0, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, eCAL_pb_ProcessState_init_default, _eCAL_pb_eTSyncState_MIN, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
#define eCAL_pb_Process_init_default {0, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, eCAL_pb_ProcessState_init_default, _eCAL_pb_eTSyncState_MIN, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
#define eCAL_pb_ProcessState_init_zero {_eCAL_pb_eProcessSeverity_MIN, {{NULL}, NULL}, _eCAL_pb_eProcessSeverityLevel_MIN}
#define eCAL_pb_Process_init_zero {0, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, eCAL_pb_ProcessState_init_zero, _eCAL_pb_eTSyncState_MIN, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
#define eCAL_pb_Process_init_zero {0, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, eCAL_pb_ProcessState_init_zero, _eCAL_pb_eTSyncState_MIN, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}

/* Field tags (for use in manual encoding/decoding) */
#define eCAL_pb_ProcessState_severity_tag 1
Expand All @@ -107,6 +108,7 @@ extern "C" {
#define eCAL_pb_Process_component_init_info_tag 16
#define eCAL_pb_Process_ecal_runtime_version_tag 17
#define eCAL_pb_Process_hgname_tag 18
#define eCAL_pb_Process_config_file_path_tag 19

/* Struct field encoding specification for nanopb */
#define eCAL_pb_ProcessState_FIELDLIST(X, a) \
Expand All @@ -129,7 +131,8 @@ X(a, CALLBACK, SINGULAR, STRING, tsync_mod_name, 14) \
X(a, STATIC, SINGULAR, INT32, component_init_state, 15) \
X(a, CALLBACK, SINGULAR, STRING, component_init_info, 16) \
X(a, CALLBACK, SINGULAR, STRING, ecal_runtime_version, 17) \
X(a, CALLBACK, SINGULAR, STRING, hgname, 18)
X(a, CALLBACK, SINGULAR, STRING, hgname, 18) \
X(a, CALLBACK, SINGULAR, STRING, config_file_path, 19)
#define eCAL_pb_Process_CALLBACK pb_default_field_callback
#define eCAL_pb_Process_DEFAULT NULL
#define eCAL_pb_Process_state_MSGTYPE eCAL_pb_ProcessState
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "service.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_SERVICE_NPB_H_INCLUDED
#define PB_ECAL_PB_SERVICE_NPB_H_INCLUDED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#include "topic.npb.h"
#if PB_PROTO_HEADER_VERSION != 40
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9 */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_ECAL_PB_TOPIC_NPB_H_INCLUDED
#define PB_ECAL_PB_TOPIC_NPB_H_INCLUDED
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/serialization/nanopb/pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

/* Version of the nanopb library. Just in case you want to check it in
* your own program. */
#define NANOPB_VERSION "nanopb-0.4.9"
#define NANOPB_VERSION "nanopb-0.4.9.1"

/* Include all the system headers needed by nanopb. You will need the
* definitions of the following:
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/serialization/nanopb/pb_decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ bool checkreturn pb_decode_ex(pb_istream_t *stream, const pb_msgdesc_t *fields,
status = pb_decode_inner(&substream, fields, dest_struct, flags);

if (!pb_close_string_substream(stream, &substream))
return false;
status = false;
}

#ifdef PB_ENABLE_MALLOC
Expand Down
3 changes: 2 additions & 1 deletion ecal/core_pb/src/ecal/core/pb/process.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2024 Continental Corporation
* Copyright (C) 2016 - 2025 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 @@ -74,4 +74,5 @@ message Process // process
int32 component_init_state = 15; // eCAL component initialization state (eCAL::Initialize(..))
string component_init_info = 16; // like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc)
string ecal_runtime_version = 17; // loaded / runtime eCAL version of a component
string config_file_path = 19; // Path from where the eCAL configuration for this process was loaded
}
Loading

0 comments on commit 1e2e345

Please sign in to comment.