RemoteGuiProvider.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 ArmarXGui::ArmarXObjects::RemoteGuiProvider
17 * @author Fabian Paus ( fabian dot paus at kit dot edu )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25
26#include <mutex>
27
29
30#include <ArmarXGui/interface/RemoteGuiInterface.h>
32
33namespace armarx
34{
35 /**
36 * @class RemoteGuiProviderPropertyDefinitions
37 * @brief
38 */
40 {
41 public:
44 {
46 "TopicName",
47 "RemoteGuiTopic",
48 "Name of the topic on which updates to the remote state are reported.");
49 }
50 };
51
52 /**
53 * @defgroup Component-RemoteGuiProvider RemoteGuiProvider
54 * @ingroup ArmarXGui-Components
55 * A description of the component RemoteGuiProvider.
56 *
57 * @class RemoteGuiProvider
58 * @ingroup Component-RemoteGuiProvider
59 * @brief Brief description of class RemoteGuiProvider.
60 *
61 * Detailed description of class RemoteGuiProvider.
62 */
64 virtual public armarx::Component,
65 virtual public armarx::RemoteGuiInterface
66 {
67 public:
68 /**
69 * @see armarx::ManagedIceObject::getDefaultName()
70 */
71 std::string
72 getDefaultName() const override
73 {
74 return "RemoteGuiProvider";
75 }
76
77 protected:
78 /**
79 * @see armarx::ManagedIceObject::onInitComponent()
80 */
81 void onInitComponent() override;
82
83 /**
84 * @see armarx::ManagedIceObject::onConnectComponent()
85 */
86 void onConnectComponent() override;
87
88 /**
89 * @see armarx::ManagedIceObject::onDisconnectComponent()
90 */
91 void onDisconnectComponent() override;
92
93 /**
94 * @see armarx::ManagedIceObject::onExitComponent()
95 */
96 void onExitComponent() override;
97
98 /**
99 * @see PropertyUser::createPropertyDefinitions()
100 */
102
103 // RemoteGuiInterface interface
104 public:
105 std::string getTopicName(const Ice::Current&) override;
106
107 void createTab(const std::string& tabId,
108 const RemoteGui::WidgetPtr& rootWidget,
109 const Ice::Current&) override;
110 void removeTab(const std::string& tabId, const Ice::Current&) override;
111
112 RemoteGui::WidgetMap getTabs(const Ice::Current&) override;
113 RemoteGui::TabWidgetStateMap getTabStates(const Ice::Current&) override;
114 RemoteGui::TabValueMap getValuesForAllTabs(const Ice::Current&) override;
115 RemoteGui::ValueMap getValues(const std::string& tabId, const Ice::Current&) override;
116
117 void setValue(const std::string& tabId,
118 const std::string& widgetName,
119 const RemoteGui::ValueVariant& value,
120 const Ice::Current&) override;
121 void setValues(const std::string& tabId,
122 const RemoteGui::ValueMap& values,
123 const Ice::Current&) override;
124
125 RemoteGui::WidgetStateMap getWidgetStates(const std::string& tabId,
126 const Ice::Current&) override;
127 void setWidgetStates(const std::string& tabId,
128 const RemoteGui::WidgetStateMap& state,
129 const Ice::Current&) override;
130
131 private:
132 std::string topicName;
133
134 RemoteGuiListenerInterfacePrx topic;
135
136 std::mutex tabMutex;
137 RemoteGui::WidgetMap tabs;
138 RemoteGui::TabWidgetStateMap tabWidgetStates;
139 RemoteGui::TabValueMap tabStates;
140 };
141} // namespace armarx
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
Brief description of class RemoteGuiProvider.
RemoteGui::TabWidgetStateMap getTabStates(const Ice::Current &) override
RemoteGui::WidgetStateMap getWidgetStates(const std::string &tabId, const Ice::Current &) override
void removeTab(const std::string &tabId, const Ice::Current &) override
void createTab(const std::string &tabId, const RemoteGui::WidgetPtr &rootWidget, const Ice::Current &) override
void onDisconnectComponent() override
void setWidgetStates(const std::string &tabId, const RemoteGui::WidgetStateMap &state, const Ice::Current &) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
RemoteGui::ValueMap getValues(const std::string &tabId, const Ice::Current &) override
RemoteGui::WidgetMap getTabs(const Ice::Current &) override
RemoteGui::TabValueMap getValuesForAllTabs(const Ice::Current &) override
std::string getTopicName(const Ice::Current &) override
void setValues(const std::string &tabId, const RemoteGui::ValueMap &values, const Ice::Current &) override
void setValue(const std::string &tabId, const std::string &widgetName, const RemoteGui::ValueVariant &value, const Ice::Current &) override
std::string getDefaultName() const override
std::map< std::string, ValueVariant > ValueMap
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.