Exemple #1
0
    def createTopLayout(self):
        top_layout = QHBoxLayout()

        image_label = QLabel()
        image = util.resourceImage("splash.jpg")
        image_label.setPixmap(image.scaled(200, 240, Qt.KeepAspectRatio))

        top_layout.addWidget(image_label)

        top_layout.addLayout(self.createInfoLayout(), 1)

        return top_layout
Exemple #2
0
    def createTopLayout(self):
        top_layout = QHBoxLayout()

        image_label = QLabel()
        image = util.resourceImage("splash.jpg")
        image_label.setPixmap(image.scaled(200, 240, Qt.KeepAspectRatio))

        top_layout.addWidget(image_label)

        top_layout.addLayout(self.createInfoLayout(), 1)

        return top_layout
Exemple #3
0
    def setValidationMessage(self, message, validation_type=WARNING):
        """Add a warning or information icon to the widget with a tooltip"""
        if message == "":
            self.validation_type = None
            self.validation_message = None
            self.validation_label.setHidden(True)
            self.validation_label.setToolTip("")
        else:
            self.validation_type = validation_type
            self.validation_message = message
            self.validation_label.setHidden(False)
            self.validation_label.setToolTip(message)
            self.validation_label.setPixmap(resourceImage(validation_type))

        MessageCenter().setWarning(self, self.validation_message)
Exemple #4
0
    def setValidationMessage(self, message, validation_type=WARNING):
        """Add a warning or information icon to the widget with a tooltip"""
        message = message.strip()
        if message == "":
            self.validation_type = None
            self.validation_message = None
            self.validation_label.setPixmap(QPixmap())
            HelpedWidget.__error_popup.hide()
            self.validationChanged.emit(True)

        else:
            self.validation_type = validation_type
            self.validation_message = message
            self.validation_label.setPixmap(resourceImage(validation_type))
            HelpedWidget.__error_popup.presentError(self, self.validation_message)
            self.validationChanged.emit(False)
Exemple #5
0
    def __init__(self, widget_label="", help_link=""):
        QWidget.__init__(self)

        self.validation_label = QLabel()
        self.validation_label.setMaximumSize(QSize(16, 16))
        self.validation_label.setPixmap(resourceImage(HelpedWidget.WARNING))
        self.validation_label.setHidden(True)

        if not widget_label == "":
            self.label = widget_label + ":"
        else:
            self.label = ""

        self.help_link = help_link
        self.validation_message = None
        self.validation_type = None

        self.widget_layout = QHBoxLayout()
        self.widget_layout.setMargin(0)
        self.widget_layout.addWidget(self.validation_label)
        self.setLayout(self.widget_layout)
Exemple #6
0
    def __init__(self):
        QSplashScreen.__init__(self)
        self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.SplashScreen)

        splash_width = 720
        splash_height = 400

        desktop = QApplication.desktop()
        screen = desktop.screenGeometry(desktop.primaryScreen()).size()

        screen_width, screen_height = screen.width(), screen.height()
        x = screen_width / 2 - splash_width / 2
        y = screen_height / 2 - splash_height / 2
        self.setGeometry(x, y, splash_width, splash_height)

        self.splash_image = util.resourceImage("splash.jpg")

        self.ert = "ERT"
        self.ert_title = "Ensemble based Reservoir Tool"
        self.version = "Version string"
        self.timestamp = "Timestamp string"
        self.copyright = u"Copyright \u00A9 2014 Statoil ASA, Norway"
Exemple #7
0
    def __init__(self):
        QSplashScreen.__init__(self)
        self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.SplashScreen)

        splash_width = 720
        splash_height = 400

        desktop = QApplication.desktop()
        screen = desktop.screenGeometry(desktop.primaryScreen()).size()

        screen_width, screen_height = screen.width(), screen.height()
        x = screen_width / 2 - splash_width / 2
        y = screen_height / 2 - splash_height / 2
        self.setGeometry(x, y, splash_width, splash_height)


        self.splash_image = util.resourceImage("splash.jpg")

        self.ert = "ERT"
        self.ert_title = "Ensemble based Reservoir Tool"
        self.version = "Version string"
        self.timestamp = "Timestamp string"
        self.copyright = u"Copyright \u00A9 2016 Statoil ASA, Norway"
Exemple #8
0
app = QtGui.QApplication(
    sys.argv)  #Early so that QT is initialized before other imports

from ert_gui.pages.application import Application
from ert_gui.pages.init.initpanel import InitPanel
from ert_gui.pages.run.runpanel import RunPanel
from ert_gui.pages.config.configpages import ConfigPages
from ert_gui.pages.plot.plotpanel import PlotPanel
from ert_gui.widgets.helpedwidget import ContentModel
from ert_gui.widgets.util import resourceImage, resourceIcon

import matplotlib
print "PyQt4 version: ", QtCore.qVersion()
print "matplotlib version: ", matplotlib.__version__

splash = QtGui.QSplashScreen(resourceImage("splash"),
                             QtCore.Qt.WindowStaysOnTopHint)
splash.show()
splash.showMessage("Starting up...", color=QtCore.Qt.white)
app.processEvents()

window = Application()

splash.showMessage("Bootstrapping...", color=QtCore.Qt.white)
app.processEvents()

ert = ErtWrapper()
strict = True
site_config = os.getenv("ERT_SITE_CONFIG")
if len(sys.argv) == 1:
    print "-----------------------------------------------------------------"
Exemple #9
0
def main(argv):
    app = QApplication(argv) #Early so that QT is initialized before other imports
    app.setWindowIcon(util.resourceIcon("application/window_icon_cutout"))

    splash = QSplashScreen(resourceImage("newsplash"), Qt.WindowStaysOnTopHint)
    splash.show()
    splash.showMessage("Starting up...", Qt.AlignLeft, Qt.white)
    app.processEvents()

    help_center = HelpCenter("ERT")
    help_center.setHelpLinkPrefix(os.getenv("ERT_SHARE_PATH") + "/gui/help/")
    help_center.setHelpMessageLink("welcome_to_ert")

    splash.showMessage("Bootstrapping...", Qt.AlignLeft, Qt.white)
    app.processEvents()

    strict = True
    site_config = os.getenv("ERT_SITE_CONFIG")
    if len(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("-----------------------------------------------------------------")
    else:
        enkf_config = 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()
                first_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.createNewConfig(enkf_config, storage_path, first_case_name, dbase_type, num_realizations)
                strict = False

        ert = Ert(EnKFMain(enkf_config, site_config=site_config, strict=strict))
        ErtConnector.setErt(ert.ert())


        splash.showMessage("Creating GUI...", Qt.AlignLeft, Qt.white)
        app.processEvents()


        window = GertMainWindow()
        window.setWidget(SimulationPanel())

        help_tool = HelpTool("ERT", window)

        window.addDock("Configuration Summary", SummaryPanel(), area=Qt.BottomDockWidgetArea)
        window.addTool(IdeTool(os.path.basename(enkf_config), ert.reloadERT, help_tool))
        window.addTool(PlotTool())
        window.addTool(ExportTool())
        window.addTool(WorkflowsTool())
        window.addTool(ManageCasesTool())
        window.addTool(help_tool)


        splash.showMessage("Communicating with ERT...", Qt.AlignLeft, Qt.white)
        app.processEvents()

        window.show()
        splash.finish(window)

        sys.exit(app.exec_())
Exemple #10
0
def main():
    QApplication.setGraphicsSystem("raster")
    app = QApplication(sys.argv)  # Early so that QT is initialized before other imports

    splash = QSplashScreen(resourceImage("newsplash"), Qt.WindowStaysOnTopHint)
    splash.show()
    splash.showMessage("Starting up...", Qt.AlignLeft, Qt.white)
    app.processEvents()

    HelpDock.setHelpLinkPrefix(os.getenv("ERT_SHARE_PATH") + "/gui/help/")

    splash.showMessage("Bootstrapping...", Qt.AlignLeft, Qt.white)
    app.processEvents()

    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("-----------------------------------------------------------------")
    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.createNewConfig(enkf_config, storage_path, firste_case_name, dbase_type, num_realizations)
                strict = False

        ert = EnKFMain(enkf_config, site_config=site_config, strict=strict)
        ErtConnector.setErt(ert)

        window = GertMainWindow()
        window.setSaveFunction(ert.saveConfig())

        splash.showMessage("Creating GUI...", Qt.AlignLeft, Qt.white)
        app.processEvents()

        simulation_panel = SimulationPanel()
        window.addTab(simulation_panel.getName(), simulation_panel)
        configuration_panel = ConfigurationPanel()
        window.addTab(configuration_panel.getName(), configuration_panel)

        splash.showMessage("Communicating with ERT...", Qt.AlignLeft, Qt.white)
        app.processEvents()

        window.show()
        splash.finish(window)

        HelpDock.setHelpMessageLink("welcome_to_ert")

        sys.exit(app.exec_())
Exemple #11
0
app = QtGui.QApplication(sys.argv) #Early so that QT is initialized before other imports

from ert_gui.pages.application import Application
from ert_gui.pages.init.initpanel import InitPanel
from ert_gui.pages.run.runpanel import RunPanel
from ert_gui.pages.config.configpages import ConfigPages
from ert_gui.pages.plot.plotpanel import PlotPanel
from ert_gui.widgets.helpedwidget import ContentModel
from ert_gui.widgets.util import resourceImage, resourceIcon

import matplotlib
print "PyQt4 version: ", QtCore.qVersion()
print "matplotlib version: ", matplotlib.__version__

splash = QtGui.QSplashScreen(resourceImage("splash") , QtCore.Qt.WindowStaysOnTopHint)
splash.show()
splash.showMessage("Starting up...", color=QtCore.Qt.white)
app.processEvents()

window = Application()

splash.showMessage("Bootstrapping...", color=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 --"
Exemple #12
0
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_())