Skip to content
Open
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
7 changes: 7 additions & 0 deletions docs/rst/appendixes/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,10 @@ DDS nomenclature

See `Fast DDS documentation <https://fast-dds.docs.eprosima.com/en/v2.4.1/fastdds/dds_layer/topic/topic.html>`__
for further information.

Partition
Logical domain that helps organize communication between publishers and subscribers.
Each Partition is uniquely identified by a name.

See `Fast DDS documentation <https://fast-dds.docs.eprosima.com/en/v2.10.1/fastdds/dds_layer/domain/domainParticipant/partition.html>`__
for further information.
21 changes: 21 additions & 0 deletions docs/rst/user_manual/commands/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ This commands show user data being received by the application in real time.

/rst/user_manual/commands/data.rst

Filter commands
===============

This command enables the user to filter the information observed by the application.

.. toctree::
:maxdepth: 2

/rst/user_manual/commands/filter.rst

Extra commands
==============

Expand Down Expand Up @@ -105,6 +115,17 @@ Summary
- ``topic`` ``topics`` |br|
``t`` ``T``

* - :ref:`user_manual_command_filter`
- Filter related commands
- ``set`` |br|
``add`` |br|
``remove`` |br|
``clear`` |br|
``<category>`` |br|
``<filter_str>`` |br|
- ``filter`` ``filters`` |br|
``f`` ``F``

* - :ref:`user_manual_command_echo`
- Show real-time receiving user data.
- ``<topic name>`` |br|
Expand Down
169 changes: 169 additions & 0 deletions docs/rst/user_manual/commands/filter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
.. include:: ../../exports/alias.include
.. include:: ../../exports/roles.include

.. _user_manual_command_filter:

######
Filter
######

**Filter** is a command that adds filters

retrieves information of the :term:`Topics <Topic>` with at least one endpoint currently active in the network.

Key-words
=========

These are the key-words recognize as this command:
``filter`` ``filters`` ``f`` ``F``.

Arguments
=========

**Filter** command supports from 0 to 3 arguments:

*No argument*
-------------

When no arguments are given to this command, the information shown is a **list** with all the list of filters
added during runtime.

The information shown is divided into lists, one for each category added at runtime.
For each list, the added filters are displayed.

The output format is as follows: :ref:`user_manual_command_filter_output`.

*1 argument:* `<clear/remove>`
------------------------------

- clear: This argument clear all the list of categories added to the filters.
- remove: This argument delete all the list of categories added to the filters.

*2 argument:* `<clear/remove> <category>`
-----------------------------------------

- clear: This argument clear the list "category" added to the filters.
- remove: This argument delete the list "category" from the filters.

*3 argument:* `<clear/remove> <category> <filter_str>`
------------------------------------------------------

- set: This argument create the `category` filter list with `filter_str` as first element.
- add: This argument add `filter_str` to `category` filter list.
- remove: This argument delete `filter_str` from `category` filter list.

.. _user_manual_command_filter_output:

Output Format
=============

The filters information is retrieved with the following format:

.. code-block:: yaml

Filter lists (1)

category_1 (2):
- filter_str_1
- filter_str_2

category_2 (2):
- filter_str_1

Example
=======

Let's assume we have a DDS network where a ShapesDemo applications is running with
the following 2 DataWriters:
- Circle (partition A)
- Square (partitions B and C).

This would be the expected output for the following commands:

- ``filter set partitions A``:

Nothing, the category "partitions" is created with filter "A" as first element.

- ``filters``:

.. code-block::

Filter lists (1)

partitions (1):
- A

- ``topics vv``:

.. code-block::

- name: Circle
type: ShapeType
datawriters:
- 01.0f.72.e4.86.f3.9b.a0.00.00.00.00|0.0.6.2 [A]
rate: 12.5391 Hz
dynamic_type_discovered: true


- ``filters add partitions B``:

Nothing, the filter "B" is added to the category "partitions".

- ``filters``:

.. code-block::

Filter lists (1)

partitions (2):
- A
- B

- ``topics vv``:

.. code-block::

- name: Circle
type: ShapeType
datawriters:
- 01.0f.72.e4.86.f3.9b.a0.00.00.00.00|0.0.6.2 [A]
rate: 12.5391 Hz
dynamic_type_discovered: true
- name: Square
type: ShapeType
datawriters:
- 01.0f.72.e4.86.f3.9b.a0.00.00.00.00|0.0.7.2 [B|C]
rate: 12.5391 Hz
dynamic_type_discovered: true

- ``filters remove partitions B``:

Nothing, the filter "B" is removed from the category "partitions".

- ``topics vv``:

.. code-block::

- name: Circle
type: ShapeType
datawriters:
- 01.0f.72.e4.86.f3.9b.a0.00.00.00.00|0.0.6.2 [A]
rate: 12.5391 Hz
dynamic_type_discovered: true

- ``filters``:

.. code-block::

Filter lists (1)

partitions (1):
- A

- ``filter clear``:

- ``filters``:

.. code-block::

Filter lists (0)
31 changes: 19 additions & 12 deletions docs/rst/user_manual/commands/topic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ It adds the Guid of each endpoint on the topic and the whether the type has been
name: <topic name>
type: <data type name>
datawriters:
- <Guid>
- <Guid> [<partitions>]
- ...
datareaders:
- <Guid>
- <Guid> [<partitions>]
- ...
rate: <samples per second> Hz
dynamic_type_discovered: <bool>
Expand All @@ -108,39 +108,46 @@ Let's assume we have a DDS network where 2 ShapesDemo applications are running.

This would be the expected output for the command ``topics``:

.. code-block::

- topic: Circle (ShapeType) (1|1) [13.0298 Hz]
- topic: Square (ShapeType) (2|2) [26.6975 Hz]

This would be the expected output for the command ``topics v``:

.. code-block::

- name: Circle
type: ShapeType
datawriters: 2
datareaders: 2
datawriters: 1
datareaders: 1
rate: 13.0298 Hz
- name: Square
type: ShapeType
datawriters: 3
datawriters: 2
datareaders: 2
rate: 26.6975 Hz

This would be the expected output for the command ``topics verbose``:
This would be the expected output for the command ``topics vv``:

.. code-block::

- name: Circle
type: ShapeType
datawriters:
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.3.2
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.3.2 ["A"]
datareaders:
- 01.0f.44.59.c9.65.78.e5.00.00.00.00|0.0.2.7
- 01.0f.44.59.c9.65.78.e5.00.00.00.00|0.0.2.7 ["A"]
rate: 13.0286 Hz
dynamic_type_discovered: true
- name: Square
type: ShapeType
datawriters:
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.1.2
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.2.2
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.1.2 ["A"]
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.2.2 ["A|B"]
datareaders:
- 01.0f.44.59.21.58.14.d2.00.00.00.00|0.0.2.7
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.4.7
- 01.0f.44.59.21.58.14.d2.00.00.00.00|0.0.2.7 ["A"]
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.4.7 ["B"]
rate: 26.685 Hz
dynamic_type_discovered: true

Expand Down
57 changes: 33 additions & 24 deletions docs/rst/user_manual/usage_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ Try out all the commands DDS Spy has to offer:
- name: Circle
type: ShapeType
datawriters:
- 01.0f.93.86.fb.9a.7f.92.00.00.02.00|0.0.3.2
- 01.0f.93.86.fb.9a.7f.92.00.00.02.00|0.0.3.2 ["A|B"]
datareaders:
- 01.0f.93.86.fb.9a.7f.92.00.00.02.00|0.0.1.7
- 01.0f.93.86.fb.9a.7f.92.00.00.02.00|0.0.2.7
- 01.0f.93.86.fb.9a.7f.92.00.00.02.00|0.0.1.7 ["A"]
- 01.0f.93.86.fb.9a.7f.92.00.00.02.00|0.0.2.7 ["B"]
rate: 11.2986 Hz
dynamic_type_discovered: false

Expand All @@ -127,27 +127,36 @@ Try out all the commands DDS Spy has to offer:
Fast DDS Spy is an interactive CLI that allow to instrospect DDS networks.
Each command shows data related with the network in Yaml format.
Commands available and the information they show:
help : this help.
version : tool version.
quit : exit interactive CLI and close program.
participants : DomainParticipants discovered in the network.
participants verbose : verbose information about DomainParticipants discovered in the network.
participants <Guid> : verbose information related with a specific DomainParticipant.
writers : DataWriters discovered in the network.
writers verbose : verbose information about DataWriters discovered in the network.
writers <Guid> : verbose information related with a specific DataWriter.
reader : DataReaders discovered in the network.
reader verbose : verbose information about DataReaders discovered in the network.
reader <Guid> : verbose information related with a specific DataReader.
topics : Topics discovered in the network in compact format.
topics v : Topics discovered in the network.
topics vv : verbose information about Topics discovered in the network.
topics <name> : Topics discovered in the network filtered by name (wildcard allowed (*)).
echo <name> : data of a specific Topic (Data Type must be discovered).
echo <wildcard_name> : data of a Topics matching the wildcard name (Data Type must be discovered).
echo <name> verbose : data with additional source info of a specific Topic.
echo <wildcard_name> verbose : data with additional source info of Topics matching the topic name (wildcard allowed (*)).
echo all : verbose data of all topics (only those whose Data Type is discovered).
help : this help.
version : tool version.
quit : exit interactive CLI and close program.
participants : DomainParticipants discovered in the network.
participants verbose : verbose information about DomainParticipants discovered in the network.
participants <Guid> : verbose information related with a specific DomainParticipant.
writers : DataWriters discovered in the network.
writers verbose : verbose information about DataWriters discovered in the network.
writers <Guid> : verbose information related with a specific DataWriter.
reader : DataReaders discovered in the network.
reader verbose : verbose information about DataReaders discovered in the network.
reader <Guid> : verbose information related with a specific DataReader.
topics : Topics discovered in the network in compact format.
topics v : Topics discovered in the network.
topics vv : verbose information about Topics discovered in the network.
topics <name> : Topics discovered in the network filtered by name (wildcard allowed (*)).
topics <name> idl : Display the IDL type definition for topics matching <name> (wildcards allowed).
filters : Display the active filters.
filters clear : Clear all the filter lists.
filters remove : Remove all the filter lists.
filter clear <category> : Clear <category> filter list.
filter remove <category> : Remove <category> filter list.
filter set <category> <filter_str> : Set <category> filter list with <filter_str> as first value.
filter add <category> <filter_str> : Add <filter_str> in <category> filter list.
filter remove <category> <filter_str> : Remove <filter_str> in <category> filter list.
echo <name> : data of a specific Topic (Data Type must be discovered).
echo <wildcard_name> : data of Topics matching the wildcard name (and whose Data Type is discovered).
echo <name> verbose : data with additional source info of a specific Topic.
echo <wildcard_name> verbose : data with additional source info of Topics matching the topic name (wildcard allowed (*)).
echo all : verbose data of all topics (only those whose Data Type is discovered).

Notes and comments:
To exit from data printing, press enter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class SpyDdsParticipant : public ddspipe::participants::DynTypesParticipant
std::shared_ptr<ddspipe::core::IReader> create_reader(
const ddspipe::core::ITopic& topic) override;

//! Override create_reader_() IParticipant method
FASTDDSSPY_PARTICIPANTS_DllAPI
std::shared_ptr<ddspipe::core::IReader> create_reader_with_filter(
const ddspipe::core::ITopic& topic,
const std::set<std::string> partitions) override;

class SpyDdsParticipantListener : public ddspipe::participants::DynTypesParticipant::DynTypesRtpsListener
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct ComplexEndpointData
{
std::string topic_name;
std::string topic_type;
std::string partition;
};

struct QoS
Expand Down Expand Up @@ -99,6 +100,7 @@ struct ComplexTopicData
struct Endpoint
{
ddspipe::core::types::Guid guid;
std::string partition;
};

std::string name;
Expand All @@ -113,6 +115,7 @@ struct DdsDataData
{
SimpleEndpointData::Topic topic;
ddspipe::core::types::Guid writer;
std::string partitions;
TimestampData timestamp;
};

Expand Down
Loading
Loading