This commit is contained in:
Marcel Paffrath 2016-07-27 13:46:42 +02:00
parent 8bd9f7debc
commit adfe9cc027
9 changed files with 39 additions and 44 deletions

View File

@ -7,38 +7,18 @@ matplotlib.use('Qt4Agg')
matplotlib.rcParams['backend.qt4']='PySide'
from PySide import QtCore, QtGui
from pylot.core.active import activeSeismoPick, surveyUtils, fmtomoUtils, seismicArrayPreparation
from pylot.core.active.gui.asp3d_layout import *
from pylot.core.active.gui.fmtomo_parameters_layout import *
from pylot.core.active.gui.vtk_tools_layout import *
from pylot.core.active.gui.windows import Gen_SeisArray, Gen_Survey_from_SA, Gen_Survey_from_SR, Call_autopicker
from pylot.core.active import activeSeismoPick, surveyUtils, fmtomoUtils, seismicArrayPreparation
from pylot.core.active.gui.windows import openFile, saveFile, browseDir, getMaxCPU
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
def openFile(name = 'Open'):
dialog = QtGui.QFileDialog()
dialog.setWindowTitle(name) #not working yet
filename = dialog.getOpenFileName()
if len(filename[0]) > 0:
return filename[0]
def saveFile(name = 'Save'):
dialog = QtGui.QFileDialog()
dialog.setWindowTitle(name)
filename = dialog.getSaveFileName()
if len(filename[0]) > 0:
return filename[0]
def browseDir(name = 'Open Directory'):
dialog = QtGui.QFileDialog()
dialog.setWindowTitle(name)
directory = dialog.getExistingDirectory()
if len(directory) > 0:
return directory
class gui_control(object):
def __init__(self):
self.mainwindow = MainWindow
@ -140,9 +120,8 @@ class gui_control(object):
self.survey = self.gssr.get_survey()
self.seisarray = self.survey.seisarray
self.initNewSurvey()
self.setSeisArrayState(True)
self.setConnected2SurveyState(True)
self.setPickState(False)
def initNewSurvey(self):
@ -352,11 +331,6 @@ class gui_control(object):
print('Connected Seismic Array to active Survey object.')
def getMaxCPU(self): ### OLD
import multiprocessing
return multiprocessing.cpu_count()
def callPicker(self):
if not self.checkSurveyState():
self.printDialogMessage('No Survey defined.')
@ -385,7 +359,7 @@ class gui_control(object):
fmtomo_parameters = QtGui.QDialog(self.mainwindow)
ui = Ui_fmtomo_parameters()
ui.setupUi(fmtomo_parameters)
ui.nproc.setMaximum(self.getMaxCPU())
ui.nproc.setMaximum(getMaxCPU())
self.fmtomo_parameters_ui = ui
self.connectButtons_startFMTOMO()

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'asp3d_layout.ui'
#
# Created: Mon Jul 18 11:26:32 2016
# Created: Wed Jul 27 11:15:05 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
@ -354,7 +354,7 @@ class Ui_MainWindow(object):
self.label_3.setText(QtGui.QApplication.translate("MainWindow", "Survey", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("MainWindow", "active", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("MainWindow", "picked", None, QtGui.QApplication.UnicodeUTF8))
self.label_11.setText(QtGui.QApplication.translate("MainWindow", "Plot Receiver and Shots of the Array colord by:", None, QtGui.QApplication.UnicodeUTF8))
self.label_11.setText(QtGui.QApplication.translate("MainWindow", "Plot Receiver and Shots of the Array colored by:", None, QtGui.QApplication.UnicodeUTF8))
self.label_10.setText(QtGui.QApplication.translate("MainWindow", "Plot a single Shot:", None, QtGui.QApplication.UnicodeUTF8))
self.shot_left.setText(QtGui.QApplication.translate("MainWindow", "<", None, QtGui.QApplication.UnicodeUTF8))
self.shot_right.setText(QtGui.QApplication.translate("MainWindow", ">", None, QtGui.QApplication.UnicodeUTF8))
@ -363,7 +363,7 @@ class Ui_MainWindow(object):
self.menuSeismic_Array.setTitle(QtGui.QApplication.translate("MainWindow", "Seismic Array", None, QtGui.QApplication.UnicodeUTF8))
self.menuSurvey.setTitle(QtGui.QApplication.translate("MainWindow", "Survey", None, QtGui.QApplication.UnicodeUTF8))
self.menuPicking.setTitle(QtGui.QApplication.translate("MainWindow", "Picking", None, QtGui.QApplication.UnicodeUTF8))
self.menuSimulation.setTitle(QtGui.QApplication.translate("MainWindow", "Simulation", None, QtGui.QApplication.UnicodeUTF8))
self.menuSimulation.setTitle(QtGui.QApplication.translate("MainWindow", "Inversion", None, QtGui.QApplication.UnicodeUTF8))
self.menuTools.setTitle(QtGui.QApplication.translate("MainWindow", "Tools", None, QtGui.QApplication.UnicodeUTF8))
self.actionLoad_Seismic_Array.setText(QtGui.QApplication.translate("MainWindow", "Load Seismic Array", None, QtGui.QApplication.UnicodeUTF8))
self.actionSave_Seismic_Array.setText(QtGui.QApplication.translate("MainWindow", "Save Seismic Array", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'fmtomo_parameters_layout.ui'
#
# Created: Mon Jul 18 11:26:32 2016
# Created: Wed Jul 27 11:15:05 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
@ -270,7 +270,7 @@ class Ui_fmtomo_parameters(object):
"Too low values will cause error.", None, QtGui.QApplication.UnicodeUTF8))
self.label_13.setText(QtGui.QApplication.translate("fmtomo_parameters", "Cushion factor [?]", None, QtGui.QApplication.UnicodeUTF8))
self.label_12.setText(QtGui.QApplication.translate("fmtomo_parameters", "%", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("fmtomo_parameters", "Number of Ponts", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("fmtomo_parameters", "Number of Points", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("fmtomo_parameters", "X", None, QtGui.QApplication.UnicodeUTF8))
self.label_6.setText(QtGui.QApplication.translate("fmtomo_parameters", "Y", None, QtGui.QApplication.UnicodeUTF8))
self.label_7.setText(QtGui.QApplication.translate("fmtomo_parameters", "Z", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'generate_seisarray_layout.ui'
#
# Created: Mon Jul 18 11:26:32 2016
# Created: Wed Jul 27 11:15:06 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'generate_survey_layout.ui'
#
# Created: Mon Jul 18 11:26:32 2016
# Created: Wed Jul 27 11:15:06 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'generate_survey_layout_minimal.ui'
#
# Created: Mon Jul 18 11:26:33 2016
# Created: Wed Jul 27 11:15:06 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'picking_parameters_layout.ui'
#
# Created: Mon Jul 18 11:26:33 2016
# Created: Wed Jul 27 11:15:06 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
@ -12,8 +12,8 @@ from PySide import QtCore, QtGui
class Ui_picking_parameters(object):
def setupUi(self, picking_parameters):
picking_parameters.setObjectName("picking_parameters")
picking_parameters.resize(400, 550)
picking_parameters.setMinimumSize(QtCore.QSize(0, 550))
picking_parameters.resize(400, 700)
picking_parameters.setMinimumSize(QtCore.QSize(0, 700))
self.verticalLayout_4 = QtGui.QVBoxLayout(picking_parameters)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.label_7 = QtGui.QLabel(picking_parameters)

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'vtk_tools_layout.ui'
#
# Created: Mon Jul 18 11:26:33 2016
# Created: Wed Jul 27 11:15:06 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!

View File

@ -1,11 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PySide import QtCore, QtGui
from pylot.core.active import surveyUtils, activeSeismoPick, seismicArrayPreparation
from generate_survey_layout import *
from generate_survey_layout_minimal import *
from generate_seisarray_layout import *
from pylot.core.active.gui.picking_parameters_layout import *
from pylot.core.active import surveyUtils
from picking_parameters_layout import *
import numpy as np
import matplotlib
@ -16,6 +16,27 @@ from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
def openFile(name = 'Open'):
dialog = QtGui.QFileDialog()
dialog.setWindowTitle(name) #not working yet
filename = dialog.getOpenFileName()
if len(filename[0]) > 0:
return filename[0]
def saveFile(name = 'Save'):
dialog = QtGui.QFileDialog()
dialog.setWindowTitle(name)
filename = dialog.getSaveFileName()
if len(filename[0]) > 0:
return filename[0]
def browseDir(name = 'Open Directory'):
dialog = QtGui.QFileDialog()
dialog.setWindowTitle(name)
directory = dialog.getExistingDirectory()
if len(directory) > 0:
return directory
def getMaxCPU():
import multiprocessing
return multiprocessing.cpu_count()