diff --git a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMover.cpp b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMover.cpp index 0f2b26950b68e6c83f81b5d075a1c47d8127e16a..fcad49ce8d360ffbfc94c4bd65a33308f5dc232d 100644 --- a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMover.cpp +++ b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMover.cpp @@ -99,7 +99,7 @@ QPointer<QDialog> TCPMover::getConfigDialog(QWidget *parent) void TCPMover::configured() { - tcpMoverUnitName = qobject_cast<TCPMoverConfigDialog*>(getConfigDialog())->editTCPMoverUnitName->text().toStdString(); + tcpMoverUnitName = qobject_cast<TCPMoverConfigDialog*>(getConfigDialog())->proxyFinder->getSelectedProxyName().toStdString(); } @@ -357,17 +357,21 @@ void TCPMover::moveRelative(float x, float y, float z) } -void TCPMoverConfigDialog::setupUI(QWidget *parent) +/*void TCPMoverConfigDialog::setupUI(QWidget *parent) { this->setWindowTitle("Enter name of TCPMoverUnit"); layout = new QGridLayout(parent); - label = new QLabel("TCPMoverUnit name:", parent); - layout->addWidget(label, 0,0); - editTCPMoverUnitName = new QLineEdit("TCPMoverUnit", parent); - layout->addWidget(editTCPMoverUnitName, 0, 1); + proxyFinder->setSearchMask("*Unit"); + layout->addWidget(proxyFinder, 0, 0, 1, 2); + + //label = new QLabel("TCPControlUnit name:", parent); + //layout->addWidget(label, 0,0); + + //editTCPMoverUnitName = new QLineEdit("TCPControlUnit", parent); + //layout->addWidget(editTCPMoverUnitName, 0, 1); buttonBox = new QDialogButtonBox(parent); buttonBox->setObjectName(QString::fromUtf8("buttonBox")); @@ -388,6 +392,6 @@ void TCPMoverConfigDialog::setupUI(QWidget *parent) TCPMoverConfigDialog::TCPMoverConfigDialog(QWidget *parent) : QDialog(parent) { - + proxyFinder = new IceProxyFinder<TCPControlUnitInterfacePrx>(this); setupUI(this); -} +}*/ diff --git a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMover.h b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMover.h index 945314aae829c6b5b57c08226abd6e12a93b2265..2f5c87ec7387c05e5f43dbd983edbd918873ed66 100644 --- a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMover.h +++ b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMover.h @@ -25,6 +25,7 @@ #define ARMARXGUI_TCPMOVER_H /** ArmarX headers **/ +#include "TCPMoverConfigDialog.h" #include "ui_TCPMover.h" // ArmarX includes @@ -35,6 +36,7 @@ #include <VirtualRobot/Nodes/RobotNode.h> #include <VirtualRobot/RobotNodeSet.h> #include <VirtualRobot/IK/DifferentialIK.h> +#include <Gui/ArmarXGuiLib/utility/IceProxyFinder.h> #include <Gui/ArmarXGuiLib/ArmarXComponentWidgetController.h> @@ -49,7 +51,7 @@ class QDialogButtonBox; namespace armarx { - class TCPMoverConfigDialog : public QDialog + /*class TCPMoverConfigDialog : public QDialog { Q_OBJECT @@ -59,12 +61,13 @@ namespace armarx { friend class TCPMover; protected: QGridLayout *layout; - QLabel *label; - QLineEdit *editTCPMoverUnitName; + //QLabel *label; + //QLineEdit *editTCPMoverUnitName; + IceProxyFinderBase* proxyFinder; QDialogButtonBox *buttonBox; void setupUI(QWidget *parent); - }; + };*/ /* diff --git a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.cpp b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..daee4b75e7d688de3711aa444dcbf4509be9fcdc --- /dev/null +++ b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.cpp @@ -0,0 +1,59 @@ +/* +* This file is part of ArmarX. +* +* ArmarX is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* ArmarX is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +* +* @package ArmarX:: +* @author Nikolaus Vahrenkamp ( vahrenkamp at kit dot edu) +* @date 2012 +* @copyright http://www.gnu.org/licenses/gpl.txt +* GNU General Public License +*/ + +#include "TCPMoverConfigDialog.h" +#include "ui_TCPMoverConfigDialog.h" + +#include <IceUtil/UUID.h> + +#include <RobotAPI/interface/units/TCPControlUnit.h> + +armarx::TCPMoverConfigDialog::TCPMoverConfigDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::TCPMoverConfigDialog), + uuid(IceUtil::generateUUID()) +{ + ui->setupUi(this); + setName(getDefaultName()); + + + proxyFinder = new IceProxyFinder<TCPControlUnitInterfacePrx>(this); + proxyFinder->setSearchMask("*Unit"); + ui->proxyFinderContainer->addWidget(proxyFinder, 0, 0, 1, 1); +} + +armarx::TCPMoverConfigDialog::~TCPMoverConfigDialog() +{ + delete ui; +} + + + +void armarx::TCPMoverConfigDialog::onInitComponent() +{ + proxyFinder->setIceManager(getIceManager()); +} + +void armarx::TCPMoverConfigDialog::onConnectComponent() +{ +} diff --git a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.h b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.h new file mode 100644 index 0000000000000000000000000000000000000000..1a0d8e1505fb9b1f1dcc94f68ccf854728168ddb --- /dev/null +++ b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.h @@ -0,0 +1,66 @@ +/* +* This file is part of ArmarX. +* +* ArmarX is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* ArmarX is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +* +* @package ArmarX:: +* @author Nikolaus Vahrenkamp ( vahrenkamp at kit dot edu) +* @date 2012 +* @copyright http://www.gnu.org/licenses/gpl.txt +* GNU General Public License +*/ + +#ifndef _ARMARXGUI_PLUGINS_HANDUNITCONFIGDIALOG_H +#define _ARMARXGUI_PLUGINS_HANDUNITCONFIGDIALOG_H + +#include <QDialog> + +#include <Core/core/IceManager.h> + +#include <Gui/ArmarXGuiLib/utility/IceProxyFinder.h> + +namespace Ui { + class TCPMoverConfigDialog; +} + +namespace armarx +{ + class TCPMoverConfigDialog : + public QDialog, + virtual public ManagedIceObject + { + Q_OBJECT + + public: + explicit TCPMoverConfigDialog(QWidget *parent = 0); + ~TCPMoverConfigDialog(); + + protected: + // ManagedIceObject interface + std::string getDefaultName() const { return "TCPMoverConfigDialog" + uuid;} + void onInitComponent(); + void onConnectComponent(); + + private: + Ui::TCPMoverConfigDialog *ui; + + IceProxyFinderBase* proxyFinder; + std::string uuid; + + friend class TCPMover; + + }; +} + +#endif diff --git a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.ui b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.ui new file mode 100644 index 0000000000000000000000000000000000000000..84b62381f213945551a34c5ccd592d7c623c6d38 --- /dev/null +++ b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/ArmarXTCPMover/TCPMoverConfigDialog.ui @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>TCPMoverConfigDialog</class> + <widget class="QDialog" name="TCPMoverConfigDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>527</width> + <height>91</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="3" column="0"> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + <item row="0" column="0"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0" colspan="2"> + <layout class="QGridLayout" name="proxyFinderContainer"/> + </item> + </layout> + </item> + </layout> + </widget> + <tabstops> + <tabstop>buttonBox</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>TCPMoverConfigDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>TCPMoverConfigDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/CMakeLists.txt b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/CMakeLists.txt index ef5fa04ceca9d1bb8125a354cdae1b364c4bd1d1..347dcd4514838f99b85919413a76eb8ead77a4f7 100644 --- a/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/CMakeLists.txt +++ b/source/RobotAPI/gui_plugins/SensorActorWidgetsPlugin/CMakeLists.txt @@ -31,6 +31,7 @@ set(SOURCES ArmarXPlotter/ArmarXPlotterDialog.cpp ArmarXTCPMover/TCPMover.cpp + ArmarXTCPMover/TCPMoverConfigDialog.cpp ) set(HEADERS @@ -39,6 +40,7 @@ set(HEADERS ArmarXPlotter/ArmarXPlotterDialog.h ArmarXTCPMover/TCPMover.h + ArmarXTCPMover/TCPMoverConfigDialog.h ) set(GUI_MOC_HDRS @@ -46,6 +48,7 @@ set(GUI_MOC_HDRS ArmarXPlotter/ArmarXPlotterDialog.h ArmarXTCPMover/TCPMover.h + ArmarXTCPMover/TCPMoverConfigDialog.h ) set(GUI_UIS @@ -53,6 +56,7 @@ set(GUI_UIS ArmarXPlotter/ArmarXPlotterDialog.ui ArmarXTCPMover/TCPMover.ui + ArmarXTCPMover/TCPMoverConfigDialog.ui )