def add_line(self, line_data: list):
        if line_data:
            self.setSortingEnabled(False)
            pair_number, linename, heading = line_data
            if linename in self.row_full_attribution:
                raise Exception(
                    "ERROR: PatchTest - Unable to add line {} when this line already exists"
                    .format(linename))
            self.row_full_attribution[linename] = [pair_number, heading]
            next_row = self.rowCount()
            self.insertRow(next_row)

            for column_index, column_data in enumerate(line_data):
                if column_index == 0:
                    item = QtWidgets.QComboBox()
                    item.addItems([str(i) for i in range(0, 15)])
                    item.setCurrentText(str(column_data))
                    self.setCellWidget(next_row, column_index, item)
                else:
                    if column_index == 2:  # heading
                        item = QtWidgets.QTableWidgetItem('{:3.3f}'.format(
                            float(column_data)).zfill(7))
                    else:
                        item = QtWidgets.QTableWidgetItem(str(column_data))
                    self.setItem(next_row, column_index, item)
            self.setSortingEnabled(True)
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setMinimumWidth(500)
        self.setMinimumHeight(400)

        self.setWindowTitle('Manage Surface')
        layout = QtWidgets.QVBoxLayout()

        self.basicdata = QtWidgets.QTextEdit()
        self.basicdata.setReadOnly(True)
        self.basicdata.setText('')
        layout.addWidget(self.basicdata)

        self.managelabel = QtWidgets.QLabel('Manage: ')
        layout.addWidget(self.managelabel)

        calclayout = QtWidgets.QHBoxLayout()
        self.calcbutton = QtWidgets.QPushButton('Calculate')
        calclayout.addWidget(self.calcbutton)
        self.calcdropdown = QtWidgets.QComboBox()
        self.calcdropdown.addItems(['area, sq nm', 'area, sq meters'])
        calclayout.addWidget(self.calcdropdown)
        self.calcanswer = QtWidgets.QLineEdit('')
        self.calcanswer.setReadOnly(True)
        calclayout.addWidget(self.calcanswer)
        layout.addLayout(calclayout)

        plotlayout = QtWidgets.QHBoxLayout()
        self.plotbutton = QtWidgets.QPushButton('Plot')
        plotlayout.addWidget(self.plotbutton)
        self.plotdropdown = QtWidgets.QComboBox()
        szepolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                          QtWidgets.QSizePolicy.Preferred)
        szepolicy.setHorizontalStretch(2)
        self.plotdropdown.setSizePolicy(szepolicy)
        plotlayout.addWidget(self.plotdropdown)
        layout.addLayout(plotlayout)

        self.calcbutton.clicked.connect(self.calculate_statistic)
        self.plotbutton.clicked.connect(self.generate_plot)

        self.setLayout(layout)
        self.surf = None
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setWindowTitle('File Analyzer')
        self.mainlayout = QtWidgets.QVBoxLayout()

        self.instructions_msg = QtWidgets.QLabel(
            'See Output tab for the results of the function.\nNOTE: posmv files are mapped on initialization, this can be a long process.'
        )

        self.start_msg = QtWidgets.QLabel(
            'Select a raw file to analyze (kmall, all, posmv, sbet, smrmsg):')

        self.ftypelabel = QtWidgets.QLabel('')

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.fil_text = QtWidgets.QLineEdit('', self)
        self.fil_text.setMinimumWidth(300)
        self.fil_text.setReadOnly(True)
        self.hlayout_one.addWidget(self.fil_text)
        self.browse_button = QtWidgets.QPushButton("Browse")
        self.hlayout_one.addWidget(self.browse_button)

        self.hlayout_one_one = QtWidgets.QHBoxLayout()
        self.fil_two_text = QtWidgets.QLineEdit('', self)
        self.fil_two_text.setMinimumWidth(300)
        self.fil_two_text.setReadOnly(True)
        self.hlayout_one_one.addWidget(self.fil_two_text)
        self.browse_two_button = QtWidgets.QPushButton("Browse")
        self.hlayout_one_one.addWidget(self.browse_two_button)

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.functioncombobox = QtWidgets.QComboBox()
        self.functioncombobox.setMinimumWidth(250)
        self.hlayout_two.addWidget(self.functioncombobox)
        self.functionrun = QtWidgets.QPushButton('Run')
        self.hlayout_two.addWidget(self.functionrun)
        self.hlayout_two.addWidget(QtWidgets.QLabel(''))

        self.button_layout = QtWidgets.QHBoxLayout()
        self.button_layout.addStretch(1)
        self.close_button = QtWidgets.QPushButton('Close', self)
        self.button_layout.addWidget(self.close_button)
        self.button_layout.addStretch(1)

        self.mainlayout.addWidget(self.instructions_msg)
        self.mainlayout.addWidget(QtWidgets.QLabel(''))
        self.mainlayout.addWidget(self.start_msg)
        self.mainlayout.addWidget(self.ftypelabel)
        self.mainlayout.addLayout(self.hlayout_one)
        self.mainlayout.addLayout(self.hlayout_one_one)
        self.mainlayout.addLayout(self.hlayout_two)
        self.mainlayout.addStretch()
        self.mainlayout.addLayout(self.button_layout)

        self.setLayout(self.mainlayout)

        self.filename = ''
        self.filenametwo = ''
        self.filetype = ''
        self.fileobject = None
        self.fileobjecttwo = None

        self.functioncombobox.currentTextChanged.connect(self.mode_switch)
        self.browse_button.clicked.connect(self.file_browse)
        self.browse_two_button.clicked.connect(self.file_browse_two)
        self.functionrun.clicked.connect(self.run_function)
        self.close_button.clicked.connect(self.close_button_clicked)

        self.mode_switch(None)
    def __init__(self, parent=None, title='', settings=None):
        super().__init__(parent, settings, widgetname='settings')

        self.setWindowTitle('Settings')
        layout = QtWidgets.QVBoxLayout()
        self.tabwidget = QtWidgets.QTabWidget()

        self.general_tab = QtWidgets.QWidget()
        self.general_layout = QtWidgets.QVBoxLayout()

        self.parallel_write = QtWidgets.QCheckBox('Enable Parallel Writes')
        self.parallel_write.setChecked(True)
        self.parallel_write.setToolTip('If checked, Kluster will write to the hard drive in parallel, disabling this ' +
                                       'is a useful step in troubleshooting PermissionErrors.')

        self.keep_waterline_changes = QtWidgets.QCheckBox('Retain Waterline Changes')
        self.keep_waterline_changes.setChecked(True)
        self.keep_waterline_changes.setToolTip('If checked (only applicable if you are using a Vessel File), Kluster will save all ' +
                                               'waterline changes in later multibeam files to the vessel file.  \nUncheck this if you ' +
                                               'do not want changes in waterline to be new entries in the vessel file.')

        self.force_coordinate_match = QtWidgets.QCheckBox('Force all days to have the same Coordinate System')
        self.force_coordinate_match.setChecked(True)
        self.force_coordinate_match.setToolTip('By default, Kluster will assign an automatic UTM zone number to each day of data.  If you ' +
                                               'have data that crosses UTM zones, you might find that a project \ncontains data with ' +
                                               'different coordinate systems.  Check this box if you want to force all days in a project ' +
                                               '\nto have the same coordinate system by using the most prevalent coordinate system in the Project Tree list.  use_epsg in project ' +
                                               'settings will ignore this.')

        self.gen_hlayout_one_one = QtWidgets.QHBoxLayout()
        self.auto_processing_mode_label = QtWidgets.QLabel('Process Mode: ')
        self.gen_hlayout_one_one.addWidget(self.auto_processing_mode_label)
        self.auto_processing_mode = QtWidgets.QComboBox()
        autooptions = ['normal', 'convert_only', 'concatenate']
        self.auto_processing_mode.addItems(autooptions)
        self.auto_processing_mode.setToolTip('Controls the processing actions that appear when new data is added or settings are changed.\n' +
                                             'See the following mode explanations for the currently available options\n\n' +
                                             'normal = data is converted and processed as it comes in, where each line added would reprocess the whole day\n' +
                                             'convert only = data is only converted, data is never automatically processed\n' +
                                             'concatenate = data is converted as lines are added and each line is processed individually.  Similar to normal\n' +
                                             '  mode but more efficient if you are adding lines as they are acquired, normal mode would do a full reprocess of\n' +
                                             '  the day after each new line is added')
        self.gen_hlayout_one_one.addWidget(self.auto_processing_mode)
        self.gen_hlayout_one_one.addStretch()

        self.gen_hlayout_one = QtWidgets.QHBoxLayout()
        self.vdatum_label = QtWidgets.QLabel('VDatum Directory')
        self.gen_hlayout_one.addWidget(self.vdatum_label)
        self.vdatum_text = QtWidgets.QLineEdit('', self)
        self.vdatum_text.setToolTip('Optional, this is required if you are using the "NOAA MLLW" or "NOAA MHW" vertical reference options.')
        self.gen_hlayout_one.addWidget(self.vdatum_text)
        self.browse_button = QtWidgets.QPushButton("Browse", self)
        self.gen_hlayout_one.addWidget(self.browse_button)

        self.gen_hlayout_two = QtWidgets.QHBoxLayout()
        self.filter_label = QtWidgets.QLabel('External Filter Directory')
        self.gen_hlayout_two.addWidget(self.filter_label)
        self.filter_text = QtWidgets.QLineEdit('', self)
        self.filter_text.setToolTip('Optional, set if you have a directory of custom Kluster filter .py files that you would like to include.')
        self.gen_hlayout_two.addWidget(self.filter_text)
        self.browse_filter_button = QtWidgets.QPushButton("Browse", self)
        self.gen_hlayout_two.addWidget(self.browse_filter_button)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { color : " + kluster_variables.error_color + "; }")

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.hlayout_five.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_five.addWidget(self.ok_button)
        self.hlayout_five.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_five.addWidget(self.cancel_button)
        self.hlayout_five.addStretch(1)
        self.default_button = QtWidgets.QPushButton('Reset Tab', self)
        self.hlayout_five.addWidget(self.default_button)
        self.hlayout_five.addStretch(1)

        self.general_layout.addWidget(self.parallel_write)
        self.general_layout.addWidget(self.keep_waterline_changes)
        self.general_layout.addWidget(self.force_coordinate_match)
        self.general_layout.addLayout(self.gen_hlayout_one_one)
        self.general_layout.addLayout(self.gen_hlayout_one)
        self.general_layout.addLayout(self.gen_hlayout_two)
        self.general_layout.addWidget(self.status_msg)
        self.general_layout.addStretch()

        self.general_tab.setLayout(self.general_layout)
        self.tabwidget.addTab(self.general_tab, 'General')

        self.display_tab = QtWidgets.QWidget()
        self.display_layout = QtWidgets.QVBoxLayout()

        # yes I know about color pickers, yes I know this is a dumb way to do this, get off my back already
        possible_colors = ['black', 'white', 'red', 'magenta', 'purple', 'blue', 'cyan', 'pink', 'salmon', 'peru',
                           'orange', 'yellow', 'light green', 'green', 'teal']
        colorone = QtWidgets.QHBoxLayout()
        self.kvar_pass_color_lbl = QtWidgets.QLabel('Pass Color')
        self.kvar_pass_color = QtWidgets.QComboBox()
        self.kvar_pass_color.addItems(possible_colors)
        self.kvar_pass_color.setCurrentText(kluster_variables.pass_color)
        self.kvar_pass_color.setToolTip('Color of the graphical labels and text where a test passes')

        self.kvar_error_color_lbl = QtWidgets.QLabel('Error Color')
        self.kvar_error_color = QtWidgets.QComboBox()
        self.kvar_error_color.addItems(possible_colors)
        self.kvar_error_color.setCurrentText(kluster_variables.error_color)
        self.kvar_error_color.setToolTip('Color of the graphical labels and text where a test fails')

        self.kvar_warning_color_lbl = QtWidgets.QLabel('Warning Color')
        self.kvar_warning_color = QtWidgets.QComboBox()
        self.kvar_warning_color.addItems(possible_colors)
        self.kvar_warning_color.setCurrentText(kluster_variables.warning_color)
        self.kvar_warning_color.setToolTip('Color of the graphical labels and text where a warning is raised')

        colorone.addWidget(self.kvar_pass_color_lbl)
        colorone.addWidget(self.kvar_pass_color)
        colorone.addWidget(self.kvar_error_color_lbl)
        colorone.addWidget(self.kvar_error_color)
        colorone.addWidget(self.kvar_warning_color_lbl)
        colorone.addWidget(self.kvar_warning_color)

        colortwo = QtWidgets.QHBoxLayout()
        self.kvar_amplitude_color_lbl = QtWidgets.QLabel('Amplitude Color')
        self.kvar_amplitude_color = QtWidgets.QComboBox()
        self.kvar_amplitude_color.addItems(possible_colors)
        self.kvar_amplitude_color.setCurrentText(kluster_variables.amplitude_color)
        self.kvar_amplitude_color.setToolTip('Color of the Amplitude status points in Points View')

        self.kvar_phase_color_lbl = QtWidgets.QLabel('Phase Color')
        self.kvar_phase_color = QtWidgets.QComboBox()
        self.kvar_phase_color.addItems(possible_colors)
        self.kvar_phase_color.setCurrentText(kluster_variables.phase_color)
        self.kvar_phase_color.setToolTip('Color of the Phase status points in Points View')

        self.kvar_reject_color_lbl = QtWidgets.QLabel('Reject Color')
        self.kvar_reject_color = QtWidgets.QComboBox()
        self.kvar_reject_color.addItems(possible_colors)
        self.kvar_reject_color.setCurrentText(kluster_variables.reject_color)
        self.kvar_reject_color.setToolTip('Color of the Reject status points in Points View')

        self.kvar_reaccept_color_lbl = QtWidgets.QLabel('Reaccept Color')
        self.kvar_reaccept_color = QtWidgets.QComboBox()
        self.kvar_reaccept_color.addItems(possible_colors)
        self.kvar_reaccept_color.setCurrentText(kluster_variables.reaccept_color)
        self.kvar_reaccept_color.setToolTip('Color of the Reaccept status points in Points View')

        colortwo.addWidget(self.kvar_amplitude_color_lbl)
        colortwo.addWidget(self.kvar_amplitude_color)
        colortwo.addWidget(self.kvar_phase_color_lbl)
        colortwo.addWidget(self.kvar_phase_color)
        colortwo.addWidget(self.kvar_reject_color_lbl)
        colortwo.addWidget(self.kvar_reject_color)
        colortwo.addWidget(self.kvar_reaccept_color_lbl)
        colortwo.addWidget(self.kvar_reaccept_color)

        self.display_layout.addLayout(colorone)
        self.display_layout.addLayout(colortwo)
        self.display_layout.addStretch()

        self.display_tab.setLayout(self.display_layout)
        self.tabwidget.addTab(self.display_tab, 'Display')

        self.processing_tab = QtWidgets.QWidget()
        self.processing_layout = QtWidgets.QVBoxLayout()

        processingone = QtWidgets.QHBoxLayout()
        self.kvar_convfiles_label = QtWidgets.QLabel('Files converted at once')
        self.kvar_convfiles = QtWidgets.QSpinBox()
        self.kvar_convfiles.setRange(1, 999)
        self.kvar_convfiles.setValue(kluster_variables.converted_files_at_once)
        self.kvar_convfiles.setToolTip('Conversion will convert this many files at once, raising this value can create memory issues in Kluster')
        processingone.addWidget(self.kvar_convfiles_label)
        processingone.addWidget(self.kvar_convfiles)

        processingtwo = QtWidgets.QHBoxLayout()
        self.kvar_pingslas_label = QtWidgets.QLabel('Pings per LAS File')
        self.kvar_pingslas = QtWidgets.QSpinBox()
        self.kvar_pingslas.setRange(1, 500000)
        self.kvar_pingslas.setValue(kluster_variables.pings_per_las)
        self.kvar_pingslas.setToolTip('LAS export will put this many pings in one file before starting a new file, raising this value can create overly large files')
        processingtwo.addWidget(self.kvar_pingslas_label)
        processingtwo.addWidget(self.kvar_pingslas)

        processingthree = QtWidgets.QHBoxLayout()
        self.kvar_pingscsv_label = QtWidgets.QLabel('Pings per CSV File')
        self.kvar_pingscsv = QtWidgets.QSpinBox()
        self.kvar_pingscsv.setRange(1, 500000)
        self.kvar_pingscsv.setValue(kluster_variables.pings_per_csv)
        self.kvar_pingscsv.setToolTip('CSV export will put this many pings in one file before starting a new file, raising this value can create overly large files')
        processingthree.addWidget(self.kvar_pingscsv_label)
        processingthree.addWidget(self.kvar_pingscsv)

        self.processing_layout.addLayout(processingone)
        self.processing_layout.addLayout(processingtwo)
        self.processing_layout.addLayout(processingthree)
        self.processing_layout.addStretch()

        self.processing_tab.setLayout(self.processing_layout)
        self.tabwidget.addTab(self.processing_tab, 'Processing')

        self.uncertainty_tab = QtWidgets.QWidget()
        self.uncertainty_layout = QtWidgets.QVBoxLayout()
        validator = QtGui.QDoubleValidator(-999, 999, 3)

        uncertaintyone = QtWidgets.QHBoxLayout()
        self.kvar_heaveerror_label = QtWidgets.QLabel('Default Heave Error (meters)')
        self.kvar_heaveerror = QtWidgets.QLineEdit('')
        self.kvar_heaveerror.setValidator(validator)
        self.kvar_heaveerror.setText(str(kluster_variables.default_heave_error))
        self.kvar_heaveerror.editingFinished.connect(self.validate_numctrl)
        self.kvar_heaveerror.setToolTip('Default 1 sigma standard deviation in the heave sensor, generally found in manufacturer specifications.')
        self.kvar_rollerror_label = QtWidgets.QLabel('Default Roll Sensor Error (meters)')
        self.kvar_rollerror = QtWidgets.QLineEdit('')
        self.kvar_rollerror.setValidator(validator)
        self.kvar_rollerror.setText(str(kluster_variables.default_roll_sensor_error))
        self.kvar_rollerror.editingFinished.connect(self.validate_numctrl)
        self.kvar_rollerror.setToolTip('Default 1 sigma standard deviation in the roll sensor, generally found in manufacturer specifications.')
        uncertaintyone.addWidget(self.kvar_heaveerror_label)
        uncertaintyone.addWidget(self.kvar_heaveerror)
        uncertaintyone.addWidget(self.kvar_rollerror_label)
        uncertaintyone.addWidget(self.kvar_rollerror)

        uncertaintytwo = QtWidgets.QHBoxLayout()
        self.kvar_pitcherror_label = QtWidgets.QLabel('Default Pitch Sensor Error (meters)')
        self.kvar_pitcherror = QtWidgets.QLineEdit('')
        self.kvar_pitcherror.setValidator(validator)
        self.kvar_pitcherror.setText(str(kluster_variables.default_pitch_sensor_error))
        self.kvar_pitcherror.editingFinished.connect(self.validate_numctrl)
        self.kvar_pitcherror.setToolTip('Default 1 sigma standard deviation in the pitch sensor, generally found in manufacturer specifications')
        self.kvar_yawerror_label = QtWidgets.QLabel('Default Yaw Sensor Error (meters)')
        self.kvar_yawerror = QtWidgets.QLineEdit('')
        self.kvar_yawerror.setValidator(validator)
        self.kvar_yawerror.setText(str(kluster_variables.default_heading_sensor_error))
        self.kvar_yawerror.editingFinished.connect(self.validate_numctrl)
        self.kvar_yawerror.setToolTip('Default 1 sigma standard deviation in the heading sensor, generally found in manufacturer specifications')
        uncertaintytwo.addWidget(self.kvar_pitcherror_label)
        uncertaintytwo.addWidget(self.kvar_pitcherror)
        uncertaintytwo.addWidget(self.kvar_yawerror_label)
        uncertaintytwo.addWidget(self.kvar_yawerror)

        uncertaintythree = QtWidgets.QHBoxLayout()
        self.kvar_beamangle_label = QtWidgets.QLabel('Default Beam Opening Angle (degrees)')
        self.kvar_beamangle = QtWidgets.QLineEdit('')
        self.kvar_beamangle.setValidator(validator)
        self.kvar_beamangle.setText(str(kluster_variables.default_beam_opening_angle))
        self.kvar_beamangle.editingFinished.connect(self.validate_numctrl)
        self.kvar_beamangle.setToolTip('Default Receiver beam opening angle, should auto populate from the multibeam data, this value is used otherwise')
        self.kvar_sverror_label = QtWidgets.QLabel('Default Surface SV Error (meters/second)')
        self.kvar_sverror = QtWidgets.QLineEdit('')
        self.kvar_sverror.setValidator(validator)
        self.kvar_sverror.setText(str(kluster_variables.default_surface_sv_error))
        self.kvar_sverror.editingFinished.connect(self.validate_numctrl)
        self.kvar_sverror.setToolTip('Default 1 sigma standard deviation in surface sv sensor, generally found in manufacturer specifications')
        uncertaintythree.addWidget(self.kvar_beamangle_label)
        uncertaintythree.addWidget(self.kvar_beamangle)
        uncertaintythree.addWidget(self.kvar_sverror_label)
        uncertaintythree.addWidget(self.kvar_sverror)

        uncertaintyfour = QtWidgets.QHBoxLayout()
        self.kvar_rollpatch_label = QtWidgets.QLabel('Default Roll Patch Error (degrees)')
        self.kvar_rollpatch = QtWidgets.QLineEdit('')
        self.kvar_rollpatch.setValidator(validator)
        self.kvar_rollpatch.setText(str(kluster_variables.default_roll_patch_error))
        self.kvar_rollpatch.editingFinished.connect(self.validate_numctrl)
        self.kvar_rollpatch.setToolTip('Default 1 sigma standard deviation in your roll angle patch test procedure')
        self.kvar_waterline_label = QtWidgets.QLabel('Default Waterline (meters)')
        self.kvar_waterline = QtWidgets.QLineEdit('')
        self.kvar_waterline.setValidator(validator)
        self.kvar_waterline.setText(str(kluster_variables.default_waterline_error))
        self.kvar_waterline.editingFinished.connect(self.validate_numctrl)
        self.kvar_waterline.setToolTip('Default 1 sigma standard deviation of the waterline measurement, only used for waterline vertical reference')
        uncertaintyfour.addWidget(self.kvar_rollpatch_label)
        uncertaintyfour.addWidget(self.kvar_rollpatch)
        uncertaintyfour.addWidget(self.kvar_waterline_label)
        uncertaintyfour.addWidget(self.kvar_waterline)

        uncertaintyfive = QtWidgets.QHBoxLayout()
        self.kvar_horizontalerror_label = QtWidgets.QLabel('Default Horizontal Positioning Error (meters)')
        self.kvar_horizontalerror = QtWidgets.QLineEdit('')
        self.kvar_horizontalerror.setValidator(validator)
        self.kvar_horizontalerror.setText(str(kluster_variables.default_horizontal_positioning_error))
        self.kvar_horizontalerror.editingFinished.connect(self.validate_numctrl)
        self.kvar_horizontalerror.setToolTip('Default 1 sigma standard deviation of the horizontal positioning system, only used if SBET is not provided')
        self.kvar_verticalerror_label = QtWidgets.QLabel('Default Vertical Positioning Error (meters)')
        self.kvar_verticalerror = QtWidgets.QLineEdit('')
        self.kvar_verticalerror.setValidator(validator)
        self.kvar_verticalerror.setText(str(kluster_variables.default_vertical_positioning_error))
        self.kvar_verticalerror.editingFinished.connect(self.validate_numctrl)
        self.kvar_verticalerror.setToolTip('Default 1 sigma standard deviation of the vertical positioning system, only used if SBET is not provided')
        uncertaintyfive.addWidget(self.kvar_horizontalerror_label)
        uncertaintyfive.addWidget(self.kvar_horizontalerror)
        uncertaintyfive.addWidget(self.kvar_verticalerror_label)
        uncertaintyfive.addWidget(self.kvar_verticalerror)

        self.uncertainty_layout.addLayout(uncertaintyone)
        self.uncertainty_layout.addLayout(uncertaintytwo)
        self.uncertainty_layout.addLayout(uncertaintythree)
        self.uncertainty_layout.addLayout(uncertaintyfour)
        self.uncertainty_layout.addLayout(uncertaintyfive)
        self.uncertainty_layout.addStretch()

        self.uncertainty_tab.setLayout(self.uncertainty_layout)
        self.tabwidget.addTab(self.uncertainty_tab, 'Uncertainty')

        layout.addWidget(self.tabwidget)
        layout.addLayout(self.hlayout_five)
        self.setLayout(layout)

        self.vdatum_pth = None
        self.filter_pth = None

        self.canceled = False

        self.browse_button.clicked.connect(self.vdatum_browse)
        self.vdatum_text.textChanged.connect(self.vdatum_changed)
        self.browse_filter_button.clicked.connect(self.filter_browse)
        self.filter_text.textChanged.connect(self.filter_changed)
        self.ok_button.clicked.connect(self.start)
        self.cancel_button.clicked.connect(self.cancel)
        self.default_button.clicked.connect(self.set_to_default)

        self.text_controls = [['vdatum_directory', self.vdatum_text], ['auto_processing_mode', self.auto_processing_mode],
                              ['filter_text', self.filter_text]]
        self.checkbox_controls = [['enable_parallel_writes', self.parallel_write], ['keep_waterline_changes', self.keep_waterline_changes],
                                  ['force_coordinate_match', self.force_coordinate_match]]

        self.read_settings()
        self.resize(600, 150)
    def __init__(self, parent=None):
        """Widget for holding all the parameter options in neat lists.
        Based on methods from ../gloo/primitive_mesh_viewer_qt.
        """
        super(SetupWidget, self).__init__(parent)

        # Create the parameter list from the default parameters given here
        self.param = Paramlist(PARAMETERS)

        # Checkbox for whether or not the pivot point is visible
        self.pivot_chk = QtWidgets.QCheckBox(u"Show pivot point")
        self.pivot_chk.setChecked(self.param.props['pivot'])
        self.pivot_chk.toggled.connect(self.update_parameters)

        # A drop-down menu for selecting which method to use for updating
        self.method_list = ['Euler', 'Runge-Kutta']
        self.method_options = QtWidgets.QComboBox()
        self.method_options.addItems(self.method_list)
        self.method_options.setCurrentIndex(
            self.method_list.index((self.param.props['method'])))
        self.method_options.currentIndexChanged.connect(self.update_parameters)

        # Separate the different parameters into groupboxes,
        # so there's a clean visual appearance
        self.parameter_groupbox = QtWidgets.QGroupBox(u"System Parameters")
        self.conditions_groupbox = QtWidgets.QGroupBox(u"Initial Conditions")
        self.display_groupbox = QtWidgets.QGroupBox(u"Display Parameters")

        self.groupbox_list = [
            self.parameter_groupbox, self.conditions_groupbox,
            self.display_groupbox
        ]

        self.splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical)

        # Get ready to create all the spinboxes with appropriate labels
        plist = []
        self.psets = []
        # important_positions is used to separate the
        # parameters into their appropriate groupboxes
        important_positions = [
            0,
        ]
        param_boxes_layout = [
            QtWidgets.QGridLayout(),
            QtWidgets.QGridLayout(),
            QtWidgets.QGridLayout()
        ]
        for nameV, minV, maxV, typeV, iniV in self.param.parameters:
            # Create Labels for each element
            plist.append(QtWidgets.QLabel(nameV))

            if nameV == 'x' or nameV == 'scale':
                # 'x' is the start of the 'Initial Conditions' groupbox,
                # 'scale' is the start of the 'Display Parameters' groupbox
                important_positions.append(len(plist) - 1)

            # Create Spinboxes based on type - doubles get a DoubleSpinBox,
            # ints get regular SpinBox.
            # Step sizes are the same for every parameter except font size.
            if typeV == 'double':
                self.psets.append(QtWidgets.QDoubleSpinBox())
                self.psets[-1].setDecimals(3)
                if nameV == 'font size':
                    self.psets[-1].setSingleStep(1.0)
                else:
                    self.psets[-1].setSingleStep(0.01)
            elif typeV == 'int':
                self.psets.append(QtWidgets.QSpinBox())

            # Set min, max, and initial values
            self.psets[-1].setMaximum(maxV)
            self.psets[-1].setMinimum(minV)
            self.psets[-1].setValue(iniV)

        pidx = -1
        for pos in range(len(plist)):
            if pos in important_positions:
                pidx += 1
            param_boxes_layout[pidx].addWidget(plist[pos], pos + pidx, 0)
            param_boxes_layout[pidx].addWidget(self.psets[pos], pos + pidx, 1)
            self.psets[pos].valueChanged.connect(self.update_parameters)

        param_boxes_layout[0].addWidget(QtWidgets.QLabel('Method: '), 8, 0)
        param_boxes_layout[0].addWidget(self.method_options, 8, 1)
        param_boxes_layout[-1].addWidget(self.pivot_chk, 2, 0, 3, 0)

        for groupbox, layout in zip(self.groupbox_list, param_boxes_layout):
            groupbox.setLayout(layout)

        for groupbox in self.groupbox_list:
            self.splitter.addWidget(groupbox)

        vbox = QtWidgets.QVBoxLayout()
        hbox = QtWidgets.QHBoxLayout()
        hbox.addWidget(self.splitter)
        hbox.addStretch(5)
        vbox.addLayout(hbox)
        vbox.addStretch(1)

        self.setLayout(vbox)
    def __init__(self, parent=None):
        super().__init__(parent)

        # fqpr = fully qualified ping record, the term for the datastore in kluster
        self.fqpr = None
        self.datasets = None
        self.variables = None
        self.recent_plot = None

        self.variable_translator = kluster_variables.variable_translator
        self.variable_reverse_lookup = kluster_variables.variable_reverse_lookup
        self.plot_lookup = {
            2: [
                'Histogram', 'Image', 'Contour', 'Line - Mean', 'Line - Nadir',
                'Line - Port Outer Beam', 'Line - Starboard Outer Beam'
            ],
            1: ['Line', 'Histogram', 'Scatter']
        }
        self.custom_plot_lookup = {
            'uncertainty': ['Vertical Sample', 'Horizontal Sample'],
            'sound_velocity_profiles': ['Plot Profiles', 'Profile Map'],
            'sound_velocity_correct': [
                '2d scatter, color by depth', '2d scatter, color by sector',
                '3d scatter, color by depth', '3d scatter, color by sector'
            ],
            'georeferenced': [
                '2d scatter, color by depth', '2d scatter, color by sector',
                '3d scatter, color by depth', '3d scatter, color by sector'
            ],
            'animations': [
                'Uncorrected Beam Vectors', 'Corrected Beam Vectors',
                'Vessel Orientation'
            ]
        }

        self.setWindowTitle('Basic Plots')
        layout = QtWidgets.QVBoxLayout()

        self.data_widget = common_widgets.PlotDataHandler()

        self.hline = QtWidgets.QFrame()
        self.hline.setFrameShape(QtWidgets.QFrame.HLine)
        self.hline.setFrameShadow(QtWidgets.QFrame.Sunken)

        self.hlayout_main = QtWidgets.QHBoxLayout()
        self.vlayout_left = QtWidgets.QVBoxLayout()
        self.vlayout_right = QtWidgets.QVBoxLayout()

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.dataset_label = QtWidgets.QLabel('Source    ', self)
        self.hlayout_one.addWidget(self.dataset_label)
        self.dataset_dropdown = QtWidgets.QComboBox(self)
        self.hlayout_one.addWidget(self.dataset_dropdown)
        self.hlayout_one.addStretch()

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.variable_label = QtWidgets.QLabel('Variable  ', self)
        self.hlayout_two.addWidget(self.variable_label)
        self.variable_dropdown = QtWidgets.QComboBox(self)
        self.hlayout_two.addWidget(self.variable_dropdown)
        self.variable_dim_label = QtWidgets.QLabel('      Dimensions', self)
        self.hlayout_two.addWidget(self.variable_dim_label)
        self.variable_dimone = QtWidgets.QLineEdit('time', self)
        self.hlayout_two.addWidget(self.variable_dimone)
        self.variable_dimtwo = QtWidgets.QLineEdit('beam', self)
        self.hlayout_two.addWidget(self.variable_dimtwo)
        self.hlayout_two.addStretch()

        self.hlayout_three = QtWidgets.QHBoxLayout()
        self.plottype_label = QtWidgets.QLabel('Plot Type', self)
        self.hlayout_three.addWidget(self.plottype_label)
        self.plottype_dropdown = QtWidgets.QComboBox(self)
        self.hlayout_three.addWidget(self.plottype_dropdown)
        self.bincount_label = QtWidgets.QLabel('Bins')
        self.bincount_label.hide()
        self.hlayout_three.addWidget(self.bincount_label)
        self.bincount = QtWidgets.QLineEdit('100', self)
        self.bincount.hide()
        self.hlayout_three.addWidget(self.bincount)
        self.hlayout_three.addStretch()

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.add_to_current_plot = QtWidgets.QCheckBox('Add to current plot',
                                                       self)
        self.add_to_current_plot.setChecked(False)
        self.hlayout_five.addWidget(self.add_to_current_plot)
        self.zero_center_plot = QtWidgets.QCheckBox('Center on zero', self)
        self.zero_center_plot.setChecked(False)
        self.zero_center_plot.hide()
        self.hlayout_five.addWidget(self.zero_center_plot)

        self.hlayout_four = QtWidgets.QHBoxLayout()
        self.hlayout_four.addStretch()
        self.plot_button = QtWidgets.QPushButton('Plot', self)
        self.plot_button.setDisabled(True)
        self.hlayout_four.addWidget(self.plot_button)
        self.exportvar_button = QtWidgets.QPushButton(' Export Variable ',
                                                      self)
        self.exportvar_button.setDisabled(True)
        self.hlayout_four.addWidget(self.exportvar_button)
        self.exportsource_button = QtWidgets.QPushButton(
            ' Export Source ', self)
        self.exportsource_button.setDisabled(True)
        self.hlayout_four.addWidget(self.exportsource_button)
        self.hlayout_four.addStretch()

        self.hlayout_six = QtWidgets.QHBoxLayout()
        self.explanation = QtWidgets.QTextEdit('', self)
        self.hlayout_six.addWidget(self.explanation)

        layout.addWidget(self.data_widget)
        layout.addWidget(self.hline)

        self.vlayout_left.addLayout(self.hlayout_one)
        self.vlayout_left.addLayout(self.hlayout_two)
        self.vlayout_left.addLayout(self.hlayout_three)
        self.vlayout_left.addLayout(self.hlayout_five)
        self.vlayout_right.addLayout(self.hlayout_six)
        self.hlayout_main.addLayout(self.vlayout_left)
        self.hlayout_main.addLayout(self.vlayout_right)
        layout.addLayout(self.hlayout_main)

        layout.addLayout(self.hlayout_four)
        self.setLayout(layout)

        self.data_widget.fqpr_loaded.connect(self.new_fqpr_loaded)
        self.data_widget.ping_count_changed.connect(self.new_ping_count)
        self.dataset_dropdown.currentTextChanged.connect(self.load_variables)
        self.variable_dropdown.currentTextChanged.connect(self.load_plot_types)
        self.plottype_dropdown.currentTextChanged.connect(
            self.plot_type_selected)
        self.plot_button.clicked.connect(self.plot)
        self.exportvar_button.clicked.connect(self.export_variable)
        self.exportsource_button.clicked.connect(self.export_source)
Пример #7
0
    def __init__(self, parent=None, settings=None):
        super().__init__(parent)
        self.external_settings = settings

        self.setWindowTitle('Project Settings')
        layout = QtWidgets.QVBoxLayout()

        self.coord_msg = QtWidgets.QLabel('Coordinate System:')

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.epsg_radio = QtWidgets.QRadioButton('From EPSG')
        self.hlayout_one.addWidget(self.epsg_radio)
        self.epsg_val = QtWidgets.QLineEdit('', self)
        self.epsg_val.setMaximumWidth(80)
        self.hlayout_one.addWidget(self.epsg_val)
        self.hlayout_one.addStretch(1)

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.auto_utm_radio = QtWidgets.QRadioButton('Auto UTM')
        self.auto_utm_radio.setChecked(True)
        self.hlayout_two.addWidget(self.auto_utm_radio)
        self.auto_utm_val = QtWidgets.QComboBox()
        self.auto_utm_val.addItems(kluster_variables.coordinate_systems)
        self.auto_utm_val.setMaximumWidth(100)
        self.hlayout_two.addWidget(self.auto_utm_val)
        self.hlayout_two.addStretch(1)

        self.vertref_msg = QtWidgets.QLabel('Vertical Reference:')

        self.hlayout_three = QtWidgets.QHBoxLayout()
        self.georef_vertref = QtWidgets.QComboBox()
        self.georef_vertref.addItems(kluster_variables.vertical_references)
        self.georef_vertref.setMaximumWidth(100)
        self.hlayout_three.addWidget(self.georef_vertref)
        self.hlayout_three.addStretch(1)

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.hlayout_five.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_five.addWidget(self.ok_button)
        self.hlayout_five.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_five.addWidget(self.cancel_button)
        self.hlayout_five.addStretch(1)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { " +
                                      kluster_variables.error_color + "; }")
        self.status_msg.setAlignment(QtCore.Qt.AlignCenter)
        self.statusbox = QtWidgets.QHBoxLayout()
        self.statusbox.addWidget(self.status_msg)

        layout.addWidget(self.coord_msg)
        layout.addLayout(self.hlayout_one)
        layout.addLayout(self.hlayout_two)
        layout.addWidget(self.vertref_msg)
        layout.addLayout(self.hlayout_three)
        layout.addStretch()
        layout.addLayout(self.statusbox)
        layout.addLayout(self.hlayout_five)
        self.setLayout(layout)

        self.canceled = False

        self.ok_button.clicked.connect(self.start)
        self.cancel_button.clicked.connect(self.cancel)
        self.georef_vertref.currentTextChanged.connect(self.find_vdatum)

        self.read_settings()
        self.resize(600, 200)
    def __init__(self, parent=None):
        super().__init__(parent)

        # fqpr = fully qualified ping record, the term for the datastore in kluster
        self.fqpr = None
        self.datasets = None
        self.variables = None
        self.recent_plot = None
        self.current_ping_count = 0

        self.wobble = None
        self.extinction = None
        self.period = None
        self.needs_rebuilding = False

        #self.plottypes = ['Wobble Test', 'Accuracy Test', 'Extinction Test', 'Data Density Test', 'Ping Period Test']
        self.plottypes = [
            'Wobble Test', 'Accuracy Test', 'Extinction Test',
            'Ping Period Test'
        ]
        self.modetypes = {
            'Wobble Test': [
                'Dashboard', 'Allowable Percent Deviation',
                'Attitude Scaling One', 'Attitude Scaling Two',
                'Attitude Latency', 'Yaw Alignment',
                'X (Forward) Sonar Offset', 'Y (Starboard) Sonar Offset',
                'Heave Sound Speed One', 'Heave Sound Speed Two'
            ],
            'Accuracy Test': ['Use most prevalent mode and frequency'],
            'Extinction Test': [
                'Plot Extinction by Frequency', 'Plot Extinction by Mode',
                'Plot Extinction by Sub Mode'
            ],
            'Data Density Test': ['By Frequency', 'By Mode'],
            'Ping Period Test': [
                'Plot Period by Frequency', 'Plot Period by Mode',
                'Plot Period by Sub Mode'
            ]
        }

        self.setWindowTitle('Advanced Plots')
        layout = QtWidgets.QVBoxLayout()

        self.data_widget = common_widgets.PlotDataHandler()

        self.hline = QtWidgets.QFrame()
        self.hline.setFrameShape(QtWidgets.QFrame.HLine)
        self.hline.setFrameShadow(QtWidgets.QFrame.Sunken)

        self.hlayout_main = QtWidgets.QHBoxLayout()
        self.vlayout_left = QtWidgets.QVBoxLayout()
        self.vlayout_right = QtWidgets.QVBoxLayout()

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.plot_type_label = QtWidgets.QLabel('Plot Type ', self)
        self.hlayout_one.addWidget(self.plot_type_label)
        self.plot_type_dropdown = QtWidgets.QComboBox(self)
        self.hlayout_one.addWidget(self.plot_type_dropdown)
        self.hlayout_one.addStretch()

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.mode_label = QtWidgets.QLabel('Mode       ', self)
        self.hlayout_two.addWidget(self.mode_label)
        self.mode_dropdown = QtWidgets.QComboBox(self)
        self.hlayout_two.addWidget(self.mode_dropdown)
        self.hlayout_two.addStretch()

        self.hlayout_extinction = QtWidgets.QHBoxLayout()
        self.roundedfreq = QtWidgets.QCheckBox('Round Frequency')
        self.roundedfreq.setChecked(True)
        self.roundedfreq.hide()
        self.hlayout_extinction.addWidget(self.roundedfreq)
        self.extinction_onlycomplete = QtWidgets.QCheckBox(
            'Only Complete Swaths')
        self.extinction_onlycomplete.setChecked(True)
        self.extinction_onlycomplete.hide()
        self.hlayout_extinction.addWidget(self.extinction_onlycomplete)
        self.extinction_binsizelabel = QtWidgets.QLabel('Depth Bin Size (m): ')
        self.extinction_binsizelabel.hide()
        self.hlayout_extinction.addWidget(self.extinction_binsizelabel)
        self.extinction_binsize = QtWidgets.QLineEdit('1', self)
        self.extinction_binsize.hide()
        self.hlayout_extinction.addWidget(self.extinction_binsize)
        self.hlayout_extinction.addStretch()

        self.vlayout_accuracy = QtWidgets.QVBoxLayout()
        self.surface_label = QtWidgets.QLabel('Path to Kluster Surface:')
        self.surface_label.hide()
        self.hlayout_accone = QtWidgets.QHBoxLayout()
        self.surf_text = QtWidgets.QLineEdit('', self)
        self.surf_text.setReadOnly(True)
        self.surf_text.hide()
        self.hlayout_accone.addWidget(self.surf_text)
        self.surf_button = QtWidgets.QPushButton("Browse", self)
        self.surf_button.hide()
        self.hlayout_accone.addWidget(self.surf_button)
        self.vlayout_accuracy.addWidget(self.surface_label)
        self.vlayout_accuracy.addLayout(self.hlayout_accone)
        self.output_label = QtWidgets.QLabel('Output Folder for Plots:')
        self.output_label.hide()
        self.hlayout_acctwo = QtWidgets.QHBoxLayout()
        self.out_text = QtWidgets.QLineEdit('', self)
        self.out_text.setReadOnly(True)
        self.out_text.hide()
        self.hlayout_acctwo.addWidget(self.out_text)
        self.output_button = QtWidgets.QPushButton("Browse", self)
        self.output_button.hide()
        self.hlayout_acctwo.addWidget(self.output_button)
        self.show_accuracy = QtWidgets.QCheckBox('Show plots')
        self.show_accuracy.hide()
        self.vlayout_accuracy.addWidget(self.output_label)
        self.vlayout_accuracy.addLayout(self.hlayout_acctwo)
        self.vlayout_accuracy.addWidget(self.show_accuracy)
        self.vlayout_accuracy.addStretch()

        self.hlayout_four = QtWidgets.QHBoxLayout()
        self.hlayout_four.addStretch()
        self.plot_button = QtWidgets.QPushButton('Plot', self)
        self.plot_button.setDisabled(True)
        self.hlayout_four.addWidget(self.plot_button)
        self.hlayout_four.addStretch()

        self.hlayout_six = QtWidgets.QHBoxLayout()
        self.explanation = QtWidgets.QTextEdit('', self)
        self.hlayout_six.addWidget(self.explanation)

        layout.addWidget(self.data_widget)
        layout.addWidget(self.hline)

        self.vlayout_left.addLayout(self.hlayout_one)
        self.vlayout_left.addLayout(self.hlayout_two)
        self.vlayout_left.addStretch()
        self.vlayout_left.addLayout(self.hlayout_extinction)
        self.vlayout_left.addLayout(self.vlayout_accuracy)
        self.vlayout_left.addStretch()

        self.vlayout_right.addLayout(self.hlayout_six)

        self.hlayout_main.addLayout(self.vlayout_left)
        self.hlayout_main.addLayout(self.vlayout_right)
        layout.addLayout(self.hlayout_main)

        layout.addLayout(self.hlayout_four)
        self.setLayout(layout)

        self.surf_button.clicked.connect(self.surf_browse)
        self.output_button.clicked.connect(self.output_browse)
        self.data_widget.fqpr_loaded.connect(self.new_fqpr_loaded)
        self.data_widget.ping_count_changed.connect(self.new_ping_count)
        self.plot_type_dropdown.currentTextChanged.connect(
            self.plottype_changed)
        self.mode_dropdown.currentTextChanged.connect(self.mode_changed)
        self.plot_button.clicked.connect(self.plot)
        self.roundedfreq.clicked.connect(self._clear_alldata)
Пример #9
0
    def __init__(self, parent=None, title='', settings=None):
        super().__init__(parent, settings, widgetname='export')

        self.setWindowTitle('Export Soundings')
        layout = QtWidgets.QVBoxLayout()

        self.basic_export_group = QtWidgets.QGroupBox(
            'Export from the following datasets:')
        self.basic_export_group.setCheckable(True)
        self.basic_export_group.setChecked(True)
        self.hlayout_zero = QtWidgets.QHBoxLayout()
        self.input_fqpr = BrowseListWidget(self)
        self.input_fqpr.sizeHint()
        self.input_fqpr.setup(mode='directory',
                              registry_key='kluster',
                              app_name='klusterbrowse',
                              filebrowse_title='Select input processed folder')
        self.input_fqpr.setMinimumWidth(600)
        self.hlayout_zero.addWidget(self.input_fqpr)
        self.basic_export_group.setLayout(self.hlayout_zero)

        self.line_export = QtWidgets.QCheckBox('Export selected lines')
        self.line_export.setChecked(False)

        self.points_view_export = QtWidgets.QCheckBox(
            'Export points in Points View')
        self.points_view_export.setChecked(False)

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.start_msg = QtWidgets.QLabel('Export to: ')
        self.hlayout_one.addWidget(self.start_msg)
        self.export_opts = QtWidgets.QComboBox()
        # self.export_opts.addItems(['csv', 'las', 'entwine'])  need to add entwine to the env
        self.export_opts.addItems(['csv', 'las'])
        self.hlayout_one.addWidget(self.export_opts)
        self.csvdelimiter_lbl = QtWidgets.QLabel('Delimiter')
        self.hlayout_one.addWidget(self.csvdelimiter_lbl)
        self.csvdelimiter_dropdown = QtWidgets.QComboBox(self)
        self.csvdelimiter_dropdown.addItems(['comma', 'space'])
        self.hlayout_one.addWidget(self.csvdelimiter_dropdown)
        self.hlayout_one.addStretch()

        self.hlayout_one_one = QtWidgets.QHBoxLayout()
        self.zdirect_check = QtWidgets.QCheckBox('Make Z Positive Down')
        self.zdirect_check.setChecked(True)
        self.hlayout_one_one.addWidget(self.zdirect_check)
        self.hlayout_one_one.addStretch()

        self.hlayout_one_three = QtWidgets.QHBoxLayout()
        self.filter_chk = QtWidgets.QCheckBox('Filter Rejected')
        self.filter_chk.setChecked(True)
        self.hlayout_one_three.addWidget(self.filter_chk)
        self.byidentifier_chk = QtWidgets.QCheckBox(
            'Separate Files by Sector/Frequency')
        self.byidentifier_chk.setChecked(False)
        self.hlayout_one_three.addWidget(self.byidentifier_chk)
        self.hlayout_one_three.addStretch()

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { color : " +
                                      kluster_variables.error_color + "; }")

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.hlayout_two.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_two.addWidget(self.ok_button)
        self.hlayout_two.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_two.addWidget(self.cancel_button)
        self.hlayout_two.addStretch(1)

        layout.addWidget(self.basic_export_group)
        layout.addWidget(self.line_export)
        layout.addWidget(self.points_view_export)
        layout.addWidget(QtWidgets.QLabel(' '))
        layout.addLayout(self.hlayout_one)
        layout.addLayout(self.hlayout_one_one)
        layout.addLayout(self.hlayout_one_three)
        layout.addWidget(self.status_msg)
        layout.addLayout(self.hlayout_two)
        self.setLayout(layout)

        self.fqpr_inst = []
        self.canceled = False

        self.basic_export_group.toggled.connect(self._handle_basic_checked)
        self.line_export.toggled.connect(self._handle_line_checked)
        self.points_view_export.toggled.connect(self._handle_points_checked)
        self.input_fqpr.files_updated.connect(
            self._event_update_fqpr_instances)
        self.export_opts.currentTextChanged.connect(self._event_update_status)
        self.ok_button.clicked.connect(self.start_export)
        self.cancel_button.clicked.connect(self.cancel_export)

        self.text_controls = [['export_ops', self.export_opts],
                              [
                                  'csvdelimiter_dropdown',
                                  self.csvdelimiter_dropdown
                              ]]
        self.checkbox_controls = [[
            'basic_export_group', self.basic_export_group
        ], ['line_export',
            self.line_export], ['points_view_export', self.points_view_export],
                                  ['zdirect_check', self.zdirect_check],
                                  ['filter_chk', self.filter_chk],
                                  ['byidentifier_chk', self.byidentifier_chk]]
        self.read_settings()
        self._event_update_status(self.export_opts.currentText())
Пример #10
0
    def __init__(self, parent=None, title='', settings=None):
        super().__init__(parent, settings, widgetname='surface_data')

        self.toplayout = QtWidgets.QVBoxLayout()
        self.setWindowTitle('Update Surface Data')

        self.listdata = TwoListWidget(title, 'In the Surface',
                                      'Possible Containers')
        self.mark_for_update_button = QtWidgets.QPushButton('Mark Update')
        self.mark_for_update_button.setDisabled(True)
        self.listdata.center_layout.addWidget(self.mark_for_update_button)
        self.listdata.center_layout.addStretch()
        self.toplayout.addWidget(self.listdata)

        self.update_checkbox = QtWidgets.QCheckBox(
            'Update Existing Container Data')
        self.update_checkbox.setToolTip(
            'Check this box to update all asterisk (*) marked containers in this surface for changes.\n'
            +
            'Updating means the container will be removed and then added back into the surface.  This must\n'
            +
            'be done for changes made in Kluster to take effect in the surface.'
        )
        self.update_checkbox.setChecked(True)
        self.toplayout.addWidget(self.update_checkbox)

        self.regrid_layout = QtWidgets.QHBoxLayout()
        self.regrid_checkbox = QtWidgets.QCheckBox('Re-Grid Data')
        self.regrid_checkbox.setToolTip(
            'Check this box to immediately grid all/updated containers after hitting OK'
        )
        self.regrid_checkbox.setChecked(True)
        self.regrid_layout.addWidget(self.regrid_checkbox)
        self.regrid_options = QtWidgets.QComboBox()
        self.regrid_options.addItems(
            ['The whole grid', 'Only where points have changed'])
        self.regrid_options.setToolTip(
            'Controls what parts of the grid get re-gridded on running this tool\n\n'
            +
            'The whole grid - will regrid the whole grid, generally this is not needed\n'
            +
            'Only where points have changed - will only update the grid where containers have been removed or added'
        )
        self.regrid_options.setCurrentText('Only where points have changed')
        self.regrid_layout.addWidget(self.regrid_options)
        self.regrid_layout.addStretch()
        self.toplayout.addLayout(self.regrid_layout)

        # self.use_dask_checkbox = QtWidgets.QCheckBox('Process in Parallel')
        # self.use_dask_checkbox.setToolTip('With this checked, gridding will be done in parallel using the Dask Client.  Assuming you have multiple\n' +
        #                                   'tiles, this should improve performance significantly.  You may experience some instability, although this\n' +
        #                                   'current implementation has not shown any during testing.')
        # self.toplayout.addWidget(self.use_dask_checkbox)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { color : " +
                                      kluster_variables.error_color + "; }")
        self.toplayout.addWidget(self.status_msg)

        self.hlayout_button = QtWidgets.QHBoxLayout()
        self.hlayout_button.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_button.addWidget(self.ok_button)
        self.hlayout_button.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_button.addWidget(self.cancel_button)
        self.hlayout_button.addStretch(1)
        self.toplayout.addLayout(self.hlayout_button)

        self.setLayout(self.toplayout)

        self.original_current = []
        self.original_possible = []
        self.canceled = False

        self.mark_for_update_button.clicked.connect(self.mark_for_update)
        self.listdata.left_list.itemClicked.connect(self.enable_markbutton)
        self.listdata.right_list.itemClicked.connect(self.disable_markbutton)
        self.ok_button.clicked.connect(self.start_processing)
        self.cancel_button.clicked.connect(self.cancel_processing)

        self.text_controls = [['regrid_options', self.regrid_options]]
        self.checkbox_controls = [['update_checkbox', self.update_checkbox],
                                  ['regrid_checkbox', self.regrid_checkbox]]
        self.read_settings()
Пример #11
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setWindowTitle('Generate New Surface')
        layout = QtWidgets.QVBoxLayout()

        self.input_msg = QtWidgets.QLabel(
            'Run surface generation on the following:')

        self.hlayout_zero = QtWidgets.QHBoxLayout()

        # fqpr = fully qualified ping record, the term for the datastore in kluster
        self.input_fqpr = BrowseListWidget(self)
        self.input_fqpr.sizeHint()
        self.input_fqpr.setup(mode='directory',
                              registry_key='kluster',
                              app_name='klusterbrowse',
                              filebrowse_title='Select input processed folder')
        self.hlayout_zero.addWidget(self.input_fqpr)

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.surface_box = QtWidgets.QGroupBox('New Surface')
        self.surf_layout = QtWidgets.QVBoxLayout()
        self.surf_msg = QtWidgets.QLabel('Select from the following options:')
        self.surf_layout.addWidget(self.surf_msg)

        self.hlayout_one_one = QtWidgets.QHBoxLayout()
        self.surf_method_lbl = QtWidgets.QLabel('Method: ')
        self.hlayout_one_one.addWidget(self.surf_method_lbl)
        self.surf_method = QtWidgets.QComboBox()
        self.surf_method.addItems(['Mean'])
        self.surf_method.setMaximumWidth(100)
        self.hlayout_one_one.addWidget(self.surf_method)
        self.surf_resolution_lbl = QtWidgets.QLabel('Resolution: ')
        self.hlayout_one_one.addWidget(self.surf_resolution_lbl)
        self.surf_resolution = QtWidgets.QComboBox()
        self.surf_resolution.addItems([
            '0.25', '0.50', '1.0', '2.0', '4.0', '8.0', '16.0', '32.0', '64.0',
            '128.0'
        ])
        self.surf_resolution.setMaximumWidth(60)
        self.hlayout_one_one.addWidget(self.surf_resolution)
        self.soundings_per_node_lbl = QtWidgets.QLabel(
            'Required Soundings/Node: ')
        self.hlayout_one_one.addWidget(self.soundings_per_node_lbl)
        self.soundings_per_node = QtWidgets.QLineEdit('')
        self.soundings_per_node.setInputMask('0;_')
        self.soundings_per_node.setMaximumWidth(13)
        self.soundings_per_node.setText('5')
        self.soundings_per_node.setDisabled(True)
        self.hlayout_one_one.addWidget(self.soundings_per_node)
        self.hlayout_one_one.addStretch(1)
        self.surf_layout.addLayout(self.hlayout_one_one)

        # self.output_msg = QtWidgets.QLabel('Select the output path for the surface')
        # self.surf_layout.addWidget(self.output_msg)

        # self.hlayout_one_two = QtWidgets.QHBoxLayout()
        # self.fil_text = QtWidgets.QLineEdit('', self)
        # self.fil_text.setMinimumWidth(400)
        # self.fil_text.setReadOnly(True)
        # self.hlayout_one_two.addWidget(self.fil_text)
        # self.browse_button = QtWidgets.QPushButton("Browse", self)
        # self.hlayout_one_two.addWidget(self.browse_button)
        # self.surf_layout.addLayout(self.hlayout_one_two)

        self.surface_box.setLayout(self.surf_layout)
        self.hlayout_one.addWidget(self.surface_box)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { " +
                                      kluster_variables.error_color + "; }")

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.hlayout_two.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_two.addWidget(self.ok_button)
        self.hlayout_two.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_two.addWidget(self.cancel_button)
        self.hlayout_two.addStretch(1)

        layout.addWidget(self.input_msg)
        layout.addLayout(self.hlayout_zero)
        layout.addLayout(self.hlayout_one)
        layout.addWidget(self.status_msg)
        layout.addLayout(self.hlayout_two)
        self.setLayout(layout)

        self.fqpr_inst = []
        self.canceled = False
        self.output_pth = None

        self.input_fqpr.files_updated.connect(
            self._event_update_fqpr_instances)
        # self.browse_button.clicked.connect(self.file_browse)
        self.ok_button.clicked.connect(self.start_processing)
        self.cancel_button.clicked.connect(self.cancel_processing)
Пример #12
0
    def __init__(self, parent=None):
        super().__init__(parent)

        # fqpr = fully qualified ping record, the term for the datastore in kluster
        self.fqpr = None
        self.datasets = None
        self.variables = None
        self.recent_plot = None

        self.variable_translator = {
            'acrosstrack': 'SoundVelocity_AcrossTrack',
            'alongtrack': 'SoundVelocity_AlongTrack',
            'beampointingangle': 'Uncorrected_Beam_Angle',
            'corr_altitude': 'Corrected_Altitude',
            'corr_heave': 'Corrected_Heave',
            'corr_pointing_angle': 'Corrected_Beam_Angle',
            'counter': 'Ping_Counter',
            'delay': 'Beam_Delay',
            'depthoffset': 'SoundVelocity_Depth',
            'detectioninfo': 'Beam_Filter',
            'frequency': 'Beam_Frequency',
            'mode': 'Ping_Mode',
            'modetwo': 'Ping_Mode_Two',
            'processing_status': 'Processing_Status',
            'qualityfactor': 'Beam_Uncertainty',
            'rel_azimuth': 'Relative_Azimuth',
            'soundspeed': 'Surface_Sound_Velocity',
            'thu': 'Beam_Total_Horizontal_Uncertainty',
            'tiltangle': 'Ping_Tilt_Angle',
            'traveltime': 'Beam_Travel_Time',
            'tvu': 'Beam_Total_Vertical_Uncertainty',
            'txsector_beam': 'Beam_Sector_Number',
            'x': 'Georeferenced_Easting',
            'y': 'Georeferenced_Northing',
            'yawpitchstab': 'Yaw_Pitch_Stabilization',
            'z': 'Georeferenced_Depth',
            'datum_uncertainty': 'Vertical_Datum_Uncertainty'
        }
        self.variable_reverse_lookup = {
            'SoundVelocity_AcrossTrack': 'acrosstrack',
            'SoundVelocity_AlongTrack': 'alongtrack',
            'Uncorrected_Beam_Angle': 'beampointingangle',
            'Corrected_Altitude': 'corr_altitude',
            'Corrected_Heave': 'corr_heave',
            'Corrected_Beam_Angle': 'corr_pointing_angle',
            'Ping_Counter': 'counter',
            'Beam_Delay': 'delay',
            'SoundVelocity_Depth': 'depthoffset',
            'Beam_Filter': 'detectioninfo',
            'Beam_Frequency': 'frequency',
            'Ping_Mode': 'mode',
            'Ping_Mode_Two': 'modetwo',
            'Processing_Status': 'processing_status',
            'Beam_Uncertainty': 'qualityfactor',
            'Relative_Azimuth': 'rel_azimuth',
            'Surface_Sound_Velocity': 'soundspeed',
            'Beam_Total_Horizontal_Uncertainty': 'thu',
            'Ping_Tilt_Angle': 'tiltangle',
            'Beam_Travel_Time': 'traveltime',
            'Beam_Total_Vertical_Uncertainty': 'tvu',
            'Beam_Sector_Number': 'txsector_beam',
            'Georeferenced_Easting': 'x',
            'Georeferenced_Northing': 'y',
            'Yaw_Pitch_Stabilization': 'yawpitchstab',
            'Georeferenced_Depth': 'z',
            'Vertical_Datum_Uncertainty': 'datum_uncertainty'
        }
        self.plot_lookup = {
            2: [
                'Histogram', 'Image', 'Contour', 'Line - Mean', 'Line - Nadir',
                'Line - Port Outer Beam', 'Line - Starboard Outer Beam'
            ],
            1: ['Line', 'Histogram', 'Scatter']
        }
        self.custom_plot_lookup = {
            'sound_velocity_profiles': ['Plot Profiles', 'Profile Map'],
            'sound_velocity_correct': [
                '2d scatter, color by depth', '2d scatter, color by sector',
                '3d scatter, color by depth', '3d scatter, color by sector'
            ],
            'georeferenced': [
                '2d scatter, color by depth', '2d scatter, color by sector',
                '3d scatter, color by depth', '3d scatter, color by sector'
            ],
            'animations': [
                'Uncorrected Beam Vectors', 'Corrected Beam Vectors',
                'Vessel Orientation'
            ]
        }

        self.setWindowTitle('Basic Plots')
        layout = QtWidgets.QVBoxLayout()

        self.data_widget = common_widgets.PlotDataHandler()

        self.hline = QtWidgets.QFrame()
        self.hline.setFrameShape(QtWidgets.QFrame.HLine)
        self.hline.setFrameShadow(QtWidgets.QFrame.Sunken)

        self.hlayout_main = QtWidgets.QHBoxLayout()
        self.vlayout_left = QtWidgets.QVBoxLayout()
        self.vlayout_right = QtWidgets.QVBoxLayout()

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.dataset_label = QtWidgets.QLabel('Source', self)
        self.dataset_label.setMinimumWidth(60)
        self.hlayout_one.addWidget(self.dataset_label)
        self.dataset_dropdown = QtWidgets.QComboBox(self)
        self.dataset_dropdown.setMinimumWidth(180)
        self.hlayout_one.addWidget(self.dataset_dropdown)
        self.hlayout_one.addStretch()

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.variable_label = QtWidgets.QLabel('Variable', self)
        self.variable_label.setMinimumWidth(60)
        self.hlayout_two.addWidget(self.variable_label)
        self.variable_dropdown = QtWidgets.QComboBox(self)
        self.variable_dropdown.setMinimumWidth(230)
        self.hlayout_two.addWidget(self.variable_dropdown)
        self.variable_dim_label = QtWidgets.QLabel('      Dimensions', self)
        self.hlayout_two.addWidget(self.variable_dim_label)
        self.variable_dimone = QtWidgets.QLineEdit('time', self)
        self.variable_dimone.setMaximumWidth(50)
        self.hlayout_two.addWidget(self.variable_dimone)
        self.variable_dimtwo = QtWidgets.QLineEdit('beam', self)
        self.variable_dimtwo.setMaximumWidth(50)
        self.hlayout_two.addWidget(self.variable_dimtwo)
        self.hlayout_two.addStretch()

        self.hlayout_three = QtWidgets.QHBoxLayout()
        self.plottype_label = QtWidgets.QLabel('Plot Type', self)
        self.plottype_label.setMinimumWidth(60)
        self.hlayout_three.addWidget(self.plottype_label)
        self.plottype_dropdown = QtWidgets.QComboBox(self)
        self.plottype_dropdown.setMinimumWidth(250)
        self.hlayout_three.addWidget(self.plottype_dropdown)
        self.bincount_label = QtWidgets.QLabel('Bins')
        self.bincount_label.hide()
        self.hlayout_three.addWidget(self.bincount_label)
        self.bincount = QtWidgets.QLineEdit('100', self)
        self.bincount.hide()
        self.hlayout_three.addWidget(self.bincount)
        self.hlayout_three.addStretch()

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.add_to_current_plot = QtWidgets.QCheckBox('Add to current plot',
                                                       self)
        self.add_to_current_plot.setChecked(False)
        self.hlayout_five.addWidget(self.add_to_current_plot)
        self.zero_center_plot = QtWidgets.QCheckBox('Center on zero', self)
        self.zero_center_plot.setChecked(False)
        self.zero_center_plot.hide()
        self.hlayout_five.addWidget(self.zero_center_plot)

        self.hlayout_four = QtWidgets.QHBoxLayout()
        self.hlayout_four.addStretch()
        self.plot_button = QtWidgets.QPushButton('Plot', self)
        self.plot_button.setMaximumWidth(70)
        self.plot_button.setDisabled(True)
        self.hlayout_four.addWidget(self.plot_button)
        self.hlayout_four.addStretch()

        self.hlayout_six = QtWidgets.QHBoxLayout()
        self.explanation = QtWidgets.QTextEdit('', self)
        self.hlayout_six.addWidget(self.explanation)

        layout.addWidget(self.data_widget)
        layout.addWidget(self.hline)

        self.vlayout_left.addLayout(self.hlayout_one)
        self.vlayout_left.addLayout(self.hlayout_two)
        self.vlayout_left.addLayout(self.hlayout_three)
        self.vlayout_left.addLayout(self.hlayout_five)
        self.vlayout_right.addLayout(self.hlayout_six)
        self.hlayout_main.addLayout(self.vlayout_left)
        self.hlayout_main.addLayout(self.vlayout_right)
        layout.addLayout(self.hlayout_main)

        layout.addLayout(self.hlayout_four)
        self.setLayout(layout)

        self.data_widget.fqpr_loaded.connect(self.new_fqpr_loaded)
        self.data_widget.ping_count_changed.connect(self.new_ping_count)
        self.dataset_dropdown.currentTextChanged.connect(self.load_variables)
        self.variable_dropdown.currentTextChanged.connect(self.load_plot_types)
        self.plottype_dropdown.currentTextChanged.connect(
            self.plot_type_selected)
        self.plot_button.clicked.connect(self.plot)
Пример #13
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setWindowTitle('Export Surface')
        layout = QtWidgets.QVBoxLayout()

        self.input_msg = QtWidgets.QLabel('Export from the following:')

        self.hlayout_zero = QtWidgets.QHBoxLayout()
        self.fil_text = QtWidgets.QLineEdit('', self)
        self.fil_text.setMinimumWidth(400)
        self.fil_text.setReadOnly(True)
        self.hlayout_zero.addWidget(self.fil_text)
        self.browse_button = QtWidgets.QPushButton("Browse", self)
        self.hlayout_zero.addWidget(self.browse_button)

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.start_msg = QtWidgets.QLabel('Export to: ')
        self.hlayout_one.addWidget(self.start_msg)
        self.export_opts = QtWidgets.QComboBox()
        self.export_opts.addItems(['Geotiff', 'BAG', 'csv'])
        self.export_opts.setMaximumWidth(100)
        self.hlayout_one.addWidget(self.export_opts)
        self.zdirect_check = QtWidgets.QCheckBox('Z as Elevation (+ UP)')
        self.zdirect_check.setChecked(True)
        self.hlayout_one.addWidget(self.zdirect_check)
        self.hlayout_one.addStretch()

        self.bag_options_widget = QtWidgets.QWidget()
        self.hlayout_bag_toplevel = QtWidgets.QHBoxLayout()
        self.vlayout_bag_leftside = QtWidgets.QVBoxLayout()
        self.vlayout_bag_rightside = QtWidgets.QVBoxLayout()

        self.bag_individual_label = QtWidgets.QLabel('Individual Name: ')
        self.vlayout_bag_leftside.addWidget(self.bag_individual_label)
        self.bag_individual = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_individual)

        self.bag_organizational_label = QtWidgets.QLabel(
            'Organizational Name: ')
        self.vlayout_bag_leftside.addWidget(self.bag_organizational_label)
        self.bag_organizational = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_organizational)

        self.bag_position_label = QtWidgets.QLabel('Position Name: ')
        self.vlayout_bag_leftside.addWidget(self.bag_position_label)
        self.bag_position = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_position)

        self.bag_date_label = QtWidgets.QLabel('Date: ')
        self.vlayout_bag_leftside.addWidget(self.bag_date_label)
        self.bag_date = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_date)

        self.bag_vert_crs_label = QtWidgets.QLabel('Vertical Coordinate WKT: ')
        self.vlayout_bag_leftside.addWidget(self.bag_vert_crs_label)
        self.bag_vert_crs = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_vert_crs)

        self.bag_abstract_label = QtWidgets.QLabel('Abstract: ')
        self.vlayout_bag_leftside.addWidget(self.bag_abstract_label)
        self.bag_abstract = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_abstract)

        self.bag_process_step_label = QtWidgets.QLabel(
            'Process Step Description: ')
        self.vlayout_bag_leftside.addWidget(self.bag_process_step_label)
        self.bag_process_step = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_process_step)

        self.bag_datetime_label = QtWidgets.QLabel('Datetime: ')
        self.vlayout_bag_leftside.addWidget(self.bag_datetime_label)
        self.bag_datetime = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_datetime)

        self.bag_restriction_label = QtWidgets.QLabel('Restriction Code: ')
        self.vlayout_bag_leftside.addWidget(self.bag_restriction_label)
        self.bag_restriction = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_restriction)

        self.bag_constraints_label = QtWidgets.QLabel('Other Constraints: ')
        self.vlayout_bag_leftside.addWidget(self.bag_constraints_label)
        self.bag_constraints = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_constraints)

        self.bag_classification_label = QtWidgets.QLabel('Classification: ')
        self.vlayout_bag_leftside.addWidget(self.bag_classification_label)
        self.bag_classification = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_classification)

        self.bag_security_label = QtWidgets.QLabel('Security User Note: ')
        self.vlayout_bag_leftside.addWidget(self.bag_security_label)
        self.bag_security = QtWidgets.QLineEdit('')
        self.vlayout_bag_rightside.addWidget(self.bag_security)

        self.hlayout_bag_toplevel.addLayout(self.vlayout_bag_leftside)
        self.hlayout_bag_toplevel.addLayout(self.vlayout_bag_rightside)
        self.bag_options_widget.setLayout(self.hlayout_bag_toplevel)

        self.output_msg = QtWidgets.QLabel('Export to the following:')

        self.hlayout_one_one = QtWidgets.QHBoxLayout()
        self.output_text = QtWidgets.QLineEdit('', self)
        self.output_text.setMinimumWidth(400)
        self.output_text.setReadOnly(True)
        self.hlayout_one_one.addWidget(self.output_text)
        self.output_button = QtWidgets.QPushButton("Browse", self)
        self.hlayout_one_one.addWidget(self.output_button)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { " +
                                      kluster_variables.error_color + "; }")

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.hlayout_two.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_two.addWidget(self.ok_button)
        self.hlayout_two.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_two.addWidget(self.cancel_button)
        self.hlayout_two.addStretch(1)

        layout.addWidget(self.input_msg)
        layout.addLayout(self.hlayout_zero)
        layout.addLayout(self.hlayout_one)
        layout.addWidget(self.bag_options_widget)
        layout.addStretch(1)
        layout.addWidget(self.output_msg)
        layout.addLayout(self.hlayout_one_one)
        layout.addWidget(self.status_msg)
        layout.addLayout(self.hlayout_two)
        # layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
        self.setLayout(layout)

        self.input_pth = ''
        self.output_pth = ''
        self.canceled = False

        self.browse_button.clicked.connect(self.grid_folder_browse)
        self.output_button.clicked.connect(self.output_file_browse)
        self.export_opts.currentTextChanged.connect(self._event_update_status)
        self.ok_button.clicked.connect(self.start_export)
        self.cancel_button.clicked.connect(self.cancel_export)

        self._event_update_status(self.export_opts.currentText())
        self._set_default_bag_options()
Пример #14
0
    def __init__(self, parent=None, title='', settings=None):
        super().__init__(parent, settings, widgetname='proj_settings')

        self.setWindowTitle('Project Settings')
        layout = QtWidgets.QVBoxLayout()

        self.incoord_group = QtWidgets.QGroupBox('Input Coordinate System:')
        self.incoord_layout = QtWidgets.QVBoxLayout()

        self.infromdata_radio = QtWidgets.QRadioButton('From multibeam data')
        self.infromdata_radio.setChecked(True)
        self.infromdata_radio.setToolTip(
            'Uses the input coordinate system determined automatically from the raw multibeam data.  This is the default option, you should only change this '
            'if you know that the multibeam is not writing the correct datum to file.  Ignored if SBET datum exists.'
        )
        self.incoord_layout.addWidget(self.infromdata_radio)

        inepsg_tooltip = 'Generates a new input coordinate system from EPSG code, ignored if SBET datum exists.  Only use if you have to overwrite the multibeam data datum description.'
        self.hlayout_zero_one = QtWidgets.QHBoxLayout()
        self.inepsg_radio = QtWidgets.QRadioButton('From EPSG')
        self.inepsg_radio.setToolTip(inepsg_tooltip)
        self.hlayout_zero_one.addWidget(self.inepsg_radio)
        self.inepsg_val = QtWidgets.QLineEdit('', self)
        self.inepsg_val.setToolTip(inepsg_tooltip)
        self.hlayout_zero_one.addWidget(self.inepsg_val)
        self.incoord_layout.addLayout(self.hlayout_zero_one)

        indropdown_tooltip = f'Generates a new input coordinate system from coordinate system description, ignored if SBET datum exists.\n\n{geo_datum_descrip}'
        self.hlayout_zero_two = QtWidgets.QHBoxLayout()
        self.indropdown_radio = QtWidgets.QRadioButton('From identifier')
        self.indropdown_radio.setToolTip(indropdown_tooltip)
        self.hlayout_zero_two.addWidget(self.indropdown_radio)
        self.indropdown_val = QtWidgets.QComboBox()
        self.indropdown_val.addItems(
            kluster_variables.geographic_coordinate_systems)
        self.indropdown_val.setCurrentIndex(
            kluster_variables.geographic_coordinate_systems.index(
                kluster_variables.default_coordinate_system))
        self.indropdown_val.setToolTip(indropdown_tooltip)
        self.hlayout_zero_two.addWidget(self.indropdown_val)
        self.incoord_layout.addLayout(self.hlayout_zero_two)

        self.incoord_group.setLayout(self.incoord_layout)

        self.outcoord_group = QtWidgets.QGroupBox('Output Coordinate System:')
        self.outcoord_layout = QtWidgets.QVBoxLayout()

        outepsg_tooltip = 'Generates a new output coordinate system from EPSG code.'
        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.epsg_radio = QtWidgets.QRadioButton('From EPSG')
        self.epsg_radio.setToolTip(outepsg_tooltip)
        self.hlayout_one.addWidget(self.epsg_radio)
        self.epsg_val = QtWidgets.QLineEdit('', self)
        self.epsg_val.setToolTip(outepsg_tooltip)
        self.hlayout_one.addWidget(self.epsg_val)
        self.outcoord_layout.addLayout(self.hlayout_one)

        autoutm_tooltip = f'Build the correct EPSG code for the output coordinate system from datum description and known hemisphere/zone number.\n\n{proj_datum_descrip}'
        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.auto_utm_radio = QtWidgets.QRadioButton('Auto UTM')
        self.auto_utm_radio.setChecked(True)
        self.auto_utm_radio.setToolTip(autoutm_tooltip)
        self.hlayout_two.addWidget(self.auto_utm_radio)
        self.auto_utm_val = QtWidgets.QComboBox()
        self.auto_utm_val.setToolTip(autoutm_tooltip)
        self.auto_utm_val.addItems(kluster_variables.coordinate_systems)
        self.auto_utm_val.setCurrentIndex(
            kluster_variables.coordinate_systems.index(
                kluster_variables.default_coordinate_system))
        self.hlayout_two.addWidget(self.auto_utm_val)
        self.outcoord_layout.addLayout(self.hlayout_two)

        self.outcoord_group.setLayout(self.outcoord_layout)

        self.vertref_msg = QtWidgets.QLabel('Vertical Reference:')

        self.hlayout_three = QtWidgets.QHBoxLayout()
        self.georef_vertref = QtWidgets.QComboBox()
        self.georef_vertref.addItems(kluster_variables.vertical_references)
        self.georef_vertref.setToolTip(
            'Set the vertical reference used in georeferencing, this determines the zero point for all depths generated in Kluster.'
        )
        self.hlayout_three.addWidget(self.georef_vertref)
        self.hlayout_three.addStretch(1)

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.hlayout_five.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_five.addWidget(self.ok_button)
        self.hlayout_five.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_five.addWidget(self.cancel_button)
        self.hlayout_five.addStretch(1)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { color : " +
                                      kluster_variables.error_color + "; }")
        self.status_msg.setAlignment(QtCore.Qt.AlignCenter)
        self.statusbox = QtWidgets.QHBoxLayout()
        self.statusbox.addWidget(self.status_msg)

        layout.addWidget(self.incoord_group)
        layout.addStretch()
        layout.addWidget(self.outcoord_group)
        layout.addStretch()
        layout.addWidget(self.vertref_msg)
        layout.addLayout(self.hlayout_three)
        layout.addStretch()
        layout.addLayout(self.statusbox)
        layout.addLayout(self.hlayout_five)
        self.setLayout(layout)

        self.canceled = False

        self.ok_button.clicked.connect(self.start)
        self.cancel_button.clicked.connect(self.cancel)
        self.georef_vertref.currentTextChanged.connect(self.find_vdatum)
        self.epsg_val.textChanged.connect(self.validate_epsg)
        self.inepsg_val.textChanged.connect(self.validate_epsg)

        self.text_controls = [['epsgval', self.epsg_val],
                              ['utmval', self.auto_utm_val],
                              ['vertref', self.georef_vertref],
                              ['inepsg_val', self.inepsg_val],
                              ['indropdown_val', self.indropdown_val]]
        self.checkbox_controls = [['infromdata_radio', self.infromdata_radio],
                                  ['inepsg_radio', self.inepsg_radio],
                                  ['indropdown_radio', self.indropdown_radio],
                                  ['epsg_radio', self.epsg_radio],
                                  ['auto_utm_radio', self.auto_utm_radio]]

        self.read_settings()
        self.validate_epsg()
        self.find_vdatum()
Пример #15
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.fqpr = None
        self.fqpr_path = None
        self.fqpr_mintime = 0
        self.fqpr_maxtime = 0
        self.fqpr_line_dict = None
        self.slider_mintime = 0
        self.slider_maxtime = 0
        self.translate_time = False

        self.setWindowTitle('Basic Plot')
        layout = QtWidgets.QVBoxLayout()

        self.start_msg = QtWidgets.QLabel(
            'Select the converted data to plot (a converted folder):')

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.fil_text = QtWidgets.QLineEdit('', self)
        self.fil_text.setMinimumWidth(400)
        self.fil_text.setReadOnly(True)
        self.hlayout_one.addWidget(self.fil_text)
        self.browse_button = QtWidgets.QPushButton("Browse", self)
        self.hlayout_one.addWidget(self.browse_button)

        self.trim_time_check = QtWidgets.QGroupBox('Trim by time')
        self.trim_time_check.setCheckable(True)
        self.trim_time_check.setChecked(False)
        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.trim_time_start_lbl = QtWidgets.QLabel('Start time (utc seconds)')
        self.hlayout_two.addWidget(self.trim_time_start_lbl)
        self.trim_time_start = QtWidgets.QLineEdit('', self)
        self.hlayout_two.addWidget(self.trim_time_start)
        self.trim_time_end_lbl = QtWidgets.QLabel('End time (utc seconds)')
        self.hlayout_two.addWidget(self.trim_time_end_lbl)
        self.trim_time_end = QtWidgets.QLineEdit('', self)
        self.hlayout_two.addWidget(self.trim_time_end)
        self.trim_time_datetime_start_lbl = QtWidgets.QLabel(
            'Start time (utc)')
        self.trim_time_datetime_start_lbl.hide()
        self.hlayout_two.addWidget(self.trim_time_datetime_start_lbl)
        self.trim_time_datetime_start = QtWidgets.QDateTimeEdit(self)
        self.trim_time_datetime_start.setDisplayFormat("MM/dd/yyyy hh:mm:ss")
        self.trim_time_datetime_start.hide()
        self.hlayout_two.addWidget(self.trim_time_datetime_start)
        self.trim_time_datetime_end_lbl = QtWidgets.QLabel('End time (utc)')
        self.trim_time_datetime_end_lbl.hide()
        self.hlayout_two.addWidget(self.trim_time_datetime_end_lbl)
        self.trim_time_datetime_end = QtWidgets.QDateTimeEdit(self)
        self.trim_time_datetime_end.setDisplayFormat("MM/dd/yyyy hh:mm:ss")
        self.trim_time_datetime_end.hide()
        self.hlayout_two.addWidget(self.trim_time_datetime_end)
        self.hlayout_two.addStretch()
        self.trim_time_check.setLayout(self.hlayout_two)

        self.trim_line_check = QtWidgets.QGroupBox('Trim by line')
        self.trim_line_check.setCheckable(True)
        self.trim_line_check.setChecked(False)
        self.hlayout_three = QtWidgets.QHBoxLayout()
        self.trim_lines_lbl = QtWidgets.QLabel('Line Name')
        self.hlayout_three.addWidget(self.trim_lines_lbl)
        self.trim_lines = QtWidgets.QComboBox(self)
        self.trim_lines.setMinimumWidth(350)
        self.hlayout_three.addWidget(self.trim_lines)
        self.trim_line_check.setLayout(self.hlayout_three)

        self.hlayout_four = QtWidgets.QHBoxLayout()
        self.ping_count_label = QtWidgets.QLabel('Ping count')
        self.hlayout_four.addWidget(self.ping_count_label)
        self.ping_count = QtWidgets.QLineEdit('', self)
        self.ping_count.setMinimumWidth(80)
        self.ping_count.setReadOnly(True)
        self.hlayout_four.addWidget(self.ping_count)
        self.time_as_label = QtWidgets.QLabel('Time as')
        self.hlayout_four.addWidget(self.time_as_label)
        self.time_as_dropdown = QtWidgets.QComboBox(self)
        self.time_as_dropdown.addItems(['utc seconds', 'utc datetime'])
        self.hlayout_four.addWidget(self.time_as_dropdown)
        self.hlayout_four.addStretch(2)

        self.hlayout_four_one = QtWidgets.QHBoxLayout()
        self.display_start_time = QtWidgets.QLabel('0.0', self)
        self.hlayout_four_one.addWidget(self.display_start_time)
        self.hlayout_four_one.addStretch()
        self.display_range = QtWidgets.QLabel('(0.0, 0.0)', self)
        self.hlayout_four_one.addWidget(self.display_range)
        self.hlayout_four_one.addStretch()
        self.display_end_time = QtWidgets.QLabel('0.0', self)
        self.hlayout_four_one.addWidget(self.display_end_time)

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.sliderbar = RangeSlider(self)
        self.sliderbar.setTickInterval(1000)
        self.sliderbar.setRangeLimit(0, 1000)
        self.sliderbar.setRange(20, 200)
        self.hlayout_five.addWidget(self.sliderbar)

        self.hlayout_six = QtWidgets.QHBoxLayout()
        self.warning_message = QtWidgets.QLabel('', self)
        self.warning_message.setStyleSheet("{};".format(
            kluster_variables.error_color))
        self.hlayout_six.addWidget(self.warning_message)

        layout.addWidget(self.start_msg)
        layout.addLayout(self.hlayout_one)
        layout.addWidget(self.trim_time_check)
        layout.addWidget(self.trim_line_check)
        layout.addLayout(self.hlayout_four)
        layout.addLayout(self.hlayout_four_one)
        layout.addLayout(self.hlayout_five)
        layout.addLayout(self.hlayout_six)
        self.setLayout(layout)

        self.browse_button.clicked.connect(self.file_browse)
        self.sliderbar.mouse_move.connect(self.update_from_slider)
        self.trim_time_start.textChanged.connect(self.update_from_trim_time)
        self.trim_time_end.textChanged.connect(self.update_from_trim_time)
        self.trim_time_datetime_start.dateTimeChanged.connect(
            self.update_from_trim_datetime)
        self.trim_time_datetime_end.dateTimeChanged.connect(
            self.update_from_trim_datetime)
        self.trim_lines.currentTextChanged.connect(self.update_from_line)
        self.trim_time_check.toggled.connect(self.trim_time_toggled)
        self.trim_line_check.toggled.connect(self.trim_line_toggled)
        self.time_as_dropdown.currentTextChanged.connect(
            self.update_translate_mode)
Пример #16
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setWindowTitle('Export Soundings')
        layout = QtWidgets.QVBoxLayout()

        self.input_msg = QtWidgets.QLabel('Export from the following:')

        self.hlayout_zero = QtWidgets.QHBoxLayout()
        self.input_fqpr = BrowseListWidget(self)
        self.input_fqpr.sizeHint()
        self.input_fqpr.setup(mode='directory', registry_key='kluster', app_name='klusterbrowse',
                              filebrowse_title='Select input processed folder')
        self.input_fqpr.setMinimumWidth(600)
        self.hlayout_zero.addWidget(self.input_fqpr)

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.start_msg = QtWidgets.QLabel('Export to: ')
        self.hlayout_one.addWidget(self.start_msg)
        self.export_opts = QtWidgets.QComboBox()
        # self.export_opts.addItems(['csv', 'las', 'entwine'])  need to add entwine to the env
        self.export_opts.addItems(['csv', 'las'])
        self.export_opts.setMaximumWidth(100)
        self.hlayout_one.addWidget(self.export_opts)
        self.csvdelimiter_lbl = QtWidgets.QLabel('Delimiter')
        self.hlayout_one.addWidget(self.csvdelimiter_lbl)
        self.csvdelimiter_dropdown = QtWidgets.QComboBox(self)
        self.csvdelimiter_dropdown.addItems(['comma', 'space'])
        self.hlayout_one.addWidget(self.csvdelimiter_dropdown)
        self.hlayout_one.addStretch()

        self.hlayout_one_one = QtWidgets.QHBoxLayout()
        self.zdirect_check = QtWidgets.QCheckBox('Make Z Positive Down')
        self.zdirect_check.setChecked(True)
        self.hlayout_one_one.addWidget(self.zdirect_check)
        self.hlayout_one_one.addStretch()

        self.hlayout_one_three = QtWidgets.QHBoxLayout()
        self.filter_chk = QtWidgets.QCheckBox('Filter Rejected')
        self.filter_chk.setChecked(True)
        self.hlayout_one_three.addWidget(self.filter_chk)
        self.byidentifier_chk = QtWidgets.QCheckBox('Separate Files by Sector/Frequency')
        self.byidentifier_chk.setChecked(False)
        self.hlayout_one_three.addWidget(self.byidentifier_chk)
        self.hlayout_one_three.addStretch()

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { " + kluster_variables.error_color + "; }")

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.hlayout_two.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_two.addWidget(self.ok_button)
        self.hlayout_two.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_two.addWidget(self.cancel_button)
        self.hlayout_two.addStretch(1)

        layout.addWidget(self.input_msg)
        layout.addLayout(self.hlayout_zero)
        layout.addLayout(self.hlayout_one)
        layout.addLayout(self.hlayout_one_one)
        layout.addLayout(self.hlayout_one_three)
        layout.addWidget(self.status_msg)
        layout.addLayout(self.hlayout_two)
        self.setLayout(layout)

        self.fqpr_inst = []
        self.canceled = False

        self.input_fqpr.files_updated.connect(self._event_update_fqpr_instances)
        self.export_opts.currentTextChanged.connect(self._event_update_status)
        self.ok_button.clicked.connect(self.start_export)
        self.cancel_button.clicked.connect(self.cancel_export)
    def __init__(self, parent=None, title='', settings=None):
        super().__init__(parent, settings, widgetname='export_tracklines')

        self.setWindowTitle('Export Tracklines')
        layout = QtWidgets.QVBoxLayout()

        self.basic_export_group = QtWidgets.QGroupBox(
            'Export from the following datasets:')
        self.basic_export_group.setCheckable(True)
        self.basic_export_group.setChecked(True)
        self.hlayout_zero = QtWidgets.QHBoxLayout()
        self.input_fqpr = BrowseListWidget(self)
        self.input_fqpr.sizeHint()
        self.input_fqpr.setup(mode='directory',
                              registry_key='kluster',
                              app_name='klusterbrowse',
                              filebrowse_title='Select input processed folder')
        self.input_fqpr.setMinimumWidth(600)
        self.hlayout_zero.addWidget(self.input_fqpr)
        self.basic_export_group.setLayout(self.hlayout_zero)

        self.line_export = QtWidgets.QCheckBox('Export selected lines')
        self.line_export.setChecked(False)

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.start_msg = QtWidgets.QLabel('Export to: ')
        self.hlayout_one.addWidget(self.start_msg)
        self.export_opts = QtWidgets.QComboBox()
        self.export_opts.addItems(['geopackage'])
        self.hlayout_one.addWidget(self.export_opts)
        self.hlayout_one.addStretch()

        self.output_msg = QtWidgets.QLabel('Export to the following:')

        self.hlayout_one_one = QtWidgets.QHBoxLayout()
        self.output_text = QtWidgets.QLineEdit('', self)
        self.output_text.setMinimumWidth(400)
        self.output_text.setReadOnly(True)
        self.hlayout_one_one.addWidget(self.output_text)
        self.output_button = QtWidgets.QPushButton("Browse", self)
        self.hlayout_one_one.addWidget(self.output_button)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { color : " +
                                      kluster_variables.error_color + "; }")

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.hlayout_two.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_two.addWidget(self.ok_button)
        self.hlayout_two.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_two.addWidget(self.cancel_button)
        self.hlayout_two.addStretch(1)

        layout.addWidget(self.basic_export_group)
        layout.addWidget(self.line_export)
        layout.addWidget(QtWidgets.QLabel(' '))
        layout.addLayout(self.hlayout_one)
        layout.addWidget(self.output_msg)
        layout.addLayout(self.hlayout_one_one)
        layout.addWidget(self.status_msg)
        layout.addLayout(self.hlayout_two)
        self.setLayout(layout)

        self.fqpr_inst = []
        self.canceled = False

        self.basic_export_group.toggled.connect(self._handle_basic_checked)
        self.line_export.toggled.connect(self._handle_line_checked)
        self.output_button.clicked.connect(self.output_file_browse)
        self.input_fqpr.files_updated.connect(
            self._event_update_fqpr_instances)
        self.ok_button.clicked.connect(self.start_export)
        self.cancel_button.clicked.connect(self.cancel_export)

        self.text_controls = [['export_ops', self.export_opts],
                              ['output_text', self.output_text]]
        self.checkbox_controls = [[
            'basic_export_group', self.basic_export_group
        ], ['line_export', self.line_export]]
        self.read_settings()
Пример #18
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setWindowTitle('Import Post Processed Navigation')
        layout = QtWidgets.QVBoxLayout()

        self.input_msg = QtWidgets.QLabel('Apply to the following:')

        self.hlayout_zero = QtWidgets.QHBoxLayout()
        self.input_fqpr = BrowseListWidget(self)
        self.input_fqpr.sizeHint()
        self.input_fqpr.setup(mode='directory', registry_key='kluster', app_name='klusterbrowse',
                              filebrowse_title='Select input processed folder')
        self.hlayout_zero.addWidget(self.input_fqpr)

        self.sbet_msg = QtWidgets.QLabel('POSPac SBET Files')

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.sbetfiles = BrowseListWidget(self)
        self.sbetfiles.setup(registry_key='kluster', app_name='klusterbrowse', supported_file_extension=['.out', '.sbet'],
                             multiselect=True, filebrowse_title='Select SBET files',
                             filebrowse_filter='POSPac SBET files (*.out;*.sbet)')
        self.hlayout_two.addWidget(self.sbetfiles)

        self.smrmsg_msg = QtWidgets.QLabel('POSPac SMRMSG Files')

        self.hlayout_three = QtWidgets.QHBoxLayout()
        self.smrmsgfiles = BrowseListWidget(self)
        self.smrmsgfiles.setup(registry_key='kluster', app_name='klusterbrowse', supported_file_extension=['.out', '.smrmsg'],
                               multiselect=True, filebrowse_title='Select SMRMSG files',
                               filebrowse_filter='POSPac SMRMSG files (*.out;*.smrmsg)')
        self.hlayout_three.addWidget(self.smrmsgfiles)

        self.log_check = QtWidgets.QGroupBox('Load from POSPac export log')
        self.log_check.setCheckable(True)
        self.log_check.setChecked(True)
        self.logopts = QtWidgets.QVBoxLayout()
        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.log_file = QtWidgets.QLineEdit('', self)
        self.log_file.setMinimumWidth(400)
        self.log_file.setReadOnly(True)
        self.hlayout_one.addWidget(self.log_file)
        self.browse_button = QtWidgets.QPushButton("Browse", self)
        self.hlayout_one.addWidget(self.browse_button)
        self.logopts.addLayout(self.hlayout_one)
        self.log_check.setLayout(self.logopts)

        self.override_check = QtWidgets.QGroupBox('Manually set metadata')
        self.override_check.setCheckable(True)
        self.override_check.setChecked(False)
        self.overrideopts = QtWidgets.QVBoxLayout()
        self.hlayout_four_one = QtWidgets.QHBoxLayout()
        self.caltext = QtWidgets.QLabel('Date of SBET')
        self.hlayout_four_one.addWidget(self.caltext)
        self.calendar_widget = QtWidgets.QDateEdit()
        self.calendar_widget.setMaximumWidth(100)
        self.calendar_widget.setCalendarPopup(True)
        currdate = datetime.now()
        self.calendar_widget.setDate(QtCore.QDate(currdate.year, currdate.month, currdate.day))
        self.hlayout_four_one.addWidget(self.calendar_widget)
        self.hlayout_four_two = QtWidgets.QHBoxLayout()
        self.datumtext = QtWidgets.QLabel('Coordinate System')
        self.hlayout_four_two.addWidget(self.datumtext)
        self.datum_val = QtWidgets.QComboBox()
        self.datum_val.addItems(['NAD83', 'WGS84'])
        self.datum_val.setMaximumWidth(100)
        self.hlayout_four_two.addWidget(self.datum_val)
        self.overrideopts.addLayout(self.hlayout_four_one)
        self.overrideopts.addLayout(self.hlayout_four_two)
        self.override_check.setLayout(self.overrideopts)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { " + kluster_variables.error_color + "; }")

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.hlayout_five.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_five.addWidget(self.ok_button)
        self.hlayout_five.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_five.addWidget(self.cancel_button)
        self.hlayout_five.addStretch(1)

        layout.addWidget(self.input_msg)
        layout.addLayout(self.hlayout_zero)
        layout.addWidget(self.sbet_msg)
        layout.addLayout(self.hlayout_two)
        layout.addWidget(self.smrmsg_msg)
        layout.addLayout(self.hlayout_three)
        layout.addWidget(self.log_check)
        layout.addWidget(self.override_check)
        layout.addWidget(self.status_msg)
        layout.addLayout(self.hlayout_five)
        self.setLayout(layout)

        self.log_file_path = ''
        self.sbet_files = []
        self.smrmsg_files = []
        self.fqpr_inst = []
        self.canceled = False

        self.browse_button.clicked.connect(self.file_browse)
        self.log_check.clicked.connect(self.log_override_checked)
        self.override_check.clicked.connect(self.log_override_checked)
        self.input_fqpr.files_updated.connect(self._event_update_fqpr_instances)
        self.sbetfiles.files_updated.connect(self.update_sbet_files)
        self.smrmsgfiles.files_updated.connect(self.update_smrmsg_files)
        self.ok_button.clicked.connect(self.start_processing)
        self.cancel_button.clicked.connect(self.cancel_processing)

        self.resize(600, 500)
Пример #19
0
    def __init__(self, parent=None, settings=None):
        super().__init__(parent)
        self.external_settings = settings

        self.setWindowTitle('Layer Settings')
        layout = QtWidgets.QVBoxLayout()

        self.layer_msg = QtWidgets.QLabel('Background Layer:')

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.layer_dropdown = QtWidgets.QComboBox()
        self.layer_dropdown.addItems([
            'None', 'Default', 'VDatum Coverage (VDatum required)',
            'OpenStreetMap (internet required)',
            'Satellite (internet required)', 'NOAA RNC (internet required)',
            'NOAA ENC (internet required)', 'GEBCO Grid (internet required)',
            'EMODnet Bathymetry (internet required)'
        ])
        self.layer_dropdown.setMaximumWidth(300)
        self.hlayout_one.addWidget(self.layer_dropdown)
        self.hlayout_one.addStretch(1)

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.transparency_label = QtWidgets.QLabel('Background Transparency: ')
        self.transparency_label.setMaximumWidth(130)
        self.hlayout_two.addWidget(self.transparency_label)
        self.transparency = QtWidgets.QLineEdit('0')
        self.transparency.setMaximumWidth(30)
        self.hlayout_two.addWidget(self.transparency)
        self.transparency_sign_label = QtWidgets.QLabel('%')
        self.hlayout_two.addWidget(self.transparency_sign_label)
        self.hlayout_two.addStretch(1)

        self.hlayout_three = QtWidgets.QHBoxLayout()
        self.surf_transparency_label = QtWidgets.QLabel(
            'Surface Transparency: ')
        self.surf_transparency_label.setMaximumWidth(130)
        self.hlayout_three.addWidget(self.surf_transparency_label)
        self.surf_transparency = QtWidgets.QLineEdit('0')
        self.surf_transparency.setMaximumWidth(30)
        self.hlayout_three.addWidget(self.surf_transparency)
        self.surf_transparency_sign_label = QtWidgets.QLabel('%')
        self.hlayout_three.addWidget(self.surf_transparency_sign_label)
        self.hlayout_three.addStretch(1)

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.hlayout_five.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_five.addWidget(self.ok_button)
        self.hlayout_five.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_five.addWidget(self.cancel_button)
        self.hlayout_five.addStretch(1)

        layout.addWidget(self.layer_msg)
        layout.addLayout(self.hlayout_one)
        layout.addLayout(self.hlayout_two)
        layout.addLayout(self.hlayout_three)
        layout.addStretch()
        layout.addLayout(self.hlayout_five)
        self.setLayout(layout)

        self.canceled = False

        self.ok_button.clicked.connect(self.start)
        self.cancel_button.clicked.connect(self.cancel)

        self.read_settings()
        self.resize(600, 200)
Пример #20
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setWindowTitle('All Processing')
        layout = QtWidgets.QVBoxLayout()

        self.input_msg = QtWidgets.QLabel('Run processing on the following:')

        self.hlayout_zero = QtWidgets.QHBoxLayout()
        self.input_fqpr = BrowseListWidget(self)
        self.input_fqpr.sizeHint()
        self.input_fqpr.setup(mode='directory',
                              registry_key='kluster',
                              app_name='klusterbrowse',
                              filebrowse_title='Select input processed folder')
        self.hlayout_zero.addWidget(self.input_fqpr)

        self.start_msg = QtWidgets.QLabel(
            'Check processes you want to include:')

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.ovec_check = QtWidgets.QGroupBox('Compute Orientation')
        self.ovec_check.setCheckable(True)
        self.ovec_check.setChecked(True)
        self.hlayout_one.addWidget(self.ovec_check)

        self.hlayout_two = QtWidgets.QHBoxLayout()
        self.bvec_check = QtWidgets.QGroupBox('Compute Beam Vectors')
        self.bvec_check.setCheckable(True)
        self.bvec_check.setChecked(True)
        self.hlayout_two.addWidget(self.bvec_check)

        self.hlayout_three = QtWidgets.QHBoxLayout()
        self.svcorr_check = QtWidgets.QGroupBox('Sound Velocity Correct')
        self.svcorr_check.setCheckable(True)
        self.svcorr_check.setChecked(True)
        self.svopts = QtWidgets.QVBoxLayout()
        self.sv_msg = QtWidgets.QLabel('(Optional) Additional .svp files')
        self.svopts.addWidget(self.sv_msg)

        self.hlayout_three_one = QtWidgets.QHBoxLayout()
        self.svfiles = BrowseListWidget(self)
        self.svfiles.setup(registry_key='kluster',
                           app_name='klusterbrowse',
                           supported_file_extension='.svp',
                           multiselect=True,
                           filebrowse_title='Select .svp files',
                           filebrowse_filter='Caris svp files (*.svp)')
        self.hlayout_three_one.addWidget(self.svfiles)
        self.svopts.addLayout(self.hlayout_three_one)
        self.svcorr_check.setLayout(self.svopts)
        self.hlayout_three.addWidget(self.svcorr_check)

        self.hlayout_four = QtWidgets.QHBoxLayout()
        self.georef_check = QtWidgets.QGroupBox('Georeference Soundings')
        self.georef_check.setCheckable(True)
        self.georef_check.setChecked(True)
        self.georefopts = QtWidgets.QVBoxLayout()
        self.coord_msg = QtWidgets.QLabel('Coordinate System:')
        self.georefopts.addWidget(self.coord_msg)

        self.hlayout_four_one = QtWidgets.QHBoxLayout()
        self.epsg_radio = QtWidgets.QRadioButton('From EPSG')
        self.hlayout_four_one.addWidget(self.epsg_radio)
        self.epsg_val = QtWidgets.QLineEdit('', self)
        self.epsg_val.setMaximumWidth(80)
        self.hlayout_four_one.addWidget(self.epsg_val)
        self.hlayout_four_one.addStretch(1)
        self.georefopts.addLayout(self.hlayout_four_one)

        self.hlayout_four_two = QtWidgets.QHBoxLayout()
        self.auto_utm_radio = QtWidgets.QRadioButton('Auto UTM')
        self.auto_utm_radio.setChecked(True)
        self.hlayout_four_two.addWidget(self.auto_utm_radio)
        self.auto_utm_val = QtWidgets.QComboBox()
        self.auto_utm_val.addItems(['NAD83', 'WGS84'])
        self.auto_utm_val.setMaximumWidth(100)
        self.hlayout_four_two.addWidget(self.auto_utm_val)
        self.hlayout_four_two.addStretch(1)
        self.georefopts.addLayout(self.hlayout_four_two)

        self.hlayout_four_three = QtWidgets.QHBoxLayout()
        self.vertref_msg = QtWidgets.QLabel('Vertical Reference:')
        self.hlayout_four_three.addWidget(self.vertref_msg)
        self.georef_vertref = QtWidgets.QComboBox()
        self.georef_vertref.addItems(['waterline', 'ellipse'])
        self.georef_vertref.setMaximumWidth(100)
        self.hlayout_four_three.addWidget(self.georef_vertref)
        self.hlayout_four_three.addStretch(1)
        self.georefopts.addLayout(self.hlayout_four_three)
        self.georef_check.setLayout(self.georefopts)
        self.hlayout_four.addWidget(self.georef_check)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { " +
                                      kluster_variables.error_color + "; }")

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.hlayout_five.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_five.addWidget(self.ok_button)
        self.hlayout_five.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_five.addWidget(self.cancel_button)
        self.hlayout_five.addStretch(1)

        layout.addWidget(self.input_msg)
        layout.addLayout(self.hlayout_zero)
        layout.addWidget(self.start_msg)
        layout.addLayout(self.hlayout_one)
        layout.addLayout(self.hlayout_two)
        layout.addLayout(self.hlayout_three)
        layout.addLayout(self.hlayout_four)
        layout.addWidget(self.status_msg)
        layout.addLayout(self.hlayout_five)
        self.setLayout(layout)

        self.addtl_cast_files = []
        self.fqpr_inst = []
        self.canceled = False

        self.input_fqpr.files_updated.connect(
            self._event_update_fqpr_instances)
        self.svfiles.files_updated.connect(self.update_cast_files)
        self.ok_button.clicked.connect(self.start_processing)
        self.cancel_button.clicked.connect(self.cancel_processing)

        self.resize(600, 500)