OpenMS  2.6.0
SwathTabWidget.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Chris Bielow $
32 // $Authors: Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // OpenMS_GUI config
38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
39 
43 
44 #include <QTabWidget>
45 
46 #include <vector>
47 #include <utility> // for std::pair
48 
49 namespace Ui
50 {
51  class SwathTabWidget;
52 }
53 
54 namespace OpenMS
55 {
56  class InputFile;
57  class OutputDirectory;
58  class ParamEditor;
59 
60 
61  namespace Internal
62  {
63  class SwathTabWidget;
64 
68  class GUILock
69  {
70  public:
71  GUILock(SwathTabWidget* stw);
72 
73  ~GUILock();
74  private:
78  };
79 
81  class OPENMS_GUI_DLLAPI SwathTabWidget : public QTabWidget
82  {
83  Q_OBJECT
84 
85  public:
86  friend class GUILock;
87 
88  explicit SwathTabWidget(QWidget *parent = nullptr);
89  ~SwathTabWidget();
90 
91  StringList getMzMLInputFiles() const;
92 
93  private slots:
94  void on_run_swath_clicked();
95  void on_edit_advanced_parameters_clicked();
97  void broadcastNewCWD_(const QString& new_cwd);
98 
99 
100  void on_btn_runPyProphet_clicked();
101 
102  void on_btn_pyresults_clicked();
103 
104  private:
107  bool findPythonScript_(const String& path_to_python_exe, String& script_name);
108 
110  void updateSwathParamFromWidgets_();
111 
113  void updateWidgetsfromSwathParam_();
114 
116  QString getCurrentOutDir_() const;
117 
120  std::vector<std::pair<String, bool>> getPyProphetInputFiles() const;
121 
123  void checkPyProphetInput_();
124 
126 
127 
131  void writeLog_(const QString& text, const QColor& color = "#000000", bool new_section = false);
133  void writeLog_(const String& text, const QColor& color = "#000000", bool new_section = false);
134 
137  bool checkOSWInputReady_();
138 
139  Ui::SwathTabWidget *ui;
142 
145  };
146 
147  }
148 } // ns OpenMS
149 
150 // this is required to allow Ui_SwathTabWidget (auto UIC'd from .ui) to have a InputFile member
OpenMS::Internal::SwathTabWidget::osw_result_files_
StringList osw_result_files_
list of .osw files produced by OSW which are currently available
Definition: SwathTabWidget.h:143
OutputDirectory
OpenMS::OutputDirectory OutputDirectory
Definition: SwathTabWidget.h:152
OpenMS::OutputDirectory
A simple widget with a line-edit and a browse button to choose filenames.
Definition: OutputDirectory.h:55
OpenMS::String
A more convenient string class.
Definition: String.h:59
InputFile
OpenMS::InputFile InputFile
Definition: SwathTabWidget.h:151
QWidget
QTabWidget
OpenMS::Internal::SwathTabWidget::swath_param_wizard_
Param swath_param_wizard_
small selection of important parameters which the user can directly change in the Wizard
Definition: SwathTabWidget.h:141
OpenMS::Internal::GUILock::old_
QWidget * old_
Definition: SwathTabWidget.h:76
OpenMS::Internal::GUILock::~GUILock
~GUILock()
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
ExternalProcessMBox.h
Ui
Definition: SwathWizardBase.h:62
Param.h
OpenMS::Internal::GUILock::GUILock
GUILock(SwathTabWidget *stw)
OpenMS::Internal::GUILock
RAII class to switch to certain TabWidget, disable the GUI and go back to the orignal Tab when this c...
Definition: SwathTabWidget.h:68
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::Internal::SwathTabWidget::ui
Ui::SwathTabWidget * ui
Definition: SwathTabWidget.h:139
OpenMS::Internal::SwathTabWidget::ep_
ExternalProcessMBox ep_
to run external programs and pipe their output into our log
Definition: SwathTabWidget.h:144
OpenMS::Internal::SwathTabWidget::swath_param_
Param swath_param_
the global Swath parameters which will be passed to OpenSwathWorkflow.exe, once updated with paramete...
Definition: SwathTabWidget.h:140
OpenMS::ExternalProcessMBox
A wrapper around ExternalProcess to conveniently show a MessageBox when an error occurs.
Definition: ExternalProcessMBox.h:54
ParamEditor
OpenMS::ParamEditor ParamEditor
Definition: SwathTabWidget.h:153
OpenMS::ParamEditor
A GUI for editing or viewing a Param object.
Definition: ParamEditor.h:176
String.h
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:73
OpenMS::InputFile
A simple widget with a line-edit and a browse button to choose filenames.
Definition: InputFile.h:55
OpenMS::Internal::GUILock::was_enabled_
bool was_enabled_
Definition: SwathTabWidget.h:77
OpenMS::Internal::SwathTabWidget
A multi-tabbed widget for the SwathWizard offering setting of parameters, input-file specification an...
Definition: SwathTabWidget.h:81
OpenMS::Internal::GUILock::stw_
SwathTabWidget * stw_
Definition: SwathTabWidget.h:75