def __init__(self, parent: QtWidgets.QWidget = None): """ initialize Parameters ---------- parent MonitorDashboard """ super().__init__() self.parent = parent self.vlayout = QtWidgets.QVBoxLayout() self.hlayoutone = QtWidgets.QHBoxLayout() self.statuslight = QtWidgets.QCheckBox('') self.statuslight.setStyleSheet( "QCheckBox::indicator {background-color : black;}") self.statuslight.setDisabled(True) self.hlayoutone.addWidget(self.statuslight) self.fil_text = QtWidgets.QLineEdit('') self.fil_text.setReadOnly(True) self.hlayoutone.addWidget(self.fil_text) self.browse_button = QtWidgets.QPushButton("Browse") self.hlayoutone.addWidget(self.browse_button) self.hlayouttwo = QtWidgets.QHBoxLayout() self.start_button = QtWidgets.QPushButton('Start') self.hlayouttwo.addWidget(self.start_button) self.stop_button = QtWidgets.QPushButton('Stop') self.hlayouttwo.addWidget(self.stop_button) spcr = QtWidgets.QLabel(' ') self.hlayouttwo.addWidget(spcr) self.include_subdirectories = QtWidgets.QCheckBox( 'Include Subdirectories') self.hlayouttwo.addWidget(self.include_subdirectories) self.vlayout.addLayout(self.hlayoutone) self.vlayout.addLayout(self.hlayouttwo) self.setLayout(self.vlayout) self.browse_button.clicked.connect(self.dir_browse) self.start_button.clicked.connect(self.start_monitoring) self.stop_button.clicked.connect(self.stop_monitoring) self.monitor = None
def __init__(self, parent=None, settings=None): super().__init__(parent) self.external_settings = settings self.parent = parent self.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.model = QtGui.QStandardItemModel() # row can be 0 even when there are more than 0 rows self.setModel(self.model) self.setUniformRowHeights(False) self.setAcceptDrops(False) self.viewport().setAcceptDrops(False) # viewport is the total rendered area, this is recommended from my reading # ExtendedSelection - allows multiselection with shift/ctrl self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) # set up the context menu per item self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.right_click_menu_files = None self.setup_menu() # makes it so no editing is possible with the table self.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.categories = ['Next Action', 'All Actions', 'Queued Files', 'Unmatched Files'] self.tree_data = {} self.actions = None self.unmatched = None self.exclude_buffer = [] self.start_button = QtWidgets.QPushButton('Start Process') self.start_button.clicked.connect(self.start_process) self.start_button.setDisabled(True) self.auto_checkbox = QtWidgets.QCheckBox('Auto') self.auto_checkbox.setCheckable(True) self.auto_checkbox.clicked.connect(self.auto_process) self.button_widget = QtWidgets.QWidget() self.button_sizer = QtWidgets.QHBoxLayout() self.button_sizer.addWidget(self.start_button) self.button_sizer.addWidget(self.auto_checkbox) self.button_sizer.setAlignment(QtCore.Qt.AlignLeft) self.button_widget.setLayout(self.button_sizer) self.button_widget.setToolTip('Start the action below by clicking "Start Process".\n' + 'If the "Start Process" button is greyed out, there is no viable action to run.\n\n' + 'If the "Auto" check box is checked, Kluster will automatically run all actions as they appear.\n' + 'You will not need to use the "Start Process" button with "Auto" enabled.') self.stop_auto = Event() self.stop_auto.set() self.auto_thread = AutoThread(self.stop_auto, self.emit_auto_signal) self.customContextMenuRequested.connect(self.show_context_menu) self.configure() self.read_settings()
def add_line(self, line_data: list): if line_data: next_row = self.rowCount() self.insertRow(next_row) self.row_full_attribution.append(line_data) for column_index, _ in enumerate(self.headr): if column_index == 0: item = QtWidgets.QCheckBox() self.setCellWidget(next_row, column_index, item) else: item = QtWidgets.QTableWidgetItem( str(line_data[column_index - 1])) self.setItem(next_row, column_index, item)
def __init__(self, parent=None, settings=None): super().__init__(parent) self.external_settings = settings self.setWindowTitle('Settings') layout = QtWidgets.QVBoxLayout() self.parallel_write = QtWidgets.QCheckBox('Enable Parallel Writes') self.parallel_write.setChecked(True) self.hlayout_one = QtWidgets.QHBoxLayout() self.vdatum_label = QtWidgets.QLabel('VDatum Directory') self.hlayout_one.addWidget(self.vdatum_label) self.vdatum_text = QtWidgets.QLineEdit('', self) self.vdatum_text.setReadOnly(True) self.hlayout_one.addWidget(self.vdatum_text) self.browse_button = QtWidgets.QPushButton("Browse", self) self.hlayout_one.addWidget(self.browse_button) 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.parallel_write) layout.addLayout(self.hlayout_one) layout.addStretch() layout.addWidget(self.status_msg) layout.addLayout(self.hlayout_five) self.setLayout(layout) self.vdatum_pth = None self.canceled = False self.browse_button.clicked.connect(self.vdatum_browse) self.ok_button.clicked.connect(self.start) self.cancel_button.clicked.connect(self.cancel) self.read_settings() self._refresh_error_message() self.resize(600, 150)
def __init__(self, parent=None, title='', settings=None): super().__init__(parent, settings, widgetname='daskclient') self.setWindowTitle('Setup Dask Client') self.client_vbox = QtWidgets.QVBoxLayout() self.local_box = QtWidgets.QGroupBox('Local Cluster') self.local_box.setToolTip('Uses your computer resources in starting the Local Cluster, this is what you want when running on a computer normally.') self.local_box.setCheckable(True) self.local_box.setChecked(True) self.local_layout = QtWidgets.QHBoxLayout() self.checkbox_layout = QtWidgets.QVBoxLayout() self.number_workers_checkbox = QtWidgets.QCheckBox('Override Number of Workers') self.number_workers_checkbox.setToolTip('Use this checkbox if you want to set a specific number of workers, default is the number of cores on your machine') self.number_workers_checkbox.setChecked(False) self.checkbox_layout.addWidget(self.number_workers_checkbox) self.number_threads_checkbox = QtWidgets.QCheckBox('Override Threads per Worker') self.number_threads_checkbox.setToolTip('Use this checkbox if you want to set a specific number of threads per worker, default is based on the number of cores on your machine') self.number_threads_checkbox.setChecked(False) self.checkbox_layout.addWidget(self.number_threads_checkbox) self.number_memory_checkbox = QtWidgets.QCheckBox('Override Memory (GB) per Worker') self.number_memory_checkbox.setToolTip('Use this amount of memory for each worker, default is the max memory available on your system') self.number_memory_checkbox.setChecked(False) self.checkbox_layout.addWidget(self.number_memory_checkbox) self.entry_layout = QtWidgets.QVBoxLayout() self.number_workers = QtWidgets.QLineEdit('') self.entry_layout.addWidget(self.number_workers) self.number_threads = QtWidgets.QLineEdit('') self.entry_layout.addWidget(self.number_threads) self.number_memory = QtWidgets.QLineEdit('') self.entry_layout.addWidget(self.number_memory) self.local_layout.addLayout(self.checkbox_layout) self.local_layout.addLayout(self.entry_layout) self.local_box.setLayout(self.local_layout) self.client_vbox.addWidget(self.local_box) self.remote_box = QtWidgets.QGroupBox('Remote Client') self.remote_box.setToolTip('Use this when you have set up a Dask Cluster on a remote server, the address given here is the address of that server.') self.remote_box.setCheckable(True) self.remote_box.setChecked(False) self.remote_layout = QtWidgets.QHBoxLayout() self.checkbox2_layout = QtWidgets.QVBoxLayout() self.remote_ip_radio = QtWidgets.QRadioButton('By IP') self.remote_ip_radio.setChecked(True) self.checkbox2_layout.addWidget(self.remote_ip_radio) self.remote_fqdn_radio = QtWidgets.QRadioButton('By FQDN') self.checkbox2_layout.addWidget(self.remote_fqdn_radio) self.remote_layout.addLayout(self.checkbox2_layout) self.addresslayout = QtWidgets.QVBoxLayout() self.remote_ip_address_label = QtWidgets.QLabel('Address') self.addresslayout.addWidget(self.remote_ip_address_label) self.remote_fqdn_address_label = QtWidgets.QLabel('Address') self.addresslayout.addWidget(self.remote_fqdn_address_label) self.remote_layout.addLayout(self.addresslayout) self.addressinputlayout = QtWidgets.QVBoxLayout() self.remote_ip_address = QtWidgets.QLineEdit('') self.remote_ip_address.setInputMask('000.000.000.000;_') self.addressinputlayout.addWidget(self.remote_ip_address) self.remote_fqdn_address = QtWidgets.QLineEdit('') self.addressinputlayout.addWidget(self.remote_fqdn_address) self.remote_layout.addLayout(self.addressinputlayout) self.portlayout = QtWidgets.QVBoxLayout() self.remote_ip_port_label = QtWidgets.QLabel('Port') self.portlayout.addWidget(self.remote_ip_port_label) self.remote_fqdn_port_label = QtWidgets.QLabel('Port') self.portlayout.addWidget(self.remote_fqdn_port_label) self.remote_layout.addLayout(self.portlayout) self.portinputlayout = QtWidgets.QVBoxLayout() self.remote_ip_port = QtWidgets.QLineEdit('') self.remote_ip_port.setInputMask('00000;_') self.portinputlayout.addWidget(self.remote_ip_port) self.remote_fqdn_port = QtWidgets.QLineEdit('') self.remote_fqdn_port.setInputMask('00000;_') self.portinputlayout.addWidget(self.remote_fqdn_port) self.remote_layout.addLayout(self.portinputlayout) self.remote_box.setLayout(self.remote_layout) self.client_vbox.addWidget(self.remote_box) self.status_msg = QtWidgets.QLabel('') self.status_msg.setStyleSheet("QLabel { color : " + kluster_variables.error_color + "; }") self.client_vbox.addWidget(self.status_msg) self.button_layout = QtWidgets.QHBoxLayout() self.button_layout.addStretch(1) self.ok_button = QtWidgets.QPushButton('OK', self) self.button_layout.addWidget(self.ok_button) self.button_layout.addStretch(1) self.cancel_button = QtWidgets.QPushButton('Cancel', self) self.button_layout.addWidget(self.cancel_button) self.button_layout.addStretch(1) self.client_vbox.addLayout(self.button_layout) self.cl = None self.setLayout(self.client_vbox) self.remote_box.clicked.connect(self.uncheck_local_box) self.local_box.clicked.connect(self.uncheck_remote_box) self.ok_button.clicked.connect(self.setup_client) self.cancel_button.clicked.connect(self.cancel_client) self.text_controls = [['number_workers', self.number_workers], ['number_memory', self.number_memory], ['number_threads', self.number_threads], ['remote_ip_address', self.remote_ip_address], ['remote_ip_port', self.remote_ip_port], ['remote_fqdn_address', self.remote_fqdn_address], ['remote_fqdn_port', self.remote_fqdn_port]] self.checkbox_controls = [['local_box', self.local_box], ['remote_box', self.remote_box], ['number_workers_checkbox', self.number_workers_checkbox], ['number_threads_checkbox', self.number_threads_checkbox], ['number_memory_checkbox', self.number_memory_checkbox]] self.read_settings()
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()
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)
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') 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())
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)
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()
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)
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()