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
46 class OPENMS_GUI_DLLAPI ToolsDialog :
47 public QDialog
48 {
49 Q_OBJECT
50
51public:
62 ToolsDialog(QWidget * parent, const Param& params, std::string ini_file, std::string default_dir, LayerDataBase::DataType layer_type, const std::string& layer_name);
64 ~ToolsDialog() override;
65
67 std::string getOutput();
69 std::string getInput();
71 std::string getTool();
73 std::string getExtension();
74
75
76private:
78 ParamEditor * editor_ = nullptr;
80 QLabel* cpu_usage_label_ = nullptr;
82 QWidget* threads_widget_ = nullptr;
84 QCheckBox* fast_mode_checkbox_ = nullptr;
86 QComboBox* threads_combo_ = nullptr;
88 const int max_threads_;
90 QLabel * tool_desc_;
92 QComboBox * tools_combo_;
94 QComboBox * input_combo_;
96 QComboBox * output_combo_;
106 QPushButton * ok_button_;
108 std::string ini_file_;
110 std::string default_dir_;
112 QString filename_;
114 std::map<FileTypes::Type, LayerDataBase::DataType> tool_map_;
117
119 void disable_();
121 void enable_();
123 std::vector<LayerDataBase::DataType> getTypesFromParam_(const Param& p) const;
127 QStringList createToolsList_();
136
137protected slots:
138
140 void ok_();
142 void setTool_(int i);
146 void loadINI_();
148 void storeINI_();
150 void fastModeToggled_(bool checked);
151 };
152
153}
A GUI for editing or viewing a Param object.
Definition ParamEditor.h:152
Management and storage of parameters / INI files.
Definition Param.h:46
TOPP tool selection dialog.
Definition ToolsDialog.h:48
Param arg_param_
Param for loading the ini-file.
Definition ToolsDialog.h:98
Param gui_param_
Param containing only parameters shown/edited in the ParamEditor (GUI subset)
Definition ToolsDialog.h:102
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_.
QStringList createToolsList_()
Create a list of all TOPP tools/utils that are compatible with the active layer type.
QComboBox * output_combo_
for choosing an output parameter
Definition ToolsDialog.h:96
void disable_()
Disables the ok button and input/output comboboxes.
std::string getTool()
to get the currently selected tool-name
ToolsDialog(QWidget *parent, const Param &params, std::string ini_file, std::string default_dir, LayerDataBase::DataType layer_type, const std::string &layer_name)
Constructor.
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:112
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:104
LayerDataBase::DataType layer_type_
The layer type of the current layer to determine all usable tools.
Definition ToolsDialog.h:116
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.
QComboBox * input_combo_
for choosing an input parameter
Definition ToolsDialog.h:94
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:114
QLabel * tool_desc_
tools description label
Definition ToolsDialog.h:90
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:100
const int max_threads_
Maximum available thread count from OpenMP.
Definition ToolsDialog.h:88
void loadINI_()
loads an ini-file into the editor
~ToolsDialog() override
Destructor.
QPushButton * ok_button_
ok-button connected with slot ok_()
Definition ToolsDialog.h:106
std::string ini_file_
Location of the temporary INI file this dialog works on.
Definition ToolsDialog.h:108
std::string default_dir_
default-dir of ini-file to open
Definition ToolsDialog.h:110
void setTool_(int i)
Slot that handles changing of the tool.
void updateGUIParamFromSingleToolParam_()
Build GUI-only editor parameters from internal parameter state and update the editor with them.
QComboBox * tools_combo_
ComboBox for choosing a TOPP-tool.
Definition ToolsDialog.h:92
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
DataType
Definition LayerDataBase.h:74