|
|
Directory dependency graph for armem_gui:Directories | |
| controller | |
| core | |
| model | |
| util | |
| view | |
Files | |
| MemoryViewer.cpp | |
| MemoryViewer.h | |
Issue boards: []( .../-/issues/?sort=updated_desc&state=opened&label_name[]=bug&first_page_size=20 ) [
]( .../-/issues/?sort=updated_desc&state=opened&label_name[]=migration&first_page_size=20 ) [
]( .../-/issues/?sort=updated_desc&state=opened&label_name[]=migration&first_page_size=20 ) | Setup: [
]( ./Installation.md ) | Maintainer: [
]( ./.gitlab/CODEOWNERS )
[[TOC]]
The armem_gui package provides a graphical interface for interacting with the ArmarX Memory system. It is designed to support users in visualizing and managing memory-related data. The GUI consists of the following core interface elements, that form the Memory Viewer:
The armem_guifollows a Model-View-Controller design pattern. In this structure:
The folder structure of the armem_gui package follows the MVC architecture used throughout the module. Each of the main directories reflects one of the core MVC responsibilities:
model/ - contains the data models used by the GUIview/ - contains the graphical components and widgets structured in several subfolderscontroller/ - contains most of the logic and coordinates between model and viewThe package additionaly includes several supporting folders:
core/ - base class(es) for the systemresources/ - GIFs, icons are stored hereutil/ - helper classes und utility functionalitytest/ - unit testsIn this GUI, each major component (except the status label) has its own dedicated controller:
MemoryViewer - serves as the central entry point of the GUI and manages the connection to the memory name systemDiskIOController - responsible for loading and storing memory data from and to diskPeriodicUpdateController - manages (periodic) memory updates on a separate thread (in PeriodicUpdateWorker)MemoryGroupBoxController - handles interactions within the memory tab widgetInstanceGroupBoxController - manages functionality related to the selected memory instanceThe MemoryViewer starts by creating the DiskIOController and the PeriodicUpdateController. The PeriodicUpdateController then creates the MemoryGroupBoxController, which then creates the InstanceGroupBoxController.
The GUI is composed of the following view components:
DiskIOView - located on the right side of the control barPeriodicUpdateView- located on the left side of the control barMemoryGroupBoxView - represents the Memory BoxInstanceGroupBoxView - represents the Instance ViewThe following diagram shows the general relationsship between the GUI components: 
There are multiple ways to open the Memory Viewer after starting ArmarXGUI.
First of all, at least the armar7_l1_1_low_level_components_sim and armar7_l2_1_memory_sim scenarios must be running. If so, the available memories will be listed in the Query Settings tab. The memories can be selected here and after clicking on the Update button, the Memory Tree will display the selected memories. Instead of manually clicking Update all the time, it is possible to activate Auto Update, which may slow down the system.
When selecting an Entity instance in the Memory Tree, the entity-specific data is shown in the Instance View, which is located on the right side of the Memory Viewer.
This tab allows you to check/uncheck the available memory checkboxes and provides some additional query settings.
This tab allows you to select different snapshot forms, that are used as the query input.
Generates predictions unsing a prediction engine. Not maintained at the moment!
Not maintained at the moment!
Allows you to independently select available memories for long term memory recording.
The Store shown Data on Disk button allows to store the data of the selected memories in a folder on the disk, which can later be loaded back in with the Load Query from Disk into WM button.
The Memory Viewer can be opened and explored without any scenarios running in the background. However to actively interact with memories, at least the following scenarios must be running:
| Scenario | Minimal set of components that need to work |
|---|---|
armar7_l2_1_memory_sim | RobotAPI |
armar7_l1_1_low_level_components_sim | ArmarXGui, RobotAPI |
The folowing example shows how to extend an existing view component. In this case the DiskIOView. The same procedure applies to any other view in this package. We will add a new button to the widget to trigger a custom controller action using Qt's signal/slot mechanism.
In DiskIOView.h, declare the button as a private member:
In the constructur of DiskIOView.cpp, create the button and add it to the layout:
After rebuilding, the new button will appear in the GUI. However, at this point it does not trigger any behavior.
In DiskIOView.h, declare a new signal that will be emitted when the button is pressed:
Next, connect the button press to the signal in the constructor in DiskIOView.cpp:
To react to this signal, add a correspondig slot in DiskIOController.h:
Then implement the slot in DiskIOController.cpp. In our case it is only a message to the console, but technically you can implement new functionality here:
Finally, connect the view's signal with the controller's slot in the DiskIOController.cpp constructor:
After rebuilding and running the application again, pressing the new button will trigger the controller slot and print:
If you want to add new funtionality, that does not fit in any of the existing tabs/widgets, it is possible to add a new tab in the existing tab group.
Lets start by creating a new folder tutorial_widget in view/memory_group, where all existing tabs can be found. In tutorial_widget create a new header file TutorialWidget.h with the following content:
Now let's create the source file TutorialWidget.cpp with the content:
Most widgets use a QVBoxLayout, but any layout can be used here.
Now TutorialWidget.h and TutorialWidget.cpp need to be added to the HEADERS/**SOURCES** in the CMakeLists.txt.
Next the new tab needs to be added to the existing tab group, which is located in MemoryGroupBoxView. In MemoryGroupBoxView.h add the new private member:
and add the include:
Now in the constructor in MemoryGroupBoxView.cpp add the new Widget to the tab group:
After rebuilding and running the application a new empty tab will show up. New functionality can be added here. To learn how to add a button we refer to the previous tutorial.
If you experience any problems with this documentation, or find certain aspects not to be covered, please feel free to create an issue. This helps us to keep the documentation up to date and to improve it. Thank you!