NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
positionview.h
1 #ifndef POSITIONVIEW_H
2 #define POSITIONVIEW_H
3 
4 // Widget to edit position of certain joint
5 // Author: Dmytro Pavlichenko <dm.mark999@gmail.com>
6 
7 #include <QObject>
8 #include <QWidget>
9 #include <QSpinBox>
10 #include <QSlider>
11 
12 class PositionView : public QWidget
13 {
14  Q_OBJECT
15 public:
16 
17  enum Alignment // Left to right of right to left spins/sliders order
18  {
19  LEFT,
20  RIGHT
21  };
22 
23  enum Type // Defines intervals for spins/sliders
24  {
25  REGULAR,
26  EXTENSION,
27  LEG
28  };
29 
30  PositionView(PositionView::Alignment alignment, PositionView::Type type, std::string jointName, QWidget *parent = 0);
31  ~PositionView();
32 
33  void setPosition(double position);
34  double getPosition();
35 
36  bool withinRange(double value);
37 
38  virtual bool eventFilter(QObject *object, QEvent *event);
39 
40  QSlider *positionSlider;
41  QDoubleSpinBox *positionSpin;
42 
43  std::string jointName;
44 
45 Q_SIGNALS:
46  void positionChanged(const std::string joint_name, const double prev, const double current);
47 
48 private Q_SLOTS:
49  void positionSliderChanged();
50  void positionSpinChanged();
51 
52 private:
53  double min;
54  double max;
55 
56  double m_prev_value;
57 };
58 
59 #endif // POSITIONVIEW_H
const std::string jointName[NUM_JOINTS]
List of names of the joints that are required by the gait motion module (indexed by the JointID enum)...
Definition: gait_common.h:57