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
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,
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
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
void onInitComponent() override
Pure virtual hook for the subclass.
Definition Component.cpp:96
void onDisconnectComponent() override
Hook for subclass.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition Component.cpp:34
void onConnectComponent() override
Pure virtual hook for the subclass.
void onExitComponent() override
Hook for subclass.
std::string getDefaultName() const override
Definition Component.cpp:90
client::plugins::PluginUser ClientPluginUser
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.