RTXI  2.4
The Real-Time eXperiment Interface Documentation
performance_measurement.h
Go to the documentation of this file.
1 /*
2  The Real-Time eXperiment Interface (RTXI)
3  Copyright (C) 2011 Georgia Institute of Technology, University of Utah, Weill Cornell Medical College
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 */
19 
20 #ifndef PERFORMANCE_MEASUREMENT_H
21 #define PERFORMANCE_MEASUREMENT_H
22 
23 #include <QWidget>
24 #include <QTextStream>
25 #include <QFile>
26 #include <QFileDialog>
27 #include <QMessageBox>
28 #include <QtWidgets>
29 
30 #include <plugin.h>
31 #include <rt.h>
32 #include <workspace.h>
33 #include <math/runningstat.h>
34 
36 {
37 class Panel;
38 class Plugin : public QObject, public ::Plugin::Object
39 {
40 
41  Q_OBJECT
42  friend class Panel;
43 
44 public:
45  static Plugin *getInstance(void);
46 
47 public slots:
49 private:
50  Plugin(void);
51  ~Plugin(void);
52  Plugin(const Plugin &) : QObject() {};
53  Plugin & operator=(const Plugin &)
54  {
55  return *getInstance();
56  };
57  static Plugin *instance;
58  Panel *panel;
59 }; // class Plugin
60 
61 class Panel : public QWidget, public RT::Device, public Workspace::Instance
62 {
63  Q_OBJECT
64 
65 public:
66  Panel(QWidget *);
67  virtual
68  ~Panel(void);
69 
73  void read(void);
74 
78  void write(void);
79 
80 public slots:
81 
85  void reset(void);
86  void resetMaxTimeStep(void);
87 
91  void update(void);
92 
93 private:
94 
95  enum
96  {
97  INIT1, INIT2, EXEC,
98  } state;
99 
100  double duration;
101  double lastRead;
102  double timestep;
103  double latency;
104  double maxDuration;
105  double maxTimestep;
106  double maxLatency;
107  double jitter;
108 
109  RunningStat timestepStat;
110  RunningStat latencyStat;
111 
112  QLineEdit *durationEdit;
113  QLineEdit *timestepEdit;
114  QLineEdit *maxDurationEdit;
115  QLineEdit *maxTimestepEdit;
116  QLineEdit *timestepJitterEdit;
117  QLineEdit *AppCpuPercentEdit;
118 }; // class Panel
119 }; // namespace PerformanceMeasurement
120 #endif /* PERFORMANCE_MEASUREMENT_H */
PerformanceMeasurement::Panel::write
void write(void)
Definition: performance_measurement.cpp:151
Workspace::Instance
Definition: workspace.h:76
Plugin::Object
Definition: plugin.h:145
workspace.h
plugin.h
PerformanceMeasurement::Plugin::createPerformanceMeasurementPanel
void createPerformanceMeasurementPanel(void)
Definition: performance_measurement.cpp:213
PerformanceMeasurement::Plugin::getInstance
static Plugin * getInstance(void)
Definition: performance_measurement.cpp:223
RT::Device
Definition: rt.h:517
PerformanceMeasurement::Panel::reset
void reset(void)
Definition: performance_measurement.cpp:172
PerformanceMeasurement::Panel::~Panel
virtual ~Panel(void)
Definition: performance_measurement.cpp:117
PerformanceMeasurement::Panel::resetMaxTimeStep
void resetMaxTimeStep(void)
Definition: performance_measurement.cpp:179
PerformanceMeasurement
Definition: performance_measurement.h:35
rt.h
Plugin
Classes associated with the loading/unloading of binaries at run-time.
Definition: plugin.h:35
PerformanceMeasurement::Panel::read
void read(void)
Definition: performance_measurement.cpp:122
PerformanceMeasurement::Panel::update
void update(void)
Definition: performance_measurement.cpp:184
PerformanceMeasurement::Panel
Definition: performance_measurement.h:61
PerformanceMeasurement::Plugin::Panel
friend class Panel
Definition: performance_measurement.h:42
PerformanceMeasurement::Panel::Panel
Panel(QWidget *)
Definition: performance_measurement.cpp:36