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::armem::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  QPushButton* collapseAllButton();
29 
30  bool isAutoEnabled() const;
31  double getUpdateFrequency() const;
32  int getUpdateIntervalMs() const;
33 
34  void startTimerIfEnabled();
35  void stopTimer();
36 
37 
38  public slots:
39 
40  signals:
41 
42  void update();
43 
44  void updateSingle();
45  void updatePeriodic();
46 
47  void collapseAll();
48 
49  private slots:
50 
51  void _updateTimerFrequency();
52  void _toggleAutoUpdates(bool enabled);
53 
54  signals:
55 
56  void startTimerSignal();
57  void stopTimerSignal();
58 
59  private:
60  QPushButton* _updateButton;
61  QCheckBox* _autoCheckBox;
62  QDoubleSpinBox* _frequencySpinBox;
63 
64  QPushButton* _collapseAllButton;
65 
66  QTimer* _timer;
67  };
68 
69 } // namespace armarx::armem::gui
armarx::armem::gui::PeriodicUpdateWidget::collapseAll
void collapseAll()
armarx::armem::gui::PeriodicUpdateWidget::startTimerSignal
void startTimerSignal()
armarx::armem::gui::PeriodicUpdateWidget::updateButton
QPushButton * updateButton()
Definition: PeriodicUpdateWidget.cpp:70
armarx::armem::gui::PeriodicUpdateWidget::updateSingle
void updateSingle()
armarx::armem::gui::PeriodicUpdateWidget::autoCheckBox
QCheckBox * autoCheckBox()
Definition: PeriodicUpdateWidget.cpp:134
armarx::armem::gui::PeriodicUpdateWidget
Definition: PeriodicUpdateWidget.h:14
armarx::armem::gui::PeriodicUpdateWidget::update
void update()
armarx::armem::gui::PeriodicUpdateWidget::timer
QTimer * timer()
Definition: PeriodicUpdateWidget.cpp:146
enabled
std::atomic< bool > * enabled
Definition: RemoteGuiWidgetController.cpp:75
armarx::armem::gui::PeriodicUpdateWidget::isAutoEnabled
bool isAutoEnabled() const
armarx::armem::gui::PeriodicUpdateWidget::frequencySpinBox
QDoubleSpinBox * frequencySpinBox()
Definition: PeriodicUpdateWidget.cpp:140
armarx::armem::gui::PeriodicUpdateWidget::getUpdateIntervalMs
int getUpdateIntervalMs() const
Definition: PeriodicUpdateWidget.cpp:82
armarx::armem::gui
Definition: ActionsMenuBuilder.cpp:6
armarx::armem::gui::PeriodicUpdateWidget::stopTimerSignal
void stopTimerSignal()
armarx::armem::gui::PeriodicUpdateWidget::collapseAllButton
QPushButton * collapseAllButton()
Definition: PeriodicUpdateWidget.cpp:76
armarx::armem::gui::PeriodicUpdateWidget::stopTimer
void stopTimer()
Definition: PeriodicUpdateWidget.cpp:106
armarx::armem::gui::PeriodicUpdateWidget::getUpdateFrequency
double getUpdateFrequency() const
armarx::armem::gui::PeriodicUpdateWidget::PeriodicUpdateWidget
PeriodicUpdateWidget(double frequency=2.0, double maxFrequency=60)
Definition: PeriodicUpdateWidget.cpp:14
armarx::armem::gui::PeriodicUpdateWidget::updatePeriodic
void updatePeriodic()
armarx::armem::gui::PeriodicUpdateWidget::startTimerIfEnabled
void startTimerIfEnabled()
Definition: PeriodicUpdateWidget.cpp:88