Gazebo Gui

API Reference

3.12.1
WorldStats.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 GZ_GUI_PLUGINS_WORLDSTATS_HH_
19 #define GZ_GUI_PLUGINS_WORLDSTATS_HH_
20 
21 #include <memory>
22 
23 #ifdef _MSC_VER
24 #pragma warning(push, 0)
25 #endif
26 #include <ignition/msgs.hh>
27 #ifdef _MSC_VER
28 #pragma warning(pop)
29 #endif
30 #include <gz/transport.hh>
31 
32 #include "gz/gui/Export.hh"
33 #include "gz/gui/Plugin.hh"
34 
35 #ifndef _WIN32
36 # define WorldStats_EXPORTS_API
37 #else
38 # if (defined(WorldStats_EXPORTS))
39 # define WorldStats_EXPORTS_API __declspec(dllexport)
40 # else
41 # define WorldStats_EXPORTS_API __declspec(dllimport)
42 # endif
43 #endif
44 
45 namespace ignition
46 {
47 namespace gui
48 {
49 namespace plugins
50 {
51  class WorldStatsPrivate;
52 
73  class WorldStats_EXPORTS_API WorldStats: public gz::gui::Plugin
74  {
75  Q_OBJECT
76 
78  Q_PROPERTY(
79  QString realTimeFactor
80  READ RealTimeFactor
81  WRITE SetRealTimeFactor
82  NOTIFY RealTimeFactorChanged
83  )
84 
85 
86  Q_PROPERTY(
87  QString simTime
88  READ SimTime
89  WRITE SetSimTime
90  NOTIFY SimTimeChanged
91  )
92 
94  Q_PROPERTY(
95  QString realTime
96  READ RealTime
97  WRITE SetRealTime
98  NOTIFY RealTimeChanged
99  )
100 
102  Q_PROPERTY(
103  QString iterations
104  READ Iterations
105  WRITE SetIterations
106  NOTIFY IterationsChanged
107  )
108 
110  public: WorldStats();
111 
113  public: virtual ~WorldStats();
114 
115  // Documentation inherited
116  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem);
117 
119  public slots: void ProcessMsg();
120 
123  public: Q_INVOKABLE QString RealTimeFactor() const;
124 
127  public: Q_INVOKABLE void SetRealTimeFactor(const QString &_realTimeFactor);
128 
130  signals: void RealTimeFactorChanged();
131 
134  public: Q_INVOKABLE QString SimTime() const;
135 
138  public: Q_INVOKABLE void SetSimTime(const QString &_simTime);
139 
141  signals: void SimTimeChanged();
142 
145  public: Q_INVOKABLE QString RealTime() const;
146 
149  public: Q_INVOKABLE void SetRealTime(const QString &_realTime);
150 
152  signals: void RealTimeChanged();
153 
156  public: Q_INVOKABLE QString Iterations() const;
157 
160  public: Q_INVOKABLE void SetIterations(const QString &_iterations);
161 
163  signals: void IterationsChanged();
164 
166  private: void OnWorldStatsMsg(const gz::msgs::WorldStatistics &_msg);
167 
168  // Private data
169  private: std::unique_ptr<WorldStatsPrivate> dataPtr;
170  };
171 }
172 }
173 }
174 
175 #endif
This plugin provides a time panel which may display:
Definition: WorldStats.hh:73
#define WorldStats_EXPORTS_API
Definition: WorldStats.hh:36
Base class for Gazebo GUI plugins.
Definition: gz/gui/Plugin.hh:54
STL namespace.
Definition: gz/gui/Application.hh:35