from PythonQt import QtGui, Qt
from PythonQt.QCustomPlot import QCustomPlot

pens = (
    Qt.QPen(Qt.Qt.black),
    Qt.QPen(Qt.Qt.red),
    Qt.QPen(Qt.Qt.green),
    Qt.QPen(Qt.Qt.blue),
    Qt.QPen(Qt.Qt.magenta),
    Qt.QPen(Qt.Qt.yellow),
    Qt.QPen(Qt.Qt.cyan),
    Qt.QPen(Qt.Qt.gray),
)


class Plot(QtGui.QWidget):
    def __init__(self, plugin):
        super(Plot, self).__init__(self)
        self.plugin = plugin

        self.qcp = QCustomPlot()
        layout = QtGui.QVBoxLayout(self)
        layout.addWidget(self.qcp)
        self.qcp.setInteraction(1, True)  # iRangeDrag
        self.qcp.setInteraction(2, True)  # iRangeZoom
        self.qcp.setAutoAddPlottableToLegend(True)
        self.qcp.legend().setVisible(True)

        self.timer = Qt.QTimer(self)
        self.timer.setSingleShot(False)
        self.timer.setInterval(100)
Exemple #2
0
        Qt.Qt.darkYellow,
        Qt.Qt.darkGray,
        Qt.Qt.lightGray,
        )
lineStyles = (
        Qt.Qt.SolidLine,
        Qt.Qt.DashLine,
        Qt.Qt.DotLine,
        Qt.Qt.DashDotLine,
        Qt.Qt.DashDotDotLine,
        )

pens = []
for ls in lineStyles:
    for c in colors:
        qpen = Qt.QPen(c)
        qpen.setStyle (ls)
        pens.append (qpen)

pens = tuple(pens)

class VelGetter:
    def __init__(self, plugin, name):
        self.plugin = plugin
        self.name = str(name)
        self.vector6 = Vector6 (self.name)

    def getV(self):
        return self.plugin.client.robot.getJointVelocityInLocalFrame (self.name)

    def createNodes(self, color):