Component.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package RobotAPI::ArmarXObjects::MemoryToDebugObserver
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2023
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
27 #include <ArmarXCore/util/tasks.h>
28 
30 
33 
35 {
36 
37  /**
38  * @defgroup Component-MemoryToDebugObserver MemoryToDebugObserver
39  * @ingroup RobotAPI-Components
40  *
41  * Transfers data from the memory system to the \ref Component-DebugObserver "Debug Observer",
42  * allowing to visualize them in the \ref ArmarXGui-GuiPlugins-PlotterPlugin "Live Plotter".
43  *
44  * @see armarx::armem::client::util::MemoryToDebugObserver for the business logic
45  * implementation.
46  *
47  * @class Component
48  * @ingroup Component-MemoryToDebugObserver
49  * @brief Implementation of \ref Component-MemoryToDebugObserver.
50  *
51  * @see armarx::armem::client::util::MemoryToDebugObserver for the business logic
52  * implementation.
53  */
54  class Component :
55  virtual public armarx::Component,
56  virtual public armarx::armem::ClientPluginUser,
59  {
60  public:
61  Component();
62 
63  /// @see armarx::ManagedIceObject::getDefaultName()
64  std::string getDefaultName() const override;
65 
66  // LightweightRemoteGuiComponentPluginUser interface
67  public:
68  void createRemoteGuiTab();
69  void RemoteGui_update() override;
70 
71 
72  protected:
74 
75  void onInitComponent() override;
76  void onConnectComponent() override;
77  void onDisconnectComponent() override;
78  void onExitComponent() override;
79 
80  void runLoop();
81 
82 
83  private:
84  struct Properties
85  {
87  std::string memoryToDebugObserverJson;
88 
89  float pollFrequencyHz = 30;
90  };
91 
92  Properties properties;
93 
95 
96  struct RemoteGuiTab : RemoteGui::Client::Tab
97  {
98  std::atomic_bool rebuild = false;
99 
101  };
102 
103  RemoteGuiTab tab;
104  };
105 } // namespace armarx::memory_to_debug_observer
armarx::memory_to_debug_observer::Component::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: Component.cpp:107
armarx::memory_to_debug_observer
Definition: Component.cpp:30
armarx::memory_to_debug_observer::Component::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: Component.cpp:124
armarx::RemoteGui::Client::Tab
Definition: Tab.h:15
armarx::memory_to_debug_observer::Component::RemoteGui_update
void RemoteGui_update() override
Definition: Component.cpp:160
LightweightRemoteGuiComponentPlugin.h
armarx::armem::client::plugins::PluginUser
Adds the Memory Name System client component plugin.
Definition: PluginUser.h:29
armarx::memory_to_debug_observer::Component::Component
Component()
Definition: Component.cpp:85
armarx::memory_to_debug_observer::Component::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:34
armarx::memory_to_debug_observer::Component::runLoop
void runLoop()
Definition: Component.cpp:129
MemoryToDebugObserver.h
armarx::RemoteGui::Client::GroupBox
Definition: Widgets.h:193
armarx::memory_to_debug_observer::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:90
DebugObserverComponentPlugin.h
armarx::armem::client::util::MemoryToDebugObserver::Properties
Configuration.
Definition: MemoryToDebugObserver.h:59
armarx::LightweightRemoteGuiComponentPluginUser
Definition: LightweightRemoteGuiComponentPlugin.h:73
tasks.h
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::DebugObserverComponentPluginUser
Definition: DebugObserverComponentPlugin.h:82
PluginUser.h
armarx::memory_to_debug_observer::Component
Implementation of MemoryToDebugObserver.
Definition: Component.h:54
armarx::memory_to_debug_observer::Component::createRemoteGuiTab
void createRemoteGuiTab()
Definition: Component.cpp:148
armarx::memory_to_debug_observer::Component::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: Component.cpp:117
armarx::memory_to_debug_observer::Component::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: Component.cpp:96