Exemple #1
0
    def __init__(self, data, parentWindow):
        super(GraphicsScene, self).__init__(parentWindow)
        self.data = data
        # Create basic objects in the scene
        self.timeAxis = TimeAxis()
        self.addItem(self.timeAxis)
        self.valueAxis = ValueAxis()
        self.addItem(self.valueAxis)
        self.valueGraph = ValueGraph(data)
        self.addItem(self.valueGraph)
        self.fit = Fit(data)
        self.addItem(self.fit)
        self.residualSeparatorAxis = QtGui.QGraphicsLineItem()
        self.addItem(self.residualSeparatorAxis)
        self.residualsGraph = ResidualsGraph(data)
        self.addItem(self.residualsGraph)
        self.informationTable = InformationTable(data,
                                                 parentWindow.menuBar(),
                                                 parentWindow.textItems,
                                                 self.valueGraph)
        self.addItem(self.informationTable)
        self.fullLightBars = FullLightBarPair(self.timeAxis, self)
        self.fullLightBars.setBarPos(100, 400)
        self.fullLightBars.setColor(QtGui.QColor("#333366"))
        self.fitBars = FitBarPair(self.timeAxis, self)
        self.fitBars.setBarPos(500, 1500)
        self.fitBars.setColor(QtGui.QColor("#336633"))

        self.timeAxis.setTime(0, 1.0)
        # Draw the time axis to get proper children bounding rect.
        self.timeAxis.update()
        self.valueAxis.setData(0, 1.0, variables.absorbanceAxisCaption)
        # Draw the absorbance axis to get proper children bounding rect,
        # even when the initial heights are wrong.
        self.valueAxis.update()

        self.recalculateBorders()

        # Set initial scene properties
        self.__setSceneSize(self.DEFAULT_WIDTH)

        # Redraw the axes with proper values set by __setSceneSize
        self.timeAxis.update()
        self.valueAxis.update()