DebugObserverComponentPlugin.cpp
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::ArmarXGuiComponentPlugins
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2019
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
24
26
28{
29 void
31 {
33 ARMARX_CHECK_EMPTY(_topicName);
34 _topicName = name;
35 }
36
37 std::string
39 {
40 return _topicName;
41 }
42
43 void
45 {
46 if (_topicName.empty())
47 {
48 parent<Component>().getProperty(_topicName, makePropertyName(_propertyName));
49 }
50 parent<Component>().offeringTopic(_topicName);
51 }
52
53 void
58
59 void
61 {
62 if (!getDebugObserver())
63 {
64 setDebugObserver(parent<Component>().getTopic<DebugObserverInterfacePrx>(_topicName));
65 }
66 }
67
68 void
70 {
71 if (!properties->hasDefinition(makePropertyName(_propertyName)))
72 {
73 properties->defineOptionalProperty<std::string>(
74 makePropertyName(_propertyName),
75 "DebugObserver",
76 "Name of the topic the DebugObserver listens on");
77 }
78 }
79} // namespace armarx::plugins
80
81namespace armarx
82{
87
90 {
91 return *_debugObserverComponentPlugin;
92 }
93
94 void
96 StringVariantBaseMap valueMap) const
97 {
98 _debugObserverComponentPlugin->setDebugObserverChannel(channelName, valueMap);
99 }
100
101 void
103 const std::string& channelname) const
104 {
105 _debugObserverComponentPlugin->removeDebugObserverChannel(channelname);
106 }
107
108 void
110 const std::string& channelName,
111 const std::string& datafieldName) const
112 {
113 _debugObserverComponentPlugin->removeDebugObserverDatafield(channelName, datafieldName);
114 }
115
116 void
118 {
119 _debugObserverComponentPlugin->removeAllDebugObserverChannels();
120 }
121
124 {
125 return _debugObserverComponentPlugin->getDebugObserver();
126 }
127
128 void
130 {
131 _debugObserverComponentPlugin->setDebugObserverBatchModeEnabled(enable);
132 }
133
134 void
136 {
137 _debugObserverComponentPlugin->sendDebugObserverBatch();
138 }
139} // namespace armarx
#define ARMARX_CHECK_NOT_EMPTY(c)
#define ARMARX_CHECK_EMPTY(c)
void setDebugObserverChannel(const std::string &channelName, StringVariantBaseMap valueMap) const
plugins::DebugObserverComponentPlugin & getDebugObserverComponentPlugin()
void removeDebugObserverDatafield(const std::string &channelName, const std::string &datafieldName) const
const DebugObserverInterfacePrx & getDebugObserver() const
void removeDebugObserverChannel(const std::string &channelname) const
void setDebugObserverChannel(const std::string &channelName, StringVariantBaseMap valueMap) const
void setChannelName(const std::string &name)
const DebugObserverInterfacePrx & getDebugObserver() const
void setDebugObserver(const DebugObserverInterfacePrx &prx)
std::string makePropertyName(const std::string &name)
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
Brief description of class DebugObserverComponentPlugin.
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
This file is part of ArmarX.
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
std::map< std::string, VariantBasePtr > StringVariantBaseMap
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.