TopicReplayerWidgetController.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarXGui::gui-plugins::TopicReplayerWidgetController
17 * @author Stefan Reither ( stef dot reither at web dot de )
18 * @date 2016
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <QTimer>
26
30
31#include <ArmarXGui/gui-plugins/TopicReplayerPlugin/ui_TopicReplayerWidget.h>
34
35namespace armarx
36{
37 /**
38 \page ArmarXGui-GuiPlugins-TopicReplayer TopicReplayer
39 \brief The TopicReplayer allows replaying files that contain recorded topics.
40
41 \image html TopicReplayer.png
42
43 \note The TopicReplayer can only replay files that have been recorded by using the storage mode "database". \n
44 Files in the storage mode "file" have to be replayed by running the TopicReplayerAppRun in the command line.
45
46 The user can...
47 \li select which of the recorded topics should be replayed. <b>(1)</b>
48 \li adjust the replay speed to a value between 0,01x and 10,00x. <b>(2)</b>
49 \li and jump to any point of time in the replay <b>(3)</b>
50
51
52 API Documentation \ref TopicReplayerWidgetController
53
54 */
55
56 /**
57 * \class TopicReplayerWidgetController
58 * \brief TopicReplayerWidgetController is the controller of the widget of the TopicReplayerGui
59 */
61 public ArmarXComponentWidgetControllerTemplate<TopicReplayerWidgetController>
62 {
63 Q_OBJECT
64
65 public:
66 /**
67 * Controller Constructor
68 */
70
71 /**
72 * Controller destructor
73 */
75
76 /**
77 * @see ArmarXWidgetController::loadSettings()
78 */
79 void loadSettings(QSettings* settings) override;
80
81 /**
82 * @see ArmarXWidgetController::saveSettings()
83 */
84 void saveSettings(QSettings* settings) override;
85
86 /**
87 * Returns the Widget name displayed in the ArmarXGui to create an
88 * instance of this class.
89 */
90 static QString
92 {
93 return "Meta.TopicReplayer";
94 }
95
96 /**
97 * \see armarx::Component::onInitComponent()
98 */
99 void onInitComponent() override;
100
101 /**
102 * \see armarx::Component::onConnectComponent()
103 */
104 void onConnectComponent() override;
105
106 public slots:
107 /* QT slot declarations */
108
109 signals:
110 /* QT signal declarations */
111
112 private slots:
113 void loadFile();
114 void loopReplay();
115 void pauseReplay();
116 void resumeReplay();
117
118 void setReplaySpeed();
119
120 void replaySpeedSliderChanged();
121 void replaySpeedSpinBoxChanged();
122 void replayPositionSliderChanged();
123 void updateReplayPositionSlider();
124
125 void stopSliderUpdater();
126 void startSliderUpdater();
127
128 void jumpToPosition();
129
130 private:
131 /**
132 * Widget Form
133 */
134 Ui::TopicReplayerWidget widget;
135
137 IceUtil::Time replayLength;
138
139 int replayPositionSliderUpdaterTimer;
140
141 void fillListOfRecordedTopics();
142 void setPausedGuiMode();
143 void setPlayingGuiMode();
144
145 void setUpReplayPositionSlider();
146
147 void onDisconnectComponent() override;
148 void timerEvent(QTimerEvent* event) override;
149 };
150} // namespace armarx
#define ARMARXCOMPONENT_IMPORT_EXPORT
void loadSettings(QSettings *settings) override
void saveSettings(QSettings *settings) override
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
This file offers overloads of toIce() and fromIce() functions for STL container types.