コード例 #1
0
    def _init_create_point_form(self, point_1=None, point_2=None):

        # Create the dialog and signals
        self.dlg_create_point = GwAuxPointUi()
        tools_gw.load_settings(self.dlg_create_point)

        validator = QDoubleValidator(-99999.99, 9999999.00, 3)
        validator.setNotation(QDoubleValidator().StandardNotation)
        self.dlg_create_point.dist_x.setValidator(validator)
        validator = QDoubleValidator(-99999.99, 9999999.00, 3)
        validator.setNotation(QDoubleValidator().StandardNotation)
        self.dlg_create_point.dist_y.setValidator(validator)
        self.dlg_create_point.dist_x.setFocus()
        self.dlg_create_point.btn_accept.clicked.connect(
            partial(self._get_values, point_1, point_2))
        self.dlg_create_point.btn_cancel.clicked.connect(self.cancel)

        if tools_gw.get_config_parser('btn_auxpoint', "rb_left", "user",
                                      "session") in ("True", True):
            self.dlg_create_point.rb_left.setChecked(True)
        elif tools_gw.get_config_parser('btn_auxpoint', "rb_right", "user",
                                        "session") in ("True", True):
            self.dlg_create_point.rb_right.setChecked(True)

        tools_gw.open_dialog(self.dlg_create_point, dlg_name='auxpoint')
コード例 #2
0
ファイル: drawtools.py プロジェクト: jeremyk6/qdraw
    def __init__(self):
        QDialog.__init__(self)

        self.setWindowTitle(tr('XY Point drawing tool'))

        self.X = QLineEdit()
        self.Y = QLineEdit()

        X_val = QDoubleValidator()
        Y_val = QDoubleValidator()

        self.X.setValidator(X_val)
        self.Y.setValidator(Y_val)

        self.crsButton = QPushButton("Projection")
        self.crsButton.clicked.connect(self.changeCRS)
        self.crsLabel = QLabel("")

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        grid = QGridLayout()
        grid.addWidget(QLabel("X"), 0, 0)
        grid.addWidget(QLabel("Y"), 0, 1)
        grid.addWidget(self.X, 1, 0)
        grid.addWidget(self.Y, 1, 1)
        grid.addWidget(self.crsButton, 2, 0)
        grid.addWidget(self.crsLabel, 2, 1)
        grid.addWidget(buttons, 3, 0, 1, 2)

        self.setLayout(grid)
コード例 #3
0
    def init_create_point_form(self, point_1=None, point_2=None):

        # Create the dialog and signals
        self.dlg_create_point = AuxPoint()
        load_settings(self.dlg_create_point, self.controller)

        validator = QDoubleValidator(-99999.99, 99999.999, 3)
        validator.setNotation(QDoubleValidator().StandardNotation)
        self.dlg_create_point.dist_x.setValidator(validator)
        validator = QDoubleValidator(-99999.99, 99999.999, 3)
        validator.setNotation(QDoubleValidator().StandardNotation)
        self.dlg_create_point.dist_y.setValidator(validator)
        self.dlg_create_point.dist_x.setFocus()
        self.dlg_create_point.btn_accept.clicked.connect(
            partial(self.get_values, point_1, point_2))
        self.dlg_create_point.btn_cancel.clicked.connect(self.cancel)
        rb_left = self.controller.plugin_settings_value(
            self.dlg_create_point.rb_left.objectName())
        if rb_left == 'true':
            self.dlg_create_point.rb_left.setChecked(True)
        else:
            self.dlg_create_point.rb_right.setChecked(True)

        open_dialog(self.dlg_create_point,
                    self.controller,
                    dlg_name='auxpoint',
                    maximize_button=False)
コード例 #4
0
 def run(self) -> None:
     """Run the form."""
     self._dlg.checkUseMPI.stateChanged.connect(self.changeUseMPI)
     if os.path.isdir(self.mpiexecDir):
         self._dlg.checkUseMPI.setChecked(True)
     else:
         self._dlg.checkUseMPI.setChecked(False)
     self._dlg.MPIBox.setText(self.mpiexecDir)
     self._dlg.SWATPlusBox.setText(self.SWATPlusDir)
     self._dlg.SWATPlusButton.clicked.connect(self.chooseSWATPlusDir)
     self._dlg.MPIButton.clicked.connect(self.chooseMPIDir)
     self._dlg.cancelButton.clicked.connect(self._dlg.close)
     self._dlg.saveButton.clicked.connect(self.save)
     self._dlg.burninDepth.setValidator(QIntValidator())
     self._dlg.widthMult.setValidator(QDoubleValidator())
     self._dlg.widthExp.setValidator(QDoubleValidator())
     self._dlg.depthMult.setValidator(QDoubleValidator())
     self._dlg.depthExp.setValidator(QDoubleValidator())
     self._dlg.upslopeHRUDrain.setValidator(QIntValidator())
     self.readProj()
     self._dlg.pointSizeBox.valueChanged.connect(self.changeFontSize)
     if not self.isBatch:
         self._dlg.exec_()
     if self._gv:
         self._gv.parametersPos = self._dlg.pos()
コード例 #5
0
ファイル: drawtools.py プロジェクト: jeremyk6/qdraw
    def __init__(self):
        QDialog.__init__(self)

        self.setWindowTitle(tr('Rectangle size'))

        self.width = QLineEdit()
        self.height = QLineEdit()

        width_val = QDoubleValidator()
        height_val = QDoubleValidator()

        self.width.setValidator(width_val)
        self.height.setValidator(height_val)

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        grid = QGridLayout()
        grid.addWidget(QLabel(tr('Give a size in m:')), 0, 0)
        grid.addWidget(QLabel(tr('Width:')), 1, 0)
        grid.addWidget(QLabel(tr('Height:')), 1, 1)
        grid.addWidget(self.width, 2, 0)
        grid.addWidget(self.height, 2, 1)
        grid.addWidget(buttons, 3, 0, 1, 2)

        self.setLayout(grid)
コード例 #6
0
def double_validator(widget,
                     min_=0,
                     max_=999999,
                     decimals=3,
                     notation=QDoubleValidator().StandardNotation):

    validator = QDoubleValidator(min_, max_, decimals)
    validator.setNotation(notation)
    widget.setValidator(validator)
コード例 #7
0
ファイル: numberwidget.py プロジェクト: transformaps/Roam
    def __init__(self, parent=None):
        super(NumberWidgetConfig, self).__init__(parent)
        self.setupUi(self)
        self.minEdit.setValidator( QDoubleValidator() )
        self.maxEdit.setValidator( QDoubleValidator() )

        self.minEdit.textChanged.connect(self.widgetchanged)
        self.maxEdit.textChanged.connect(self.widgetchanged)
        self.prefixEdit.textChanged.connect(self.widgetchanged)
        self.suffixEdit.textChanged.connect(self.widgetchanged)
        self.places_spin.valueChanged.connect(self.widgetchanged)
        self.step_spin.valueChanged.connect(self.widgetchanged)

        self.places_spin.setVisible(False)
        self.places_label.setVisible(False)
コード例 #8
0
    def init_create_circle_form(self, point):

        # Create the dialog and signals
        self.dlg_create_circle = AuxCircle()
        self.load_settings(self.dlg_create_circle)
        self.cancel_circle = False
        validator = QDoubleValidator(0.00, 999.00, 3)
        validator.setNotation(QDoubleValidator().StandardNotation)
        self.dlg_create_circle.radius.setValidator(validator)

        self.dlg_create_circle.btn_accept.clicked.connect(partial(self.get_radius, point))
        self.dlg_create_circle.btn_cancel.clicked.connect(self.cancel)
        self.dlg_create_circle.radius.setFocus()

        self.open_dialog(self.dlg_create_circle, dlg_name='auxcircle')
コード例 #9
0
    def __init__(self, parent=None):
        super(AreaWidget, self).__init__(parent)

        self.setupUi(self)

        self.canvas = iface.mapCanvas()

        self.admin_bounds_key = get_admin_bounds()
        if not self.admin_bounds_key:
            raise ValueError('Admin boundaries not available')

        self.cities = get_cities()
        if not self.cities:
            raise ValueError('Cities list not available')

        self.area_admin_0.addItems(sorted(self.admin_bounds_key.keys()))
        self.populate_admin_1()
        self.populate_cities()

        self.area_admin_0.currentIndexChanged.connect(self.populate_admin_1)
        self.area_admin_0.currentIndexChanged.connect(self.populate_cities)

        self.area_fromfile_browse.clicked.connect(self.open_vector_browse)
        self.area_fromadmin.toggled.connect(self.area_fromadmin_toggle)
        self.area_fromfile.toggled.connect(self.area_fromfile_toggle)

        self.radioButton_secondLevel_region.toggled.connect(
            self.radioButton_secondLevel_region_toggle)
        self.radioButton_secondLevel_region_toggle()

        icon = QIcon(QPixmap(':/plugins/LDMP/icons/map-marker.svg'))
        self.area_frompoint_choose_point.setIcon(icon)
        self.area_frompoint_choose_point.clicked.connect(self.point_chooser)
        #TODO: Set range to only accept valid coordinates for current map coordinate system
        self.area_frompoint_point_x.setValidator(QDoubleValidator())
        #TODO: Set range to only accept valid coordinates for current map coordinate system
        self.area_frompoint_point_y.setValidator(QDoubleValidator())
        self.area_frompoint.toggled.connect(self.area_frompoint_toggle)
        self.area_frompoint_toggle()

        # Setup point chooser
        self.choose_point_tool = QgsMapToolEmitPoint(self.canvas)
        self.choose_point_tool.canvasClicked.connect(self.set_point_coords)

        proj_crs = QgsCoordinateReferenceSystem(
            self.canvas.mapSettings().destinationCrs().authid())
        self.mQgsProjectionSelectionWidget.setCrs(
            QgsCoordinateReferenceSystem('epsg:4326'))
コード例 #10
0
    def master_estimate_result_new(self,
                                   tablename=None,
                                   result_id=None,
                                   index=0):
        """ Button 38: New estimate result """

        # Create dialog
        dlg_estimate_result_new = EstimateResultNew()
        self.load_settings(dlg_estimate_result_new)

        # Set signals
        dlg_estimate_result_new.btn_close.clicked.connect(
            partial(self.close_dialog, dlg_estimate_result_new))
        dlg_estimate_result_new.prices_coefficient.setValidator(
            QDoubleValidator())

        self.populate_cmb_result_type(dlg_estimate_result_new.cmb_result_type,
                                      'plan_result_type', False)

        if result_id != 0 and result_id:
            sql = (
                f"SELECT * FROM {tablename} "
                f" WHERE result_id = '{result_id}' AND current_user = cur_user"
            )
            row = self.controller.get_row(sql)
            if row is None:
                message = "Any record found for current user in table"
                self.controller.show_warning(message,
                                             parameter='plan_result_cat')
                return

            utils_giswater.setWidgetText(dlg_estimate_result_new,
                                         dlg_estimate_result_new.result_id,
                                         row['result_id'])
            dlg_estimate_result_new.cmb_result_type.setCurrentIndex(index)
            utils_giswater.setWidgetText(
                dlg_estimate_result_new,
                dlg_estimate_result_new.prices_coefficient,
                row['network_price_coeff'])
            utils_giswater.setWidgetText(dlg_estimate_result_new,
                                         dlg_estimate_result_new.observ,
                                         row['descript'])
            dlg_estimate_result_new.result_id.setEnabled(False)
            dlg_estimate_result_new.cmb_result_type.setEnabled(False)
            dlg_estimate_result_new.prices_coefficient.setEnabled(False)
            dlg_estimate_result_new.observ.setEnabled(False)
            dlg_estimate_result_new.btn_calculate.setText("Close")
            dlg_estimate_result_new.btn_calculate.clicked.connect(
                partial(self.close_dialog))
        else:
            dlg_estimate_result_new.btn_calculate.clicked.connect(
                partial(self.master_estimate_result_new_calculate,
                        dlg_estimate_result_new))
        # TODO pending translation
        # Manage i18n of the form and open it
        # self.controller.translate_form(dlg_estimate_result_new, 'estimate_result_new')

        self.open_dialog(dlg_estimate_result_new,
                         dlg_name="plan_estimate_result_new",
                         maximize_button=False)
コード例 #11
0
    def __init__(self, isFull, screenmap_type, screenmap_factor, parent=None):
        super(FullReducedDialog, self).__init__(parent)
        self.setupUi(self)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)

        self.radio_reduced.setChecked(not isFull)
        self.radio_full.setChecked(isFull)
        self.ok = False
        self.edit_oversample.setText(str(screenmap_factor))
        self.edit_oversample.setValidator(QDoubleValidator(0, 10, 2))
        if screenmap_type == "WithBBOX":
            self.radio_sm_feature.setChecked(True)
            self.radio_sm_none.setChecked(False)
            self.radio_sm_px.setChecked(False)
        elif screenmap_type == "WithPX":
            self.radio_sm_feature.setChecked(False)
            self.radio_sm_none.setChecked(False)
            self.radio_sm_px.setChecked(True)
        else:
            self.radio_sm_feature.setChecked(False)
            self.radio_sm_none.setChecked(True)
            self.radio_sm_px.setChecked(False)
        self.sm_factor = screenmap_factor
        self.sm_type = screenmap_type
コード例 #12
0
    def initGui(self):
        """Create the menu entries and toolbar icons inside the QGIS GUI."""

        # Input
        global last_path_input
        last_path_input = self.dlg.LE_input.text()

        self.dlg.PB_input.clicked.connect(self.select_input_files)
        self.dlg.LE_input.editingFinished.connect(self.check_input_path)

        # Output
        global last_path_output, output_message
        last_path_output = self.dlg.LE_output.text()
        output_message = True

        self.dlg.PB_output.clicked.connect(self.select_output_directory)
        self.dlg.LE_output.editingFinished.connect(self.check_output_path)
        self.dlg.PB_quit.clicked.connect(self.quit_plugin)
        self.dlg.PB_ok.clicked.connect(self.run)
        self.dlg.tabWidget.setCurrentIndex(0)

        # Set current line edit
        self.dlg.LE_input.setFocus()

        # Check validation
        self.dlg.LE_minHeightThres.setValidator(QIntValidator())
        self.dlg.LE_maxHeightThres.setValidator(QIntValidator())
        self.dlg.LE_DRFD.setValidator(QDoubleValidator())
        self.dlg.LE_DRPB.setValidator(QDoubleValidator())
        self.dlg.txt_triangle_peri.setValidator(QDoubleValidator())
        self.dlg.LE_minWidthThres.setValidator(QIntValidator())
        self.dlg.LE_minForSurfThres.setValidator(QIntValidator())
        self.dlg.LE_minClearingSurfThres.setValidator(QIntValidator())
        self.dlg.LE_gradConvDiameter.setValidator(QIntValidator())

        # Set add result to canevas as default
        self.dlg.CB_addLayer.setCheckState(2)

        # set progress bar settings
        self.dlg.progressBar.setMinimum(0)
        self.dlg.progressBar.setValue(0)

        icon_path = ':/plugins/forLim/icon.png'
        self.add_action(icon_path,
                        text=self.tr(u'forLim'),
                        callback=self.run,
                        parent=self.iface.mainWindow())
コード例 #13
0
def double_validator(widget,
                     min_=-9999999,
                     max_=9999999,
                     decimals=2,
                     notation=QDoubleValidator().StandardNotation):
    """
    Create and apply a validator for doubles to ensure the number is within a maximum and minimum values
        :param widget: Widget to apply the validator
        :param min_: Minimum value (int)
        :param max_: Maximum value (int)
        :param decimals: Number of decimals (int)
        :param notation:
    """

    validator = QDoubleValidator(min_, max_, decimals)
    validator.setNotation(notation)
    widget.setValidator(validator)
コード例 #14
0
    def __init__(self, parent=None):
        super(DataCubeWidget, self).__init__(parent)
        self.setupUi(self)

        logoPath = os.path.join(os.path.dirname(os.path.dirname(__file__)), "icons", "datacube.png")
        self.labelLogo.setText('<img src="%s" width="150">' % logoPath)

        self.plotParameters = []

        self.rectangle = None
        self.pt = None

        self.yAbsoluteMin = 0
        self.yAbsoluteMax = 1

        AddEndpointTreeItem(self.treeWidget.invisibleRootItem(),
                                self.treeWidget, self)

        self.treeWidget.itemClicked.connect(self.treeItemClicked)

        self.comboCoverageForRGB.currentIndexChanged.connect(self.coverageForRGBHasChanged)

        self.applyButton.clicked.connect(self.updateRGB)
        self.selectPointButton.clicked.connect(self.togglePointMapTool)
        self.selectRegionButton.clicked.connect(self.toggleRegionMapTool)

        iface.mapCanvas().mapToolSet.connect(self.unsetTool)

        self.pointSelectionTool = PointSelectionMapTool(iface.mapCanvas())
        self.regionSelectionTool = RegionSelectionMapTool(iface.mapCanvas())
        plotWidget.plotDataChanged.connect(self.plotDataChanged)
        self.pointSelectionTool.pointSelected.connect(self.setPoint)
        self.regionSelectionTool.regionSelected.connect(self.setRectangle)

        self.comboCoverageToPlot.currentIndexChanged.connect(self.coverageToPlotHasChanged)

        self.plotButton.clicked.connect(self.drawPlot)
        self.chkFilter.stateChanged.connect(self.filterCheckChanged)

        self.txtMinY.setValidator(QDoubleValidator(self))
        self.txtMaxY.setValidator(QDoubleValidator(self))
コード例 #15
0
 def init(self):
     """Set up the dialog."""
     self._dlg.pushButton.clicked.connect(self.selectByThreshold)
     self._dlg.checkBox.stateChanged.connect(self.switchSelectSmall)
     self.subbasinsLayer.selectionChanged.connect(self.setCount)
     self._dlg.saveButton.clicked.connect(self.save)
     self._dlg.cancelButton.clicked.connect(self.cancel)
     self._dlg.checkBox.setChecked(False)
     self._dlg.groupBox.setVisible(False)
     self._dlg.areaButton.setChecked(False)
     self._dlg.percentButton.setChecked(True)
     self._dlg.threshold.setValidator(QDoubleValidator())
     self._dlg.threshold.setText('5')
コード例 #16
0
ファイル: double_property.py プロジェクト: ollawone/stdm
    def init_gui(self):
        """
        Initializes form widgets
        """
        validator = QDoubleValidator()
        self.edtMinVal.setValidator(validator)
        self.edtMaxVal.setValidator(validator)

        self.edtMinVal.setText(str(self._min_val))
        self.edtMaxVal.setText(str(self._max_val))

        self.edtMinVal.setEnabled(not self.in_db)
        self.edtMaxVal.setEnabled(not self.in_db)
        self.sbPrecision.setEnabled(not self.in_db)
        self.sbScale.setEnabled(not self.in_db)

        self.sbPrecision.setValue(self._precision)
        self.sbScale.setValue(self._scale)
コード例 #17
0
    def init_osnap_tab(self):
        # Inizializzazione del TAB che riguarda gli SNAP ad oggetto

        # Memorizzo il valore dell'OSMODE per determinare gli osnap impostati
        OsMode = QadVariables.get(
            QadMsg.translate("Environment variables", "OSMODE"))
        self.checkBox_CENP.setChecked(OsMode & QadSnapTypeEnum.CEN)
        self.checkBox_ENDP.setChecked(OsMode & QadSnapTypeEnum.END)
        self.checkBox_END_PLINE.setChecked(OsMode & QadSnapTypeEnum.END_PLINE)
        self.checkBox_EXTP.setChecked(OsMode & QadSnapTypeEnum.EXT)
        self.checkBox_INTP.setChecked(OsMode & QadSnapTypeEnum.INT)
        self.checkBox_MIDP.setChecked(OsMode & QadSnapTypeEnum.MID)
        self.checkBox_NODP.setChecked(OsMode & QadSnapTypeEnum.NOD)
        self.checkBox_QUADP.setChecked(OsMode & QadSnapTypeEnum.QUA)
        #self.checkBox_INSP.setChecked(OsMode & QadSnapTypeEnum.INS)
        #self.checkBox_INTAPP.setChecked(OsMode & QadSnapTypeEnum.APP)
        self.checkBox_NEARP.setChecked(OsMode & QadSnapTypeEnum.NEA)
        self.checkBox_PERP.setChecked(OsMode & QadSnapTypeEnum.PER)
        self.checkBox_PARALP.setChecked(OsMode & QadSnapTypeEnum.PAR)
        self.checkBox_PROGRESP.setChecked(OsMode & QadSnapTypeEnum.PR)
        self.checkBox_TANP.setChecked(OsMode & QadSnapTypeEnum.TAN)
        self.checkBox_EXT_INT.setChecked(OsMode & QadSnapTypeEnum.EXT_INT)
        self.checkBox_TANP.setChecked(OsMode & QadSnapTypeEnum.TAN)

        self.checkBox_IsOsnapON.setChecked(not (OsMode
                                                & QadSnapTypeEnum.DISABLE))

        AutoSnap = QadVariables.get(
            QadMsg.translate("Environment variables", "AUTOSNAP"))
        self.checkBox_ObjectSnapTracking.setChecked(
            AutoSnap & QadAUTOSNAPEnum.OBJ_SNAP_TRACKING)

        ProgrDistance = QadVariables.get(
            QadMsg.translate("Environment variables", "OSPROGRDISTANCE"))
        stringA = str(ProgrDistance)
        self.lineEdit_ProgrDistance.setText(stringA)
        self.lineEdit_ProgrDistance.setValidator(
            QDoubleValidator(self.lineEdit_ProgrDistance))
        self.lineEdit_ProgrDistance.installEventFilter(self)
コード例 #18
0
    def __init__(self, parent=None):
        super(DlgCalculateSOC, self).__init__(parent)

        self.setupUi(self)

        self.regimes = [('Temperate dry (Fl = 0.80)', .80),
                        ('Temperate moist (Fl = 0.69)', .69),
                        ('Tropical dry (Fl = 0.58)', .58),
                        ('Tropical moist (Fl = 0.48)', .48),
                        ('Tropical montane (Fl = 0.64)', .64)]

        self.fl_chooseRegime_comboBox.addItems([r[0] for r in self.regimes])
        self.fl_chooseRegime_comboBox.setEnabled(False)
        self.fl_custom_lineEdit.setEnabled(False)
        # Setup validator for lineedit entries
        validator = QDoubleValidator()
        validator.setBottom(0)
        validator.setDecimals(3)
        self.fl_custom_lineEdit.setValidator(validator)
        self.fl_radio_default.toggled.connect(self.fl_radios_toggled)
        self.fl_radio_chooseRegime.toggled.connect(self.fl_radios_toggled)
        self.fl_radio_custom.toggled.connect(self.fl_radios_toggled)
コード例 #19
0
    def __init__(self, iface, params, config):
        """Constructor."""
        super(XPSSDockWidget, self).__init__(iface.mainWindow())
        self.iface = iface
        self.params = params
        self.inp_file_path = config['EPANET']['inp_file_path']
        self.pump_db_file_path = config['XPSS']['pump_db_file_path']
        self.pipe_db_file_path = config['XPSS']['pipe_db_file_path']
        self.pipe_rgh_db_file_path = config['XPSS']['pipe_rgh_db_file_path']
        self.op_edu_table_path = config['XPSS']['op_edu_table_path']
        #self.flow_units = config['XPSS']['flow_units'].split()
        #self.length_units = config['XPSS']['length_units'].split()
        self.pipedb = PipeDatabase().load(self.pipe_db_file_path,
                                          self.pipe_rgh_db_file_path)
        self.solvervars = None

        logger.debugger(str(self.pipedb.materials))

        self.params.attach(self)

        self.setupUi(self)
        self.setWindowTitle(params.plug_in_name)

        self.decimals = 1

        self.tool = None

        # Dialogs
        self.hydraulics_dialog = None
        self.quality_dialog = None
        self.reactions_dialog = None
        self.times_dialog = None
        self.energy_dialog = None
        self.report_dialog = None
        self.output_dialog = None

        self.log_dialog = None

        # Inp file
        self.btn_project_new.clicked.connect(self.project_new_clicked)
        self.btn_project_load.clicked.connect(self.project_load_clicked)
        self.btn_project_save.clicked.connect(self.project_save_clicked)
        self.btn_project_saveas.clicked.connect(self.project_saveas_clicked)

        curr_dir = os.path.dirname(os.path.abspath(__file__))

        # Project buttons
        set_up_button(self.btn_project_new,
                      os.path.join(
                          curr_dir,
                          'i_new.png',
                      ),
                      tooltip_text='New project')
        set_up_button(self.btn_project_load,
                      os.path.join(curr_dir, 'i_load.png'),
                      tooltip_text='Open project')
        set_up_button(self.btn_project_save,
                      os.path.join(curr_dir, 'i_save.png'),
                      tooltip_text='Save project')
        set_up_button(self.btn_project_saveas,
                      os.path.join(curr_dir, 'i_saveas.png'),
                      tooltip_text='Save project as')

        # Tools buttons
        set_up_button(self.btn_add_junction,
                      os.path.join(curr_dir, 'i_junction.png'), True, 12, 12,
                      'Create junction')  # TODO: softcode
        set_up_button(self.btn_add_reservoir,
                      os.path.join(curr_dir, 'i_reservoir.png'), True, 14, 14,
                      'Create reservoir')  # TODO: softcode
        # set_up_button(self.btn_add_tank, os.path.join(curr_dir, 'i_tank.png'), True, 14, 12,
        #               'Create tank')  # TODO: softcode
        set_up_button(self.btn_add_pipe, os.path.join(curr_dir, 'i_pipe.png'),
                      True, 13, 5, 'Create/edit pipe')  # TODO: softcode
        # set_up_button(self.btn_add_pump, os.path.join(curr_dir, 'i_pump.png'), True, 15, 11,
        #               'Create pump')  # TODO: softcode
        # set_up_button(self.btn_add_valve, os.path.join(curr_dir, 'i_valve.png'), True, 13, 14,
        #               'Create valve')  # TODO: softcode
        set_up_button(self.btn_move_element,
                      os.path.join(curr_dir, 'i_move.png'), True, 15, 15,
                      'Move element')  # TODO: softcode
        set_up_button(self.btn_delete_element,
                      os.path.join(curr_dir, 'i_delete2.png'), True, 13, 15,
                      'Delete element(s)')  # TODO: softcode

        # EPANET button
        set_up_button(self.btn_xpss_run,
                      os.path.join(curr_dir, 'i_run.png'),
                      tooltip_text='Run')

        self.btn_move_element.setCheckable(True)
        self.btn_delete_element.setCheckable(True)

        self.btn_add_junction.clicked.connect(self.add_junction)
        self.btn_add_reservoir.clicked.connect(self.add_reservoir)
        # self.btn_add_tank.clicked.connect(self.add_tank)

        self.btn_add_pipe.clicked.connect(self.add_pipe)
        # self.btn_add_pump.clicked.connect(self.add_pump)
        # self.btn_add_valve.clicked.connect(self.add_valve)

        self.btn_move_element.clicked.connect(self.move_element)
        self.btn_delete_element.clicked.connect(self.delete_element)

        # Layers
        self.cbo_dem.activated.connect(self.cbo_dem_activated)

        QgsProject.instance().legendLayersAdded.connect(
            self.update_layers_combos)
        QgsProject.instance().layerRemoved.connect(self.update_layers_combos)
        self.update_layers_combos()
        self.preselect_layers_combos()

        # XPSS
        self.btn_xpss_run.clicked.connect(self.btn_xpss_run_clicked)

        self.btn_view_results.clicked.connect(self.btn_view_results_clicked)

        self.btn_display_style.clicked.connect(self.btn_display_style_clicked)

        #self.btn_xpss_output.clicked.connect(self.btn_xpss_output_clicked)

        self.btn_xpss_run.setEnabled(True)

        # Settings
        #- General

        self.txt_pump_db.setText(self.pump_db_file_path)
        self.txt_pipe_db.setText(self.pipe_db_file_path)
        self.txt_pipe_rgh_db.setText(self.pipe_rgh_db_file_path)
        self.txt_op_edu_table.setText(self.op_edu_table_path)

        #- Pipe Network

        self.cbo_pipe_mtl.activated.connect(self.cbo_pipe_mtl_activated)

        self.cbo_pipe_dia_units.activated.connect(
            self.cbo_pipe_dia_units_activated)

        self.cbo_pipe_dia.activated.connect(self.cbo_pipe_dia_activated)

        self.txt_station_depth.setText("{:.1f}".format(6))
        self.txt_station_depth.setValidator(QDoubleValidator())

        #- Solver

        driver = self.cbo_solver.currentText()

        self.txt_flowrate.setValidator(QDoubleValidator())

        if driver == "Constant Flow":  #TODO:  Soft code
            self.txt_flowrate.setText("11.0")
        else:
            self.txt_flowrate.setText("20.0")

        self.cbo_flow_units.setCurrentIndex(0)

        #TODO: Update value on unit change
        # self.cbo_flow_units.activated.connect(
        #     self.cbo_flow_units_activated
        # )

        self.cbo_friction_loss_eq.activated.connect(
            self.cbo_fricton_loss_eq_activated)

        self.cbo_op_edu_method.activated.connect(
            self.cbo_op_edu_method_activated)

        #TODO: soft code
        self.txt_epa_a.setText("{:.1f}".format(0.5))
        self.txt_epa_b.setText("{:.1f}".format(20))

        self.txt_epa_a.setValidator(QDoubleValidator())
        self.txt_epa_b.setValidator(QDoubleValidator())

        self.cbo_lat_pipe_sch.activated.connect(
            self.cbo_lat_pipe_dia_activated)

        self.cbo_lat_pipe_dia_units.activated.connect(
            self.cbo_lat_pipe_dia_units_activated)

        self.cbo_lat_pipe_dia.activated.connect(
            self.cbo_lat_pipe_dia_activated)
        #self.cbo_lat_pipe_dia.setValidator(QDoubleValidator())

        self.txt_min_vel.setText("{:.1f}".format(2.0))
        self.txt_min_vel.setValidator(QDoubleValidator())

        self.txt_max_vel.setText("{:.1f}".format(5.0))
        self.txt_max_vel.setValidator(QDoubleValidator())

        self.cbo_lat_pipe_mtl.activated.connect(
            self.cbo_lat_pipe_mtl_activated)

        # Reporting

        self.bto_metric.clicked.connect(self.bto_metric_clicked)
        self.bto_us.clicked.connect(self.bto_us_clicked)
        self.bto_imperial.clicked.connect(self.bto_imperial_clicked)

        #TODO: This does nothing because combo boxes are not populated yet
        self.update_report_units(USSystem)

        # Project File

        self.txt_prj_file.setText(self.inp_file_path)

        self.read_inp_file()
コード例 #20
0
    def setupUi(self):
        self.resize(550, 550)
        self.setWindowTitle('Settings')

        #create tabWidget that holds the tabs
        self.tabWidget = QtGui.QTabWidget(self)
        self.tabWidget.setGeometry(QRect(10, 20, 500, 480))
        self.tabWidget.setObjectName('tabWidget')
        tab0labels = [['Name', (50, 50, 56, 17)],['Layer Opacity',(50,100,80,25)], ['Hover Template', (50, 150, 120, 17)]]
        tab1labels = [['Until now "Metadata" has to be edited in the shogun2-webapp', (50, 50, 300, 17)]]
        tab2labels = [['explanation', (50, 50, 400, 200)]]
        tab3labels = [['Users', (100, 10, 50, 20)], ['Groups', (320, 10, 50, 20)]]
        tabwidgets = [['General', tab0labels], ['Metadata', tab1labels], ['Style', tab2labels], ['Permissions', tab3labels]]

        expl = 'To edit the style of layer in shogun, first add the layer to QGIS.\n'
        expl += 'Then style the layer via the QGIS layer properties.\nWhen finished, '
        expl += 'you can upload the current layer style \nto this layer in Shogun by '
        expl += 'right-clicking it in \nthe Shogun Editor menu'

        #first set the labes for all tabwwidgets in a loop:
        for tab in tabwidgets:
            t = QtGui.QWidget()
            t.setObjectName(tab[0])
            self.tabs.append(t)
            self.tabWidget.addTab(t, tab[0])

            for label in tab[1]:
                l = QtGui.QLabel(t)
                l.setGeometry(QRect(label[1][0],label[1][1],label[1][2],label[1][3]))
                if label[0] == 'explanation':
                    l.setText(expl)
                    l.setAlignment(Qt.AlignTop)
                else:
                    l.setText(label[0])


        self.tabWidget.setCurrentIndex(0)


        #then populate the specific tabwidgets with other QObjects:
        #tab 0 = 'General':
        self.nameEdit = QtGui.QLineEdit(self.tabs[0])
        self.nameEdit.setGeometry(QRect(180, 40, 113, 27))
        self.tabedits.append(self.nameEdit)

        self.sliderEdit = QtGui.QLineEdit(self.tabs[0])
        self.sliderEdit.setGeometry(QRect(400, 90, 30, 23))
        self.sliderEdit.setInputMask('9.99')
        if sys.version_info[0] >= 3:
            validator = QDoubleValidator(-0.01, 1.01, 2)
        else:
            validator = QtGui.QDoubleValidator(-0.01, 1.01, 2)
        self.sliderEdit.setValidator(validator)
        self.tabedits.append(self.sliderEdit)

        self.hoverEdit = QtGui.QLineEdit(self.tabs[0])
        self.hoverEdit.setGeometry(QRect(180, 140, 113,27))
        self.tabedits.append(self.hoverEdit)

        self.hoverBox = QtGui.QComboBox(self.tabs[0])
        self.hoverBox.setGeometry(QRect(320, 140, 80, 27))
        self.tabedits.append(self.hoverBox)

        self.hoverAddButton = QtGui.QPushButton(self.tabs[0])
        self.hoverAddButton.setGeometry(QRect(410, 140, 30, 27))
        self.hoverAddButton.setText('Add')
        self.tabedits.append(self.hoverAddButton)

        self.slider = QtGui.QSlider(self.tabs[0])
        self.slider.setGeometry(QRect(180, 90, 160, 18))
        self.slider.setOrientation(Qt.Horizontal)
        self.slider.setMaximum(100)
        self.slider.setMinimum(-1)
        self.slider.setEnabled(False)
        self.moreObjects.append(self.slider)
        self.slider.valueChanged.connect(lambda: self.sliderEdit.setText(str(float(self.slider.value())/100)))
        self.sliderEdit.textEdited.connect(lambda: self.slider.setValue(int(float(self.sliderEdit.text())*100)))

        self.hoverAddButton.clicked.connect(self.addHoverAttribute)



        #tab 3 = 'Permissions':
        self.usertabel = QtGui.QTableWidget(self.tabs[3])
        self.usertabel.setGeometry(QRect(10, 30, 230, 300))
        self.usertabel.setColumnCount(3)
        self.usertabel.setHorizontalHeaderLabels(['Read', 'Update', 'Delete'])
        self.moreObjects.append(self.usertabel)

        self.groupstabel = QtGui.QTableWidget(self.tabs[3])
        self.groupstabel.setGeometry(QRect(250, 30, 230, 300))
        self.groupstabel.setColumnCount(3)
        self.groupstabel.setHorizontalHeaderLabels(['Read', 'Update', 'Delete'])
        self.moreObjects.append(self.groupstabel)


        #create Gui surrounding the tabs
        self.editCheckBox = QtGui.QCheckBox(self)
        self.editCheckBox.setGeometry(QRect(420, 10, 50, 17))
        self.editCheckBox.setText('Edit')

        self.pushButtonOk = QtGui.QPushButton(self)
        self.pushButtonOk.setGeometry(QRect(420, 500, 85, 27))
        self.pushButtonCancel = QtGui.QPushButton(self)
        self.pushButtonCancel.setGeometry(QRect(320, 500, 85, 27))
        self.pushButtonCancel.setText('Cancel')
コード例 #21
0
ファイル: drawtools.py プロジェクト: jeremyk6/qdraw
    def __init__(self):
        QDialog.__init__(self)

        self.setWindowTitle(tr('DMS Point Tool'))

        self.lat_D = QLineEdit()
        self.lat_M = QLineEdit()
        self.lat_S = QLineEdit()
        self.lat_DM = QLineEdit()
        self.lon_D = QLineEdit()
        self.lon_M = QLineEdit()
        self.lon_S = QLineEdit()
        self.lon_DM = QLineEdit()

        self.lat_M.textEdited.connect(self.lat_MS_edited)
        self.lat_S.textEdited.connect(self.lat_MS_edited)
        self.lat_DM.textEdited.connect(self.lat_DM_edited)
        self.lon_M.textEdited.connect(self.lon_MS_edited)
        self.lon_S.textEdited.connect(self.lon_MS_edited)
        self.lon_DM.textEdited.connect(self.lon_DM_edited)

        int_val = QIntValidator()
        int_val.setBottom(0)

        float_val = QDoubleValidator()
        float_val.setBottom(0)

        self.lat_D.setValidator(int_val)
        self.lat_M.setValidator(int_val)
        self.lat_S.setValidator(float_val)
        self.lat_DM.setValidator(float_val)

        self.lon_D.setValidator(int_val)
        self.lon_M.setValidator(int_val)
        self.lon_S.setValidator(float_val)
        self.lon_DM.setValidator(float_val)

        self.lat_NS = QComboBox()
        self.lat_NS.addItem("N")
        self.lat_NS.addItem("S")

        self.lon_EW = QComboBox()
        self.lon_EW.addItem("E")
        self.lon_EW.addItem("W")

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        lat_grp = QGroupBox(tr("Latitude"), self)
        lat_grp.setStyleSheet(
            "QGroupBox { font-weight: bold; color: #3c3c3c; } ")
        lat_grid = QGridLayout()
        lat_grid.addWidget(QLabel(tr("Degrees")), 0, 0)
        lat_grid.addWidget(QLabel(tr("Minutes")), 0, 1)
        lat_grid.addWidget(QLabel(tr("Seconds")), 0, 2)
        lat_grid.addWidget(QLabel(tr("Direction")), 0, 3)
        lat_grid.addWidget(self.lat_D, 1, 0)
        lat_grid.addWidget(self.lat_M, 1, 1)
        lat_grid.addWidget(self.lat_S, 1, 2)
        lat_grid.addWidget(self.lat_NS, 1, 3)
        lat_grid.addWidget(QLabel(tr("Decimal minutes")), 2, 1)
        lat_grid.addWidget(self.lat_DM, 3, 1, 1, 2)
        lat_grp.setLayout(lat_grid)

        lon_grp = QGroupBox(tr("Longitude"), self)
        lon_grp.setStyleSheet(
            "QGroupBox { font-weight: bold; color: #3c3c3c; } ")
        lon_grid = QGridLayout()
        lon_grid.addWidget(QLabel(tr("Degrees")), 0, 0)
        lon_grid.addWidget(QLabel(tr("Minutes")), 0, 1)
        lon_grid.addWidget(QLabel(tr("Seconds")), 0, 2)
        lon_grid.addWidget(QLabel(tr("Direction")), 0, 3)
        lon_grid.addWidget(self.lon_D, 1, 0)
        lon_grid.addWidget(self.lon_M, 1, 1)
        lon_grid.addWidget(self.lon_S, 1, 2)
        lon_grid.addWidget(self.lon_EW, 1, 3)
        lon_grid.addWidget(QLabel(tr("Decimal minutes")), 2, 1)
        lon_grid.addWidget(self.lon_DM, 3, 1, 1, 2)
        lon_grp.setLayout(lon_grid)

        vbox = QVBoxLayout()
        vbox.addWidget(lat_grp)
        vbox.addWidget(lon_grp)
        vbox.addWidget(buttons)

        self.setLayout(vbox)
コード例 #22
0
ファイル: maindialog.py プロジェクト: APA2527/MASK-GIS-2
    def __init__(self, parameters, is_new):
        QDialog.__init__(self, None)

        self.ui = Ui_MainDialog()
        self.ui.setupUi(self)
        self.ui.layer_list = LayerListWidget(self.ui.labelingGroup)
        self.ui.labelingLayout.addWidget(self.ui.layer_list)

        self.ui.bufferUnits.setValidator(QDoubleValidator())
        self.ui.bufferSegments.setValidator(QIntValidator())
        self.ui.simplifyTolerance.setValidator(QDoubleValidator())

        self.parameters = parameters
        if self.parameters.file_format is None:
            self.parameters.file_format = "ESRI Shapefile"
        self.style = QgsStyle()

        # connect edit style
        self.ui.editStyleBtn.clicked.connect(self.on_style_edit)
        # connect file browser
        self.ui.browseBtn.clicked.connect(self.on_file_browse)
        # add a "tips" button
        self.ui.tipsBtn = QPushButton(self.tr("Tips"), self.ui.buttonBox)
        self.ui.buttonBox.addButton(self.ui.tipsBtn, QDialogButtonBox.ActionRole)
        self.ui.tipsBtn.clicked.connect(self.show_tips)
        # add a "save as defaults" button
        self.ui.saveDefaultsBtn = QPushButton(
            self.tr("Save as defaults"), self.ui.buttonBox
        )
        self.ui.buttonBox.addButton(
            self.ui.saveDefaultsBtn, QDialogButtonBox.ActionRole
        )
        self.ui.saveDefaultsBtn.clicked.connect(self.on_save_defaults)
        # add a "load defaults" button
        self.ui.loadDefaultsBtn = QPushButton(
            self.tr("Load defaults"), self.ui.buttonBox
        )
        self.ui.buttonBox.addButton(
            self.ui.loadDefaultsBtn, QDialogButtonBox.ActionRole
        )
        self.ui.loadDefaultsBtn.clicked.connect(self.load_defaults)
        # connect the "help" button
        self.ui.buttonBox.helpRequested.connect(self.on_help)

        self.ui.layer_list.ui.polygonOperatorCombo.currentIndexChanged[int].connect(
            self.on_polygon_operator_changed
        )

        # connect the "apply" button
        for btn in self.ui.buttonBox.buttons():
            if self.ui.buttonBox.buttonRole(btn) == QDialogButtonBox.ApplyRole:
                btn.clicked.connect(self.on_apply)
                break

        # save current style
        self.save_style_parameters = MaskParameters()
        self.update_parameters_from_style(self.save_style_parameters)
        self.update_parameters_from_style(self.parameters)

        self.is_new = is_new
        if self.is_new:
            self.setWindowTitle(self.tr("Create a mask"))
        else:
            self.setWindowTitle(self.tr("Update the current mask"))
コード例 #23
0
    def generateRestrictionForVehiclesForm(self):

        QgsMessageLog.logMessage(
            "In generateRestrictionForVehiclesForm::generateForm ... ",
            tag="TOMs panel")

        layout = QFormLayout()
        # Add restriction for vehicles type
        self.cb_restrictionForVehiclesType = QComboBox(self)
        enumList = self.getEnumList('RestrictionTypeValue')
        self.cb_restrictionForVehiclesType.addItems(enumList)
        layout.addRow(self.tr("&Access Restriction Type:"),
                      self.cb_restrictionForVehiclesType)

        # add measure
        self.le_restrictionForVehiclesMeasure = QLineEdit()
        self.le_restrictionForVehiclesMeasure.setValidator(
            QDoubleValidator(0.99, 999.99, 2))
        layout.addRow(self.tr("&Measure (in metric units):"),
                      self.le_restrictionForVehiclesMeasure)

        # add measure
        self.le_restrictionForVehiclesMeasure2 = QLineEdit()
        self.le_restrictionForVehiclesMeasure2.setValidator(
            QDoubleValidator(0.99, 999.99, 2))
        layout.addRow(
            self.tr("&Measure (in imperial units) [only if present]:"),
            self.le_restrictionForVehiclesMeasure2)

        # Add vehicle exemption
        self.cb_restrictionForVehiclesVehicleExemptions = QComboBox(self)
        enumList = self.getTableList('"moving_traffic"."vehicleQualifiers"')
        self.cb_restrictionForVehiclesVehicleExemptions.addItems(enumList)
        layout.addRow(self.tr("&Vehicle exemptions:"),
                      self.cb_restrictionForVehiclesVehicleExemptions)

        # Add vehicle inclusions
        self.cb_restrictionForVehiclesVehicleInclusions = QComboBox(self)
        enumList = self.getTableList('"moving_traffic"."vehicleQualifiers"')
        self.cb_restrictionForVehiclesVehicleInclusions.addItems(enumList)
        layout.addRow(self.tr("&Vehicle inclusions:"),
                      self.cb_restrictionForVehiclesVehicleInclusions)

        # add structure type
        self.cb_restrictionForVehiclesStructureType = QComboBox(self)
        enumList = self.getEnumList('StructureTypeValue')
        self.cb_restrictionForVehiclesStructureType.addItems(enumList)
        layout.addRow(self.tr("&Structure Type:"),
                      self.cb_restrictionForVehiclesStructureType)

        # add traffic sign
        """self.cb_trafficSign = QComboBox(self)
        enumList = self.getTableList('Signs')
        self.cb_timePeriods.addItems(enumList)
        layout.addRow(self.tr("&Traffic Sign:"), self.cb_timePeriods)"""

        self.restrictionForVehiclesAttributeStack.setLayout(layout)

        geomLayout = QFormLayout()
        self.btn_PointReference = QPushButton("Location")
        self.btn_PointReference.clicked.connect(self.getPointReference)
        geomLayout.addRow(self.tr("&Restriction For Vehicle Location:"),
                          self.btn_PointReference)

        # add link direction
        self.cb_restrictionForVehiclesLinkDirectionValue = QComboBox(self)
        enumList = self.getEnumList('LinkDirectionValue')
        self.cb_restrictionForVehiclesLinkDirectionValue.addItems(enumList)
        geomLayout.addRow(self.tr("&Applicable link direction:"),
                          self.cb_restrictionForVehiclesLinkDirectionValue)

        self.restrictionForVehiclesGeometryStack.setLayout(geomLayout)

        # create relevant features
        """
コード例 #24
0
ファイル: drawtools.py プロジェクト: jeremyk6/qdraw
    def __init__(self):
        QDialog.__init__(self)

        self.setWindowTitle(tr('DMS Point Tool'))

        self.lat_D = QLineEdit()
        self.lat_M = QLineEdit()
        self.lat_S = QLineEdit()
        self.lat_DM = QLineEdit()
        self.lon_D = QLineEdit()
        self.lon_M = QLineEdit()
        self.lon_S = QLineEdit()
        self.lon_DM = QLineEdit()

        self.lat_M.textEdited.connect(self.lat_MS_edited)
        self.lat_S.textEdited.connect(self.lat_MS_edited)
        self.lat_DM.textEdited.connect(self.lat_DM_edited)
        self.lon_M.textEdited.connect(self.lon_MS_edited)
        self.lon_S.textEdited.connect(self.lon_MS_edited)
        self.lon_DM.textEdited.connect(self.lon_DM_edited)

        int_val = QIntValidator()
        int_val.setBottom(0)

        float_val = QDoubleValidator()
        float_val.setBottom(0)

        self.lat_D.setValidator(int_val)
        self.lat_M.setValidator(int_val)
        self.lat_S.setValidator(float_val)
        self.lat_DM.setValidator(float_val)

        self.lon_D.setValidator(int_val)
        self.lon_M.setValidator(int_val)
        self.lon_S.setValidator(float_val)
        self.lon_DM.setValidator(float_val)

        self.lat_NS = QComboBox()
        self.lat_NS.addItem("N")
        self.lat_NS.addItem("S")

        self.lon_EW = QComboBox()
        self.lon_EW.addItem("E")
        self.lon_EW.addItem("W")

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        lat_grp = QGroupBox(tr("Latitude"), self)
        lat_grp.setStyleSheet(
            "QGroupBox { font-weight: bold; color: #3c3c3c; } ")
        lat_grid = QGridLayout()
        lat_grid.addWidget(QLabel(tr("Degrees")), 0, 0)
        lat_grid.addWidget(QLabel(tr("Minutes")), 0, 1)
        lat_grid.addWidget(QLabel(tr("Seconds")), 0, 2)
        lat_grid.addWidget(QLabel(tr("Direction")), 0, 3)
        lat_grid.addWidget(self.lat_D, 1, 0)
        lat_grid.addWidget(self.lat_M, 1, 1)
        lat_grid.addWidget(self.lat_S, 1, 2)
        lat_grid.addWidget(self.lat_NS, 1, 3)
        lat_grid.addWidget(QLabel(tr("Decimal minutes")), 2, 1)
        lat_grid.addWidget(self.lat_DM, 3, 1, 1, 2)
        lat_grp.setLayout(lat_grid)

        lon_grp = QGroupBox(tr("Longitude"), self)
        lon_grp.setStyleSheet(
            "QGroupBox { font-weight: bold; color: #3c3c3c; } ")
        lon_grid = QGridLayout()
        lon_grid.addWidget(QLabel(tr("Degrees")), 0, 0)
        lon_grid.addWidget(QLabel(tr("Minutes")), 0, 1)
        lon_grid.addWidget(QLabel(tr("Seconds")), 0, 2)
        lon_grid.addWidget(QLabel(tr("Direction")), 0, 3)
        lon_grid.addWidget(self.lon_D, 1, 0)
        lon_grid.addWidget(self.lon_M, 1, 1)
        lon_grid.addWidget(self.lon_S, 1, 2)
        lon_grid.addWidget(self.lon_EW, 1, 3)
        lon_grid.addWidget(QLabel(tr("Decimal minutes")), 2, 1)
        lon_grid.addWidget(self.lon_DM, 3, 1, 1, 2)
        lon_grp.setLayout(lon_grid)

        vbox = QVBoxLayout()
        vbox.addWidget(lat_grp)
        vbox.addWidget(lon_grp)
        vbox.addWidget(buttons)

        self.setLayout(vbox)