OpenMS  3.0.0
TheoreticalSpectrumGenerationDialog.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-2022.
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: Timo Sachsenberg $
32 // $Authors: Marc Sturm, Tom Waschischeck $
33 // --------------------------------------------------------------------------
34 
35 
36 #pragma once
37 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
38 
39 #include <QtWidgets/QDialog>
40 #include <QtWidgets/qspinbox.h>
41 #include <QtWidgets/qlabel.h>
42 
46 
47 #include <array>
48 
49 namespace Ui
50 {
51  class TheoreticalSpectrumGenerationDialogTemplate;
52 }
53 
54 class QListWidgetItem;
55 
56 namespace OpenMS
57 {
58  class TestTSGDialog; // fwd declaring test class
59 
61  enum class CheckBoxState
62  {
63  HIDDEN,
64  ENABLED,
65  PRECHECKED
66  };
67 
73  class OPENMS_GUI_DLLAPI TheoreticalSpectrumGenerationDialog :
74  public QDialog
75  {
76  Q_OBJECT
77 
78  public:
80  struct CheckBox {
82  CheckBox(QDoubleSpinBox** sb, QLabel** l, std::array<CheckBoxState, 3> s, std::pair<String, String> p_t, std::pair<String, String> p_s);
83 
85  QDoubleSpinBox** ptr_to_spin_box;
86 
89 
91  const std::array<CheckBoxState, 3> state;
92 
94  const std::pair<String, String> param_this;
95 
97  const std::pair<String, String> param_spin;
98  };
99 
101  enum class SequenceType
102  {
103  PEPTIDE,
104  RNA,
105  METABOLITE
106  };
107 
108  friend class TestTSGDialog; // to test the GUI expressed in the private member ui
109 
114 
116  const MSSpectrum& getSpectrum() const;
117 
119  const String getSequence() const;
120 
121 protected slots:
122 
124  void modelChanged_();
126  void seqTypeSwitch_();
128  void listWidgetItemClicked_(QListWidgetItem* item);
130  void calculateSpectrum_();
131 
132 protected:
133 
134 private:
136  Param getParam_() const;
137 
140  void updateIonTypes_();
141 
143  Ui::TheoreticalSpectrumGenerationDialogTemplate* ui_;
144 
147 
151  const std::array<CheckBox, 12> check_boxes_;
152 
155  };
156 
157 }
OpenMS::CheckBoxState
CheckBoxState
state of an ion (and its intensity)
Definition: TheoreticalSpectrumGenerationDialog.h:61
OpenMS::TheoreticalSpectrumGenerationDialog::CheckBox::param_spin
const std::pair< String, String > param_spin
parameter with description of the ion intensity
Definition: TheoreticalSpectrumGenerationDialog.h:97
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::CheckBoxState::ENABLED
check box enabled (visible, but not checked)
QDialog
OpenMS::TheoreticalSpectrumGenerationDialog::CheckBox::ptr_to_spin_box
QDoubleSpinBox ** ptr_to_spin_box
pointer to the corresponding ion intensity spin box
Definition: TheoreticalSpectrumGenerationDialog.h:85
OpenMS::TheoreticalSpectrumGenerationDialog::seq_type_
SequenceType seq_type_
save current sequence setting
Definition: TheoreticalSpectrumGenerationDialog.h:146
OpenMS::TheoreticalSpectrumGenerationDialog::CheckBox::ptr_to_spin_label
QLabel ** ptr_to_spin_label
pointer to the label of the spin box
Definition: TheoreticalSpectrumGenerationDialog.h:88
OpenMS::TheoreticalSpectrumGenerationDialog::CheckBox::param_this
const std::pair< String, String > param_this
parameter with description of this ion
Definition: TheoreticalSpectrumGenerationDialog.h:94
OpenMS::TheoreticalSpectrumGenerationDialog::check_boxes_
const std::array< CheckBox, 12 > check_boxes_
Definition: TheoreticalSpectrumGenerationDialog.h:151
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::TheoreticalSpectrumGenerationDialog::CheckBox
struct for all information about a check box of an ion
Definition: TheoreticalSpectrumGenerationDialog.h:80
Ui
Definition: SwathWizardBase.h:62
OpenMS::CheckBoxState::HIDDEN
check box hidden (invisible)
OpenMS::TheoreticalSpectrumGenerationDialog::ui_
Ui::TheoreticalSpectrumGenerationDialogTemplate * ui_
UI.
Definition: TheoreticalSpectrumGenerationDialog.h:143
Param.h
OpenMS::CheckBoxState::PRECHECKED
check box enabled and checked by default
OpenMS::IdentificationDataInternal::RNA
Definition: MetaData.h:69
OpenMS::TheoreticalSpectrumGenerationDialog::CheckBox::state
const std::array< CheckBoxState, 3 > state
State of this check box depending on sequence type ("Peptide", "RNA", "Metabolite")
Definition: TheoreticalSpectrumGenerationDialog.h:91
String.h
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::TheoreticalSpectrumGenerationDialog
Dialog which allows to enter an AA or NA sequence and generates a theoretical spectrum for it.
Definition: TheoreticalSpectrumGenerationDialog.h:73
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
OpenMS::TheoreticalSpectrumGenerationDialog::SequenceType
SequenceType
type of the input sequence (corresponds to the value of the combo box 'ui_->seq_type')
Definition: TheoreticalSpectrumGenerationDialog.h:101
OpenMS::TheoreticalSpectrumGenerationDialog::spec_
MSSpectrum spec_
member to save the calculated spectrum to
Definition: TheoreticalSpectrumGenerationDialog.h:154
MSSpectrum.h