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

[19743] Status layout with problems per entity #204

Merged
merged 43 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5f8d281
Refs #19533: Add Status view to layout
JesusPoderoso Sep 18, 2023
423411f
Refs #19533: Improve disable view of chart layout button
JesusPoderoso Oct 25, 2023
df89f1f
Fix mock build issue
JesusPoderoso Oct 30, 2023
c162098
Fix visual details
JesusPoderoso Oct 30, 2023
56d54df
Display entity information when clicked in status layout
JesusPoderoso Oct 31, 2023
022ed1e
Refs #19533: Fix warning visual issue
JesusPoderoso Nov 2, 2023
00f073a
Refs #19533: Add filter to status layout properly
JesusPoderoso Nov 2, 2023
7a5fc14
Refs #19743: Fix topic filtering visual bugs
JesusPoderoso Nov 3, 2023
18e4069
Refs #19743: Add load model check for empty filter
JesusPoderoso Nov 7, 2023
15e9ae9
Refs #19743: [ARS] Set Backend status references
JesusPoderoso Nov 10, 2023
a50a7d5
Refs #19743: [ARS] Delete debug comment
JesusPoderoso Nov 10, 2023
6b2f4e4
Refs #19743: [ARS] Rename all problems to statuses
JesusPoderoso Nov 10, 2023
15a9ad6
Refs #19743: [ARS] Improve comments
JesusPoderoso Nov 10, 2023
2c3a635
Refs #19743: [ARS] Minor sugestions
JesusPoderoso Nov 10, 2023
0a21318
Refs #19743: [ARS] Improve entity status assignments
JesusPoderoso Nov 10, 2023
6c4a09a
Refs #19743: [ARS] Add missing problem sample 'Liveliness changed'
JesusPoderoso Nov 13, 2023
08ae1ac
Refs #19743: [ARS] Improve error / warning counter update and update …
JesusPoderoso Nov 13, 2023
9a69d19
Refs #19743: [ARS] Rename method
JesusPoderoso Nov 13, 2023
67699fb
Refs #19743: [ARS] QML minor changes
JesusPoderoso Nov 13, 2023
5b533f9
Refs #19743: [ARS] Improve graph connections section
JesusPoderoso Nov 13, 2023
1a105ea
Refs #19743: [ARS] Fix style in the imported qml files
JesusPoderoso Nov 13, 2023
ebcdc84
Refs #19743: [ARS] Remove unnecessary dead code
JesusPoderoso Nov 13, 2023
119401a
Refs #19743: [ARS] Remove unnecessary method
JesusPoderoso Nov 13, 2023
4095424
Refs #19743: [ARS] Refactor tree model filtering
JesusPoderoso Nov 13, 2023
5620d09
Refs #19743: [ARS] Remove info dead code
JesusPoderoso Nov 13, 2023
737cfc0
Refs #19743: [ARS] Improve StatusLayout.qml comments
JesusPoderoso Nov 13, 2023
f09da2b
Refs #19743: [ARS] Improve pointers deletion
JesusPoderoso Nov 13, 2023
70ef10a
Refs #19743: Refactor model roles to use direct get methods
JesusPoderoso Nov 13, 2023
0dd2396
Refs #19743: [ALRS] Rename 'copy' model method as 'filtered_copy'
JesusPoderoso Nov 14, 2023
1d1d043
Refs #19743: [ALRS] Remove repeated description in problems
JesusPoderoso Nov 14, 2023
1e19b6b
Refs #19743: [ALRS] Rename domain graph public property entity id as …
JesusPoderoso Nov 14, 2023
42e3846
Refs #19743: [ALRS] Improve status counter anchoring to avoid overlap…
JesusPoderoso Nov 14, 2023
eccba19
Refs #19743: [ALRS] Improve status sample kind usage
JesusPoderoso Nov 14, 2023
b54565e
Refs #19743: [ALRS] Treat entity status model status as StatusLevel i…
JesusPoderoso Nov 14, 2023
82f82ff
Refs #19743: [ALRS] Comment typo
JesusPoderoso Nov 14, 2023
ea8c0d2
Refs #19743: [ARS] Improve entity info update when new status reported
JesusPoderoso Nov 20, 2023
94d1e49
Refs #19743: [ARS] Remove unnecessary error check
JesusPoderoso Nov 20, 2023
a096479
Refs #19743: [ARS] Get Status Level string from sources (backend)
JesusPoderoso Nov 20, 2023
a292074
Refs #19743: [ARS] Fix visual bug with expand/collapse status layout …
JesusPoderoso Nov 20, 2023
83f858a
Refs #19743: [ARS] Fix timer flow
JesusPoderoso Nov 20, 2023
dbbd7ef
Refs #19743: [ARS] Add try-catch in get_status_data
JesusPoderoso Nov 20, 2023
69acbc9
Refs #19743: [ARS] Fix timer
JesusPoderoso Nov 20, 2023
3ace55c
Refs #19743: [ARS] Fix left panel focus
JesusPoderoso Nov 20, 2023
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ set(PROJECT_HEADERS
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/model/statistics/EntityItem.h
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/model/SubListedListItem.h
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/model/SubListedListModel.h
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/model/tree/StatusTreeItem.h
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/model/tree/StatusTreeModel.h
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/model/tree/TreeItem.h
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/model/tree/TreeModel.h
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/statistics/DataChartBox.h
Expand Down Expand Up @@ -261,6 +263,8 @@ set(PROJECT_SOURCES_NO_MAIN
${PROJECT_SOURCE_DIR}/src/model/physical/ProcessModelItem.cpp
${PROJECT_SOURCE_DIR}/src/model/statistics/EntityItem.cpp
${PROJECT_SOURCE_DIR}/src/model/SubListedListModel.cpp
${PROJECT_SOURCE_DIR}/src/model/tree/StatusTreeItem.cpp
${PROJECT_SOURCE_DIR}/src/model/tree/StatusTreeModel.cpp
${PROJECT_SOURCE_DIR}/src/model/tree/TreeItem.cpp
${PROJECT_SOURCE_DIR}/src/model/tree/TreeModel.cpp
${PROJECT_SOURCE_DIR}/src/statistics/DataChartBox.cpp
Expand Down
4 changes: 4 additions & 0 deletions fastdds_monitor.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ SOURCES += \
src/model/physical/ProcessModelItem.cpp \
src/model/statistics/EntityItem.cpp \
src/model/SubListedListModel.cpp \
src/model/tree/StatusTreeItem.cpp \
src/model/tree/StatusTreeModel.cpp \
src/model/tree/TreeItem.cpp \
src/model/tree/TreeModel.cpp \
src/statistics/DataChartBox.cpp \
Expand Down Expand Up @@ -75,6 +77,8 @@ HEADERS += \
include/fastdds_monitor/model/statistics/EntityItem.h \
include/fastdds_monitor/model/SubListedListItem.h \
include/fastdds_monitor/model/SubListedListModel.h \
include/fastdds_monitor/model/tree/StatusTreeModel.h \
include/fastdds_monitor/model/tree/StatusTreeItem.h \
include/fastdds_monitor/model/tree/TreeItem.h \
include/fastdds_monitor/model/tree/TreeModel.h \
include/fastdds_monitor/statistics/DataChartBox.h \
Expand Down
14 changes: 14 additions & 0 deletions include/fastdds_monitor/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <QObject>
#include <QtCharts/QVXYModelMapper>

#include <fastdds_monitor/backend/backend_types.h>

class Engine;

enum class ErrorType : int
Expand Down Expand Up @@ -59,6 +61,15 @@ class Controller : public QObject
QString error_msg,
ErrorType error_type = ErrorType::GENERIC);

//! Status counters displayed in the QML
struct StatusCounters
{
std::map<backend::EntityId,uint32_t> errors;
std::map<backend::EntityId,uint32_t> warnings;
int32_t total_errors = 0;
int32_t total_warnings = 0;
} status_counters;

public slots:

// Methods to be called from QML
Expand Down Expand Up @@ -275,6 +286,9 @@ public slots:
//! Signal to inform qml that a new monitor has been initialized
void monitorInitialized();

//! Signal to notify status counters have been updated
void update_status_counters(QString errors, QString warnings);

protected:

//! Reference to \c Engine object
Expand Down
85 changes: 82 additions & 3 deletions include/fastdds_monitor/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@
#include <QWaitCondition>

#include <fastdds_monitor/backend/Callback.h>
#include <fastdds_monitor/backend/Listener.h>
#include <fastdds_monitor/backend/StatusCallback.h>
#include <fastdds_monitor/backend/Listener.h>
#include <fastdds_monitor/backend/SyncBackendConnection.h>
#include <fastdds_monitor/Controller.h>
#include <fastdds_monitor/model/tree/TreeModel.h>
#include <fastdds_monitor/model/info/InfoModel.h>
#include <fastdds_monitor/statistics/dynamic/DynamicStatisticsData.h>
#include <fastdds_monitor/statistics/historic/HistoricStatisticsData.h>
#include <fastdds_monitor/model/tree/StatusTreeModel.h>

struct EntityClicked
{
Expand Down Expand Up @@ -267,6 +268,26 @@ class Engine : public QQmlApplicationEngine
bool new_entity = true,
bool last_clicked = false);

/**
* @brief Update the entity status model with the status kind received
*
* @param id entity id
* @param kind StatusKind reported
* @return true if any change in model has been done
*/
bool update_entity_status(
const backend::EntityId& id,
backend::StatusKind kind);

/**
* @brief Update the entity status counters and populate the model with empty message if empty
*
* @param id entity id
* @return false
*/
bool remove_inactive_entities_from_status_model(
const backend::EntityId& id);

/**
* @brief Update the internal dds model with entities related with Entity referenced by \c id
*
Expand Down Expand Up @@ -348,6 +369,19 @@ class Engine : public QQmlApplicationEngine
bool add_callback(
backend::Callback callback);

/**
* @brief add a status callback arrived from the backend to the status callback queue
*
* Add a status callback to the status callback queue in order to process it afterwards by the main thread.
* Emit a signal that communicate the main thread that there are info to process in the status callback queue.
* Add a status callback issue.
*
* @param callback new status callback to add
* @return true
*/
bool add_callback(
backend::StatusCallback callback);

/**
* @brief Refresh the view
*
Expand Down Expand Up @@ -390,6 +424,14 @@ class Engine : public QQmlApplicationEngine
*/
void process_callback_queue();

/**
* @brief Pop status callbacks from the status callback queues while non empty and update the models
*
* @warning This method must be executed from the main Thread (or at least a QThread) so the models are
* updated in the view when modified.
*/
void process_status_callback_queue();

//! Refresh summary panel
void refresh_summary();

Expand Down Expand Up @@ -507,14 +549,26 @@ class Engine : public QQmlApplicationEngine
*/
void new_callback_signal();

/**
* Internal signal that communicate that there are status callbacks to process by the main Thread.
* Arise from \c add_callback
*/
void new_status_callback_signal();

public slots:

/**
* Receive the internal signal \c new_callback_signal and start the process of
* callback queue by \c process_callback_queue
* Receive the internal signal \c new_callback_signal and start the process of callback
* queue by \c process_callback_queue
*/
void new_callback_slot();

/**
* Receive the internal signal \c new_status_callback_signal and start the process of status
* callback queue by \c process_status_callback_queue
*/
void new_status_callback_slot();

protected:

/**
Expand Down Expand Up @@ -633,13 +687,23 @@ public slots:
//! True if there are callbacks in the callback queue
bool are_callbacks_to_process_();

//! True if there are status callbacks in the callback queue
bool are_status_callbacks_to_process_();

//! Pop a callback from callback queues and call \c read_callback for that callback
bool process_callback_();

//! Pop a status callback from callback queues and call \c read_callback for that status callback
bool process_status_callback_();

//! Update the model concerned by the entity in the callback
bool read_callback_(
backend::Callback callback);

//! Update the model concerned by the entity in the status callback
bool read_callback_(
backend::StatusCallback callback);

//! Common method to demultiplex to update functions depending on the entity kind
bool update_entity_generic(
backend::EntityId entity_id,
Expand Down Expand Up @@ -695,6 +759,12 @@ public slots:
//! Data that is represented in the Status Model when this model is refreshed
backend::Info status_info_;

//! Data Model for Fast DDS Monitor status view. Collects all entities statuses detected by the monitor service
models::StatusTreeModel* entity_status_model_;

//! Display and allow to filter Model for Fast DDS Monitor status view.
models::StatusTreeModel* entity_status_proxy_model_;

//! TODO
models::ListModel* source_entity_id_model_;

Expand Down Expand Up @@ -722,9 +792,15 @@ public slots:
//! Mutex to protect \c callback_queue_
std::recursive_mutex callback_queue_mutex_;

//! Mutex to protect \c status_callback_queue_
std::recursive_mutex status_callback_queue_mutex_;

//! Queue of Callbacks that have arrived by the \c Listener and have not been processed
QQueue<backend::Callback> callback_queue_;

//! Queue of status Callbacks that have arrived by the \c Listener and have not been processed
QQueue<backend::StatusCallback> status_callback_queue_;

//! Object that manage all the communications with the QML view
Controller* controller_;

Expand All @@ -746,6 +822,9 @@ public slots:
* to happen) there are going to create entities already created.
*/
std::recursive_mutex initializing_monitor_;

//! All status log
backend::Info status_status_log_;
};

#endif // _EPROSIMA_FASTDDS_MONITOR_ENGINE_H
6 changes: 6 additions & 0 deletions include/fastdds_monitor/backend/Listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class Listener : public PhysicalListener
EntityId datawriter_id,
const Status& status) override;

//! Callback when a status is reported
void on_status_reported(
EntityId domain_id,
EntityId entity_id,
StatusKind data_kind) override;

protected:

//! Engine reference
Expand Down
60 changes: 60 additions & 0 deletions include/fastdds_monitor/backend/StatusCallback.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// This file is part of eProsima Fast DDS Monitor.
//
// eProsima Fast DDS Monitor is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// eProsima Fast DDS Monitor is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with eProsima Fast DDS Monitor. If not, see <https://www.gnu.org/licenses/>.

/**
* @file StatusCallback.h
*/

#ifndef _EPROSIMA_FASTDDS_MONITOR_BACKEND_STATUS_CALLBACK_H
#define _EPROSIMA_FASTDDS_MONITOR_BACKEND_STATUS_CALLBACK_H

#include <fastdds_monitor/backend/backend_types.h>

namespace backend {

/*
* Struct that store the status callback information required by the GUI.
* It encapsulates the domain id, entity id and the kind of the new status reported.
*/
struct StatusCallback
{
//! Void constructor to use copy constructor afterwards
StatusCallback()
{
}

//! Standard constructor with the two fields required
StatusCallback(
backend::EntityId domain_entity_id,
backend::EntityId entity_id,
backend::StatusKind status_kind)
: domain_entity_id(domain_entity_id)
, entity_id(entity_id)
, status_kind(status_kind)
{
}
//! Information of the domain \c EntityId the callback refers
backend::EntityId domain_entity_id;
//! Information of the \c EntityId the callback refers
backend::EntityId entity_id;
//! Information of the \c StatusKind the callback refers
backend::StatusKind status_kind;
};

} // namespace backend

#endif // _EPROSIMA_FASTDDS_MONITOR_BACKEND_STATUS_CALLBACK_H
45 changes: 45 additions & 0 deletions include/fastdds_monitor/backend/SyncBackendConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define _EPROSIMA_FASTDDS_MONITOR_BACKEND_SYNCBACKENDCONNECTION_H

#include <fastdds_statistics_backend/StatisticsBackend.hpp>
#include <fastdds_statistics_backend/types/types.hpp>

#include <fastdds_monitor/backend/backend_types.h>
#include <fastdds_monitor/backend/Listener.h>
Expand Down Expand Up @@ -116,6 +117,14 @@ class SyncBackendConnection
std::string get_name(
backend::EntityId id);

//! Get the alias of an entity from the Backend by calling \c get_info
jepemi marked this conversation as resolved.
Show resolved Hide resolved
std::string get_alias(
backend::EntityId id);

//! Get the status level of an entity from the Backend by calling \c get_status
StatusLevel get_status(
backend::EntityId id);

//! Get the alive status of an entity from the Backend by calling \c is_active
bool get_alive(
backend::EntityId id);
Expand Down Expand Up @@ -147,6 +156,42 @@ class SyncBackendConnection
Timestamp start_time = Timestamp(),
Timestamp end_time = std::chrono::system_clock::now());

bool get_status_data(
EntityId source_entity_id,
ConnectionListSample& sample);

bool get_status_data(
EntityId source_entity_id,
DeadlineMissedSample& sample);

bool get_status_data(
EntityId source_entity_id,
IncompatibleQosSample& sample);

bool get_status_data(
EntityId source_entity_id,
InconsistentTopicSample& sample);

bool get_status_data(
EntityId source_entity_id,
LivelinessChangedSample& sample);

bool get_status_data(
EntityId source_entity_id,
LivelinessLostSample& sample);

bool get_status_data(
EntityId source_entity_id,
ProxySample& sample);

bool get_status_data(
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
Loading
Loading