urclib.ui_qt.unified_window
The main window and associated functions for the URC tool GUI.
Module Contents
Classes
Main Window for the URC tool GUI. |
Functions
|
Execute the assigned tasks. |
- urclib.ui_qt.unified_window.run_urc_tasks(cg_kwargs, pe_kwargs, post_prog)
Execute the assigned tasks.
- Parameters:
cg_kwargs (dict or None) – Keyword arguments for run_create_pe_grid(), or None if it isn’t to be run.
pe_kwargs (dict or None) – Keyword arguments for run_pe_score(), or None if it isn’t to be run.
post_prog (function) – Method or function to be called on progress updates.
- Returns:
Results of requested analyses.
- Return type:
dict
- class urclib.ui_qt.unified_window.REEToolMainWindow
Bases:
PyQt5.QtWidgets.QMainWindowMain Window for the URC tool GUI.
- _update_path_label(attr, io_path, lbl)
Update path and displayed dlg_label. :param attr: The attribute to update with ioPath. :type attr: str :param io_path: The new path value; can be None if now path is assigned. :type io_path: str or None :param lbl: The dlg_label to update. :type lbl: .ElideLabelWidget.ElideLabelWidget
- _io_path(attr, lbl, filt, isopen, isdir=False, dlg_label=None)
Request new path from user.
- Parameters:
attr (str) – The attribute of the instance to assign the path to.
lbl (.ElideLabelWidget.ElideLabelWidget) – The Label to be updated with the new path.
filt (str or None) – The file pattern to use in the file dialog’s filter. Can be None if isdir is True.
isopen (bool) – If True, displays an open dialog; otherwise, it displays a save dialog.
isdir (bool,optional) – If True, directories are selected by the dialog; otherwise, files are selected. Default is False.
dlg_label (str,optional) – The label to apply to the dialog; if None, display a generic title. Default is None.
- Returns:
The selected path.
- Return type:
str
- _opt_toggled(enabled, attr_prefix)
Toggle widgets associated with a boolean flag.
- Parameters:
enabled (bool) – The flag state.
attr_prefix (str) – The prefix for widgets to update.
- _remove_from_recentlist(path)
Remove path from recent menu.
- Parameters:
path (str) – The path to remove.
- _update_recentlist(path)
Add path to top of open recent menu.
- Parameters:
path (str) – Path to add to top of open recent menu.
refresh list of most recently opened simulation projects.
- _do_openrecent()
Menu action to call when an Open Recent entry is selected.
- task_changed(selected, deselected)
Slot invoked when the task table selection has changed.
- Parameters:
selected (PyQt5.QtCore.QItemSelection) – List of indices of newly selected cells.
deselected (PyQt5.QtCore.QItemSelection) – unused
- task_checked(index, label, enabled)
Slot for responding to a task item being checked
- Parameters:
index (int) – Unused.
label (str) – The label of the table entry.
enabled (bool) – Reflects the state of the checkbox adjacent to the entry in the task table.
- run_task()
Slot for executing any of the checked tasks.
- _update_common_path(pattr, lbl)
Subtract common path from a given path.
- Parameters:
pattr (str) – The attribute of this object to update with the relative path.
lbl (.ElideLabelWidget.ElideLabelWidget) – The label to extract the path from.
- new_settings()
Set widgets to the defaults.
- open_settings()
Load settings from a project file.
- save_settings()
Save settings to existing project file, or create a new one if one currently doesn’t exist for the project.
- save_as_settings()
Create a new file and save settings to it.
- _onShowDocumentation(suffix='index.html')
- _showAbout()
- display_results(workspaces, prog_dlg)
- Parameters:
workspaces (dict) – Collection of ReeWorkspaces which contain paths to the result files.
prog_dlg (.ProgLogDlg.ProgLogDlg) – The progress dialog which was running the analysis.
- export_settings()
Gather widget values into a dict for export.
- Returns:
The structured collection of widget values suitable for export.
- Return type:
dict
- import_settings(params)
Import widget values from a dict.
- Parameters:
params (dict) – The settings to assign to the tool’s widgets.
- _init_create_grid()
Initialize widgets for Create Grid pane.
- create_grid_checkmissing()
Validates the parameters for create grid prior to execution.
- Returns:
- A list of strings representing error messages. If this list is empty, then no required values are
missing; otherwise, the check has failed.
- Return type:
list
- create_grid_prep()
Packages arguments for run_create_pe_grid() from the existing widgets.
- Returns:
Keyword arguments to pass through run_create_pe_grid().
- Return type:
dict
- _on_use_sa_toggled(is_checked)
Slot for toggling the use of Secondary Alteration inputs.
- Parameters:
is_checked (bool) – The state of include Secondary Alteration domains.
- _on_sd_inputbutton_clicked()
User selection of structural domain input file.
- _on_ld_inputbutton_clicked()
User selection of lithological domain input file.
- _on_sa_inputbutton_clicked()
User selection of secondary alteration domain input file.
- _on_ldinds_button_clicked()
User selection for Lithologic domain index output raster.
- _on_lginds_button_clicked()
User selection for Local group index output raster.
- _on_sainds_button_clicked()
User selection for Secondary Alteration domain index output raster.
- _on_sdinds_button_clicked()
User selection for Structural domain index output raster.
- _on_udinds_button_clicked()
User selection for Unique domain index output raster.
- _on_cg_outdir_clicked()
Update common paths for any existint output index files.
- _on_projbox_toggled(checked)
Enable or disables the box containing projection selection widgets.
- Parameters:
checked (bool) – Flag indicating the enabled/disabled state of the widgets used for projection selection.
- _on_cliplyr_clicked()
User selection of a clipping layer to apply to the results of the grid creation.
- _init_pescore()
Initialize widgets for PE Score pane.
- pescore_checkmissing(cg_enabled=False)
Validates the parameters for pe score prior to execution.
- Returns:
- A list of strings representing error messages. If this list is empty, then no required values are
missing; otherwise, the check has failed.
- Return type:
list
- pescore_prep(cg_enabled=False)
Packages arguments for run_pe_score() from the existing widgets.
- Parameters:
cg_enabled (bool,optional) –
- Returns:
Keyword arguments to pass through run_pe_score().
- Return type:
dict
- _testindex_path(input_dir, ind_name)
Test to see if an index file exists at the input directory location.
- Parameters:
input_dir (str) – Path to the parent directory of the file.
ind_name (str) – Name of the file to query about.
- Returns:
True if the file exists; False otherwise.
- Return type:
bool
- _on_gdb_action_triggered(checked)
User selection of a GDB directory for input.
- Parameters:
checked (bool) – Unused.
- _on_sql_action_triggered(checked)
User selection of a SQLite file for input.
- Parameters:
checked (bool) – Unused.
- _on_indexdir_clicked()
User selection of an input directory for input.
- _pe_outdir_clicked()
User selection of a directory for output files.
- _on_rasterdir_clicked()
User selection of a directory for saving intermediate raster files.
- _on_limit_da_ds_toggled(is_checked)
Toggle to limit calculations to _only_ DA or _only_ DS.
- Parameters:
is_checked (bool) – If True then calculations will be limited to either DA or DS; otherwise, both will be calculated.
- _on_rasterdir_toggled(is_checked)
Toggle for saving intermediate rasters.
- Parameters:
is_checked (bool) – If True intermediate rasters will be saved; otherwise, they will be omitted.
- _on_indexfield_edit_finished()
Check to see if the file name exists in the input directory. If not, paint the text red.
- _on_cliplyr_toggled(checked)
Enables or disables the inclusion of a clipping layer.
- Parameters:
checked (bool) – Include a clip layer if checked; otherwise, omit the clip layer.