def __init__(self,filename,env,parent=None): super(correlateData,self).__init__(parent) pg.setConfigOption('background', 'w') pg.setConfigOption('foreground', 'k') self.fileName=filename self.setWindowTitle("Correlate data") self.resize(1000,1000) self.env=env self.correlation={} self.signalChoice1=QtGui.QComboBox() self.signalChoice2=QtGui.QComboBox() self.signals=readHdf5.getSignals(self.fileName[0],self.env) self.signalChoice1.addItems(self.signals) self.signalChoice2.addItems(self.signals) self.p1=pg.PlotWidget() self.p2=pg.PlotWidget() self.p3=pg.PlotWidget() self.listShots=QtGui.QListWidget() self.listShots.addItems(self.fileName) self.listShots.itemClicked.connect(self.display) button1=QtGui.QPushButton('Calculate correlation') button1.clicked.connect(self.calculate) button2= QtGui.QPushButton('Remove correlation') button2.clicked.connect(self.delCorr) self.corrName=QtGui.QLineEdit() button3= QtGui.QPushButton('Save correlation') button3.clicked.connect(self.saveCorr) vbox1=QtGui.QVBoxLayout() vbox1.addStretch(1) vbox2=QtGui.QVBoxLayout() vbox2.addStretch(1) hbox1=QtGui.QHBoxLayout() hbox1.addStretch(1) #dataWin=QtGui.QFrame() #dataWin.setLayout(hbox1) vbox1.addWidget(self.signalChoice1) vbox1.addWidget(self.signalChoice2) vbox1.addWidget(self.p1) vbox1.addWidget(self.p2) vbox2.addWidget(self.listShots) vbox2.addWidget(button1) vbox2.addWidget(self.p3) vbox2.addWidget(self.corrName) vbox2.addWidget(button2) win2=QtGui.QFrame() win2.setLayout(vbox1) win3=QtGui.QFrame() win3.setLayout(vbox2) hbox1.addWidget(win2) hbox1.addWidget(win3) #self.setCentralWidget(dataWin) self.setLayout(hbox1) self.show()
def __init__(self,filename,env,parent=None): super(plotSignal,self).__init__(parent) pg.setConfigOption('background', 'w') pg.setConfigOption('foreground', 'k') self.fileName=filename self.setWindowTitle("Plotting signal") self.resize(1000,600) self.env=env self.signalChoice=QtGui.QComboBox() self.signals=readHdf5.getSignals(self.fileName[0],self.env) self.signalChoice.addItems(self.signals) self.signalChoice.activated['QString'].connect(self.plotSignal) self.p1=pg.PlotWidget() #self.p1.resize(500,300) self.p2=pg.PlotWidget() self.p3=pg.PlotWidget() button2=QtGui.QPushButton('FFT') button2.clicked.connect(self.calculatefft) vbox=QtGui.QVBoxLayout() vbox.addWidget(self.signalChoice) vbox.addWidget(self.p1) vbox.addWidget(self.p2) vbox.addStretch(1) vbox2=QtGui.QVBoxLayout() vbox2.addStretch(1) draw=QtGui.QFrame() label1=QtGui.QLabel('Properties') button3=QtGui.QPushButton('Match frequencies') button3.clicked.connect(self.matchFreq) button1=QtGui.QPushButton('calculate') self.frqlabel=QtGui.QLabel('Sampling rate:') button1.clicked.connect(self.calculate) self.textResult=QtGui.QTextEdit() self.textResult.setReadOnly(True) self.attribut=QtGui.QLineEdit() # self.save=QtGui.QPushButton('Save data') # self.save.clicked.connect(self.saveData) process=QtGui.QFrame() vbox2.addWidget(self.frqlabel) vbox2.addWidget(self.p3) vbox2.addWidget(button3) vbox2.addWidget(button2) vbox2.addWidget(label1) vbox2.addWidget(button1) vbox2.addWidget(self.textResult) vbox2.addWidget(self.attribut) # vbox2.addWidget(self.save) process.setLayout(vbox2) draw.setLayout(vbox) splitterH=QtGui.QSplitter(QtCore.Qt.Horizontal,self) splitterH.addWidget(draw) splitterH.addWidget(process) self.setCentralWidget(splitterH) try: [self.left,self.right,saveName,self.signalName]=pickle.load( open( "User.dat", "rb" ) ) self.existingData=True self.signalChoice.setCurrentIndex(self.signals.index(self.signalName)) self.plotSignal(self.signalName) self.updatePlot() self.attribut.setText(saveName) except Exception,e: print str(e) self.existingData=False
def __init__(self,filename,env,parent=None): super(langmuirSingle,self).__init__(parent) pg.setConfigOption('background', 'w') pg.setConfigOption('foreground', 'k') self.fileName=filename[0] self.setWindowTitle("Plotting signal") self.resize(1000,600) self.env=env self.Back=False self.signalChoice1=QtGui.QComboBox() self.signalChoice2=QtGui.QComboBox() self.signals=readHdf5.getSignals(self.fileName,self.env) self.signalChoice1.addItems(self.signals) self.signalChoice2.addItems(self.signals) self.p1=pg.PlotWidget() self.p2=pg.PlotWidget() self.p3=pg.PlotWidget() self.p4=pg.PlotWidget() button1=QtGui.QPushButton('Select I and V signals') button1.clicked.connect(self.chooseSignals) button2=QtGui.QPushButton('Select window') button2.clicked.connect(self.displayIV) button3=QtGui.QPushButton('Select current correction') button3.clicked.connect(self.currentCorrection) button4=QtGui.QPushButton('Select temperature zone') button4.clicked.connect(self.temperature) self.textResult=QtGui.QTextEdit() self.textResult.setReadOnly(True) self.text1=QtGui.QLineEdit('100') self.gas=QtGui.QComboBox() self.gas.addItems(['Argon','Helium']) self.tempChoice=QtGui.QCheckBox('Calculate temp') self.temp=QtGui.QLineEdit() formbox=QtGui.QFormLayout() formbox.addRow('Probe rate : ',self.text1) formbox.addRow('Type of gas : ',self.gas) formbox.addRow('Use Temperature : ',self.tempChoice) formbox.addRow('Temperature : ',self.temp) form=QtGui.QFrame() form.setLayout(formbox) button5=QtGui.QPushButton('Save background') button5.clicked.connect(self.saveBack) self.saveL=QtGui.QLineEdit() button6=QtGui.QPushButton('Save attribute') button6.clicked.connect(self.saveAttr) vbox2=QtGui.QVBoxLayout() vbox2.addStretch(1) vbox2.addWidget(form) vbox2.addWidget(button5) vbox2.addWidget(self.p3) vbox2.addWidget(button3) vbox2.addWidget(self.p4) vbox2.addWidget(button4) vbox2.addWidget(self.textResult) vbox2.addWidget(self.saveL) vbox2.addWidget(button6) vbox1=QtGui.QVBoxLayout() vbox1.addStretch(1) vbox1.addWidget(self.signalChoice1) vbox1.addWidget(self.signalChoice2) vbox1.addWidget(button1) vbox1.addWidget(self.p1) vbox1.addWidget(self.p2) vbox1.addWidget(button2) dataWin=QtGui.QFrame() dataWin.setLayout(vbox1) processWin=QtGui.QFrame() processWin.setLayout(vbox2) splitterH=QtGui.QSplitter(QtCore.Qt.Horizontal,self) splitterH.addWidget(dataWin) splitterH.addWidget(processWin) self.setCentralWidget(splitterH) try: [sig1,sig2,self.l1,self.r1,self.l2,self.r2,self.l3,self.r3,lsample,gasindex,calculate,temp]=pickle.load( open( "UserLangmuir.dat", "rb" ) ) self.signalChoice1.setCurrentIndex(self.signals.index(sig1)) self.signalChoice2.setCurrentIndex(self.signals.index(sig2)) self.text1.setText(lsample) self.gas.setCurrentIndex(gasindex) self.temp.setText(temp) self.tempChoice.setCheckState(calculate) self.chooseSignals() self.updatePlot() self.displayIV() self.currentCorrection() self.temperature() except Exception,e: print str(e) self.l1=0. self.r1=2. self.l2=0. self.r2=0. self.l3=0. self.r3=0. print 'toto'