OpenMS
Loading...
Searching...
No Matches
ToolsDialog.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Marc Sturm $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13// OpenMS_GUI config
14#include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
15
18
19class QLabel;
20class QComboBox;
21class QCheckBox;
22class QPushButton;
23class QString;
24class QWidget;
25
26#include <QtWidgets/QDialog>
27
28namespace OpenMS
29{
30 class ParamEditor;
31 class TVToolDiscovery;
32
47 class OPENMS_GUI_DLLAPI ToolsDialog :
48 public QDialog
49 {
50 Q_OBJECT
51
52public:
64 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);
66 ~ToolsDialog() override;
67
69 std::string getOutput();
71 std::string getInput();
73 std::string getTool();
75 std::string getExtension();
76
77
78private:
80 ParamEditor * editor_ = nullptr;
82 QLabel* cpu_usage_label_ = nullptr;
84 QWidget* threads_widget_ = nullptr;
86 QCheckBox* fast_mode_checkbox_ = nullptr;
88 QComboBox* threads_combo_ = nullptr;
90 const int max_threads_;
92 QLabel * tool_desc_;
94 QComboBox * tools_combo_;
98 QComboBox * input_combo_;
100 QComboBox * output_combo_;
112 QPushButton * ok_button_;
114 std::string ini_file_;
116 std::string default_dir_;
118 QString filename_;
120 std::map<FileTypes::Type, LayerDataBase::DataType> tool_map_;
125
127 void disable_();
129 void enable_();
131 std::vector<LayerDataBase::DataType> getTypesFromParam_(const Param& p) const;
135 QStringList createToolsList_();
144
145protected slots:
146
148 void ok_();
150 void setTool_(int i);
154 void loadINI_();
156 void storeINI_();
160 void fastModeToggled_(bool checked);
161 };
162
163}
A GUI for editing or viewing a Param object.
Definition ParamEditor.h:152
Management and storage of parameters / INI files.
Definition Param.h:46
Scans for tools and generates a param for each asynchronously.
Definition TVToolDiscovery.h:37
TOPP tool selection dialog.
Definition ToolsDialog.h:49
Param arg_param_
Param for loading the ini-file.
Definition ToolsDialog.h:102
QPushButton * reload_plugins_button_
Button to rerun the automatic plugin detection.
Definition ToolsDialog.h:96
Param gui_param_
Param containing only parameters shown/edited in the ParamEditor (GUI subset)
Definition ToolsDialog.h:106
void mergeGUIParamIntoSingleToolParam_()
Merge edited GUI-only parameters back into internal parameter state.
void applyThreadsToSingleToolParam_()
Apply the selected thread mode/value back to single_tool_param_.
Param plugin_params_
Param object containing all plugin params.
Definition ToolsDialog.h:110
QStringList createToolsList_()
Create a list of all TOPP tool/util/plugins that are compatible with the active layer type.
QComboBox * output_combo_
for choosing an output parameter
Definition ToolsDialog.h:100
void disable_()
Disables the ok button and input/output comboboxes.
std::string getTool()
to get the currently selected tool-name
std::string getExtension()
get the default extension for the output file
void setInputOutputCombo_(const Param &p)
Fill input_combo_ and output_combo_ box with the appropriate entries from the specified param object.
void storeINI_()
stores an ini-file from the editor
QString filename_
name of ini-file
Definition ToolsDialog.h:118
std::string getInput()
to get the parameter name for input
void fastModeToggled_(bool checked)
Slot toggling between fast and manual thread mode.
void ok_()
if ok button pressed show the tool output in a new layer, a new window or standard output as messageb...
const Param tool_params_
Param object containing all TOPP tool/util params.
Definition ToolsDialog.h:108
LayerDataBase::DataType layer_type_
The layer type of the current layer to determine all usable plugins.
Definition ToolsDialog.h:124
std::vector< LayerDataBase::DataType > getTypesFromParam_(const Param &p) const
Determine all types a tool is compatible with by mapping each file extensions in a tools param.
std::string getOutput()
to get the parameter name for output. Empty if no output was selected.
void enable_()
Enables the ok button and input/output comboboxes.
TVToolDiscovery * tool_scanner_
Pointer to the tool scanner for access to the plugins and to rerun the plugins detection.
Definition ToolsDialog.h:122
QComboBox * input_combo_
for choosing an input parameter
Definition ToolsDialog.h:98
std::map< FileTypes::Type, LayerDataBase::DataType > tool_map_
Mapping of file extension to layer type to determine the type of a tool.
Definition ToolsDialog.h:120
QLabel * tool_desc_
tools description label
Definition ToolsDialog.h:92
void createINI_()
Slot that retrieves and displays the defaults.
void initializeThreadsControls_()
Populate and initialize thread controls.
Param single_tool_param_
Intact tool parameters (after :1:) for the currently selected tool; used for applying changes from gu...
Definition ToolsDialog.h:104
const int max_threads_
Maximum available thread count from OpenMP.
Definition ToolsDialog.h:90
void loadINI_()
loads an ini-file into the editor
~ToolsDialog() override
Destructor.
QPushButton * ok_button_
ok-button connected with slot ok_()
Definition ToolsDialog.h:112
std::string ini_file_
Location of the temporary INI file this dialog works on.
Definition ToolsDialog.h:114
std::string default_dir_
default-dir of ini-file to open
Definition ToolsDialog.h:116
void setTool_(int i)
Slot that handles changing of the tool.
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.
void updateGUIParamFromSingleToolParam_()
Build GUI-only editor parameters from internal parameter state and update the editor with them.
void reloadPlugins_()
rerun the automatic plugin detection
QComboBox * tools_combo_
ComboBox for choosing a TOPP-tool.
Definition ToolsDialog.h:94
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
DataType
Definition LayerDataBase.h:74