Commit f90b70a5 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel

Add button Apply constraints

parent ec2802e3
...@@ -19,6 +19,15 @@ class DirectPathBox(QtGui.QGroupBox): ...@@ -19,6 +19,15 @@ class DirectPathBox(QtGui.QGroupBox):
q = self.plugin.client.robot.shootRandomConfig() q = self.plugin.client.robot.shootRandomConfig()
self.plugin.hppPlugin.setCurrentQtConfig(q) self.plugin.hppPlugin.setCurrentQtConfig(q)
def applyConstraints (self):
q0 = self.plugin.hppPlugin.getCurrentQtConfig()
res, q1, err = self.plugin.client.problem.applyConstraints (q0)
self.plugin.hppPlugin.setCurrentQtConfig(q1)
if not res:
self.plugin.main.logError ("Projection failed: " + str(err))
else:
self.plugin.main.logError ("Projection succeeded.")
def getFrom (self): def getFrom (self):
self.fromCfg = self.plugin.hppPlugin.getCurrentQtConfig() self.fromCfg = self.plugin.hppPlugin.getCurrentQtConfig()
...@@ -46,6 +55,8 @@ class DirectPathBox(QtGui.QGroupBox): ...@@ -46,6 +55,8 @@ class DirectPathBox(QtGui.QGroupBox):
box = QtGui.QVBoxLayout(self) box = QtGui.QVBoxLayout(self)
random = QtGui.QPushButton(self) random = QtGui.QPushButton(self)
box.addWidget(random) box.addWidget(random)
applyConstraints = QtGui.QPushButton(self)
box.addWidget(applyConstraints)
setFrom = QtGui.QPushButton(self) setFrom = QtGui.QPushButton(self)
box.addWidget(setFrom) box.addWidget(setFrom)
setTo = QtGui.QPushButton(self) setTo = QtGui.QPushButton(self)
...@@ -57,12 +68,14 @@ class DirectPathBox(QtGui.QGroupBox): ...@@ -57,12 +68,14 @@ class DirectPathBox(QtGui.QGroupBox):
makePath = QtGui.QPushButton(self) makePath = QtGui.QPushButton(self)
box.addWidget(makePath) box.addWidget(makePath)
random.text = "Shoot random config" random.text = "Shoot random config"
applyConstraints.text = "Apply constraints"
setFrom.text = 'Save config as origin' setFrom.text = 'Save config as origin'
setTo.text = 'Save config as destination' setTo.text = 'Save config as destination'
self.validatePath.text = 'Validate path' self.validatePath.text = 'Validate path'
self.projectPath.text = "Project path" self.projectPath.text = "Project path"
makePath.text = 'Create path' makePath.text = 'Create path'
random.connect('clicked()', self.shootRandom) random.connect('clicked()', self.shootRandom)
applyConstraints.connect('clicked()', self.applyConstraints)
setFrom.connect('clicked()', self.getFrom) setFrom.connect('clicked()', self.getFrom)
setTo.connect('clicked()', self.getTo) setTo.connect('clicked()', self.getTo)
makePath.connect('clicked()', self.makePath) makePath.connect('clicked()', self.makePath)
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