PeriodicUpdateWidget.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QWidget>
4 
5 
6 class QCheckBox;
7 class QDoubleSpinBox;
8 class QPushButton;
9 class QTimer;
10 
11 namespace armarx::skills::gui
12 {
13 
14  class PeriodicUpdateWidget : public QWidget
15  {
16  Q_OBJECT
17  using This = PeriodicUpdateWidget;
18 
19  public:
20  PeriodicUpdateWidget(double frequency = 2.0, double maxFrequency = 60);
21 
22 
23  QTimer* timer();
24 
25  QCheckBox* autoCheckBox();
26  QDoubleSpinBox* frequencySpinBox();
27  QPushButton* updateButton();
28 
29  bool isAutoEnabled() const;
30  double getUpdateFrequency() const;
31  int getUpdateIntervalMs() const;
32 
33  void startTimerIfEnabled();
34  void stopTimer();
35 
36 
37  public slots:
38 
39  signals:
40 
41  void update();
42 
43  void updateSingle();
44  void updatePeriodic();
45 
46  private slots:
47 
48  void _updateTimerFrequency();
49  void _toggleAutoUpdates(bool enabled);
50 
51  signals:
52 
53  void startTimerSignal();
54  void stopTimerSignal();
55 
56  private:
57  QPushButton* _updateButton;
58  QCheckBox* _autoCheckBox;
59  QDoubleSpinBox* _frequencySpinBox;
60 
61  QPushButton* _collapseAllButton;
62 
63  QTimer* _timer;
64  };
65 
66 } // namespace armarx::skills::gui
armarx::skills::gui::PeriodicUpdateWidget::stopTimer
void stopTimer()
Definition: PeriodicUpdateWidget.cpp:96
armarx::skills::gui::PeriodicUpdateWidget::getUpdateIntervalMs
int getUpdateIntervalMs() const
Definition: PeriodicUpdateWidget.cpp:72
armarx::skills::gui::PeriodicUpdateWidget::PeriodicUpdateWidget
PeriodicUpdateWidget(double frequency=2.0, double maxFrequency=60)
Definition: PeriodicUpdateWidget.cpp:13
armarx::skills::gui::PeriodicUpdateWidget::startTimerSignal
void startTimerSignal()
armarx::skills::gui::PeriodicUpdateWidget::timer
QTimer * timer()
Definition: PeriodicUpdateWidget.cpp:136
armarx::skills::gui::PeriodicUpdateWidget
Definition: PeriodicUpdateWidget.h:14
armarx::skills::gui::PeriodicUpdateWidget::update
void update()
enabled
std::atomic< bool > * enabled
Definition: RemoteGuiWidgetController.cpp:75
armarx::skills::gui::PeriodicUpdateWidget::stopTimerSignal
void stopTimerSignal()
armarx::skills::gui::PeriodicUpdateWidget::frequencySpinBox
QDoubleSpinBox * frequencySpinBox()
Definition: PeriodicUpdateWidget.cpp:130
armarx::skills::gui
Definition: PeriodicUpdateWidget.cpp:11
armarx::skills::gui::PeriodicUpdateWidget::updateButton
QPushButton * updateButton()
Definition: PeriodicUpdateWidget.cpp:66
armarx::skills::gui::PeriodicUpdateWidget::getUpdateFrequency
double getUpdateFrequency() const
armarx::skills::gui::PeriodicUpdateWidget::isAutoEnabled
bool isAutoEnabled() const
armarx::skills::gui::PeriodicUpdateWidget::updateSingle
void updateSingle()
armarx::skills::gui::PeriodicUpdateWidget::updatePeriodic
void updatePeriodic()
armarx::skills::gui::PeriodicUpdateWidget::autoCheckBox
QCheckBox * autoCheckBox()
Definition: PeriodicUpdateWidget.cpp:124
armarx::skills::gui::PeriodicUpdateWidget::startTimerIfEnabled
void startTimerIfEnabled()
Definition: PeriodicUpdateWidget.cpp:78