def __init__(self, parent_name='', curve_type=None, x1=None, x2=None, y1=None, y2=None, s=''): self.id = AnnotationObject.newid() # information to be saved in annotation file self.__parent_name = parent_name self.__curve_type = curve_type self.x_from = x1 self.x_to = x2 self.yval1 = y1 self.yval2 = y2 self.valid = True # if a curve is valid and should be plotted self.text = Qwt.QwtText(self.text_wrap(str(s))) self.__too_small_limit = 0 self.font_app = QtGui.QFont() # QPen settings self.pen_def = Qt.QPen() self.pen_symbol = Qt.QPen() self.symbol = Qwt.QwtSymbol() self.__default_pen = Qt.QPen() self.color_highlight = Qt.Qt.darkMagenta
def get_symbol_highlight(self): symbol = Qwt.QwtSymbol(self.symbol) pen = Qt.QPen(self.pen_symbol) pen.setColor(self.color_highlight) symbol.setPen(pen) symbol.setBrush(Qt.QBrush(self.color_highlight)) # new 2016-07-14 return symbol
def __init__(self, parent=None): super(IVSweepDaqWidget, self).__init__(parent) self.setupUi(self) self.aoDeviceCombo.currentIndexChanged.connect( self.updateDaqChannelsAo) self.aiDeviceCombo.currentIndexChanged.connect( self.updateDaqChannelsAi) self.populateDaqCombos() self.restoreSettings() self.msmThread = None self.startPb.clicked.connect(self.startPbClicked) self.hkSub = HousekeepingSubscriber(self) self.hkSub.adrTemperatureReceived.connect(self.temperatureSb.setValue) self.hkSub.start() self.rawPlot.setAxisTitle(QwtPlot.yLeft, 'Vmeas') self.rawPlot.setAxisTitle(QwtPlot.xBottom, 'Vdrive') self.rawCurve = QwtPlotCurve('') self.rawCurve.attach(self.rawPlot) self.criticalCurve1 = QwtPlotCurve('+') self.criticalCurve1.setSymbol( Qwt.QwtSymbol(Qwt.QwtSymbol.Cross, Qt.QBrush(), Qt.QPen(Qt.Qt.red), Qt.QSize(5, 5))) self.criticalCurve1.attach(self.criticalPlot) self.criticalCurve2 = QwtPlotCurve('-') self.criticalCurve2.setSymbol( Qwt.QwtSymbol(Qwt.QwtSymbol.Cross, Qt.QBrush(), Qt.QPen(Qt.Qt.blue), Qt.QSize(5, 5))) self.criticalCurve2.attach(self.criticalPlot) self.criticalPlot.setAxisTitle(QwtPlot.yLeft, 'Vcrit') self.clearData() self.clearCriticalData() self.clearPb.clicked.connect(self.clearData) self.coilSweepCb.toggled.connect(self.toggleCoilSweep) self.clearCriticalPb.clicked.connect(self.clearCriticalData) self.samplesPerPointSb.valueChanged.connect( lambda value: self.discardSamplesSb.setMaximum(value - 1)) self.coilEnableCb.toggled.connect(self.toggleCoil) self.coilVoltageSb.valueChanged.connect(self.updateCoilVoltage) self.toggleCoil(self.coilEnableCb.isChecked()) self.coilDriverCombo.currentIndexChanged.connect( self.coilDriverChanged) self.Vcoil = np.nan
def define_symbol(self, s=Qwt.QwtSymbol.VLine, c=Qt.Qt.black, qsize=Qt.QSize(15, 15)): self.symbol = Qwt.QwtSymbol(s, Qt.QBrush(c), self.pen_symbol, qsize)