code cleanup

This commit is contained in:
Marcel Paffrath 2016-08-02 12:21:25 +02:00
parent a8522d0fae
commit c13bdd2cf2
2 changed files with 31 additions and 90 deletions

View File

@ -93,7 +93,6 @@ class gui_control(object):
self.setConnected2SurveyState(False) self.setConnected2SurveyState(False)
self.setSeisArrayState(True) self.setSeisArrayState(True)
def gen_survey(self): def gen_survey(self):
if self.checkSurveyState(): if self.checkSurveyState():
if not self.continueDialogExists('Survey'): if not self.continueDialogExists('Survey'):
@ -126,13 +125,11 @@ class gui_control(object):
self.setSeisArrayState(True) self.setSeisArrayState(True)
self.setConnected2SurveyState(True) self.setConnected2SurveyState(True)
def initNewSurvey(self): def initNewSurvey(self):
self.survey.setArtificialPick(0, 0) # artificial pick at source origin self.survey.setArtificialPick(0, 0) # artificial pick at source origin
self.setSurveyState(True) self.setSurveyState(True)
self.setPickState(False) self.setPickState(False)
def addArrayPlot(self): def addArrayPlot(self):
self.seisArrayFigure = Figure() self.seisArrayFigure = Figure()
self.seisArrayCanvas = FigureCanvas(self.seisArrayFigure) self.seisArrayCanvas = FigureCanvas(self.seisArrayFigure)
@ -140,13 +137,11 @@ class gui_control(object):
self.seisArrayToolbar = NavigationToolbar(self.seisArrayCanvas, self.mainwindow) self.seisArrayToolbar = NavigationToolbar(self.seisArrayCanvas, self.mainwindow)
self.mainUI.verticalLayout_tr1.addWidget(self.seisArrayToolbar) self.mainUI.verticalLayout_tr1.addWidget(self.seisArrayToolbar)
def addSurfacePlot(self): def addSurfacePlot(self):
self.surfaceFigure = Figure() self.surfaceFigure = Figure()
self.surfaceCanvas = FigureCanvas(self.surfaceFigure) self.surfaceCanvas = FigureCanvas(self.surfaceFigure)
self.mainUI.horizontalLayout_tr.addWidget(self.surfaceCanvas) self.mainUI.horizontalLayout_tr.addWidget(self.surfaceCanvas)
def addStatPlots(self): def addStatPlots(self):
self.statFigure_left = Figure() self.statFigure_left = Figure()
self.statCanvas_left = FigureCanvas(self.statFigure_left) self.statCanvas_left = FigureCanvas(self.statFigure_left)
@ -154,7 +149,6 @@ class gui_control(object):
self.statToolbar_left = NavigationToolbar(self.statCanvas_left, self.mainwindow) self.statToolbar_left = NavigationToolbar(self.statCanvas_left, self.mainwindow)
self.mainUI.verticalLayout_br1.addWidget(self.statToolbar_left) self.mainUI.verticalLayout_br1.addWidget(self.statToolbar_left)
self.statFigure_right = Figure() self.statFigure_right = Figure()
self.statCanvas_right = FigureCanvas(self.statFigure_right) self.statCanvas_right = FigureCanvas(self.statFigure_right)
self.mainUI.verticalLayout_br2.addWidget(self.statCanvas_right) self.mainUI.verticalLayout_br2.addWidget(self.statCanvas_right)
@ -163,7 +157,6 @@ class gui_control(object):
self.addItems2StatsComboBox() self.addItems2StatsComboBox()
def addItems2StatsComboBox(self): def addItems2StatsComboBox(self):
self.mainUI.comboBox_stats.insertItem(0, 'picked traces') self.mainUI.comboBox_stats.insertItem(0, 'picked traces')
self.mainUI.comboBox_stats.insertItem(1, 'mean SNR') self.mainUI.comboBox_stats.insertItem(1, 'mean SNR')
@ -172,7 +165,6 @@ class gui_control(object):
self.mainUI.comboBox_stats.insertItem(4, 'median SPE') self.mainUI.comboBox_stats.insertItem(4, 'median SPE')
self.enablePickedTools(False) self.enablePickedTools(False)
def addItems2ShotsComboBox(self): def addItems2ShotsComboBox(self):
shotnumbers = self.survey.data.keys() shotnumbers = self.survey.data.keys()
shotnumbers.sort() shotnumbers.sort()
@ -180,7 +172,6 @@ class gui_control(object):
self.mainUI.comboBox_shots.insertItem(index, 'Shot: %s'%shotnumber) self.mainUI.comboBox_shots.insertItem(index, 'Shot: %s'%shotnumber)
self.mainUI.comboBox_shots.setMaxCount(len(shotnumbers)) self.mainUI.comboBox_shots.setMaxCount(len(shotnumbers))
def increaseShotnumber(self): def increaseShotnumber(self):
currentIndex = self.mainUI.comboBox_shots.currentIndex() currentIndex = self.mainUI.comboBox_shots.currentIndex()
maxindex = self.mainUI.comboBox_shots.maxCount() - 1 maxindex = self.mainUI.comboBox_shots.maxCount() - 1
@ -189,7 +180,6 @@ class gui_control(object):
else: else:
self.mainUI.comboBox_shots.setCurrentIndex(currentIndex + 1) self.mainUI.comboBox_shots.setCurrentIndex(currentIndex + 1)
def decreaseShotnumber(self): def decreaseShotnumber(self):
currentIndex = self.mainUI.comboBox_shots.currentIndex() currentIndex = self.mainUI.comboBox_shots.currentIndex()
maxindex = self.mainUI.comboBox_shots.maxCount() - 1 maxindex = self.mainUI.comboBox_shots.maxCount() - 1
@ -203,20 +193,16 @@ class gui_control(object):
shotnumber = int(self.mainUI.comboBox_shots.currentText().split()[1]) shotnumber = int(self.mainUI.comboBox_shots.currentText().split()[1])
self.survey.data[shotnumber].matshow() self.survey.data[shotnumber].matshow()
def addArrayAxes(self): def addArrayAxes(self):
self.seisArrayAx = self.seisArrayFigure.add_subplot(111) self.seisArrayAx = self.seisArrayFigure.add_subplot(111)
def addSurfaceAxes(self): def addSurfaceAxes(self):
self.surfaceAx = self.surfaceFigure.add_subplot(111, projection = '3d') self.surfaceAx = self.surfaceFigure.add_subplot(111, projection = '3d')
def addStatAxes(self): def addStatAxes(self):
self.statAx_left = self.statFigure_left.add_subplot(111) self.statAx_left = self.statFigure_left.add_subplot(111)
self.statAx_right = self.statFigure_right.add_subplot(111) self.statAx_right = self.statFigure_right.add_subplot(111)
def enablePickedTools(self, bool, twoDim = False): def enablePickedTools(self, bool, twoDim = False):
self.mainUI.comboBox_stats.setEnabled(bool) self.mainUI.comboBox_stats.setEnabled(bool)
self.statToolbar_left.setEnabled(bool) self.statToolbar_left.setEnabled(bool)
@ -229,31 +215,26 @@ class gui_control(object):
if bool == False: if bool == False:
self.mainUI.comboBox_shots.clear() self.mainUI.comboBox_shots.clear()
def replotArray(self): def replotArray(self):
self.seisArrayFigure.clf() self.seisArrayFigure.clf()
self.addArrayAxes() self.addArrayAxes()
self.plotArray() self.plotArray()
self.seisArrayCanvas.draw() self.seisArrayCanvas.draw()
def replotSurface(self): def replotSurface(self):
self.surfaceFigure.clf() self.surfaceFigure.clf()
self.addSurfaceAxes() self.addSurfaceAxes()
self.plotSurface() self.plotSurface()
self.surfaceCanvas.draw() self.surfaceCanvas.draw()
def plotArray(self): def plotArray(self):
self.seisarray.plotArray2D(self.seisArrayAx, highlight_measured = True, plot_topo = True, twoDim = self.seisarray.twoDim) self.seisarray.plotArray2D(self.seisArrayAx, highlight_measured = True, plot_topo = True, twoDim = self.seisarray.twoDim)
def plotSurface(self): def plotSurface(self):
if not self.seisarray.twoDim: if not self.seisarray.twoDim:
self.seisarray.plotSurface3D(ax = self.surfaceAx, exag = True) self.seisarray.plotSurface3D(ax = self.surfaceAx, exag = True)
self.seisarray.plotArray3D(ax = self.surfaceAx, legend = False, markersize = 3) self.seisarray.plotArray3D(ax = self.surfaceAx, legend = False, markersize = 3)
def InitPickedWidgets(self): def InitPickedWidgets(self):
if self.checkPickState(): if self.checkPickState():
surveyUtils.plotScatterStats4Receivers(self.survey, self.mainUI.comboBox_stats.currentText(), surveyUtils.plotScatterStats4Receivers(self.survey, self.mainUI.comboBox_stats.currentText(),
@ -262,7 +243,6 @@ class gui_control(object):
self.statAx_right, twoDim = self.survey.twoDim) self.statAx_right, twoDim = self.survey.twoDim)
self.addItems2ShotsComboBox() self.addItems2ShotsComboBox()
def refreshPickedWidgets(self): def refreshPickedWidgets(self):
self.statFigure_left.clf() self.statFigure_left.clf()
self.statFigure_right.clf() self.statFigure_right.clf()
@ -271,7 +251,6 @@ class gui_control(object):
self.statCanvas_left.draw() self.statCanvas_left.draw()
self.statCanvas_right.draw() self.statCanvas_right.draw()
def printSurveyTextbox(self, init = True): def printSurveyTextbox(self, init = True):
if init == True: if init == True:
surveytup = (0, 0, 0, 0) surveytup = (0, 0, 0, 0)
@ -287,7 +266,6 @@ class gui_control(object):
string = surveyTitle + surveyText string = surveyTitle + surveyText
self.mainUI.textBox_survey.setText(string) self.mainUI.textBox_survey.setText(string)
def printSeisArrayTextbox(self, init = True): def printSeisArrayTextbox(self, init = True):
if init == True: if init == True:
seistup = (0, 0, 0) seistup = (0, 0, 0)
@ -302,7 +280,6 @@ class gui_control(object):
string = seisArrayTitle + seisArrayText string = seisArrayTitle + seisArrayText
self.mainUI.textBox_seisarray.setText(string) self.mainUI.textBox_seisarray.setText(string)
def interpolate_receivers(self): def interpolate_receivers(self):
if not self.checkSeisArrayState(): if not self.checkSeisArrayState():
self.printDialogMessage('No Seismic Array defined.') self.printDialogMessage('No Seismic Array defined.')
@ -310,7 +287,6 @@ class gui_control(object):
self.seisarray.interpolateAll() self.seisarray.interpolateAll()
self.refreshSeisArrayWidgets() self.refreshSeisArrayWidgets()
def refreshSeisArrayWidgets(self): def refreshSeisArrayWidgets(self):
self.replotArray() self.replotArray()
self.replotSurface() self.replotSurface()
@ -333,7 +309,6 @@ class gui_control(object):
self.printSurveyTextbox(init = False) self.printSurveyTextbox(init = False)
print('Connected Seismic Array to active Survey object.') print('Connected Seismic Array to active Survey object.')
def startPicker(self): def startPicker(self):
if not self.checkSurveyState(): if not self.checkSurveyState():
self.printDialogMessage('No Survey defined.') self.printDialogMessage('No Survey defined.')
@ -351,7 +326,6 @@ class gui_control(object):
self.setPickState(True) self.setPickState(True)
self.printSurveyTextbox(init = False) self.printSurveyTextbox(init = False)
def startFMTOMO(self): def startFMTOMO(self):
if not self.checkSurveyState(): if not self.checkSurveyState():
self.printDialogMessage('No Survey defined.') self.printDialogMessage('No Survey defined.')
@ -374,7 +348,6 @@ class gui_control(object):
else: else:
self.vtktools.start_dialog() self.vtktools.start_dialog()
def postprocessing(self): def postprocessing(self):
if not self.checkSurveyState(): if not self.checkSurveyState():
self.printDialogMessage('No Survey defined.') self.printDialogMessage('No Survey defined.')
@ -419,7 +392,6 @@ class gui_control(object):
self.setSeisArrayState(False) self.setSeisArrayState(False)
self.printDialogMessage('Loaded Survey.') self.printDialogMessage('Loaded Survey.')
def load_seisarray(self): def load_seisarray(self):
disconnect = False disconnect = False
if self.checkSeisArrayState(): if self.checkSeisArrayState():
@ -450,7 +422,6 @@ class gui_control(object):
self.seisarray = seisarray self.seisarray = seisarray
self.setSeisArrayState(True) self.setSeisArrayState(True)
def save_seisarray(self): def save_seisarray(self):
if not self.checkSeisArrayState(): if not self.checkSeisArrayState():
self.printDialogMessage('No Seismic Array defined.') self.printDialogMessage('No Seismic Array defined.')
@ -460,7 +431,6 @@ class gui_control(object):
return return
self.seisarray.saveSeisArray(filename) self.seisarray.saveSeisArray(filename)
def save_survey(self): def save_survey(self):
if not self.checkSurveyState(): if not self.checkSurveyState():
self.printDialogMessage('No Survey defined.') self.printDialogMessage('No Survey defined.')
@ -470,7 +440,6 @@ class gui_control(object):
return return
self.survey.saveSurvey(filename) self.survey.saveSurvey(filename)
def setSurveyState(self, state): def setSurveyState(self, state):
if state == True: if state == True:
self.mainUI.survey_active.setPixmap(self.applypixmap) self.mainUI.survey_active.setPixmap(self.applypixmap)
@ -478,21 +447,18 @@ class gui_control(object):
elif state == False: elif state == False:
self.mainUI.survey_active.setPixmap(self.cancelpixmap) self.mainUI.survey_active.setPixmap(self.cancelpixmap)
def checkSurveyState(self): def checkSurveyState(self):
if self.survey == None: if self.survey == None:
return False return False
else: else:
return True return True
def checkSeisArrayState(self): def checkSeisArrayState(self):
if self.seisarray == None: if self.seisarray == None:
return False return False
else: else:
return True return True
def setPickState(self, state): def setPickState(self, state):
if state == True and self.checkSurveyState(): if state == True and self.checkSurveyState():
self.mainUI.picked_active.setPixmap(self.applypixmap) self.mainUI.picked_active.setPixmap(self.applypixmap)
@ -510,7 +476,6 @@ class gui_control(object):
self.enablePickedTools(False) self.enablePickedTools(False)
self.survey.picked = False self.survey.picked = False
def setSeisArrayState(self, state): def setSeisArrayState(self, state):
if state == True: if state == True:
self.mainUI.seisarray_active.setPixmap(self.applypixmap) self.mainUI.seisarray_active.setPixmap(self.applypixmap)
@ -522,14 +487,12 @@ class gui_control(object):
if self.seisArrayFigure is not None: if self.seisArrayFigure is not None:
self.seisArrayFigure.clf() self.seisArrayFigure.clf()
def setConnected2SurveyState(self, state): def setConnected2SurveyState(self, state):
if state == True: if state == True:
self.mainUI.seisarray_on_survey_active.setPixmap(self.applypixmap) self.mainUI.seisarray_on_survey_active.setPixmap(self.applypixmap)
elif state == False: elif state == False:
self.mainUI.seisarray_on_survey_active.setPixmap(self.cancelpixmap) self.mainUI.seisarray_on_survey_active.setPixmap(self.cancelpixmap)
def checkConnected2SurveyState(self): def checkConnected2SurveyState(self):
if self.checkSurveyState(): if self.checkSurveyState():
if self.survey.seisarray != None: if self.survey.seisarray != None:
@ -537,14 +500,12 @@ class gui_control(object):
else: else:
return False return False
def checkPickState(self): def checkPickState(self):
if not self.survey: if not self.survey:
self.printDialogMessage('No Survey defined.') self.printDialogMessage('No Survey defined.')
return return
return self.survey.picked return self.survey.picked
def printDialogMessage(self, message): def printDialogMessage(self, message):
qmb = QtGui.QMessageBox() qmb = QtGui.QMessageBox()
qmb.setText(message) qmb.setText(message)
@ -552,7 +513,6 @@ class gui_control(object):
qmb.setIcon(QtGui.QMessageBox.Warning) qmb.setIcon(QtGui.QMessageBox.Warning)
qmb.exec_() qmb.exec_()
def continueDialogExists(self, name): def continueDialogExists(self, name):
qmb = QtGui.QMessageBox() qmb = QtGui.QMessageBox()
qmb.setText('%s object already exists. Overwrite?'%name) qmb.setText('%s object already exists. Overwrite?'%name)
@ -564,7 +524,6 @@ class gui_control(object):
else: else:
return False return False
def continueDialogMessage(self, message): def continueDialogMessage(self, message):
qmb = QtGui.QMessageBox() qmb = QtGui.QMessageBox()
qmb.setText(message) qmb.setText(message)
@ -576,7 +535,6 @@ class gui_control(object):
else: else:
return False return False
def exitApp(self): def exitApp(self):
QtCore.QCoreApplication.instance().quit() QtCore.QCoreApplication.instance().quit()
@ -590,4 +548,3 @@ if __name__ == "__main__":
gui = gui_control() gui = gui_control()
sys.exit(app.exec_()) sys.exit(app.exec_())

View File

@ -45,6 +45,7 @@ def getMaxCPU():
import multiprocessing import multiprocessing
return multiprocessing.cpu_count() return multiprocessing.cpu_count()
class Gen_SeisArray(object): class Gen_SeisArray(object):
def __init__(self, mainwindow): def __init__(self, mainwindow):
self.mainwindow = mainwindow self.mainwindow = mainwindow
@ -65,6 +66,7 @@ class Gen_SeisArray(object):
def start_dialog(self): def start_dialog(self):
if self.qdialog.exec_(): if self.qdialog.exec_():
self.refresh_selection()
if self.ui.radioButton_interpolatable.isChecked(): if self.ui.radioButton_interpolatable.isChecked():
self.seisarray = seismicArrayPreparation.SeisArray(self.recfile, True) self.seisarray = seismicArrayPreparation.SeisArray(self.recfile, True)
elif self.ui.radioButton_normal.isChecked(): elif self.ui.radioButton_normal.isChecked():
@ -75,8 +77,14 @@ class Gen_SeisArray(object):
self.seisarray.addMeasuredTopographyPoints(self.ptsfile) self.seisarray.addMeasuredTopographyPoints(self.ptsfile)
self.executed = True self.executed = True
else: else:
self.refresh_selection()
self.executed = False self.executed = False
def refresh_selection(self):
self.srcfile = self.ui.lineEdit_src.text()
self.recfile = self.ui.lineEdit_rec.text()
self.ptsfile = self.ui.lineEdit_pts.text()
def get_seisarray(self): def get_seisarray(self):
if self.seisarray is not None: if self.seisarray is not None:
return self.seisarray return self.seisarray
@ -96,7 +104,6 @@ class Gen_SeisArray(object):
self.ui.lineEdit_pts.setText(openFile('Open measured points file.')) self.ui.lineEdit_pts.setText(openFile('Open measured points file.'))
class Gen_Survey_from_SA(object): class Gen_Survey_from_SA(object):
def __init__(self, mainwindow, seisarray): def __init__(self, mainwindow, seisarray):
self.mainwindow = mainwindow self.mainwindow = mainwindow
@ -118,13 +125,20 @@ class Gen_Survey_from_SA(object):
def start_dialog(self): def start_dialog(self):
if self.qdialog.exec_(): if self.qdialog.exec_():
self.refresh_selection()
self.survey = activeSeismoPick.Survey(self.obsdir, seisArray = self.seisarray, self.survey = activeSeismoPick.Survey(self.obsdir, seisArray = self.seisarray,
useDefaultParas = True, fstart = self.fstart, useDefaultParas = True, fstart = self.fstart,
fend = self.fend) fend = self.fend)
self.executed = True self.executed = True
else: else:
self.refresh_selection()
self.executed = False self.executed = False
def refresh_selection(self):
self.obsdir = self.ui.lineEdit_obs.text()
self.fstart = self.ui.fstart.text()
self.fend = self.ui.fend.text()
def get_survey(self): def get_survey(self):
return self.survey return self.survey
@ -157,13 +171,22 @@ class Gen_Survey_from_SR(object):
def start_dialog(self): def start_dialog(self):
if self.qdialog.exec_(): if self.qdialog.exec_():
self.refresh_selection()
self.survey = activeSeismoPick.Survey(self.obsdir, self.srcfile, self.recfile, self.survey = activeSeismoPick.Survey(self.obsdir, self.srcfile, self.recfile,
useDefaultParas = True, useDefaultParas = True,
fstart = self.fstart, fend = self.fend) fstart = self.fstart, fend = self.fend)
self.executed = True self.executed = True
else: else:
self.refresh_selection()
self.executed = False self.executed = False
def refresh_selection(self):
self.obsdir = self.ui.lineEdit_obs.text()
self.srcfile = self.ui.lineEdit_src.text()
self.recfile = self.ui.lineEdit_rec.text()
self.fstart = self.ui.fstart.text()
self.fend = self.ui.fend.text()
def get_survey(self): def get_survey(self):
return self.survey return self.survey
@ -256,7 +279,6 @@ class Call_autopicker(object):
self.snrCanvas.draw() self.snrCanvas.draw()
def start_dialog(self): def start_dialog(self):
self.init_last_selection()
self.plotDynSNR() self.plotDynSNR()
if self.qdialog.exec_(): if self.qdialog.exec_():
self.refresh_selection() self.refresh_selection()
@ -294,19 +316,6 @@ class Call_autopicker(object):
self.p1 = float(self.ui.p1.value()) self.p1 = float(self.ui.p1.value())
self.p2 = float(self.ui.p2.value()) self.p2 = float(self.ui.p2.value())
def init_last_selection(self):
self.ui.ncores.setValue(self.ncores)
self.ui.lineEdit_vmin.setText(str(self.vmin))
self.ui.lineEdit_vmax.setText(str(self.vmax))
self.ui.slider_folm.setValue(self.folm)
self.ui.checkBox_AIC.setChecked(self.AIC)
self.ui.lineEdit_aicleft.setText(str(self.aicwindow[0]))
self.ui.lineEdit_aicright.setText(str(self.aicwindow[1]))
self.ui.shift_snr.setValue(self.shiftSNR)
self.ui.shift_snr.setValue(self.shiftDist)
self.ui.p1.setValue(self.p1)
self.ui.p2.setValue(self.p2)
def connectButtons(self): def connectButtons(self):
QtCore.QObject.connect(self.ui.slider_folm, QtCore.SIGNAL("valueChanged(int)"), self.refreshFolm) QtCore.QObject.connect(self.ui.slider_folm, QtCore.SIGNAL("valueChanged(int)"), self.refreshFolm)
QtCore.QObject.connect(self.ui.shift_snr, QtCore.SIGNAL("valueChanged(int)"), self.plotDynSNR) QtCore.QObject.connect(self.ui.shift_snr, QtCore.SIGNAL("valueChanged(int)"), self.plotDynSNR)
@ -324,7 +333,6 @@ class Call_autopicker(object):
self.ui.lineEdit_rec.setText(openFile('Open receiverfile.')) self.ui.lineEdit_rec.setText(openFile('Open receiverfile.'))
class Call_FMTOMO(object): class Call_FMTOMO(object):
def __init__(self, mainwindow, survey): def __init__(self, mainwindow, survey):
self.mainwindow = mainwindow self.mainwindow = mainwindow
@ -343,7 +351,6 @@ class Call_FMTOMO(object):
self.connectButtons() self.connectButtons()
def start_dialog(self): def start_dialog(self):
self.init_last_selection()
if self.qdialog.exec_(): if self.qdialog.exec_():
self.refresh_selection() self.refresh_selection()
@ -383,22 +390,6 @@ class Call_FMTOMO(object):
self.simuldir = self.ui.simuldir.text() self.simuldir = self.ui.simuldir.text()
self.picks_dir = os.path.join(self.simuldir, 'picks') self.picks_dir = os.path.join(self.simuldir, 'picks')
def init_last_selection(self):
self.ui.fmtomo_dir.setText(self.fmtomo_dir)
self.ui.nIter.setValue(self.nIter)
self.ui.nproc.setValue(self.nproc)
self.ui.btop.setText(str(self.btop))
self.ui.bbot.setText(str(self.bbot))
self.ui.pgrid_x.setValue(self.propgrid[0])
self.ui.pgrid_y.setValue(self.propgrid[1])
self.ui.pgrid_z.setValue(self.propgrid[2])
self.ui.invgrid_x.setValue(self.vgrid[0])
self.ui.invgrid_y.setValue(self.vgrid[1])
self.ui.invgrid_z.setValue(self.vgrid[2])
self.ui.cushion.setValue(self.cushionfactor)
self.ui.customgrid.setText(self.customgrid)
self.ui.simuldir.setText(self.simuldir)
def connectButtons(self): def connectButtons(self):
QtCore.QObject.connect(self.ui.browse_tomodir, QtCore.SIGNAL("clicked()"), self.chooseFMTOMOdir) QtCore.QObject.connect(self.ui.browse_tomodir, QtCore.SIGNAL("clicked()"), self.chooseFMTOMOdir)
QtCore.QObject.connect(self.ui.browse_customgrid, QtCore.SIGNAL("clicked()"), self.chooseCustomgrid) QtCore.QObject.connect(self.ui.browse_customgrid, QtCore.SIGNAL("clicked()"), self.chooseCustomgrid)
@ -418,7 +409,7 @@ class Call_VTK_dialog(object):
def __init__(self, mainwindow): def __init__(self, mainwindow):
self.mainwindow = mainwindow self.mainwindow = mainwindow
self.init_dialog() self.init_dialog()
#self.refresh_selection() self.refresh_selection()
self.start_dialog() self.start_dialog()
def init_dialog(self): def init_dialog(self):
@ -430,22 +421,15 @@ class Call_VTK_dialog(object):
self.connectButtons() self.connectButtons()
def start_dialog(self): def start_dialog(self):
#self.init_last_selection()
self.qdialog.exec_() self.qdialog.exec_()
#self.refresh_selection() self.refresh_selection()
# def refresh_selection(self): def refresh_selection(self):
# self.vg = self.ui.lineEdit_vg.text() self.vg = self.ui.lineEdit_vg.text()
# self.vgout = self.ui.lineEdit_vgout.text() self.vgout = self.ui.lineEdit_vgout.text()
# self.rays = self.ui.lineEdit_rays.text() self.rays = self.ui.lineEdit_rays.text()
# self.raysout = self.ui.lineEdit_raysout.text() self.raysout = self.ui.lineEdit_raysout.text()
# def init_last_selection(self):
# self.ui.lineEdit_vg.setText(self.vg)
# self.ui.lineEdit_vgout.setText(self.vgout)
# self.ui.lineEdit_rays.setText(self.rays)
# self.ui.lineEdit_raysout.setText(self.raysout)
def checkVgStartButton(self): def checkVgStartButton(self):
ui = self.ui ui = self.ui
if ui.radioButton_rel.isChecked(): if ui.radioButton_rel.isChecked():