Ignition Gui

API Reference

5.0.0
Publisher.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef IGNITION_GUI_PLUGINS_PUBLISHER_HH_
19 #define IGNITION_GUI_PLUGINS_PUBLISHER_HH_
20 
21 #include <memory>
22 
23 #include "ignition/gui/Plugin.hh"
24 
25 #ifndef _WIN32
26 # define Publisher_EXPORTS_API
27 #else
28 # if (defined(Publisher_EXPORTS))
29 # define Publisher_EXPORTS_API __declspec(dllexport)
30 # else
31 # define Publisher_EXPORTS_API __declspec(dllimport)
32 # endif
33 #endif
34 
35 namespace ignition
36 {
37 namespace gui
38 {
39 namespace plugins
40 {
41  class PublisherPrivate;
42 
47  class Publisher_EXPORTS_API Publisher : public Plugin
48  {
49  Q_OBJECT
50 
52  Q_PROPERTY(
53  QString msgType
54  READ MsgType
55  WRITE SetMsgType
56  NOTIFY MsgTypeChanged
57  )
58 
59 
60  Q_PROPERTY(
61  QString msgData
62  READ MsgData
63  WRITE SetMsgData
64  NOTIFY MsgDataChanged
65  )
66 
68  Q_PROPERTY(
69  QString topic
70  READ Topic
71  WRITE SetTopic
72  NOTIFY TopicChanged
73  )
74 
76  Q_PROPERTY(
77  double frequency
78  READ Frequency
79  WRITE SetFrequency
80  NOTIFY FrequencyChanged
81  )
82 
84  public: Publisher();
85 
87  public: virtual ~Publisher();
88 
89  // Documentation inherited
90  public: virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem);
91 
94  public slots: void OnPublish(const bool _checked);
95 
99  public: Q_INVOKABLE QString MsgType() const;
100 
104  public: Q_INVOKABLE void SetMsgType(const QString &_msgType);
105 
107  signals: void MsgTypeChanged();
108 
112  public: Q_INVOKABLE QString MsgData() const;
113 
117  public: Q_INVOKABLE void SetMsgData(const QString &_msgData);
118 
120  signals: void MsgDataChanged();
121 
125  public: Q_INVOKABLE QString Topic() const;
126 
130  public: Q_INVOKABLE void SetTopic(const QString &_topic);
131 
133  signals: void TopicChanged();
134 
137  public: Q_INVOKABLE double Frequency() const;
138 
141  public: Q_INVOKABLE void SetFrequency(const double _frequency);
142 
144  signals: void FrequencyChanged();
145 
148  private: std::unique_ptr<PublisherPrivate> dataPtr;
149  };
150 }
151 }
152 }
153 
154 #endif
STL namespace.
Definition: Application.hh:35
Base class for Ignition GUI plugins.
Definition: Plugin.hh:54
#define Publisher_EXPORTS_API
Definition: Publisher.hh:26
Plotting Topic to handle published topics & their registered fields.
Definition: PlottingInterface.hh:95
Definition: Application.hh:40