TaskTrajectoryDressUpParameter.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "PreCompiled.h"
00025
00026 #ifndef _PreComp_
00027 #endif
00028
00029 #include <QString>
00030 #include <QSlider>
00031 #include "ui_TaskTrajectoryDressUpParameter.h"
00032 #include "TaskTrajectoryDressUpParameter.h"
00033 #include <Gui/Application.h>
00034 #include <Gui/Document.h>
00035 #include <Gui/BitmapFactory.h>
00036 #include <Gui/ViewProvider.h>
00037 #include <Gui/WaitCursor.h>
00038 #include <Base/Console.h>
00039 #include <Gui/Selection.h>
00040 #include <Gui/Placement.h>
00041
00042
00043 using namespace RobotGui;
00044 using namespace Gui;
00045
00046 TaskTrajectoryDressUpParameter::TaskTrajectoryDressUpParameter(Robot::TrajectoryDressUpObject *obj,QWidget *parent)
00047 : TaskBox(Gui::BitmapFactory().pixmap("Robot_TrajectoryDressUp"),
00048 tr("Dress Up Parameter"),
00049 true,
00050 parent),
00051 pcObject(obj)
00052 {
00053
00054 proxy = new QWidget(this);
00055 ui = new Ui_TaskTrajectoryDressUpParameter();
00056 ui->setupUi(proxy);
00057 QMetaObject::connectSlotsByName(this);
00058
00059 this->groupLayout()->addWidget(proxy);
00060
00061
00062 ui->doubleSpinBoxSpeed->setValue (pcObject->Speed.getValue() / 1000.0) ;
00063 ui->doubleSpinBoxAccel->setValue (pcObject->Acceleration.getValue() / 1000.0) ;
00064 ui->checkBoxUseSpeed ->setChecked (pcObject->UseSpeed.getValue()) ;
00065 ui->checkBoxUseAccel ->setChecked (pcObject->UseAcceleration.getValue()) ;
00066 ui->comboBoxCont ->setCurrentIndex (pcObject->ContType.getValue()) ;
00067 ui->comboBoxOrientation->setCurrentIndex (pcObject->AddType.getValue()) ;
00068
00069 PosAdd = pcObject->PosAdd.getValue();
00070 viewPlacement();
00071
00072 QObject::connect(ui->toolButtonChoosePlacement,SIGNAL(clicked()),this,SLOT(createPlacementDlg()));
00073
00074 }
00075
00076
00077
00078 TaskTrajectoryDressUpParameter::~TaskTrajectoryDressUpParameter()
00079 {
00080 delete ui;
00081 }
00082
00083 void TaskTrajectoryDressUpParameter::writeValues(void)
00084 {
00085 pcObject->Speed.setValue ( ui->doubleSpinBoxSpeed->value()*1000.0);
00086 pcObject->Acceleration.setValue ( ui->doubleSpinBoxAccel->value()*1000.0);
00087 pcObject->UseSpeed.setValue ( ui->checkBoxUseSpeed ->isChecked() );
00088 pcObject->UseAcceleration.setValue( ui->checkBoxUseAccel ->isChecked() );
00089 pcObject->ContType.setValue ( ui->comboBoxCont ->currentIndex());
00090 pcObject->AddType.setValue ( ui->comboBoxOrientation->currentIndex());
00091 pcObject->PosAdd.setValue(PosAdd);
00092 }
00093
00094 void TaskTrajectoryDressUpParameter::createPlacementDlg(void)
00095 {
00096 Gui::Dialog::Placement *plc = new Gui::Dialog::Placement();
00097 plc->setPlacement(PosAdd);
00098 if(plc->exec()==QDialog::Accepted){
00099 PosAdd = plc->getPlacement();
00100 viewPlacement();
00101 }
00102
00103 }
00104
00105
00106 void TaskTrajectoryDressUpParameter::viewPlacement(void)
00107 {
00108 double A,B,C;
00109 Base::Vector3d pos = PosAdd.getPosition();
00110 PosAdd.getRotation().getYawPitchRoll(A,B,C);
00111 QString val = QString::fromAscii("(%1,%2,%3),(%4,%5,%6)\n")
00112 .arg(pos.x,0,'g',6)
00113 .arg(pos.y,0,'g',6)
00114 .arg(pos.z,0,'g',6)
00115 .arg(A,0,'g',6)
00116 .arg(B,0,'g',6)
00117 .arg(C,0,'g',6);
00118
00119 ui->lineEditPlacement->setText(val);
00120 }
00121
00122 #include "moc_TaskTrajectoryDressUpParameter.cpp"