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 
25 #include <string>
26 
27 #include <QPushButton>
28 #include <QTableWidget>
29 
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 
45 {
46  motionPlanningServerProxyName = settings->value("motionPlanningServerProxyName", QString::fromStdString(motionPlanningServerProxyName)).toString().toStdString();
47 }
48 
50 {
51  settings->setValue("motionPlanningServerProxyName", QString::fromStdString(motionPlanningServerProxyName));
52 }
53 
55 {
56  usingProxy(motionPlanningServerProxyName);
57 }
58 
60 {
61  taskList->setMotionPlanningServer(getProxy<MotionPlanningServerInterfacePrx>(motionPlanningServerProxyName));
62  taskList->enableAutoUpdate(true);
63 }
64 
66 {
67  taskList->clearList();
68  taskList->setMotionPlanningServer(nullptr);
69  taskList->enableAutoUpdate(false);
70 }
71 
73 {
74  if (!dialog)
75  {
76  dialog = new MotionPlanningServerConfigDialog(parent);
77  }
78 
79  return qobject_cast<MotionPlanningServerConfigDialog*>(dialog);
80 }
81 
83 {
84  motionPlanningServerProxyName = dialog->finder->getSelectedProxyName().toStdString();
85 }
86 
armarx::MotionPlanningServerWidgetController::onDisconnectComponent
void onDisconnectComponent() override
Definition: MotionPlanningServerWidgetController.cpp:65
armarx::MotionPlanningServerConfigDialog
The config dialog of the palnning server gui.
Definition: MotionPlanningServerConfigDialog.h:40
armarx::MotionPlanningServerWidgetController::saveSettings
void saveSettings(QSettings *settings) override
Definition: MotionPlanningServerWidgetController.cpp:49
armarx::MotionPlanningServerWidgetController::getConfigDialog
QPointer< QDialog > getConfigDialog(QWidget *parent=nullptr) override
Returns the plugin's config dialog.
Definition: MotionPlanningServerWidgetController.cpp:72
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:44
armarx::MotionPlanningServerWidgetController::onConnectComponent
void onConnectComponent() override
Definition: MotionPlanningServerWidgetController.cpp:59
armarx::MotionPlanningServerWidgetController::onInitComponent
void onInitComponent() override
Definition: MotionPlanningServerWidgetController.cpp:54
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:151
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::MotionPlanningServerWidgetController::configured
void configured() override
Callback called when the config dialog is closed.
Definition: MotionPlanningServerWidgetController.cpp:82
MotionPlanningServerWidgetController.h