NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
posveleffview.h
1 #ifndef POSVELEFFVIEW_H
2 #define POSVELEFFVIEW_H
3 
4 // Widget to edit position, velocity and effort of certain joint
5 // Author: Dmytro Pavlichenko <dm.mark999@gmail.com>
6 
7 #include <QWidget>
8 #include <QSpinBox>
9 #include <QSlider>
10 
11 #include <trajectory_editor/historykeeper.h>
12 #include <trajectory_editor/spaces/basicsmallview.h>
13 
14 class PosVelEffView : public BasicSmallView
15 {
16  Q_OBJECT
17 public:
18 
19  enum Field
20  {
21  POSITION,
22  EFFORT,
23  VELOCITY
24  };
25 
26  PosVelEffView(BasicSmallView::Alignment alignment, BasicSmallView::Type type, std::string jointName, bool shiftMirrored, QWidget *parent = 0);
27  ~PosVelEffView();
28 
29  void setField(PosVelEffView::Field field, double value);
30  void setEffort(double effort);
31  void setVelocity(double velocity);
32  void setPosition(double rate);
33 
34  double getPosition();
35  double getEffort();
36  double getVelocity();
37 
38  void clearHistoryOfChanges();
39 
40 Q_SIGNALS:
41  void fieldChanged(PosVelEffView::Field, std::string jointName);
42  void changeForInverse(std::string inverse_joint_name, PosVelEffView::Field field, double value);
43 
44 private Q_SLOTS:
45  void positionSliderChanged();
46  void positionSpinChanged();
47 
48  void handleEffortChanged();
49  void handleVelocityChanged();
50 
51 private:
52  QSlider *positionSlider;
53  QDoubleSpinBox *positionSpin;
54  QDoubleSpinBox *effortSpin;
55  QDoubleSpinBox *velocitySpin;
56 
57  HistoryKeeper *effortHistory;
58  HistoryKeeper *positionHistory;
59  HistoryKeeper *velocityHistory;
60 };
61 
62 #endif // POSVELEFFVIEW_H