robot_input_config_widget.cpp
Go to the documentation of this file.
1 //
2 // Created by yijiangh on 9/4/17.
3 //
4 
5 #include <QString>
6 #include <QFileDialog>
7 
9 #include <ui_robot_input_config.h>
10 
11 choreo_gui::RobotInputConfigWidget::RobotInputConfigWidget(choreo_msgs::RobotInputParameters params)
12  : params_(params)
13 {
14  ui_ = new Ui::RobotInputConfigWindow();
15  ui_->setupUi(this);
16 
17  connect(ui_->pushbutton_accept, SIGNAL(clicked()), this, SLOT(accept_changes_handler()));
18  connect(ui_->pushbutton_cancel, SIGNAL(clicked()), this, SLOT(cancel_changes_handler()));
19  connect(ui_->pushbutton_save, SIGNAL(clicked()), this, SLOT(save_changes_handler()));
20 
21  ui_->lineedit_a1->setValidator(new QDoubleValidator(this));
22  ui_->lineedit_a2->setValidator(new QDoubleValidator(this));
23  ui_->lineedit_a3->setValidator(new QDoubleValidator(this));
24  ui_->lineedit_a4->setValidator(new QDoubleValidator(this));
25  ui_->lineedit_a5->setValidator(new QDoubleValidator(this));
26  ui_->lineedit_a6->setValidator(new QDoubleValidator(this));
27  ui_->lineedit_e1->setValidator(new QDoubleValidator(this));
28 
29  // set default initial pose value
30  params_.init_pose.resize(7);
31 }
32 
34 {
35  ui_->lineedit_e1->setText(QString::number(params_.init_pose[0]));
36  ui_->lineedit_a1->setText(QString::number(params_.init_pose[1]));
37  ui_->lineedit_a2->setText(QString::number(params_.init_pose[2]));
38  ui_->lineedit_a3->setText(QString::number(params_.init_pose[3]));
39  ui_->lineedit_a4->setText(QString::number(params_.init_pose[4]));
40  ui_->lineedit_a5->setText(QString::number(params_.init_pose[5]));
41  ui_->lineedit_a6->setText(QString::number(params_.init_pose[6]));
42 }
43 
45 {
46  params_.init_pose[0] = ui_->lineedit_e1->text().toDouble();
47  params_.init_pose[1] = ui_->lineedit_a1->text().toDouble();
48  params_.init_pose[2] = ui_->lineedit_a2->text().toDouble();
49  params_.init_pose[3] = ui_->lineedit_a3->text().toDouble();
50  params_.init_pose[4] = ui_->lineedit_a4->text().toDouble();
51  params_.init_pose[5] = ui_->lineedit_a5->text().toDouble();
52  params_.init_pose[6] = ui_->lineedit_a6->text().toDouble();
53 }
RobotInputConfigWidget(choreo_msgs::RobotInputParameters params)
virtual void update_display_fields()
Reads the internal data structure to update the fields of the GUI.
choreo_msgs::RobotInputParameters params_
virtual void update_internal_fields()
Reads the fields of the GUI to update the internal data structure.


choreo_gui
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:58:56