Skip to content
Snippets Groups Projects
Commit 9f7ed668 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Change CartesianWaypointControlGuiWidgetController to use RobotUnitComponentPlugi

parent 00e41e60
No related branches found
No related tags found
No related merge requests found
......@@ -17,12 +17,8 @@ set(GUI_MOC_HDRS ${HEADERS})
set(GUI_UIS CartesianWaypointControlGuiWidget.ui)
set(COMPONENT_LIBS
VirtualRobot
SimpleConfigDialog
RobotAPIInterfaces
RobotAPICore
RobotAPIComponentPlugins
)
if(ArmarXGui_FOUND)
......
......@@ -59,21 +59,20 @@ namespace armarx
{
std::lock_guard g{_allMutex};
_robotStateComponentName = settings->value("rsc", "Armar6StateComponent").toString().toStdString();
_robotUnitName = settings->value("ru", "Armar6Unit").toString().toStdString();
getRobotUnitComponentPlugin().setRobotUnitName(settings->value("ru", "Armar6Unit").toString().toStdString());
}
void CartesianWaypointControlGuiWidgetController::saveSettings(QSettings* settings)
{
std::lock_guard g{_allMutex};
settings->setValue("rsc", QString::fromStdString(_robotStateComponentName));
settings->setValue("ru", QString::fromStdString(_robotUnitName));
settings->setValue("ru", QString::fromStdString(getRobotUnitComponentPlugin().getRobotUnitName()));
}
void CartesianWaypointControlGuiWidgetController::onInitComponent()
{
std::lock_guard g{_allMutex};
usingProxy(_robotStateComponentName);
usingProxy(_robotUnitName);
}
void CartesianWaypointControlGuiWidgetController::onConnectComponent()
......@@ -82,7 +81,6 @@ namespace armarx
//proxies
{
_robotStateComponent = getProxy<RobotStateComponentInterfacePrx>(_robotStateComponentName);
_robotUnit = getProxy<RobotUnitInterfacePrx>(_robotUnitName);
}
//robot
{
......@@ -135,7 +133,7 @@ namespace armarx
ARMARX_IMPORTANT << "Creating " << njointControllerClassName << " '"
<< _controllerName << "'";
_controller = NJointCartesianWaypointControllerInterfacePrx::checkedCast(
_robotUnit->createNJointController(
getRobotUnit()->createNJointController(
njointControllerClassName,
_controllerName,
cfg));
......@@ -200,7 +198,7 @@ namespace armarx
{
std::lock_guard g{_allMutex};
_robotStateComponentName = _dialog->getProxyName("rsc");
_robotUnitName = _dialog->getProxyName("ru");
getRobotUnitComponentPlugin().setRobotUnitName(_dialog->getProxyName("ru"));
}
void CartesianWaypointControlGuiWidgetController::triggerParsing()
......
......@@ -34,6 +34,7 @@
#include <RobotAPI/interface/core/RobotState.h>
#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
#include <RobotAPI/interface/units/RobotUnit/NJointCartesianWaypointController.h>
#include <RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.h>
#include <RobotAPI/gui-plugins/CartesianWaypointControlGui/ui_CartesianWaypointControlGuiWidget.h>
......@@ -59,7 +60,8 @@ namespace armarx
*/
class ARMARXCOMPONENT_IMPORT_EXPORT
CartesianWaypointControlGuiWidgetController:
public armarx::ArmarXComponentWidgetControllerTemplate < CartesianWaypointControlGuiWidgetController >
public armarx::ArmarXComponentWidgetControllerTemplate < CartesianWaypointControlGuiWidgetController >,
public virtual RobotUnitComponentPluginUser
{
Q_OBJECT
......@@ -106,9 +108,7 @@ namespace armarx
private:
std::string _robotStateComponentName;
std::string _robotUnitName;
RobotStateComponentInterfacePrx _robotStateComponent;
RobotUnitInterfacePrx _robotUnit;
Ui::CartesianWaypointControlGuiWidget _ui;
QPointer<SimpleConfigDialog> _dialog;
NJointCartesianWaypointControllerInterfacePrx _controller;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment