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
25
26#include <filesystem>
27
28#include <QMessageBox>
29#include <QPushButton>
30
31#include <IceUtil/UUID.h>
32
35
36#include <RobotAPI/interface/components/TrajectoryPlayerInterface.h>
37#include <RobotAPI/interface/core/RobotState.h>
38
39#include <RobotComponents/gui-plugins/MMMPlayerPlugin/ui_MMMPlayerConfigDialog.h>
40#include <RobotComponents/interface/components/MMMPlayerInterface.h>
41
43 QDialog(parent), 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
65void
67{
68 kinematicUnitComponentProxyFinder->setIceManager(this->getIceManager());
69 mmmPlayerComponentProxyFinder->setIceManager(this->getIceManager());
70 trajPlayerComponentProxyFinder->setIceManager(this->getIceManager());
71}
72
73void
77
78void
80{
81
82 QObject::disconnect();
83}
84
89
90void
91armarx::MMMPlayerConfigDialog::verifyConfiguration()
92{
93 if (kinematicUnitComponentProxyFinder->getSelectedProxyName().trimmed().length() == 0)
94 {
95 QMessageBox::critical(this, "Invalid Configuration", "The proxy name must not be empty");
96 }
97 else
98 {
99 if (mmmPlayerComponentProxyFinder->getSelectedProxyName().trimmed().length() == 0)
100 {
101 needtoCreate = ui->needCreated->isChecked();
102 }
103
104 kinematicTopicName = ui->topicNameEditor->text().toStdString();
105
106 this->accept();
107 }
108}
109
110void
111armarx::MMMPlayerConfigDialog::reject()
112{
113 if (getIceManager())
114 {
115 getIceManager()->removeObject("MMMPlayerConfigDialog");
116 }
117
118 QDialog::reject();
119}
Widget to conveniently retrieve a proxy instance name of a specific interface type (the template para...
void onInitComponent() override
Pure virtual hook for the subclass.
void onConnectComponent() override
Pure virtual hook for the subclass.
void onExitComponent() override
Hook for subclass.
IceManagerPtr getIceManager() const
Returns the IceManager.
ArmarX Headers.