Beispiel #1
0
    def __init__(self, *args, **kwargs):
        #super(AutoUpdatePlot, self).__init__()
        #self.app = Qt.QApplication(sys.argv)

        canvasBackground = kwargs.get('canvasBackground', Qt.Qt.white)
        self.chartHistoryLen = kwargs.get('chartHistoryLen', 10)
        chartTitle = kwargs.get('chartTitle', '')
        chartXAxisTitle = kwargs.get('chartXAxisTitle', 'X Values')
        chartYAxisTitle = kwargs.get('chartYAxisTitle', 'Y Values')
        winHorSize = kwargs.get('winHorSize', 500)
        winVertSize = kwargs.get('winVertSize', 300)
        winTitle = kwargs.get('winTitle', '')
        self.curves = {}

        self.dlg = Qt.QDialog(None)

        #Create a Qwt Plot
        self.plot = Qwt.QwtPlot(*args)
        self.plot.setCanvasBackground(canvasBackground)
        #self._alignScales()
        self.plot.setTitle(chartTitle)
        self.plot.insertLegend(Qwt.QwtLegend(), Qwt.QwtPlot.RightLegend)

        mY = Qwt.QwtPlotMarker()
        mY.setLabelAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignTop)
        mY.setLineStyle(Qwt.QwtPlotMarker.HLine)
        mY.setYValue(0.0)
        mY.attach(self.plot)

        self.plot.setAxisTitle(Qwt.QwtPlot.xBottom, chartXAxisTitle)
        self.plot.setAxisTitle(Qwt.QwtPlot.yLeft, chartYAxisTitle)
        layout = Qt.QVBoxLayout()
        layout.addWidget(self.plot)
        self.dlg.setLayout(layout)
        self.dlg.resize(winHorSize, winVertSize)
        self.dlg.setWindowTitle(winTitle)
        self.dlg.timerEvent = self.timerEvent
        self.dlg.show()
 def __init__(self):
     super(showImage, self).__init__()
     self.counter = 0
     self.dialog = Qt.QDialog()
     #QtGui.QDialog()
     self.initUI()