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 Navigation::ArmarXObjects::ControlMemory
17  * @author Fabian Reister ( fabian dot reister at kit dot edu )
18  * @date 2021
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
27 
29 
33 // #include <ArmarXCore/libraries/ArmarXCoreComponentPlugins/DebugObserverComponentPlugin.h>
34 
35 #include <mutex>
36 
37 
39 {
40 
41  /**
42  * @defgroup Component-ControlMemory ControlMemory
43  * @ingroup armarx_navigation-Components
44  * A description of the component ControlMemory.
45  *
46  * @class ControlMemory
47  * @ingroup Component-ControlMemory
48  * @brief Brief description of class ControlMemory.
49  *
50  * Detailed description of class ControlMemory.
51  */
52  class Component :
53  virtual public armarx::Component
54  // , virtual public armarx::DebugObserverComponentPluginUser
55  ,
57  virtual public armarx::ArVizComponentPluginUser,
59  {
60  public:
61  /// @see armarx::ManagedIceObject::getDefaultName()
62  std::string getDefaultName() const override;
63  static std::string GetDefaultName();
64 
65 
66  protected:
67  /// @see PropertyUser::createPropertyDefinitions()
69 
70  /// @see armarx::ManagedIceObject::onInitComponent()
71  void onInitComponent() override;
72 
73  /// @see armarx::ManagedIceObject::onConnectComponent()
74  void onConnectComponent() override;
75 
76  /// @see armarx::ManagedIceObject::onDisconnectComponent()
77  void onDisconnectComponent() override;
78 
79  /// @see armarx::ManagedIceObject::onExitComponent()
80  void onExitComponent() override;
81 
82 
83  void createRemoteGuiTab();
84  void RemoteGui_update() override;
85 
86 
87  private:
88  void visuRun();
89 
90  void loadDefaultConfigs();
91 
92 
93  private:
94  /// Properties shown in the Scenario GUI.
95  struct Properties
96  {
97  std::string snapshotToLoad = "";
98 
100  {
101  bool visuLocations = true;
102  bool visuGraphEdges = true;
103  float visuFrequency = 2;
104  };
105  LocationGraph locationGraph;
106  };
107  Properties properties;
108  std::mutex propertiesMutex;
109 
110 
111  /// Tab shown in the Remote GUI.
112  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
113  {
115  {
117 
120 
121  void setup(Component& owner);
122  void update(Component& owner);
123  };
124  LocationGraph locationGraph;
125  };
126  RemoteGuiTab tab;
127 
128 
129  struct Tasks
130  {
132  };
133  Tasks tasks;
134  };
135 
136 } // namespace armarx::control
ArVizComponentPlugin.h
armarx::control::components::control_memory::Component::RemoteGuiTab::LocationGraph
Definition: Component.h:114
armarx::control::components::control_memory::Component::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:65
ReadWritePluginUser.h
armarx::control::components::control_memory::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:470
plugins.h
armarx::RemoteGui::Client::Tab
Definition: Tab.h:15
armarx::control::components::control_memory::Component::onInitComponent
void onInitComponent() override
Definition: Component.cpp:95
armarx::control::components::control_memory::Component::RemoteGuiTab::LocationGraph::visuLocations
armarx::RemoteGui::Client::CheckBox visuLocations
Definition: Component.h:118
armarx::control::components::control_memory
Definition: Component.cpp:60
armarx::control::components::control_memory::Component::RemoteGui_update
void RemoteGui_update() override
Definition: Component.cpp:504
armarx::control::components::control_memory::Component::RemoteGuiTab::LocationGraph::group
armarx::RemoteGui::Client::GroupBox group
Definition: Component.h:116
LightweightRemoteGuiComponentPlugin.h
armarx::control::components::control_memory::Component::RemoteGuiTab::LocationGraph::visuGraphEdges
armarx::RemoteGui::Client::CheckBox visuGraphEdges
Definition: Component.h:119
armarx::control::components::control_memory::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:464
armarx::control::components::control_memory::Component::Properties::LocationGraph::visuLocations
bool visuLocations
Definition: Component.h:101
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
armarx::control::components::control_memory::Component::RemoteGuiTab::LocationGraph::update
void update(Component &owner)
Definition: Component.cpp:532
armarx::control::components::control_memory::Component::Properties::LocationGraph::visuFrequency
float visuFrequency
Definition: Component.h:103
armarx::armem::server::plugins::ReadWritePluginUser
Base class of memory server components.
Definition: ReadWritePluginUser.h:20
armarx::RemoteGui::Client::GroupBox
Definition: Widgets.h:193
armarx::control::components::control_memory::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:436
armarx::control::components::control_memory::Component
Definition: Component.h:52
TaskUtil.h
armarx::LightweightRemoteGuiComponentPluginUser
Definition: LightweightRemoteGuiComponentPlugin.h:73
armarx::control::components::control_memory::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:476
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::control::components::control_memory::Component::RemoteGuiTab::LocationGraph::setup
void setup(Component &owner)
Definition: Component.cpp:511
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::control::components::control_memory::Component::GetDefaultName
static std::string GetDefaultName()
Definition: Component.cpp:482
armarx::RemoteGui::Client::CheckBox
Definition: Widgets.h:129
armarx::control::components::control_memory::Component::Properties::LocationGraph
Definition: Component.h:99
armarx::control::components::control_memory::Component::Properties::LocationGraph::visuGraphEdges
bool visuGraphEdges
Definition: Component.h:102
armarx::control::components::control_memory::Component::createRemoteGuiTab
void createRemoteGuiTab()
Definition: Component.cpp:489