File tree Expand file tree Collapse file tree 3 files changed +54
-1
lines changed
include/fastdds_monitor/backend Expand file tree Collapse file tree 3 files changed +54
-1
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,10 @@ class SyncBackendConnection
116
116
EntityKind get_type (
117
117
backend::EntityId id);
118
118
119
+ // ! Get entity by GUID in string format
120
+ backend::EntityId get_entity_by_guid (
121
+ const std::string& guid);
122
+
119
123
// ! Get a summary of important data collected from the backend related with the entity with id \c id
120
124
EntityInfo get_summary (
121
125
backend::EntityId id);
@@ -211,6 +215,10 @@ class SyncBackendConnection
211
215
std::string get_deserialized_guid (
212
216
const backend::GUID_s& data);
213
217
218
+ // ! Convert a given entity guid in string format to GUID_s
219
+ backend::GUID_s get_serialize_guid (
220
+ const std::string& guid_str);
221
+
214
222
// ! Get info from an entity from the Backend
215
223
std::vector<EntityId> get_entities (
216
224
EntityKind entity_type,
Original file line number Diff line number Diff line change @@ -1193,8 +1193,23 @@ bool Engine::update_entity_status(
1193
1193
backend::policy_documentation_description (policy_id) +
1194
1194
std::string (" \" >here</a></html>" ),
1195
1195
" " , true );
1196
+ std::string remote_entity;
1197
+ backend::EntityId remote_entity_id = backend_connection_.get_entity_by_guid (remote_entity_guid);
1198
+ if (remote_entity_id.is_valid ())
1199
+ {
1200
+ EntityInfo entity_info = backend_connection_.get_info (remote_entity_id);
1201
+ std::string remote_entity_kind = utils::to_string (
1202
+ backend::entity_kind_to_QString (backend_connection_.get_type (remote_entity_id)));
1203
+ std::stringstream ss;
1204
+ ss << std::string (entity_info[" alias" ]) << " (" << remote_entity_kind << " )" ;
1205
+ remote_entity = ss.str ();
1206
+ }
1207
+ else
1208
+ {
1209
+ remote_entity = remote_entity_guid;
1210
+ }
1196
1211
auto remote_entity_item = new models::StatusTreeItem (id, kind,
1197
- std::string (" Remote entity: " + remote_entity_guid ),
1212
+ std::string (" Remote entity: " + remote_entity ),
1198
1213
sample.status , std::string (" " ), std::string (
1199
1214
" " ), remote_entity_guid, false );
1200
1215
entity_status_model_->addItem (incompatible_qos_item, policy_item);
Original file line number Diff line number Diff line change @@ -555,6 +555,22 @@ EntityKind SyncBackendConnection::get_type(
555
555
}
556
556
}
557
557
558
+ backend::EntityId SyncBackendConnection::get_entity_by_guid (
559
+ const std::string& guid)
560
+ {
561
+ try
562
+ {
563
+ return StatisticsBackend::get_entity_by_guid (guid);
564
+ }
565
+ catch (const Exception& e)
566
+ {
567
+ qWarning () << " Fail getting entity by guid " << e.what ();
568
+ static_cast <void >(e); // In release qWarning does not compile and so e is not used
569
+
570
+ return EntityId::invalid ();
571
+ }
572
+ }
573
+
558
574
std::vector<EntityId> SyncBackendConnection::get_entities (
559
575
EntityKind entity_type,
560
576
EntityId entity_id)
@@ -940,6 +956,20 @@ std::string SyncBackendConnection::get_deserialized_guid(
940
956
return StatisticsBackend::deserialize_guid (data);
941
957
}
942
958
959
+ backend::GUID_s SyncBackendConnection::get_serialize_guid (
960
+ const std::string& guid_str)
961
+ {
962
+ try
963
+ {
964
+ return StatisticsBackend::serialize_guid (guid_str);
965
+ }
966
+ catch (const std::exception& e)
967
+ {
968
+ qWarning () << " Error generating GUID from string " << e.what ();
969
+ }
970
+ return backend::GUID_s ();
971
+ }
972
+
943
973
bool SyncBackendConnection::build_source_target_entities_vectors (
944
974
DataKind data_kind,
945
975
EntityId source_entity_id,
You can’t perform that action at this time.
0 commit comments