EtherCAT Graphical User Interface Code 0.0.1
EtherCAT GUI that uses different communication protocols with EtherCAT Master server.
Loading...
Searching...
No Matches
wave_widget.h
1#ifndef WAVEWIDGET_H
2#define WAVEWIDGET_H
3
4
5#include <QtUiTools/QtUiTools>
6#include <QWidget>
7#include <QLabel>
8#include <functional>
9#include "ec_gui_utils.h"
10
11
12enum SliderProperty : uint8_t
13{
14 NOT_AVAILABLE = 0, // slider not available for changing.
15 AVAILABLE = 1, // slider available for changing.
16 ALWAYS_AVAILABLE = 2, // slider always available.
17 PARTIAL_AVAILABLE = 3, // slider partial available.
18};
19
20
21class WaveWidget : public QWidget
22{
23Q_OBJECT
24public:
25
26 explicit WaveWidget (QDoubleSpinBox *valuebox,
27 uint8_t valuebox_property,
28 const QString& min,
29 const QString& max,
30 uint8_t decimal_value,
31 const QString& unit,
32 QWidget * parent = 0);
33
34 double get_spinbox_value();
35 void set_spinbox_value(double actual_spinbox_value);
36 void align_spinbox(double value);
37 void align_spinbox();
38 void align_wave_spinbox();
39 void change_spinbox(double value);
40 void disable_slider();
41 void enable_slider();
42
43 bool set_wave_info(double st,bool stopping_wave);
44 double compute_wave(double t);
45
47
48private:
49
50 void on_slider_changed();
51 void on_spinbox_changed();
52 void wave_param_changed();
53 void set_wave_param();
54
55 void enable_tab_wave();
56 void disable_tab_wave();
57 void tab_wave_selected();
58
59 QSlider * _valueslider;
60 QDoubleSpinBox * _valuebox;
61 QTabWidget * _tab_wave,*_tab_wave_type;
62 QDoubleSpinBox *_wave_a,*_wave_f,*_wave_t;
63 int _slider_spinbox_fct;
64
65 double _actual_spinbox_value;
66 double _min_slider_value,_max_slider_value;
67
68 SecondOrderFilter<double>::Ptr _slider_filtered;
69 uint8_t _valuebox_property;
70 uint64_t _trj_counter=0;
71 bool _init_trj;
72 double _trj_start_t,_trj_t;
73 double _chirp_w_start,_chirp_w_diff;
74 bool _chirp_inv=false;
75 uint8_t _chirp_dur_s;
76 double _fx,_x0;
77 double _amp,_freq,_theta;
78 int _wave_type;
79 bool _stopping_wave=false;
80 bool _is_wave=false;
81};
82
83#endif
Definition wave_widget.h:22