MMMPlayerConfigDialog.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * ArmarX is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * @package ArmarX::
18 * @author Nikolaus Vahrenkamp ( vahrenkamp at kit dot edu)
19 * @date 2012
20 * @copyright http://www.gnu.org/licenses/gpl.txt
21 * GNU General Public License
22 */
23 
24 #include "MMMPlayerConfigDialog.h"
25 #include <RobotComponents/gui-plugins/MMMPlayerPlugin/ui_MMMPlayerConfigDialog.h>
26 #include <IceUtil/UUID.h>
27 
28 #include <QPushButton>
29 #include <QMessageBox>
30 
31 #include <RobotAPI/interface/core/RobotState.h>
32 
34 #include <filesystem>
36 
37 #include <RobotComponents/interface/components/MMMPlayerInterface.h>
38 #include <RobotAPI/interface/components/TrajectoryPlayerInterface.h>
39 
40 
42  QDialog(parent),
43  ui(new Ui::MMMPlayerConfigDialog)
44 {
45  ui->setupUi(this);
46  connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(verifyConfiguration()));
47  connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
48 
49  ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
50 
51  kinematicUnitComponentProxyFinder = new IceProxyFinder<KinematicUnitInterfacePrx>(this);
52  kinematicUnitComponentProxyFinder->setSearchMask("KinematicUnit*");
53  ui->verticalLayout->addWidget(kinematicUnitComponentProxyFinder);
54 
55  mmmPlayerComponentProxyFinder = new IceProxyFinder<MMMPlayerInterfacePrx>(this);
56  mmmPlayerComponentProxyFinder->setSearchMask("MMMPlayer*");
57  ui->verticalLayout->addWidget(mmmPlayerComponentProxyFinder);
58 
59  trajPlayerComponentProxyFinder = new IceProxyFinder<TrajectoryPlayerInterfacePrx>(this);
60  trajPlayerComponentProxyFinder->setSearchMask("TrajectoryPlayer*");
61  ui->verticalLayout->addWidget(trajPlayerComponentProxyFinder);
62  needtoCreate = false;
63 }
64 
66 {
67  kinematicUnitComponentProxyFinder->setIceManager(this->getIceManager());
68  mmmPlayerComponentProxyFinder->setIceManager(this->getIceManager());
69  trajPlayerComponentProxyFinder->setIceManager(this->getIceManager());
70 }
71 
73 {
74 
75 }
76 
78 {
79 
80  QObject::disconnect();
81 }
82 
84 {
85  delete ui;
86 }
87 
88 
89 void armarx::MMMPlayerConfigDialog::verifyConfiguration()
90 {
91  if (kinematicUnitComponentProxyFinder->getSelectedProxyName().trimmed().length() == 0)
92  {
93  QMessageBox::critical(this, "Invalid Configuration", "The proxy name must not be empty");
94  }
95  else
96  {
97  if (mmmPlayerComponentProxyFinder->getSelectedProxyName().trimmed().length() == 0)
98  {
99  needtoCreate = ui->needCreated->isChecked();
100  }
101 
102  kinematicTopicName = ui->topicNameEditor->text().toStdString();
103 
104  this->accept();
105  }
106 }
107 
108 void armarx::MMMPlayerConfigDialog::reject()
109 {
110  if (getIceManager())
111  {
112  getIceManager()->removeObject("MMMPlayerConfigDialog");
113  }
114 
115  QDialog::reject();
116 
117 }
118 
armarx::MMMPlayerConfigDialog::MMMPlayerConfigDialog
MMMPlayerConfigDialog(QWidget *parent=0)
Definition: MMMPlayerConfigDialog.cpp:41
armarx::IceProxyFinderBase::setSearchMask
void setSearchMask(const QString &searchMask)
Definition: IceProxyFinder.cpp:88
MMMPlayerConfigDialog.h
armarx::MMMPlayerConfigDialog::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: MMMPlayerConfigDialog.cpp:72
armarx::MMMPlayerConfigDialog::~MMMPlayerConfigDialog
~MMMPlayerConfigDialog() override
Definition: MMMPlayerConfigDialog.cpp:83
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:58
CMakePackageFinder.h
armarx::MMMPlayerConfigDialog::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: MMMPlayerConfigDialog.cpp:65
armarx::IceProxyFinder
Definition: StatechartViewerController.h:51
armarx::MMMPlayerConfigDialog::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: MMMPlayerConfigDialog.cpp:77
ArmarXDataPath.h
armarx::MMMPlayerConfigDialog
Definition: MMMPlayerConfigDialog.h:39