##

LogPlayWidget.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_LOGPLAYWIDGET_HH_
#define GAZEBO_GUI_LOGPLAYWIDGET_HH_
#include "gazebo/common/Time.hh"
#include "gazebo/gui/qt.h"
#include "gazebo/gui/TimePanel.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
class LogPlayWidgetPrivate;
class LogPlayViewPrivate;
class TimePanel;
class GZ_GUI_VISIBLE LogPlayWidget : public QWidget
{
Q_OBJECT
public: explicit LogPlayWidget(QWidget *_parent = 0);
public: virtual ~LogPlayWidget();
public: bool IsPaused() const;
public: void SetPaused(const bool _paused);
public: void EmitSetCurrentTime(const common::Time &_time);
public: void EmitSetStartTime(const common::Time &_time);
public: void EmitSetEndTime(const common::Time &_time);
public slots: void OnPlay();
public slots: void OnPause();
public slots: void OnStepForward();
public slots: void OnStepBack();
public slots: void OnRewind();
public slots: void OnForward();
public slots: void OnSeek(const common::Time &_time);
public slots: void OnCurrentTime();
signals: void ShowPlay();
signals: void HidePlay();
signals: void ShowPause();
signals: void HidePause();
signals: void SetCurrentDays(const QString &);
signals: void SetCurrentHours(const QString &);
signals: void SetCurrentMinutes(const QString &);
signals: void SetCurrentSeconds(const QString &);
signals: void SetEndTime(const QString &);
signals: void SetCurrentTime(const common::Time &_time);
signals: void SetStartTime(const common::Time &_time);
signals: void SetEndTime(const common::Time &_time);
private: void PublishMultistep(const int _step);
private: void SetupButton(QToolButton *_button, QString _icon,
bool _isSmall);
private: LogPlayWidgetPrivate *dataPtr;
};
class GZ_GUI_VISIBLE LogPlayView: public QGraphicsView
{
Q_OBJECT
public: explicit LogPlayView(LogPlayWidget *_parent = 0);
public slots: void SetCurrentTime(const common::Time &_time);
public slots: void SetStartTime(const common::Time &_time);
public slots: void SetEndTime(const common::Time &_time);
public slots: void DrawTimeline();
signals: void Seek(const common::Time &_time);
// Documentation inherited
protected: void mousePressEvent(QMouseEvent *_event);
// Documentation inherited
protected: void mouseReleaseEvent(QMouseEvent *_event);
// Documentation inherited
protected: void mouseMoveEvent(QMouseEvent *_event);
private: LogPlayViewPrivate *dataPtr;
};
class GZ_GUI_VISIBLE CurrentTimeItem: public QObject,
public QGraphicsRectItem
{
Q_OBJECT
public: CurrentTimeItem();
// Documentation inherited
private: virtual void paint(QPainter *_painter,
const QStyleOptionGraphicsItem *_option, QWidget *_widget);
};
}
}
#endif
Time.hh
gazebo::gui::LogPlayView::DrawTimeline
void DrawTimeline()
Draw the timeline.
gazebo::gui::LogPlayWidget::OnRewind
void OnRewind()
Jump to the start of the log file.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::LogPlayWidget::HidePause
void HidePause()
Qt signal to hide the pause button.
gazebo::gui::LogPlayView::Seek
void Seek(const common::Time &_time)
Qt signal used to seek.
gazebo::common::Time
A Time class, can be used to hold wall- or sim-time. stored as sec and nano-sec.
Definition: Time.hh:47
gazebo::gui::LogPlayWidget::SetStartTime
void SetStartTime(const common::Time &_time)
Qt signal used to set the start time in the view.
gazebo::gui::LogPlayView::SetEndTime
void SetEndTime(const common::Time &_time)
Set the log end time.
gazebo::gui::LogPlayWidget::OnPlay
void OnPlay()
Play simulation.
gazebo::gui::LogPlayView::SetCurrentTime
void SetCurrentTime(const common::Time &_time)
Set the position of the current time item.
gazebo::gui::LogPlayView::LogPlayView
LogPlayView(LogPlayWidget *_parent=0)
Constructor;.
gazebo::gui::LogPlayWidget::LogPlayWidget
LogPlayWidget(QWidget *_parent=0)
Constructor.
system.hh
gazebo::gui::LogPlayWidget::EmitSetEndTime
void EmitSetEndTime(const common::Time &_time)
Emit signal to set end time.
gazebo::gui::LogPlayWidget::OnForward
void OnForward()
Jump to the end of the log file.
gazebo::gui::LogPlayWidget::HidePlay
void HidePlay()
Qt signal to hide the play button.
gazebo::gui::LogPlayWidget::SetCurrentDays
void SetCurrentDays(const QString &)
Qt signal used to set the current day line edit.
gazebo::gui::LogPlayWidget::OnPause
void OnPause()
Pause simulation.
gazebo::gui::LogPlayWidget::IsPaused
bool IsPaused() const
Returns if the simulation is displayed as paused.
gazebo::gui::LogPlayWidget::OnSeek
void OnSeek(const common::Time &_time)
Jump to a given time in the log file.
gazebo::gui::LogPlayWidget::EmitSetCurrentTime
void EmitSetCurrentTime(const common::Time &_time)
Emit signal to set current time.
gazebo::gui::LogPlayWidget::SetCurrentHours
void SetCurrentHours(const QString &)
Qt signal used to set the current hour line edit.
gazebo::gui::LogPlayWidget::EmitSetStartTime
void EmitSetStartTime(const common::Time &_time)
Emit signal to set start time.
gazebo::gui::LogPlayWidget::SetPaused
void SetPaused(const bool _paused)
Set whether to display the simulation as paused.
gazebo::gui::LogPlayWidget::ShowPlay
void ShowPlay()
Qt signal to show the play button.
gazebo::gui::LogPlayWidget
Widget which displays log playback options.
Definition: LogPlayWidget.hh:35
gazebo::gui::LogPlayWidget::OnCurrentTime
void OnCurrentTime()
Callback when the current time has been edited.
gazebo::gui::LogPlayWidget::SetCurrentTime
void SetCurrentTime(const common::Time &_time)
Qt signal used to set the current time in the view.
gazebo::gui::LogPlayWidget::SetEndTime
void SetEndTime(const QString &)
Qt signal used to set the end time line edit.
gazebo::gui::LogPlayWidget::SetCurrentMinutes
void SetCurrentMinutes(const QString &)
Qt signal used to set the current minute line edit.
gazebo::gui::CurrentTimeItem
Item which represents the current time within the view.
Definition: LogPlayWidget.hh:197
gazebo::gui::LogPlayView::mousePressEvent
void mousePressEvent(QMouseEvent *_event)
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::LogPlayView::SetStartTime
void SetStartTime(const common::Time &_time)
Set the log start time.
gazebo::gui::CurrentTimeItem::CurrentTimeItem
CurrentTimeItem()
Constructor;.
gazebo::gui::LogPlayView::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *_event)
gazebo::gui::LogPlayWidget::OnStepForward
void OnStepForward()
Step simulation forward.
gazebo::gui::LogPlayWidget::ShowPause
void ShowPause()
Qt signal to show the pause button.
gazebo::gui::LogPlayView::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *_event)
gazebo::gui::LogPlayWidget::SetCurrentSeconds
void SetCurrentSeconds(const QString &)
Qt signal used to set the current second line edit.
TimePanel.hh
gazebo::gui::LogPlayWidget::~LogPlayWidget
virtual ~LogPlayWidget()
Destructor.
gazebo::gui::LogPlayView
View for the timeline.
Definition: LogPlayWidget.hh:154
gazebo::gui::LogPlayWidget::OnStepBack
void OnStepBack()
Step simulation back.