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
34using namespace armarx;
35
37 motionPlanningServerProxyName{"MotionPlanningServer"}
38{
39 widget.setupUi(getWidget());
40 taskList = new MotionPlanningServerTaskList{};
41 widget.verticalLayout->addWidget(taskList);
42}
43
44void
46{
47 motionPlanningServerProxyName =
48 settings
49 ->value("motionPlanningServerProxyName",
50 QString::fromStdString(motionPlanningServerProxyName))
51 .toString()
52 .toStdString();
53}
54
55void
57{
58 settings->setValue("motionPlanningServerProxyName",
59 QString::fromStdString(motionPlanningServerProxyName));
60}
61
62void
64{
65 usingProxy(motionPlanningServerProxyName);
66}
67
68void
70{
71 taskList->setMotionPlanningServer(
72 getProxy<MotionPlanningServerInterfacePrx>(motionPlanningServerProxyName));
73 taskList->enableAutoUpdate(true);
74}
75
76void
78{
79 taskList->clearList();
80 taskList->setMotionPlanningServer(nullptr);
81 taskList->enableAutoUpdate(false);
82}
83
84QPointer<QDialog>
86{
87 if (!dialog)
88 {
89 dialog = new MotionPlanningServerConfigDialog(parent);
90 }
91
92 return qobject_cast<MotionPlanningServerConfigDialog*>(dialog);
93}
94
95void
97{
98 motionPlanningServerProxyName = dialog->finder->getSelectedProxyName().toStdString();
99}
virtual QPointer< QWidget > getWidget()
getWidget returns a pointer to the a widget of this controller.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
The config dialog of the palnning server gui.
QPointer< QDialog > getConfigDialog(QWidget *parent=nullptr) override
Returns the plugin's config dialog.
void configured() override
Callback called when the config dialog is closed.
This file offers overloads of toIce() and fromIce() functions for STL container types.