def chooseSignals(self): Usignal=self.signalChoice1.currentText() Isignal=self.signalChoice2.currentText() Udata,Idata,time,self.sampling=readHdf5.getMultiData(self.fileName,Usignal,Isignal,self.env) self.Udata=np.array(Udata) self.Idata=np.array(Idata) self.time=np.array(time) self.Udata=self.Udata*20. self.Idata=-self.Idata*0.01 self.p1.clear() self.p2.clear() self.p3.clear() self.p4.clear() self.lr=pg.LinearRegionItem([self.l1,self.r1]) self.lr.setZValue(-10) self.p1.addItem(self.lr) self.lr.sigRegionChanged.connect(self.updatePlot) self.p1.plot(self.time,self.Idata) self.p2.plot(self.time,self.Idata)
def __init__(self,filename,env,parent=None): super(langmuirTime,self).__init__(parent) pg.setConfigOption('background', 'w') pg.setConfigOption('foreground', 'k') self.fileName=filename[0] self.setWindowTitle("langmuir time evolution") self.resize(1000,600) self.env=env self.p0=pg.PlotWidget() self.p0.setLabel('left', "Langmuir current (A)") self.p0.setLabel('bottom', "Time (s)") self.lr=pg.LinearRegionItem([2.,3.]) self.lr.setZValue(-10) self.p0.addItem(self.lr) self.Udata,self.Idata,self.time,self.sampling=readHdf5.getMultiData(self.fileName,'PXI M6251/Lang_I','PXI M6251/Lang_U',self.env) self.Udata=np.array(self.Udata) self.Idata=np.array(self.Idata) self.time=np.array(self.time) self.Udata=self.Udata*20. self.Idata=-self.Idata*0.01 self.p0.plot(self.time,self.Idata) self.p1=pg.PlotWidget() self.p1.setLabel('left', "Plasma density (m^-3)") self.p1.setLabel('bottom', "Time (s)") self.p2=pg.PlotWidget() self.p2.setLabel('left', "Plasma temperature (eV)") self.p2.setLabel('bottom', "Time (s)") self.p3=pg.PlotWidget() self.p3.setLabel('left', "Potenials (V)") self.p3.setLabel('bottom', "Time (s)") button0=QtGui.QPushButton('Start calculation') button0.clicked.connect(self.start) button1=QtGui.QPushButton('Save data') button1.clicked.connect(self.save) self.ramps=QtGui.QLineEdit('10') self.slots=QtGui.QLineEdit('50') self.gas=QtGui.QLineEdit('Helium') self.tempT=QtGui.QLineEdit('') self.freq=QtGui.QLineEdit('1000') formbox=QtGui.QFormLayout() formbox.addRow('Number of ramps : ',self.ramps) formbox.addRow('Number of time slots : ',self.slots) formbox.addRow('Gas : ',self.gas) formbox.addRow('Temperature (auto if empty): ',self.tempT) formbox.addRow('Sweep frequency: ',self.freq) form=QtGui.QFrame() form.setLayout(formbox) vbox2=QtGui.QVBoxLayout() vbox2.addStretch(1) vbox2.addWidget(form) vbox2.addWidget(button0) vbox2.addWidget(button1) vbox1=QtGui.QVBoxLayout() vbox1.addStretch(1) vbox1.addWidget(self.p0) vbox1.addWidget(self.p1) vbox1.addWidget(self.p2) vbox1.addWidget(self.p3) frame1=QtGui.QFrame() frame1.setLayout(vbox1) frame2=QtGui.QFrame() frame2.setLayout(vbox2) splitterH=QtGui.QSplitter(QtCore.Qt.Horizontal,self) splitterH.addWidget(frame1) splitterH.addWidget(frame2) self.setCentralWidget(splitterH) self.show()