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_
void scopeTaskInitialization(int task_id, bool inherit_signals)
ScopeCollectionWidget(SignalHelper::ConstPtr signal_helper, QWidget *parent=0)
std::shared_ptr< const SignalHelper > ConstPtr
Definition: signal_helper.h:46
void addMeasurement(const QString &key, Measurement::ConstPtr measurement, SignalHelper::SignalData &signal_data, bool first)
std::shared_ptr< const Measurement > ConstPtr
Definition: signals.h:175
void removeSignal(const QString &key, int value_idx)
void scopeMeasurementUpdate(const QString &key, Measurement::ConstPtr measurement, SignalHelper::SignalData &signal_data, bool first)
void scopeSignalRemoval(const QString &key, int value_idx)
void previewTimeUpdate(double preview_time)


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:07:16