1
from PyQt4 import QtCore, QtGui
6
def __init__(self, scene, image):
10
def QTColorGet(self, color):
11
if (color == "#000000"):
12
return QtCore.Qt.black
13
if (color == "#FF0000"):
15
if (color == "#0000FF"):
17
if (color == "#FF9900"):
18
return QtCore.Qt.yellow
20
return QtCore.Qt.black
22
def addLines(self, show_max, axislimits=None):
25
#print str(axislimits)
27
for line in self.image['lines']:
28
if linecounter == show_max:
30
linecounter = linecounter + 1
32
plotnb = 0 # Where we are in the axis
34
if not line[plotnb]['hidden']:
35
if plotnb != self.image['axes_number'] - 1:
36
qtcolor = self.QTColorGet(line[plotnb]['color'])
38
pen.setWidthF(line[plotnb]['penwidth'])
39
ptr = self.scene.addLine(plotnb * defaults.axiswidth, self.image['height'] - line[plotnb]['y'], (plotnb + 1) * defaults.axiswidth, self.image['height'] - line[plotnb+1]['y'], pen)
40
ptr.setToolTip("%s -> %s" % (line[plotnb]['strval'], line[plotnb+1]['strval']))
41
ptr.setCursor(QtCore.Qt.OpenHandCursor)
44
def showLines(self, show_max):
47
for item in self.scene.items():
48
if ((itemnb - 1)/self.image['axes_number'] == show_max):
53
def update_lines_view(self, value):
54
for item in self.scene.items():
59
def maxLinesGet(self):
61
for line in self.image['lines']:
62
linecounter = linecounter + 1