Ignition Gui

API Reference

1.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 #include <ignition/msgs.hh>
24 #include <ignition/transport.hh>
25 
26 #include "ignition/gui/Export.hh"
27 #include "ignition/gui/Plugin.hh"
28 
29 #ifndef _WIN32
30 # define WorldStats_EXPORTS_API
31 #else
32 # if (defined(WorldStats_EXPORTS))
33 # define WorldStats_EXPORTS_API __declspec(dllexport)
34 # else
35 # define WorldStats_EXPORTS_API __declspec(dllimport)
36 # endif
37 #endif
38 
39 namespace ignition
40 {
41 namespace gui
42 {
43 namespace plugins
44 {
45  class WorldStatsPrivate;
46 
61  {
62  Q_OBJECT
63 
65  Q_PROPERTY(
66  QString realTimeFactor
67  READ RealTimeFactor
68  WRITE SetRealTimeFactor
69  NOTIFY RealTimeFactorChanged
70  )
71 
72 
73  Q_PROPERTY(
74  QString simTime
75  READ SimTime
76  WRITE SetSimTime
77  NOTIFY SimTimeChanged
78  )
79 
81  Q_PROPERTY(
82  QString realTime
83  READ RealTime
84  WRITE SetRealTime
85  NOTIFY RealTimeChanged
86  )
87 
89  Q_PROPERTY(
90  QString iterations
91  READ Iterations
92  WRITE SetIterations
93  NOTIFY IterationsChanged
94  )
95 
97  public: WorldStats();
98 
100  public: virtual ~WorldStats();
101 
102  // Documentation inherited
103  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem);
104 
106  public slots: void ProcessMsg();
107 
110  public: Q_INVOKABLE QString RealTimeFactor() const;
111 
114  public: Q_INVOKABLE void SetRealTimeFactor(const QString &_realTimeFactor);
115 
117  signals: void RealTimeFactorChanged();
118 
121  public: Q_INVOKABLE QString SimTime() const;
122 
125  public: Q_INVOKABLE void SetSimTime(const QString &_simTime);
126 
128  signals: void SimTimeChanged();
129 
132  public: Q_INVOKABLE QString RealTime() const;
133 
136  public: Q_INVOKABLE void SetRealTime(const QString &_realTime);
137 
139  signals: void RealTimeChanged();
140 
143  public: Q_INVOKABLE QString Iterations() const;
144 
147  public: Q_INVOKABLE void SetIterations(const QString &_iterations);
148 
150  signals: void IterationsChanged();
151 
153  private: void OnWorldStatsMsg(const ignition::msgs::WorldStatistics &_msg);
154 
155  // Private data
156  private: std::unique_ptr<WorldStatsPrivate> dataPtr;
157  };
158 }
159 }
160 }
161 
162 #endif
#define WorldStats_EXPORTS_API
Definition: WorldStats.hh:30
STL namespace.
Definition: Application.hh:28
Base class for Ignition GUI plugins.
Definition: Plugin.hh:47
Definition: Application.hh:33