scope_collection_widget.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement
4  *
5  * Copyright (c) 2020,
6  * TU Dortmund - Institute of Control Theory and Systems Engineering.
7  * All rights reserved.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  *
22  * Authors: Christoph Rösmann
23  *********************************************************************/
24 
25 #ifndef SRC_GUI_INCLUDE_CORBO_GUI_SCOPE_COLLECTION_WIDGET_H_
26 #define SRC_GUI_INCLUDE_CORBO_GUI_SCOPE_COLLECTION_WIDGET_H_
27 
30 #include <corbo-gui/utilities.h>
31 #include <QTimer>
32 #include <QVBoxLayout>
33 #include <QWidget>
34 
35 namespace corbo {
36 namespace gui {
37 
38 class ScopeCollectionWidget : public QWidget
39 {
40  Q_OBJECT
41 
42  public:
43  explicit ScopeCollectionWidget(SignalHelper::ConstPtr signal_helper, QWidget* parent = 0);
44  virtual ~ScopeCollectionWidget();
45 
46  QSize sizeHint() const override;
47 
48  public slots:
49  // void addSignal(const QString& key, const SignalInterface& signal, SignalHelper::SignalData& signal_data, bool updated);
50  void addMeasurement(const QString& key, Measurement::ConstPtr measurement, SignalHelper::SignalData& signal_data, bool first);
51  void removeSignal(const QString& key, int value_idx);
52  void initializeTask(int task_id);
53  void resizeScopeAxes();
54  void addScope();
55  void closeAllScopes();
56 
57  signals:
58  void scopeMeasurementUpdate(const QString& key, Measurement::ConstPtr measurement, SignalHelper::SignalData& signal_data, bool first);
59  void scopeSignalRemoval(const QString& key, int value_idx);
60  void scopeTaskInitialization(int task_id, bool inherit_signals);
62  void previewTimeUpdate(double preview_time);
63 
64  protected:
65  void createMenu();
66  void createScopeArea();
67 
68  private:
69  QVBoxLayout* _main_layout;
70  QVBoxLayout* _scope_layout;
71 
73 
74  bool _inherit_signals = true;
75 
76  // can be changed (e.g. by the dial) to change the current time for TimeSeriesSequence plots:
77  double _current_preview_time = 0.0;
78  QTimer* _dial_preview_time_timer = nullptr;
79 };
80 
81 } // namespace gui
82 } // namespace corbo
83 
84 #endif // SRC_GUI_INCLUDE_CORBO_GUI_SCOPE_COLLECTION_WIDGET_H_
corbo::gui::ScopeCollectionWidget::ScopeCollectionWidget
ScopeCollectionWidget(SignalHelper::ConstPtr signal_helper, QWidget *parent=0)
Definition: scope_collection_widget.cpp:83
signal_collection_widget.h
corbo::gui::ScopeCollectionWidget::removeSignal
void removeSignal(const QString &key, int value_idx)
Definition: scope_collection_widget.cpp:258
corbo
Definition: communication/include/corbo-communication/utilities.h:37
corbo::gui::ScopeCollectionWidget::scopeSignalRemoval
void scopeSignalRemoval(const QString &key, int value_idx)
corbo::gui::ScopeCollectionWidget::createScopeArea
void createScopeArea()
Definition: scope_collection_widget.cpp:193
signal_helper.h
corbo::gui::ScopeCollectionWidget::addScope
void addScope()
Definition: scope_collection_widget.cpp:210
corbo::gui::ScopeCollectionWidget::previewTimeUpdate
void previewTimeUpdate(double preview_time)
corbo::gui::ScopeCollectionWidget::scopeTaskInitialization
void scopeTaskInitialization(int task_id, bool inherit_signals)
corbo::gui::ScopeCollectionWidget::createMenu
void createMenu()
Definition: scope_collection_widget.cpp:99
corbo::gui::ScopeCollectionWidget::_signal_helper
SignalHelper::ConstPtr _signal_helper
Definition: scope_collection_widget.h:138
corbo::gui::ScopeCollectionWidget::_dial_preview_time_timer
QTimer * _dial_preview_time_timer
Definition: scope_collection_widget.h:144
corbo::gui::ScopeCollectionWidget::closeAllScopes
void closeAllScopes()
Definition: scope_collection_widget.cpp:238
corbo::gui::ScopeCollectionWidget::requestScopeAxesResize
void requestScopeAxesResize()
corbo::gui::ScopeCollectionWidget::sizeHint
QSize sizeHint() const override
Definition: scope_collection_widget.cpp:97
corbo::gui::ScopeCollectionWidget::_scope_layout
QVBoxLayout * _scope_layout
Definition: scope_collection_widget.h:136
corbo::gui::ScopeCollectionWidget::resizeScopeAxes
void resizeScopeAxes()
Definition: scope_collection_widget.cpp:262
corbo::gui::ScopeCollectionWidget::scopeMeasurementUpdate
void scopeMeasurementUpdate(const QString &key, Measurement::ConstPtr measurement, SignalHelper::SignalData &signal_data, bool first)
corbo::gui::ScopeCollectionWidget::_current_preview_time
double _current_preview_time
Definition: scope_collection_widget.h:143
corbo::gui::ScopeCollectionWidget::initializeTask
void initializeTask(int task_id)
Definition: scope_collection_widget.cpp:260
corbo::Measurement::ConstPtr
std::shared_ptr< const Measurement > ConstPtr
Definition: signals.h:197
corbo::gui::SignalHelper::ConstPtr
std::shared_ptr< const SignalHelper > ConstPtr
Definition: signal_helper.h:112
corbo::gui::ScopeCollectionWidget::_main_layout
QVBoxLayout * _main_layout
Definition: scope_collection_widget.h:135
corbo::gui::ScopeCollectionWidget::addMeasurement
void addMeasurement(const QString &key, Measurement::ConstPtr measurement, SignalHelper::SignalData &signal_data, bool first)
Definition: scope_collection_widget.cpp:253
corbo::gui::ScopeCollectionWidget::_inherit_signals
bool _inherit_signals
Definition: scope_collection_widget.h:140
utilities.h
corbo::gui::ScopeCollectionWidget::~ScopeCollectionWidget
virtual ~ScopeCollectionWidget()
Definition: scope_collection_widget.cpp:95


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:06:10