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 <ArmarXGui/gui-plugins/TopicReplayerPlugin/ui_TopicReplayerWidget.h>
26 
29 
32 
34 
35 #include <QTimer>
36 
37 namespace armarx
38 {
39  /**
40  \page ArmarXGui-GuiPlugins-TopicReplayer TopicReplayer
41  \brief The TopicReplayer allows replaying files that contain recorded topics.
42 
43  \image html TopicReplayer.png
44 
45  \note The TopicReplayer can only replay files that have been recorded by using the storage mode "database". \n
46  Files in the storage mode "file" have to be replayed by running the TopicReplayerAppRun in the command line.
47 
48  The user can...
49  \li select which of the recorded topics should be replayed. <b>(1)</b>
50  \li adjust the replay speed to a value between 0,01x and 10,00x. <b>(2)</b>
51  \li and jump to any point of time in the replay <b>(3)</b>
52 
53 
54  API Documentation \ref TopicReplayerWidgetController
55 
56  */
57 
58  /**
59  * \class TopicReplayerWidgetController
60  * \brief TopicReplayerWidgetController is the controller of the widget of the TopicReplayerGui
61  */
64  public ArmarXComponentWidgetControllerTemplate<TopicReplayerWidgetController>
65  {
66  Q_OBJECT
67 
68  public:
69  /**
70  * Controller Constructor
71  */
73 
74  /**
75  * Controller destructor
76  */
78 
79  /**
80  * @see ArmarXWidgetController::loadSettings()
81  */
82  void loadSettings(QSettings* settings) override;
83 
84  /**
85  * @see ArmarXWidgetController::saveSettings()
86  */
87  void saveSettings(QSettings* settings) override;
88 
89  /**
90  * Returns the Widget name displayed in the ArmarXGui to create an
91  * instance of this class.
92  */
93  static QString GetWidgetName()
94  {
95  return "Meta.TopicReplayer";
96  }
97 
98  /**
99  * \see armarx::Component::onInitComponent()
100  */
101  void onInitComponent() override;
102 
103  /**
104  * \see armarx::Component::onConnectComponent()
105  */
106  void onConnectComponent() override;
107 
108  public slots:
109  /* QT slot declarations */
110 
111  signals:
112  /* QT signal declarations */
113 
114  private slots:
115  void loadFile();
116  void loopReplay();
117  void pauseReplay();
118  void resumeReplay();
119 
120  void setReplaySpeed();
121 
122  void replaySpeedSliderChanged();
123  void replaySpeedSpinBoxChanged();
124  void replayPositionSliderChanged();
125  void updateReplayPositionSlider();
126 
127  void stopSliderUpdater();
128  void startSliderUpdater();
129 
130  void jumpToPosition();
131 
132  private:
133  /**
134  * Widget Form
135  */
136  Ui::TopicReplayerWidget widget;
137 
139  IceUtil::Time replayLength;
140 
141  int replayPositionSliderUpdaterTimer;
142 
143  void fillListOfRecordedTopics();
144  void setPausedGuiMode();
145  void setPlayingGuiMode();
146 
147  void setUpReplayPositionSlider();
148 
149  void onDisconnectComponent() override;
150  void timerEvent(QTimerEvent* event) override;
151 
152  };
153 }
154 
armarx::TopicReplayerWidgetController::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
Definition: TopicReplayerWidgetController.h:93
armarx::TopicReplayerWidgetController
TopicReplayerWidgetController is the controller of the widget of the TopicReplayerGui.
Definition: TopicReplayerWidgetController.h:62
PeriodicTask.h
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
IceInternal::Handle
Definition: forward_declarations.h:8
ArmarXGuiPlugin.h
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
TopicReplayer.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
ImportExportComponent.h