MotionPlanningServerWidgetController.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package RobotComponents
19  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
20  * @date 2015
21  * @copyright http://www.gnu.org/licenses/gpl.txt
22  * GNU General Public License
23  */
24 
26 
27 #include <string>
28 
29 #include <QPushButton>
30 #include <QTableWidget>
31 
33 
34 using namespace armarx;
35 
37  motionPlanningServerProxyName{"MotionPlanningServer"}
38 {
39  widget.setupUi(getWidget());
40  taskList = new MotionPlanningServerTaskList{};
41  widget.verticalLayout->addWidget(taskList);
42 }
43 
44 void
46 {
47  motionPlanningServerProxyName =
48  settings
49  ->value("motionPlanningServerProxyName",
50  QString::fromStdString(motionPlanningServerProxyName))
51  .toString()
52  .toStdString();
53 }
54 
55 void
57 {
58  settings->setValue("motionPlanningServerProxyName",
59  QString::fromStdString(motionPlanningServerProxyName));
60 }
61 
62 void
64 {
65  usingProxy(motionPlanningServerProxyName);
66 }
67 
68 void
70 {
71  taskList->setMotionPlanningServer(
72  getProxy<MotionPlanningServerInterfacePrx>(motionPlanningServerProxyName));
73  taskList->enableAutoUpdate(true);
74 }
75 
76 void
78 {
79  taskList->clearList();
80  taskList->setMotionPlanningServer(nullptr);
81  taskList->enableAutoUpdate(false);
82 }
83 
84 QPointer<QDialog>
86 {
87  if (!dialog)
88  {
89  dialog = new MotionPlanningServerConfigDialog(parent);
90  }
91 
92  return qobject_cast<MotionPlanningServerConfigDialog*>(dialog);
93 }
94 
95 void
97 {
98  motionPlanningServerProxyName = dialog->finder->getSelectedProxyName().toStdString();
99 }
armarx::MotionPlanningServerWidgetController::onDisconnectComponent
void onDisconnectComponent() override
Definition: MotionPlanningServerWidgetController.cpp:77
armarx::MotionPlanningServerConfigDialog
The config dialog of the palnning server gui.
Definition: MotionPlanningServerConfigDialog.h:39
armarx::MotionPlanningServerWidgetController::saveSettings
void saveSettings(QSettings *settings) override
Definition: MotionPlanningServerWidgetController.cpp:56
armarx::MotionPlanningServerWidgetController::getConfigDialog
QPointer< QDialog > getConfigDialog(QWidget *parent=nullptr) override
Returns the plugin's config dialog.
Definition: MotionPlanningServerWidgetController.cpp:85
armarx::MotionPlanningServerWidgetController::MotionPlanningServerWidgetController
MotionPlanningServerWidgetController()
Controller Constructor.
Definition: MotionPlanningServerWidgetController.cpp:36
armarx::MotionPlanningServerTaskList
Definition: MotionPlanningServerTaskList.h:40
armarx::MotionPlanningServerWidgetController::loadSettings
void loadSettings(QSettings *settings) override
Definition: MotionPlanningServerWidgetController.cpp:45
armarx::MotionPlanningServerWidgetController::onConnectComponent
void onConnectComponent() override
Definition: MotionPlanningServerWidgetController.cpp:69
armarx::MotionPlanningServerWidgetController::onInitComponent
void onInitComponent() override
Definition: MotionPlanningServerWidgetController.cpp:63
PlanningUtil.h
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:154
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::MotionPlanningServerWidgetController::configured
void configured() override
Callback called when the config dialog is closed.
Definition: MotionPlanningServerWidgetController.cpp:96
MotionPlanningServerWidgetController.h