def __init__(self): QtGui.QWidget.__init__(self) plotLayout = QtGui.QHBoxLayout() self.plot = PlotView() parameterLayout = QtGui.QVBoxLayout() self.plotList = QtGui.QListWidget(self) self.plotList.setMaximumWidth(150) self.plotList.setMinimumWidth(150) self.plotDataPanel = PlotParameterConfigurationPanel(self, 150) parameterLayout.addWidget(self.plotList) parameterLayout.addWidget(self.plotDataPanel) self.connect(self.plotList, QtCore.SIGNAL('currentItemChanged(QListWidgetItem *, QListWidgetItem *)'), self.select) ContentModel.modelConnect('initialized()', self.updateList) #todo: listen to ensemble changes! self.plotDataFetcher = PlotDataFetcher() self.connect(self.plotDataFetcher, QtCore.SIGNAL('dataChanged()'), self.drawPlot) self.plotContextDataFetcher = PlotContextDataFetcher() plot_view_layout = QtGui.QGridLayout() plot_view_layout.addWidget(self.plot, 0, 0, 1, 1) self.h_zoom_slider = ZoomSlider() self.connect(self.h_zoom_slider, QtCore.SIGNAL('zoomValueChanged(float, float)'), self.plot.setXZoomFactors) self.v_zoom_slider = ZoomSlider(horizontal=False) self.connect(self.v_zoom_slider, QtCore.SIGNAL('zoomValueChanged(float, float)'), self.plot.setYZoomFactors) plot_view_layout.addWidget(self.h_zoom_slider, 1, 0, 1, 1) plot_view_layout.addWidget(self.v_zoom_slider, 0, 1, 1, 1) plotLayout.addLayout(parameterLayout) plotLayout.addLayout(plot_view_layout) self.plotViewSettings = PlotViewSettingsPanel(plotView=self.plot, width=250) self.connect(self.plotViewSettings, QtCore.SIGNAL('comparisonCaseSelected(String)'), self.plotDataFetcher.updateComparisonFS) plotLayout.addWidget(self.plotViewSettings) self.setLayout(plotLayout) self.connect(self.plot.plot_settings, QtCore.SIGNAL('plotSettingsChanged(PlotSettings)'), self.fetchSettings) ContentModel.modelConnect('casesUpdated()', self.updateList)
def __init__(self): ContentModel.__init__(self) QObject.__init__(self) self.parameter = None # the order of these handlers depend on ERT's way of keeping track of the keys self.handlers = [RFTFetcher(), EnsembleFetcher()] self.current_handler = None self.empty_panel = QFrame() self.fs_for_comparison_plots = None self.comparison_fs_name = "None" self.data = None
firste_case_name = new_configuration_dialog.getCaseName() dbase_type = new_configuration_dialog.getDBaseType() num_realizations = new_configuration_dialog.getNumberOfRealizations() storage_path = new_configuration_dialog.getStoragePath() ert.enkf.enkf_main_create_new_config(enkf_config, storage_path, firste_case_name, dbase_type, num_realizations) strict = False ert.bootstrap(enkf_config, site_config=site_config, strict=strict) window.setSaveFunction(ert.save) splash.showMessage("Creating GUI...", color=QtCore.Qt.white) app.processEvents() #window.addPage("Configuration", resourceIcon("config"), ConfigPages(window)) window.addPage("Init", resourceIcon("db"), InitPanel(window)) window.addPage("Run", resourceIcon("run"), RunPanel(window)) window.addPage("Plots", resourceIcon("plot"), PlotPanel()) splash.showMessage("Communicating with ERT...", color=QtCore.Qt.white) app.processEvents() ContentModel.contentModel = ert ContentModel.updateObservers() window.show() splash.finish(window) sys.exit(app.exec_())
def __init__(self): ContentModel.__init__(self)
def __init__(self): ContentModel.__init__(self) self.observation_icon = resourceIcon("observation")
num_realizations = new_configuration_dialog.getNumberOfRealizations() storage_path = new_configuration_dialog.getStoragePath() ert.enkf.enkf_main_create_new_config(enkf_config, storage_path , firste_case_name, dbase_type, num_realizations) strict = False ert.bootstrap(enkf_config, site_config = site_config, strict = strict) window.setSaveFunction(ert.save) splash.showMessage("Creating GUI...", color=QtCore.Qt.white) app.processEvents() #window.addPage("Configuration", resourceIcon("config"), ConfigPages(window)) window.addPage("Init", resourceIcon("db"), InitPanel(window)) window.addPage("Run", resourceIcon("run"), RunPanel(window)) window.addPage("Plots", resourceIcon("plot"), PlotPanel()) splash.showMessage("Communicating with ERT...", color=QtCore.Qt.white) app.processEvents() ContentModel.contentModel = ert ContentModel.updateObservers() window.show() splash.finish(window) sys.exit(app.exec_())
def main(): app = QtGui.QApplication(sys.argv) #Early so that QT is initialized before other imports from ert_gui.pages.config.configpages import ConfigPages from ert_gui.pages.plot.plotpanel import PlotPanel splash = QtGui.QSplashScreen(resourceImage("newsplash") , QtCore.Qt.WindowStaysOnTopHint) splash.show() splash.showMessage("Starting up...", QtCore.Qt.AlignLeft, QtCore.Qt.white) app.processEvents() window = Application() splash.showMessage("Bootstrapping...", QtCore.Qt.AlignLeft, QtCore.Qt.white) app.processEvents() ert = ErtWrapper( ) strict = True site_config = os.getenv("ERT_SITE_CONFIG") if len(sys.argv) == 1: print "-----------------------------------------------------------------" print "-- You must supply the name of configuration file as the first --" print "-- commandline argument: --" print "-- --" print "-- bash% gert <config_file> --" print "-- --" print "-- If the configuration file does not exist, gert will create --" print "-- create a new configuration file. --" print "-----------------------------------------------------------------" #sys.exit(0) else: enkf_config = sys.argv[1] if not os.path.exists(enkf_config): print "Trying to start new config" new_configuration_dialog = NewConfigurationDialog(enkf_config) success = new_configuration_dialog.exec_() if not success: print "Can not run without a configuration file." sys.exit(1) else: enkf_config = new_configuration_dialog.getConfigurationPath() firste_case_name = new_configuration_dialog.getCaseName() dbase_type = new_configuration_dialog.getDBaseType() num_realizations = new_configuration_dialog.getNumberOfRealizations() storage_path = new_configuration_dialog.getStoragePath() EnKFMain.create_new_config(enkf_config, storage_path , firste_case_name, dbase_type, num_realizations) strict = False ert.bootstrap(enkf_config, site_config = site_config, strict = strict) window.setSaveFunction(ert.save) splash.showMessage("Creating GUI...", QtCore.Qt.AlignLeft, QtCore.Qt.white) app.processEvents() window.addPage("Configuration", resourceIcon("config"), ConfigPages(window)) window.addPage("Init" , resourceIcon("db"), InitPanel(window)) window.addPage("Run" , resourceIcon("run"), RunPanel(window)) window.addPage("Plots", resourceIcon("plot"), PlotPanel()) splash.showMessage("Communicating with ERT...", QtCore.Qt.AlignLeft, QtCore.Qt.white) app.processEvents() ContentModel.contentModel = ert ContentModel.updateObservers() window.show() splash.finish(window) sys.exit(app.exec_())