Commit 1f011f74 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel

Add getHppContext

parent a809de86
......@@ -125,8 +125,9 @@ namespace hpp {
{
HppWidgetsPlugin::openConnection();
hpp_ = new HppManipClient (0,0);
QByteArray iiop = getHppIIOPurl ().toLatin1();
hpp_->connect (iiop.constData ());
QByteArray iiop = getHppIIOPurl ().toLatin1();
QByteArray context = getHppContext ().toLatin1();
hpp_->connect (iiop.constData (), context.constData ());
}
void HppManipulationWidgetsPlugin::closeConnection()
......
......@@ -150,6 +150,7 @@ namespace hpp {
main->registerSlot("lengthBetweenRefresh", pathPlayer_);
main->registerSlot("getCurrentPath", pathPlayer_);
main->registerSlot("getHppIIOPurl", this);
main->registerSlot("getHppContext", this);
main->registerSlot("getSelectedJoint", jointTreeWidget_);
main->registerSignal(SIGNAL(appliedConfigAtParam(int,double)), pathPlayer_);
......@@ -226,12 +227,20 @@ namespace hpp {
return gepetto::gui::omniOrb::IIOPurl (host, port);
}
QString HppWidgetsPlugin::getHppContext () const
{
QString context = gepetto::gui::MainWindow::instance ()->settings_->getSetting
("hpp/context", QString ()).toString ();
return context;
}
void HppWidgetsPlugin::openConnection ()
{
closeConnection ();
hpp_ = new hpp::corbaServer::Client (0,0);
QByteArray iiop = getHppIIOPurl ().toLatin1();
hpp_->connect (iiop.constData ());
QByteArray iiop = getHppIIOPurl ().toLatin1();
QByteArray context = getHppContext ().toLatin1();
hpp_->connect (iiop.constData (), context.constData ());
}
void HppWidgetsPlugin::closeConnection ()
......
......@@ -123,6 +123,8 @@ signals:
QString getHppIIOPurl () const;
QString getHppContext () const;
public:
/// Get the corbaserver client.
HppClient* client () const;
......
......@@ -4,7 +4,6 @@
#
from PythonQt import QtGui, Qt
from hpp.corbaserver import Client
import sys
sys.argv = ["none"]
......
......@@ -21,8 +21,10 @@ def fromHPP(t):
class _Clients(object):
def __init__(self, mainWindow):
self.hppPlugin = mainWindow.getFromSlot("getHppIIOPurl")
self.basic = BasicClient(url= str(self.hppPlugin.getHppIIOPurl()))
self.manipulation = ManipClient(url= str(self.hppPlugin.getHppIIOPurl()))
self.basic = BasicClient(url= str(self.hppPlugin.getHppIIOPurl()),
postContextId= str(self.hppPlugin.getHppContext()))
self.manipulation = ManipClient(url= str(self.hppPlugin.getHppIIOPurl()),)
postContextId= str(self.hppPlugin.getHppContext()))
self.viewer = ViewerClient()
class _GraspMode(QWidget):
......
......@@ -4,7 +4,6 @@
#
from PythonQt import QtGui, Qt, QtCore
from hpp.corbaserver import Client
from hpp import Transform
from numpy import array
......
......@@ -180,7 +180,8 @@ class Plugin(QtGui.QDockWidget):
self.tabWidget.addTab (CollisionPairs(self), "Collision pairs")
def resetConnection(self):
self.client = Client(url= str(self.hppPlugin.getHppIIOPurl()))
self.client = Client(url= str(self.hppPlugin.getHppIIOPurl()),
postContextId= str(self.hppPlugin.getHppContext()))
self.resetRobot();
self.gui = GuiClient()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment