Exemplo n.º 1
0
    def addPair(self, down, up):
        """Once we have completed a full transaction, with 'down' and
           'up' events, it ends up here.
           """
        dataTransaction = self.getDataTransaction(down, up)
        self.stack.extend(up.timestamp)

        # Tag the interval we've chosen. The tag is a list that will
        # be updated with the canvas item reference once we have it.
        tag = [None]
        row = self.stack.pickRow(down.timestamp, up.timestamp, tag)

        w = self.stack.canvas.root().add(
            gnomecanvas.CanvasRect,
            y1=row.top,
            y2=row.bottom,
            fill_color=Style.getBarColor(dataTransaction).gdkString,
            outline_color='black',
            width_units=1.0)
        self.view.ruler.resizer.track(w,
                                      x1=(down.timestamp, 0),
                                      x2=(up.timestamp, 0))
        tag[0] = w

        if up.status:
            # An error occurred, mark it in red
            x = 2
            err = self.stack.canvas.root().add(
                gnomecanvas.CanvasRect,
                y1=row.top - x,
                y2=row.bottom + x,
                fill_color_rgba=Style.errorMarkerColor.rgba)
            self.view.ruler.resizer.track(err,
                                          x1=(up.timestamp, -x),
                                          x2=(up.timestamp, x))

        # Set up links between the up/down transactions and the widget
        w.downTransaction = down
        w.upTransaction = up
        w.dataTransaction = dataTransaction
        self.view.transactionWidgets[down] = w
        self.view.transactionWidgets[up] = w
Exemplo n.º 2
0
    def addPair(self, down, up):
        """Once we have completed a full transaction, with 'down' and
           'up' events, it ends up here.
           """
        dataTransaction = self.getDataTransaction(down, up)
        self.stack.extend(up.timestamp)

        # Tag the interval we've chosen. The tag is a list that will
        # be updated with the canvas item reference once we have it.
        tag = [None]
        row = self.stack.pickRow(down.timestamp, up.timestamp, tag)

        w = self.stack.canvas.root().add(
            gnomecanvas.CanvasRect,
            y1 = row.top,
            y2 = row.bottom,
            fill_color = Style.getBarColor(dataTransaction).gdkString,
            outline_color = 'black',
            width_units = 1.0)
        self.view.ruler.resizer.track(w, x1=(down.timestamp, 0), x2=(up.timestamp, 0))
        tag[0] = w

        if up.status:
            # An error occurred, mark it in red
            x = 2
            err = self.stack.canvas.root().add(
                gnomecanvas.CanvasRect,
                y1 = row.top - x,
                y2 = row.bottom + x,
                fill_color_rgba = Style.errorMarkerColor.rgba)
            self.view.ruler.resizer.track(err,
                                          x1=(up.timestamp, -x),
                                          x2=(up.timestamp, x))

        # Set up links between the up/down transactions and the widget
        w.downTransaction = down
        w.upTransaction = up
        w.dataTransaction = dataTransaction
        self.view.transactionWidgets[down] = w
        self.view.transactionWidgets[up] = w
Exemplo n.º 3
0
 def _cursorCallback(self, t):
     self.cursorLabel.set_markup(Style.toMonospaceMarkup(
         " %.04f s " % t))
Exemplo n.º 4
0
 def onHilightChanged(self, transaction):
     self.dataDetail.set_markup(Style.toMonospaceMarkup(transaction.getHexDump()))
     self.decodedDetail.set_markup(Style.toMonospaceMarkup(transaction.decoded))
Exemplo n.º 5
0
 def _cursorCallback(self, t):
     self.cursorLabel.set_markup(Style.toMonospaceMarkup(
         " %.04f s " % t))
Exemplo n.º 6
0
 def onHilightChanged(self, transaction):
     self.dataDetail.set_markup(Style.toMonospaceMarkup(transaction.getHexDump()))
     self.decodedDetail.set_markup(Style.toMonospaceMarkup(transaction.decoded))