MessageDisplayComponentPlugin.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 
27 
28 namespace armarx::plugins
29 {
30  void MessageDisplayComponentPlugin::setDisplayMessage(const std::string& caption, const std::string& subCaption) const
31  {
32  ARMARX_CHECK_NOT_NULL(_display);
33  _display->setMessage(caption, subCaption);
34  }
35  void MessageDisplayComponentPlugin::setDisplayMessageCaption(const std::string& text) const
36  {
37  ARMARX_CHECK_NOT_NULL(_display);
38  _display->setCaption(text);
39  }
41  {
42  ARMARX_CHECK_NOT_NULL(_display);
43  _display->setSubCaption(text);
44  }
45 
46  const MessageDisplayInterfacePrx& MessageDisplayComponentPlugin::getMessageDisplay() const
47  {
48  return _display;
49  }
50 
52  {
53  if (!_display)
54  {
55  parent<Component>().offeringTopicFromProperty(_propertyName);
56  }
57  }
58 
60  {
61  if (!_display)
62  {
63  parent<Component>().getTopicFromProperty(_display, _propertyName);
64  }
65  }
66 
68  {
69  if (!properties->hasDefinition(_propertyName))
70  {
71  properties->defineOptionalProperty<std::string>(
72  _propertyName,
73  "MessageDisplayTopic",
74  "Name of the message display component that should be used");
75  }
76  }
77 }
78 
79 namespace armarx
80 {
82  {
83  addPlugin(_messageDisplayComponentPlugin);
84  }
85 
86  void MessageDisplayComponentPluginUser::setDisplayMessage(const std::string& caption, const std::string& subCaption) const
87  {
88  _messageDisplayComponentPlugin->setDisplayMessage(caption, subCaption);
89  }
91  {
92  _messageDisplayComponentPlugin->setDisplayMessageCaption(text);
93  }
95  {
96  _messageDisplayComponentPlugin->setDisplayMessageSubCaption(text);
97  }
98 
99  const MessageDisplayInterfacePrx& MessageDisplayComponentPluginUser::getMessageDisplay() const
100  {
101  return _messageDisplayComponentPlugin->getMessageDisplay();
102  }
103 }
armarx::MessageDisplayComponentPluginUser::setDisplayMessage
void setDisplayMessage(const std::string &caption, const std::string &subCaption) const
Definition: MessageDisplayComponentPlugin.cpp:86
armarx::plugins::MessageDisplayComponentPlugin::setDisplayMessageCaption
void setDisplayMessageCaption(const std::string &text) const
Definition: MessageDisplayComponentPlugin.cpp:35
ARMARX_CHECK_NOT_NULL
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
Definition: ExpressionException.h:206
armarx::plugins::MessageDisplayComponentPlugin::setDisplayMessageSubCaption
void setDisplayMessageSubCaption(const std::string &text) const
Definition: MessageDisplayComponentPlugin.cpp:40
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
Definition: ManagedIceObject.h:182
armarx::MessageDisplayComponentPluginUser::getMessageDisplay
const MessageDisplayInterfacePrx & getMessageDisplay() const
Definition: MessageDisplayComponentPlugin.cpp:99
armarx::plugins::MessageDisplayComponentPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition: MessageDisplayComponentPlugin.cpp:59
armarx::MessageDisplayComponentPluginUser::setDisplayMessageSubCaption
void setDisplayMessageSubCaption(const std::string &text) const
Definition: MessageDisplayComponentPlugin.cpp:94
MessageDisplayComponentPlugin.h
armarx::plugins::MessageDisplayComponentPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: MessageDisplayComponentPlugin.cpp:67
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:28
Component.h
armarx::plugins::MessageDisplayComponentPlugin::preOnInitComponent
void preOnInitComponent() override
Definition: MessageDisplayComponentPlugin.cpp:51
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::plugins::MessageDisplayComponentPlugin::setDisplayMessage
void setDisplayMessage(const std::string &caption, const std::string &subCaption) const
Definition: MessageDisplayComponentPlugin.cpp:30
armarx::MessageDisplayComponentPluginUser::MessageDisplayComponentPluginUser
MessageDisplayComponentPluginUser()
Definition: MessageDisplayComponentPlugin.cpp:81
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::plugins::MessageDisplayComponentPlugin::getMessageDisplay
const MessageDisplayInterfacePrx & getMessageDisplay() const
Definition: MessageDisplayComponentPlugin.cpp:46
armarx::MessageDisplayComponentPluginUser::setDisplayMessageCaption
void setDisplayMessageCaption(const std::string &text) const
Definition: MessageDisplayComponentPlugin.cpp:90