selectCtrl.hpp
Go to the documentation of this file.
1 
10 #ifndef QTCTRL_CTRL_SELECT
11 #define QTCTRL_CTRL_SELECT
12 
13 #include <gui/ctrlWdgt.hpp>
14 #include <gui/inputDialog.hpp>
15 #include <QGroupBox>
16 #include <QRadioButton>
17 #include <QComboBox>
18 #include <QPushButton>
19 #include <QFileDialog>
20 #include <QFileInfo>
21 #include <QMainWindow>
22 
34 class QtCtrlSelect : public OkCancelDialog {
35  Q_OBJECT // This macro is needed to handle graphical events
36 
38  static const int ROS_choices = 2;
39 
41  QGroupBox ROS_workspace;
42 
45 
47  QComboBox ctrl_select;
48 
50  int ctrl_id;
51 
53  QPushButton ctrl_param;
54 
56  static const char *default_save_name;
57 
59  QString save_file_name;
60 
62  QPushButton save_file;
63 
65  const double time_step;
66 
69 
72 
75 
76 public:
84  QtCtrlSelect(QWidget* parent, const double tm_stp,
85  const MotionModel& motion);
86 
87 
91  bool startROS() const { return select_ROS[0][1].isChecked(); }
92 
96  bool emptyROSworkspace() const
97  { return select_ROS[1][0].isChecked(); }
98 
103 
108 
110  const QString& saveFileName() const { return save_file_name; }
111 
112 private Q_SLOTS:
114  void updateROSline() { ROS_workspace.setEnabled( startROS() ); }
115 
118  void updateCtrl(int new_id); // Param. default value does not work.
119 
122  void updateCtrl() { updateCtrl(ctrl_id); }
123 
125  void updateFileName();
126 }; // end of class QtCtrlSelect
127 
128 #endif // QTCTRL_CTRL_SELECT
bool emptyROSworkspace() const
Indicates if starting ROS should use empty workspace.
Definition: selectCtrl.hpp:96
Controller is the abstract class inherited by all the implemented controllers.
Definition: controller.hpp:28
Qt dialogs to get an array of double values or an oriented point, and also base class of the controll...
QString save_file_name
The save file name.
Definition: selectCtrl.hpp:59
This class defines a sub-class of dialog windows which lower part is a horizontal button panel with o...
Definition: inputDialog.hpp:27
static const char * default_save_name
The name displayed when no save file is selected.
Definition: selectCtrl.hpp:56
bool startROS() const
Indicates whether ROS should be started.
Definition: selectCtrl.hpp:91
QPushButton save_file
The button displaying and changing save file.
Definition: selectCtrl.hpp:62
QComboBox ctrl_select
The pop-up menu with the list of possible controllers.
Definition: selectCtrl.hpp:47
This abstract class is inherited by all those containing a Qt widget intended to show the controller&#39;...
Definition: ctrlWdgt.hpp:24
int ctrl_id
The identification number of the selected controller.
Definition: selectCtrl.hpp:50
const double time_step
The controller&#39;s time step.
Definition: selectCtrl.hpp:65
void updateFileName()
Updates the button displaying the save file.
Definition: selectCtrl.cpp:218
QRadioButton select_ROS[ROS_choices][ROS_choices]
The radio buttons to select ROS environment.
Definition: selectCtrl.hpp:44
ControlWidget * newCtrlWidget()
Gives the selected controller&#39;s widget, or null pointer if the dialog was cancelled.
Definition: selectCtrl.hpp:107
ControlWidget * ctrl_wdgt
The widget showing the controller&#39;s velocities.
Definition: selectCtrl.hpp:74
const MotionModel & motion_model
The motion model of the controlled robot.
Definition: selectCtrl.hpp:68
Qt based control widget for qt_ctrl.
This class defines a motion model, with the motion limits.
Definition: motion.hpp:28
QGroupBox ROS_workspace
The ROS workspace group box (may be desabled).
Definition: selectCtrl.hpp:41
void updateCtrl()
Updates the parameters of the current controller.
Definition: selectCtrl.hpp:122
QPushButton ctrl_param
The button to set the controller&#39;s parameters.
Definition: selectCtrl.hpp:53
QtCtrlSelect(QWidget *parent, const double tm_stp, const MotionModel &motion)
The dialog is build with a given parent and a time step for the future controller.
Definition: selectCtrl.cpp:34
const QString & saveFileName() const
Gives the save file name.
Definition: selectCtrl.hpp:110
This class defines an accept/cancel dialog to create a controller and its display widget which will b...
Definition: selectCtrl.hpp:34
void updateROSline()
Enables or disables the ROS workspace group box.
Definition: selectCtrl.hpp:114
static const int ROS_choices
The number of ROS environments and sub-environments.
Definition: selectCtrl.hpp:38
Controller * newController()
Gives the selected controller, or null pointer if the dialog was cancelled.
Definition: selectCtrl.hpp:102
Controller * controller
The controller created by this dialog.
Definition: selectCtrl.hpp:71


qt_ctrl
Author(s): Alexis Scheuer
autogenerated on Wed Dec 16 2020 15:51:32