Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21817] Improve endpoints display and topic traceability #238

Merged
merged 8 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/configurations/Linux/colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[
"-DBUILD_MOCK=ON",
"-DQT_PATH=$GITHUB_WORKSPACE/qt_installation/Qt/5.15.2",
"-DBUILD_APP_TESTS=ON",
"-DBUILD_APP_TESTS=OFF",
"-DCMAKE_CXX_FLAGS='-Werror'"
]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
with:
packages_names: fastdds_monitor
cmake_build_type: 'Release'
cmake_args: '-DTHIRDPARTY=ON -DBUILD_DOCUMENTATION=ON -DBUILD_DOCUMENTATION_TESTS=ON'
cmake_args: '-DTHIRDPARTY=ON -DBUILD_DOCUMENTATION=ON -DBUILD_DOCUMENTATION_TESTS=ON -DBUILD_APP_TESTS=OFF'
colcon_meta_file: ${{ github.workspace }}/src/fastdds_monitor/.github/workflows/configurations/Linux/colcon.meta
workspace: ${{ github.workspace }}
test_report_artifact: 'fastdds_monitor_documentation'
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def select_css(html_css_dir):
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False

suppress_warnings = []
suppress_warnings = ['config.cache']

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand Down
2 changes: 1 addition & 1 deletion docs/rst/getting_started/entities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ for a more detailed explanation of the *DomainParticipant* entity in DDS.
Each *DomainParticipant* can only communicate under one *Domain*
(see :ref:`logical entities <logical_entities>` section) and so it exists a direct connection between each
*DomainParticipant* and the *Domain* in which it works.
From the :numref:`entities diagram <fig_entities_diagram>` it can be seen that *DomainParticipant* entities
From the :ref:`entities diagram <fig_entities_diagram>` it can be seen that *DomainParticipant* entities
are contained in a
*Process*, this is because a system process (so-called *Process* entity) executes an application using *Fast DDS*
that instantiates *DomainParticipants*.
Expand Down
25 changes: 17 additions & 8 deletions include/fastdds_monitor/Controller.h
depink5 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,16 @@ public slots:
bool endTimeDefault,
QString statisticKind);

//! Returns the eProsima Fast DDS version used to compile de Monitor
//! Returns the eProsima Fast DDS version used to compile the Monitor
QString fastdds_version();

//! Returns the eProsima Fast DDS Statistics Backend version used to compile de Monitor
//! Returns the eProsima Fast DDS Statistics Backend version used to compile the Monitor
QString fastdds_statistics_backend_version();

//! Returns the Qt version used to compile de Monitor
//! Returns the Qt version used to compile the Monitor
QString qt_version();

//! Returns the eProsima Fast DDS Monitor version used to compile de Monitor
//! Returns the eProsima Fast DDS Monitor version used to compile the Monitor
QString fastdds_monitor_version();

//! Returns the system information for which Fast DDS is built
Expand Down Expand Up @@ -211,12 +211,12 @@ public slots:
* @brief Export the series given to a new csv file
*
* Export one or multiple series to a new csv file.
* Each series to export is given in a vector as chartobox id and series index to get the data from the models.
* Each series to export is given in a vector as chartbox id and series index to get the data from the models.
* Each series to export is given with its headers in order to save them in the csv and can import the file.
*
* @param file_name path and name to the new csv file
* @param chartbox_ids ids of the chartboxes of each series
* @param series_indexes indexes of the serioes inside each chartbox
* @param series_indexes indexes of the series inside each chartbox
* @param data_kinds DataKind that refers to the each series
* @param chartbox_names Title of the chartbox this series belongs
* @param label_names Label of each series
Expand Down Expand Up @@ -256,12 +256,12 @@ public slots:
* @brief Export the series given to a new csv file
*
* Export one or multiple series to a new csv file.
* Each series to export is given in a vector as chartobox id and series index to get the data from the models.
* Each series to export is given in a vector as chartbox id and series index to get the data from the models.
* Each series to export is given with its headers in order to save them in the csv and can import the file.
*
* @param series_id path and name to the new csv file
* @param series_id ids of the chartboxes of each series
* @param series_indexes indexes of the serioes inside each chartbox
* @param series_indexes indexes of the series inside each chartbox
* @param data_kinds DataKind that refers to the each series
* @param chartbox_names Title of the chartbox this series belongs
* @param label_names Label of each series
Expand All @@ -279,6 +279,15 @@ public slots:
QString get_type_idl (
QString entity_id);

QString get_endpoint_topic_id(
QString endpoint_id);

QString get_domain_id(
QString entity_id);

QString get_name(
QString entity_id);

QString get_data_type_name(
QString entity_id);

Expand Down
16 changes: 14 additions & 2 deletions include/fastdds_monitor/Engine.h
depink5 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class Engine : public QQmlApplicationEngine
*
* @param file_name path and name to the new csv file
* @param chartbox_ids ids of the chartboxes of each series
* @param series_indexes indexes of the serioes inside each chartbox
* @param series_indexes indexes of the series inside each chartbox
* @param data_kinds DataKind that refers to the each series
* @param chartbox_names Title of the chartbox this series belongs
* @param label_names Label of each series
Expand Down Expand Up @@ -526,6 +526,10 @@ class Engine : public QQmlApplicationEngine
//! Retrive a string list containing the available data kinds.
std::vector<std::string> get_data_kinds();

//! Retrieve the name associated to a specific entity
std::string get_name(
const backend::EntityId& entity_id);

//! Retrieve the data type name associated to a specific entity
std::string get_data_type_name(
const backend::EntityId& entity_id);
Expand All @@ -534,6 +538,14 @@ class Engine : public QQmlApplicationEngine
std::string get_type_idl(
const backend::EntityId& entity_id);

//! Retrieve the topic id associated to a specific endpoint
models::EntityId get_endpoint_topic_id(
const models::EntityId& endpoint_id);

//! Retrieve the id of the domain associated to an entity (Domain, DomainParticipant, Topìc or Endpoints)
models::EntityId get_domain_id(
const models::EntityId& entity_id);

//! Returns whether the data kind entered requires a target entity to be defined.
bool data_kind_has_target(
const QString& data_kind);
Expand Down Expand Up @@ -823,7 +835,7 @@ public slots:
/**
* Protect the dds model while a new monitor is being created
*
* This mutex is needed because when a new Domain is initialie, it is set as entity:clicked.
* This mutex is needed because when a new Domain is initialized, it is set as entity:clicked.
* Thus, the dds model is filled, and so clear and check in database to create it from scratch.
* If during this process the callbacks of the entities of this new domain arrive (and it is very likely
* to happen) there are going to create entities already created.
Expand Down
12 changes: 8 additions & 4 deletions include/fastdds_monitor/backend/SyncBackendConnection.h
depink5 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ class SyncBackendConnection
EntityInfo get_info(
EntityId id);

//! Get the id of the topic associated to an endpoint
backend::EntityId get_endpoint_topic_id(
backend::EntityId endpoint_id);

//! Get the id of the domain associated to an entity (Domain, DomainParticipant, Topìc or Endpoints)
backend::EntityId get_domain_id(
backend::EntityId entity_id);

//! Get the \c EntityKind of a given \c EntityId
EntityKind get_type(
backend::EntityId id);
Expand Down Expand Up @@ -191,10 +199,6 @@ class SyncBackendConnection
EntityId source_entity_id,
SampleLostSample& sample);

/*bool get_status_data(
EntityId source_entity_id,
StatusesSizeSample& sample);*/

//! Get info from an entity from the Backend
std::vector<EntityId> get_entities(
EntityKind entity_type,
Expand Down
16 changes: 8 additions & 8 deletions qml/DomainGraphLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Item

// Public signals
signal update_tab_name(string new_name, string new_icon, string stack_id) // Update tab name based on selected domain id
signal openEntitiesMenu(string domainEntityId, string entityId, string currentAlias, string entityKind)
signal openTopicMenu(string domainEntityId, string domainId, string entityId, string currentAlias, string entityKind)
signal openEntitiesMenu(string domainEntityId, string entityId, string currentAlias, string entityKind, int caller)
signal openTopicMenu(string domainEntityId, string domainId, string entityId, string currentAlias, string entityKind, int caller)
signal openLoadingGraphDialog() //l et tab layout know that graph is about to be generated
signal initialized() // let tab layout know that graph has been generated

Expand Down Expand Up @@ -246,7 +246,7 @@ Item
onClicked:
{
if(mouse.button & Qt.RightButton) {
openTopicMenu(domain_entity_id, domain_id, modelData["id"], modelData["alias"], modelData["kind"])
openTopicMenu(domain_entity_id, domain_id, modelData["id"], modelData["alias"], modelData["kind"], panels.openMenuCaller.domainGraph)
} else {
controller.topic_click(modelData["id"])
}
Expand Down Expand Up @@ -613,7 +613,7 @@ Item
onClicked:
{
if(mouse.button & Qt.RightButton) {
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"])
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"], openMenuCaller.domainGraph)
} else {
controller.host_click(modelData["id"])
}
Expand Down Expand Up @@ -757,7 +757,7 @@ Item
onClicked:
{
if(mouse.button & Qt.RightButton) {
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"])
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"], openMenuCaller.domainGraph)
} else {
controller.user_click(modelData["id"])
}
Expand Down Expand Up @@ -900,7 +900,7 @@ Item
onClicked:
{
if(mouse.button & Qt.RightButton) {
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"])
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"], openMenuCaller.domainGraph)
} else {
controller.process_click(modelData["id"])
}
Expand Down Expand Up @@ -1067,7 +1067,7 @@ Item
onClicked:
{
if(mouse.button & Qt.RightButton) {
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"])
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"], openMenuCaller.domainGraph)
} else {
controller.participant_click(modelData["id"])
}
Expand Down Expand Up @@ -1271,7 +1271,7 @@ Item
onClicked:
{
if(mouse.button & Qt.RightButton) {
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"])
openEntitiesMenu(domain_entity_id, modelData["id"], modelData["alias"], modelData["kind"], openMenuCaller.domainGraph)
} else {
controller.endpoint_click(modelData["id"])
}
Expand Down
96 changes: 90 additions & 6 deletions qml/EntitiesMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,103 @@ import Theme 1.0
/*
Menu containing the possible actions that can be performed on any DDS, physical and logical entity.
*/


Menu {
id: entitiesMenu
property string domainEntityId: ""
property string entityId: ""
property string currentAlias: ""
property string entityKind: ""
property string showGraphButtonName: ""

signal changeAlias(string domainEntityId, string entityId, string currentAlias, string entityKind)
signal filterEntityStatusLog(string entityId)
signal openTopicView(string domainEntityId, string domainId, string topicId)

//////////////////
// Menu options //
//////////////////

Component {
id: changeAlias

MenuItem {
text: "Change alias"
MouseArea {
hoverEnabled: true
anchors.fill: parent
onEntered: parent.highlighted = true
onExited: parent.highlighted = false
onPressed: {
entitiesMenu.changeAlias(entitiesMenu.domainEntityId, entitiesMenu.entityId, entitiesMenu.currentAlias, entitiesMenu.entityKind)
entitiesMenu.close()
}
}
Component.onCompleted: highlighted = false
}
}

Component {
id: viewProblems

MenuItem {
text: "View Problems"
MouseArea {
hoverEnabled: true
anchors.fill: parent
onEntered: parent.highlighted = true
onExited: parent.highlighted = false
onPressed: {
entitiesMenu.filterEntityStatusLog(entitiesMenu.entityId)
entitiesMenu.close()
}
}
Component.onCompleted: highlighted = false
}
}

Component {
id: showGraph

MenuItem {
text: entitiesMenu.showGraphButtonName
MouseArea {
hoverEnabled: true
anchors.fill: parent
onEntered: parent.highlighted = true
onExited: parent.highlighted = false
onPressed: {
let domain = controller.get_name(entitiesMenu.domainEntityId)
let topicId = controller.get_endpoint_topic_id(entityId)
entitiesMenu.openTopicView(entitiesMenu.domainEntityId, domain, topicId)
entitiesMenu.close()
}
}
Component.onCompleted: highlighted = false
}
}

MenuItem {
text: "Change alias"
onTriggered: changeAlias(menu.domainEntityId, menu.entityId, menu.currentAlias, menu.entityKind)
// Print menu options depending on the entity kind
ListModel {
id: entityModel
}
MenuItem {
text: "View Problems"
onTriggered: filterEntityStatusLog(menu.entityId)

Repeater {
model: entityModel
delegate: Loader {
sourceComponent: available ? option : null
}
}

// Update model if some property change implies graphic changes in UI
onEntityKindChanged: updateEntityModel()
onShowGraphButtonNameChanged: updateEntityModel()

function updateEntityModel() {
entityModel.clear()
entityModel.append({"available": entitiesMenu.entityKind === "DataWriter" || entitiesMenu.entityKind === "DataReader", "option": showGraph})
entityModel.append({"available": true, "option": changeAlias})
entityModel.append({"available": true, "option": viewProblems})
}
}
6 changes: 3 additions & 3 deletions qml/EntityList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Rectangle {
}
onClicked: {
if(mouse.button & Qt.RightButton) {
openEntitiesMenu("", id, name, kind)
openEntitiesMenu(controller.get_domain_id(id), id, name, kind, openMenuCaller.leftPanel)
} else {
controller.participant_click(id)
}
Expand Down Expand Up @@ -173,7 +173,7 @@ Rectangle {
}
onClicked: {
if(mouse.button & Qt.RightButton) {
openEntitiesMenu("", id, name, kind)
openEntitiesMenu(controller.get_domain_id(id), id, name, kind, openMenuCaller.leftPanel)
} else {
controller.endpoint_click(id)
}
Expand Down Expand Up @@ -245,7 +245,7 @@ Rectangle {

onClicked: {
if(mouse.button & Qt.RightButton) {
openEntitiesMenu("", id, name, kind)
openEntitiesMenu(controller.get_domain_id(id), id, name, kind, openMenuCaller.leftPanel)
} else {
controller.locator_click(id)
}
Expand Down
Loading
Loading