コード例 #1
0
 def create_Well_Log_View(self):
     if not hasattr(self, "tab_well_log_view"):
         self.tab_well_log_view = self.create_new_tab(
             "tab_well_log_view", "Well Logs")
         self.tab_well_log_view.view_type = "WellLogView"
         layout = QGridLayout(self.tab_well_log_view)
         self.well_log_view = WellLogView(self.tab_well_log_view)
         layout.addWidget(self.well_log_view)
         self.tabWidget.setCurrentWidget(self.tab_well_log_view)
     else:
         self.statusBar().showMessage('Well Log View already opened.')
コード例 #2
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.mayavi_widget = MayaviQWidget()

        # Layouting

        main_layout = QGridLayout()
        main_layout.addWidget(self.mayavi_widget, 1, 1)

        self.setCentralWidget(QWidget())
        self.centralWidget().setLayout(main_layout)
コード例 #3
0
    def initUI(self):
        # uic.loadUi('pygeopressure_gui/ui/pygeopressure.ui', self)
        self.setWindowIcon(QIcon(':/icon.png'))
        self.setWindowTitle("pyGeoPressure V1.0")

        layout = QGridLayout(self.tab_seis)
        self.mayavi_widget = MayaviQWidget(self.tab_seis)
        layout.addWidget(self.mayavi_widget)

        self.populate_treeWidget()
        self.update_velocity_conversion_panel(0)
        self.show()
コード例 #4
0
 def create_Map_View(self):
     "Create a New Tab containing the MapView in the main TabWidget"
     if not hasattr(self, "tab_map_view"):
         self.tab_map_view = self.create_new_tab("tab_map_view", "Map View")
         # add adtional info
         self.tab_map_view.view_type = "MapView"
         layout = QGridLayout(self.tab_map_view)
         self.map_view = MapView(self.tab_map_view)
         layout.addWidget(self.map_view)
         self.init_map_view()
         self.tabWidget.setCurrentWidget(self.tab_new)
         # return the current tab
         # self.tabWidget.currentWidget()
     else:
         self.statusBar().showMessage('Map View already opened.')
コード例 #5
0
    def create_Section_View(self):
        if not hasattr(self, "tab_section_view"):
            self.tab_section_view = self.create_new_tab(
                "tab_section_view", "Section View")
            # add adtional info
            self.tab_section_view.view_type = "SectionView"
            layout = QGridLayout(self.tab_section_view)
            self.section_view = SectionView(self.tab_section_view)
            layout.addWidget(self.section_view)
            self.tabWidget.setCurrentWidget(self.tab_section_view)

            file_path = Path(CONF.data_root) / CONF.current_survey / ".survey"
            if file_path.exists():
                survey_set = ppp.SurveySetting(ppp.ThreePoints(str(file_path)))
                inline_SpinBox = \
                    self.section_view.control_widget.inline_SpinBox
                inline_SpinBox.setMaximum(survey_set.endInline)
                inline_SpinBox.setMinimum(survey_set.startInline)
                inline_SpinBox.setSingleStep(survey_set.stepInline)
                inline_SpinBox.setValue(survey_set.startInline)
                crline_SpinBox = \
                    self.section_view.control_widget.crline_SpinBox
                crline_SpinBox.setMaximum(survey_set.endCrline)
                crline_SpinBox.setMinimum(survey_set.startCrline)
                crline_SpinBox.setSingleStep(survey_set.stepCrline)
                crline_SpinBox.setValue(survey_set.stepCrline)
                step_inline_SpinBox = \
                    self.section_view.control_widget.step_inline_SpinBox
                step_inline_SpinBox.setMinimum(survey_set.stepInline)
                step_inline_SpinBox.setMaximum(survey_set.stepInline *
                                               (survey_set.nEast - 1))
                step_inline_SpinBox.setSingleStep(survey_set.stepInline)
                step_crline_SpinBox = \
                    self.section_view.control_widget.step_crline_SpinBox
                step_crline_SpinBox.setMinimum(survey_set.stepCrline)
                step_crline_SpinBox.setMaximum(survey_set.stepCrline *
                                               (survey_set.nEast - 1))
                step_crline_SpinBox.setSingleStep(survey_set.stepCrline)
                # seis_path = Path(CONF.data_root) / \
                #     CONF.current_survey / "Seismics" / ".seismics"
                # self.section_view.load_data_list(seis_path)

                self.section_view.status.connect(self.show_section_view_status)
        else:
            self.statusBar().showMessage('Section View already opened.')
コード例 #6
0
    def __init__(self, parent=None):
        """

        :param parent:
        :return:
        """

        super(PropertiesWidget, self).__init__(parent)

        code_label = QLabel()
        code_label.setText("Code")
        self.code_plain_text_edit = QPlainTextEdit()
        control_points_group_box = QGroupBox()
        control_points_group_box.setTitle("Control Points")

        main_layout = QGridLayout()
        main_layout.addWidget(code_label, 0, 0)
        main_layout.addWidget(self.code_plain_text_edit, 0, 1)
        main_layout.addWidget(control_points_group_box, 1, 0, 1, 2)

        self.control_points_group_box_layout = QVBoxLayout()
        control_points_group_box.setLayout(self.control_points_group_box_layout)

        self.setLayout(main_layout)
コード例 #7
0
    def __init__(self, universe, parent=None):
        super(NaturalLawPropertiesWidget, self).__init__(parent)
        self.natural_law = None
        self.universe = universe

        self.name_editor = QLineEdit()
        self.name_editor_groupbox = QGroupBox("Name")
        self.name_editor_groupbox_layout = QHBoxLayout()
        self.name_editor_groupbox.setLayout(self.name_editor_groupbox_layout)
        self.name_editor_groupbox_layout.addWidget(self.name_editor)
        self.name_editor_groupbox_layout.addStretch()

        self.force_combo_box = QComboBox()
        self.force_combo_box.setModel(ForcesInUniverseListModel(universe))
        self.atom_in_combo_box = QComboBox()
        self.atom_in_combo_box.setModel(AtomsInUniverseListModel(universe))
        self.atom_out_combo_box = QComboBox()
        self.atom_out_combo_box.setModel(AtomsInUniverseListModel(universe))
        self.transformation_label = QLabel()

        self.conversion_scheme_groupbox = QGroupBox("Conversion scheme")
        self.conversion_scheme_groupbox.setVisible(False)
        self.conversion_scheme_groupbox_layout = QGridLayout()
        self.conversion_scheme_groupbox.setLayout(self.conversion_scheme_groupbox_layout)
        self.conversion_scheme_groupbox_layout.addWidget(self.atom_in_combo_box, 1, 0)
        self.conversion_scheme_groupbox_layout.addWidget(self.force_combo_box, 0, 1)
        self.conversion_scheme_groupbox_layout.addWidget(self.atom_out_combo_box, 1, 2)
        self.conversion_scheme_groupbox_layout.addWidget(self.transformation_label, 1, 1)

        self.conversion_rate_formula_label = LatexLabelWidget()

        self.multiplicative_component_label = QLabel(u"υ = ")
        self.multiplicative_component_label.setFont(QFont("Times New Roman", 15, italic=True))
        self.multiplicative_component_double_spinbox = QDoubleSpinBox()

        self.additive_component_label = QLabel(u"s = ")
        self.additive_component_label.setFont(QFont("Times New Roman", 15, italic=True))
        self.additive_component_double_spinbox = QDoubleSpinBox()

        self.conversion_rate_groupbox = QGroupBox("Conversion rate")
        self.conversion_rate_groupbox_layout = QGridLayout()
        self.conversion_rate_groupbox.setLayout(self.conversion_rate_groupbox_layout)
        self.conversion_rate_groupbox_layout.addWidget(self.conversion_rate_formula_label, 0, 0, 1, 2)
        self.conversion_rate_groupbox_layout.addWidget(self.multiplicative_component_label, 1, 0)
        self.conversion_rate_groupbox_layout.addWidget(self.multiplicative_component_double_spinbox, 1, 1)
        self.conversion_rate_groupbox_layout.addWidget(self.additive_component_label, 2, 0)
        self.conversion_rate_groupbox_layout.addWidget(self.additive_component_double_spinbox, 2, 1)

        main_layout = QVBoxLayout()
        main_layout.addWidget(self.name_editor_groupbox)
        main_layout.addWidget(self.conversion_scheme_groupbox)
        main_layout.addWidget(self.conversion_rate_groupbox)
        main_layout.addStretch()

        self.setLayout(main_layout)

        self.name_editor.textChanged.connect(self.name_editor_text_changed)
        self.multiplicative_component_double_spinbox.valueChanged.connect(self.multiplicative_component_value_changed)
        self.additive_component_double_spinbox.valueChanged.connect(self.additive_component_value_changed)

        self.atom_in_combo_box.currentIndexChanged.connect(self.atom_in_combo_box_current_index_changed)

        self.setDisabled(True)
コード例 #8
0
class NaturalLawPropertiesWidget(QWidget):
    """
    This widget modifies properties of a natural law
    """

    def __init__(self, universe, parent=None):
        super(NaturalLawPropertiesWidget, self).__init__(parent)
        self.natural_law = None
        self.universe = universe

        self.name_editor = QLineEdit()
        self.name_editor_groupbox = QGroupBox("Name")
        self.name_editor_groupbox_layout = QHBoxLayout()
        self.name_editor_groupbox.setLayout(self.name_editor_groupbox_layout)
        self.name_editor_groupbox_layout.addWidget(self.name_editor)
        self.name_editor_groupbox_layout.addStretch()

        self.force_combo_box = QComboBox()
        self.force_combo_box.setModel(ForcesInUniverseListModel(universe))
        self.atom_in_combo_box = QComboBox()
        self.atom_in_combo_box.setModel(AtomsInUniverseListModel(universe))
        self.atom_out_combo_box = QComboBox()
        self.atom_out_combo_box.setModel(AtomsInUniverseListModel(universe))
        self.transformation_label = QLabel()

        self.conversion_scheme_groupbox = QGroupBox("Conversion scheme")
        self.conversion_scheme_groupbox.setVisible(False)
        self.conversion_scheme_groupbox_layout = QGridLayout()
        self.conversion_scheme_groupbox.setLayout(self.conversion_scheme_groupbox_layout)
        self.conversion_scheme_groupbox_layout.addWidget(self.atom_in_combo_box, 1, 0)
        self.conversion_scheme_groupbox_layout.addWidget(self.force_combo_box, 0, 1)
        self.conversion_scheme_groupbox_layout.addWidget(self.atom_out_combo_box, 1, 2)
        self.conversion_scheme_groupbox_layout.addWidget(self.transformation_label, 1, 1)

        self.conversion_rate_formula_label = LatexLabelWidget()

        self.multiplicative_component_label = QLabel(u"υ = ")
        self.multiplicative_component_label.setFont(QFont("Times New Roman", 15, italic=True))
        self.multiplicative_component_double_spinbox = QDoubleSpinBox()

        self.additive_component_label = QLabel(u"s = ")
        self.additive_component_label.setFont(QFont("Times New Roman", 15, italic=True))
        self.additive_component_double_spinbox = QDoubleSpinBox()

        self.conversion_rate_groupbox = QGroupBox("Conversion rate")
        self.conversion_rate_groupbox_layout = QGridLayout()
        self.conversion_rate_groupbox.setLayout(self.conversion_rate_groupbox_layout)
        self.conversion_rate_groupbox_layout.addWidget(self.conversion_rate_formula_label, 0, 0, 1, 2)
        self.conversion_rate_groupbox_layout.addWidget(self.multiplicative_component_label, 1, 0)
        self.conversion_rate_groupbox_layout.addWidget(self.multiplicative_component_double_spinbox, 1, 1)
        self.conversion_rate_groupbox_layout.addWidget(self.additive_component_label, 2, 0)
        self.conversion_rate_groupbox_layout.addWidget(self.additive_component_double_spinbox, 2, 1)

        main_layout = QVBoxLayout()
        main_layout.addWidget(self.name_editor_groupbox)
        main_layout.addWidget(self.conversion_scheme_groupbox)
        main_layout.addWidget(self.conversion_rate_groupbox)
        main_layout.addStretch()

        self.setLayout(main_layout)

        self.name_editor.textChanged.connect(self.name_editor_text_changed)
        self.multiplicative_component_double_spinbox.valueChanged.connect(self.multiplicative_component_value_changed)
        self.additive_component_double_spinbox.valueChanged.connect(self.additive_component_value_changed)

        self.atom_in_combo_box.currentIndexChanged.connect(self.atom_in_combo_box_current_index_changed)

        self.setDisabled(True)

    def switch_to_natural_law(self, natural_law):
        """
        This method initializes widget with current state of natural law
        provided and keeps and eye on specific natural law by writing changes
        to NaturalLaw object as far as properties are modified in graphical
        interface
        :param natural_law: a natural law in concern
        :type natural_law: engine.NaturalLaw
        :return: Nothing
        """
        self.natural_law = natural_law
        self.name_editor.setText(self.natural_law.name)

        if self.natural_law.atom_in is not None:
            self.atom_in_combo_box.setCurrentIndex(self.universe.atoms.index(self.natural_law.atom_in))
        if self.natural_law.atom_out is not None:
            self.atom_out_combo_box.setCurrentIndex(self.universe.atoms.index(self.natural_law.atom_out))
        if self.natural_law.accelerator is not None:
            self.force_combo_box.setCurrentIndex(self.universe.forces.index(self.natural_law.accelerator))

        self.multiplicative_component_double_spinbox.setValue(self.natural_law.multiplicative_component)
        self.additive_component_double_spinbox.setValue(self.natural_law.additive_component)

        self.update_conversion_rate_formula_label()

        self.setEnabled(True)

    def invalidate(self):
        self.switch_to_natural_law(self.natural_law)

    def name_editor_text_changed(self, value):
        self.natural_law.name = value

    def multiplicative_component_value_changed(self, value):
        self.natural_law.multiplicative_component = value
        self.update_conversion_rate_formula_label()

    def additive_component_value_changed(self, value):
        self.natural_law.additive_component = value
        self.update_conversion_rate_formula_label()

    def update_conversion_rate_formula_label(self):
        self.conversion_rate_formula_label.text.set_text(
            "$ f * \upsilon + s = f * {upsilon} + {s} $".format(
                upsilon=self.natural_law.multiplicative_component, s=self.natural_law.additive_component
            )
        )
        self.conversion_rate_formula_label.draw()

    def atom_in_combo_box_current_index_changed(self, index):
        # here we should remove the previous connection.
        pass