OpenMS
Loading...
Searching...
No Matches
ToolsDialog Class Reference

TOPP tool selection dialog. More...

#include <OpenMS/VISUAL/DIALOGS/ToolsDialog.h>

Inheritance diagram for ToolsDialog:
[legend]
Collaboration diagram for ToolsDialog:
[legend]

Public Member Functions

 ToolsDialog (QWidget *parent, const Param &params, std::string ini_file, std::string default_dir, LayerDataBase::DataType layer_type, const std::string &layer_name, TVToolDiscovery *tool_scanner)
 Constructor.
 
 ~ToolsDialog () override
 Destructor.
 
std::string getOutput ()
 to get the parameter name for output. Empty if no output was selected.
 
std::string getInput ()
 to get the parameter name for input
 
std::string getTool ()
 to get the currently selected tool-name
 
std::string getExtension ()
 get the default extension for the output file
 

Protected Slots

void ok_ ()
 if ok button pressed show the tool output in a new layer, a new window or standard output as messagebox
 
void setTool_ (int i)
 Slot that handles changing of the tool.
 
void createINI_ ()
 Slot that retrieves and displays the defaults.
 
void loadINI_ ()
 loads an ini-file into the editor
 
void storeINI_ ()
 stores an ini-file from the editor
 
void reloadPlugins_ ()
 rerun the automatic plugin detection
 
void fastModeToggled_ (bool checked)
 Slot toggling between fast and manual thread mode.
 

Private Member Functions

void disable_ ()
 Disables the ok button and input/output comboboxes.
 
void enable_ ()
 Enables the ok button and input/output comboboxes.
 
std::vector< LayerDataBase::DataTypegetTypesFromParam_ (const Param &p) const
 Determine all types a tool is compatible with by mapping each file extensions in a tools param.
 
void setInputOutputCombo_ (const Param &p)
 Fill input_combo_ and output_combo_ box with the appropriate entries from the specified param object.
 
QStringList createToolsList_ ()
 Create a list of all TOPP tool/util/plugins that are compatible with the active layer type.
 
void initializeThreadsControls_ ()
 Populate and initialize thread controls.
 
void applyThreadsToSingleToolParam_ ()
 Apply the selected thread mode/value back to single_tool_param_.
 
void updateGUIParamFromSingleToolParam_ ()
 Build GUI-only editor parameters from internal parameter state and update the editor with them.
 
void mergeGUIParamIntoSingleToolParam_ ()
 Merge edited GUI-only parameters back into internal parameter state.
 

Private Attributes

ParamEditoreditor_ = nullptr
 ParamEditor for reading ini-files.
 
QLabel * cpu_usage_label_ = nullptr
 Label for CPU usage row.
 
QWidgetthreads_widget_ = nullptr
 Container for thread controls (FastMode + manual controls)
 
QCheckBox * fast_mode_checkbox_ = nullptr
 Enables automatic use of all available threads.
 
QComboBox * threads_combo_ = nullptr
 Manual thread count dropdown (1..max)
 
const int max_threads_
 Maximum available thread count from OpenMP.
 
QLabel * tool_desc_
 tools description label
 
QComboBox * tools_combo_
 ComboBox for choosing a TOPP-tool.
 
QPushButton * reload_plugins_button_
 Button to rerun the automatic plugin detection.
 
QComboBox * input_combo_
 for choosing an input parameter
 
QComboBox * output_combo_
 for choosing an output parameter
 
Param arg_param_
 Param for loading the ini-file.
 
Param single_tool_param_
 Intact tool parameters (after :1:) for the currently selected tool; used for applying changes from gui_param_ and for executing the tool.
 
Param gui_param_
 Param containing only parameters shown/edited in the ParamEditor (GUI subset)
 
const Param tool_params_
 Param object containing all TOPP tool/util params.
 
Param plugin_params_
 Param object containing all plugin params.
 
QPushButton * ok_button_
 ok-button connected with slot ok_()
 
std::string ini_file_
 Location of the temporary INI file this dialog works on.
 
std::string default_dir_
 default-dir of ini-file to open
 
QString filename_
 name of ini-file
 
std::map< FileTypes::Type, LayerDataBase::DataTypetool_map_
 Mapping of file extension to layer type to determine the type of a tool.
 
TVToolDiscoverytool_scanner_
 Pointer to the tool scanner for access to the plugins and to rerun the plugins detection.
 
LayerDataBase::DataType layer_type_
 The layer type of the current layer to determine all usable plugins.
 

Detailed Description

TOPP tool selection dialog.

In the dialog, the user can

  • select a TOPP tool
  • select the options used for the input and output file
  • and set the parameters for the tool

This information can then be used to execute the tool.

The offered tools depend on the data type set in the constructor.

Constructor & Destructor Documentation

◆ ToolsDialog()

ToolsDialog ( QWidget parent,
const Param params,
std::string  ini_file,
std::string  default_dir,
LayerDataBase::DataType  layer_type,
const std::string &  layer_name,
TVToolDiscovery tool_scanner 
)

Constructor.

Parameters
[in]parentQt parent widget
[in]paramsContaining all TOPP tool/util params
[in]ini_fileThe file name of the temporary INI file created by this dialog
[in]default_dirThe default directory for loading and storing INI files
[in]layer_typeThe type of data (determines the applicable tools)
[in]layer_nameThe name of the selected layer
[in]tool_scannerPointer to the tool scanner for access to the plugins and to rerun the plugins detection

◆ ~ToolsDialog()

~ToolsDialog ( )
override

Destructor.

Member Function Documentation

◆ applyThreadsToSingleToolParam_()

void applyThreadsToSingleToolParam_ ( )
private

Apply the selected thread mode/value back to single_tool_param_.

◆ createINI_

void createINI_ ( )
protectedslot

Slot that retrieves and displays the defaults.

◆ createToolsList_()

QStringList createToolsList_ ( )
private

Create a list of all TOPP tool/util/plugins that are compatible with the active layer type.

◆ disable_()

void disable_ ( )
private

Disables the ok button and input/output comboboxes.

◆ enable_()

void enable_ ( )
private

Enables the ok button and input/output comboboxes.

◆ fastModeToggled_

void fastModeToggled_ ( bool  checked)
protectedslot

Slot toggling between fast and manual thread mode.

◆ getExtension()

std::string getExtension ( )

get the default extension for the output file

Referenced by TOPPViewBase::showTOPPDialog_().

◆ getInput()

std::string getInput ( )

to get the parameter name for input

Referenced by TOPPViewBase::showTOPPDialog_().

◆ getOutput()

std::string getOutput ( )

to get the parameter name for output. Empty if no output was selected.

Referenced by TOPPViewBase::showTOPPDialog_().

◆ getTool()

std::string getTool ( )

to get the currently selected tool-name

Referenced by TOPPViewBase::showTOPPDialog_().

◆ getTypesFromParam_()

std::vector< LayerDataBase::DataType > getTypesFromParam_ ( const Param p) const
private

Determine all types a tool is compatible with by mapping each file extensions in a tools param.

◆ initializeThreadsControls_()

void initializeThreadsControls_ ( )
private

Populate and initialize thread controls.

◆ loadINI_

void loadINI_ ( )
protectedslot

loads an ini-file into the editor

◆ mergeGUIParamIntoSingleToolParam_()

void mergeGUIParamIntoSingleToolParam_ ( )
private

Merge edited GUI-only parameters back into internal parameter state.

◆ ok_

void ok_ ( )
protectedslot

if ok button pressed show the tool output in a new layer, a new window or standard output as messagebox

◆ reloadPlugins_

void reloadPlugins_ ( )
protectedslot

rerun the automatic plugin detection

◆ setInputOutputCombo_()

void setInputOutputCombo_ ( const Param p)
private

Fill input_combo_ and output_combo_ box with the appropriate entries from the specified param object.

◆ setTool_

void setTool_ ( int  i)
protectedslot

Slot that handles changing of the tool.

◆ storeINI_

void storeINI_ ( )
protectedslot

stores an ini-file from the editor

◆ updateGUIParamFromSingleToolParam_()

void updateGUIParamFromSingleToolParam_ ( )
private

Build GUI-only editor parameters from internal parameter state and update the editor with them.

Member Data Documentation

◆ arg_param_

Param arg_param_
private

Param for loading the ini-file.

◆ cpu_usage_label_

QLabel* cpu_usage_label_ = nullptr
private

Label for CPU usage row.

◆ default_dir_

std::string default_dir_
private

default-dir of ini-file to open

◆ editor_

ParamEditor* editor_ = nullptr
private

ParamEditor for reading ini-files.

◆ fast_mode_checkbox_

QCheckBox* fast_mode_checkbox_ = nullptr
private

Enables automatic use of all available threads.

◆ filename_

QString filename_
private

name of ini-file

◆ gui_param_

Param gui_param_
private

Param containing only parameters shown/edited in the ParamEditor (GUI subset)

◆ ini_file_

std::string ini_file_
private

Location of the temporary INI file this dialog works on.

◆ input_combo_

QComboBox* input_combo_
private

for choosing an input parameter

◆ layer_type_

LayerDataBase::DataType layer_type_
private

The layer type of the current layer to determine all usable plugins.

◆ max_threads_

const int max_threads_
private

Maximum available thread count from OpenMP.

◆ ok_button_

QPushButton* ok_button_
private

ok-button connected with slot ok_()

◆ output_combo_

QComboBox* output_combo_
private

for choosing an output parameter

◆ plugin_params_

Param plugin_params_
private

Param object containing all plugin params.

◆ reload_plugins_button_

QPushButton* reload_plugins_button_
private

Button to rerun the automatic plugin detection.

◆ single_tool_param_

Param single_tool_param_
private

Intact tool parameters (after :1:) for the currently selected tool; used for applying changes from gui_param_ and for executing the tool.

◆ threads_combo_

QComboBox* threads_combo_ = nullptr
private

Manual thread count dropdown (1..max)

◆ threads_widget_

QWidget* threads_widget_ = nullptr
private

Container for thread controls (FastMode + manual controls)

◆ tool_desc_

QLabel* tool_desc_
private

tools description label

◆ tool_map_

std::map<FileTypes::Type, LayerDataBase::DataType> tool_map_
private

Mapping of file extension to layer type to determine the type of a tool.

◆ tool_params_

const Param tool_params_
private

Param object containing all TOPP tool/util params.

◆ tool_scanner_

TVToolDiscovery* tool_scanner_
private

Pointer to the tool scanner for access to the plugins and to rerun the plugins detection.

◆ tools_combo_

QComboBox* tools_combo_
private

ComboBox for choosing a TOPP-tool.