Ignition Gui

API Reference

5.0.0
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 IGNITION_GUI_PLUGINS_WORLDSTATS_HH_
19 #define IGNITION_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 <ignition/transport.hh>
31 
32 #include "ignition/gui/Export.hh"
33 #include "ignition/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 
69  {
70  Q_OBJECT
71 
73  Q_PROPERTY(
74  QString realTimeFactor
75  READ RealTimeFactor
76  WRITE SetRealTimeFactor
77  NOTIFY RealTimeFactorChanged
78  )
79 
80 
81  Q_PROPERTY(
82  QString simTime
83  READ SimTime
84  WRITE SetSimTime
85  NOTIFY SimTimeChanged
86  )
87 
89  Q_PROPERTY(
90  QString realTime
91  READ RealTime
92  WRITE SetRealTime
93  NOTIFY RealTimeChanged
94  )
95 
97  Q_PROPERTY(
98  QString iterations
99  READ Iterations
100  WRITE SetIterations
101  NOTIFY IterationsChanged
102  )
103 
105  public: WorldStats();
106 
108  public: virtual ~WorldStats();
109 
110  // Documentation inherited
111  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem);
112 
114  public slots: void ProcessMsg();
115 
118  public: Q_INVOKABLE QString RealTimeFactor() const;
119 
122  public: Q_INVOKABLE void SetRealTimeFactor(const QString &_realTimeFactor);
123 
125  signals: void RealTimeFactorChanged();
126 
129  public: Q_INVOKABLE QString SimTime() const;
130 
133  public: Q_INVOKABLE void SetSimTime(const QString &_simTime);
134 
136  signals: void SimTimeChanged();
137 
140  public: Q_INVOKABLE QString RealTime() const;
141 
144  public: Q_INVOKABLE void SetRealTime(const QString &_realTime);
145 
147  signals: void RealTimeChanged();
148 
151  public: Q_INVOKABLE QString Iterations() const;
152 
155  public: Q_INVOKABLE void SetIterations(const QString &_iterations);
156 
158  signals: void IterationsChanged();
159 
161  private: void OnWorldStatsMsg(const ignition::msgs::WorldStatistics &_msg);
162 
163  // Private data
164  private: std::unique_ptr<WorldStatsPrivate> dataPtr;
165  };
166 }
167 }
168 }
169 
170 #endif
#define WorldStats_EXPORTS_API
Definition: WorldStats.hh:36
STL namespace.
Definition: Application.hh:35
Base class for Ignition GUI plugins.
Definition: Plugin.hh:54
Definition: Application.hh:40