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
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
9 changes: 9 additions & 0 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 @@ -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
12 changes: 12 additions & 0 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 @@ -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
8 changes: 8 additions & 0 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
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
31 changes: 28 additions & 3 deletions qml/LeftPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ RowLayout {
Issues
}

// Enum exposed in Panels.qml for Menu items message customization
readonly property var openMenuCaller: ({
leftPanel: 0,
domainGraph: 1
})

property variant panelItem: [monitoringPanel, statusPanel, issuesPanel]

property variant visiblePanel: panelItem[LeftPanel.LeftSubPanel.Explorer]
Expand Down Expand Up @@ -67,7 +73,10 @@ RowLayout {

EntitiesMenu {
id: entitiesMenu
}
onChangeAlias: leftPanel.changeAlias(domainEntityId, entityId, currentAlias, entityKind)
onFilterEntityStatusLog: leftPanel.filterEntityStatusLog(entityId)
onOpenTopicView: leftPanel.openTopicView(domainEntityId, domainId, topicId)
}

TopicMenu {
id: topicMenu
Expand All @@ -87,20 +96,36 @@ RowLayout {
aliasDialog.open()
}

function openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind) {
function openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind, caller) {
entitiesMenu.domainEntityId = domainEntityId
entitiesMenu.entityId = entityId
entitiesMenu.currentAlias = currentAlias
entitiesMenu.entityKind = entityKind

if (caller === openMenuCaller.domainGraph) {
entitiesMenu.showGraphButtonName = "Filter topic graph"
}
else {
entitiesMenu.showGraphButtonName = "Show topic graph"
}

entitiesMenu.popup()
}

function openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind) {
function openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller) {
topicMenu.domainEntityId = domainEntityId
topicMenu.domainId = domainId
topicMenu.entityId = entityId
topicMenu.currentAlias = currentAlias
topicMenu.entityKind = entityKind

if (caller === openMenuCaller.domainGraph) {
topicMenu.showGraphButtonName = "Filter topic graph"
}
else {
topicMenu.showGraphButtonName = "Show topic graph"
}

topicMenu.popup()
}

Expand Down
4 changes: 2 additions & 2 deletions qml/LogicalView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Rectangle {
}
onClicked: {
if(mouse.button & Qt.RightButton) {
openEntitiesMenu(domainId, id, name, kind)
openEntitiesMenu(domainId, id, name, kind, openMenuCaller.leftPanel)
} else {
controller.domain_click(id)
}
Expand Down Expand Up @@ -167,7 +167,7 @@ Rectangle {

onClicked: {
if(mouse.button & Qt.RightButton) {
openTopicMenu(domainId, domainName, id, name, kind)
openTopicMenu(domainId, domainName, id, name, kind, openMenuCaller.leftPanel)
} else {
controller.topic_click(id)
}
Expand Down
15 changes: 9 additions & 6 deletions qml/Panels.qml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ RowLayout {
}
}
onOpenEntitiesMenu: {
panels.openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind)
panels.openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind, caller)
}
onOpenTopicMenu: {
panels.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind)
panels.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller)
}
}
StatusLayout {
Expand Down Expand Up @@ -164,6 +164,9 @@ RowLayout {
}
}

// Expose LeftPanel openMenuCaller enum to be used in other children components (e.g: DomainGraphView.qml)
property alias openMenuCaller: leftPanel.openMenuCaller

function createHistoricChart(dataKind){
tabs.chartsLayout_createHistoricChart(dataKind)
}
Expand Down Expand Up @@ -196,11 +199,11 @@ RowLayout {
leftPanel.changeExplorerEntityInfo(status)
}

function openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind) {
leftPanel.openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind)
function openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind, caller) {
leftPanel.openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind, caller)
}

function openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind) {
leftPanel.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind)
function openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller) {
leftPanel.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller)
}
}
Loading
Loading