OpenMS
TheoreticalSpectrumGenerationDialog.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Marc Sturm, Tom Waschischeck $
7 // --------------------------------------------------------------------------
8 
9 
10 #pragma once
11 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
12 
13 #include <QtWidgets/QDialog>
14 #include <QtWidgets/qspinbox.h>
15 #include <QtWidgets/qlabel.h>
16 
20 
21 #include <array>
22 
23 namespace Ui
24 {
25  class TheoreticalSpectrumGenerationDialogTemplate;
26 }
27 
28 class QListWidgetItem;
29 
30 namespace OpenMS
31 {
32  class TestTSGDialog; // fwd declaring test class
33 
35  enum class CheckBoxState
36  {
37  HIDDEN,
38  ENABLED,
39  PRECHECKED
40  };
41 
47  class OPENMS_GUI_DLLAPI TheoreticalSpectrumGenerationDialog :
48  public QDialog
49  {
50  Q_OBJECT
51 
52  public:
54  struct CheckBox {
56  CheckBox(QDoubleSpinBox** sb, QLabel** l, std::array<CheckBoxState, 3> s, std::pair<String, String> p_t, std::pair<String, String> p_s);
57 
59  QDoubleSpinBox** ptr_to_spin_box;
60 
63 
65  const std::array<CheckBoxState, 3> state;
66 
68  const std::pair<String, String> param_this;
69 
71  const std::pair<String, String> param_spin;
72  };
73 
75  enum class SequenceType
76  {
77  PEPTIDE,
78  RNA,
79  METABOLITE
80  };
81 
82  friend class TestTSGDialog; // to test the GUI expressed in the private member ui
83 
88 
90  const MSSpectrum& getSpectrum() const;
91 
93  const String getSequence() const;
94 
95 protected slots:
96 
98  void modelChanged_();
102  void listWidgetItemClicked_(QListWidgetItem* item);
105 
106 protected:
107 
108 private:
110  Param getParam_() const;
111 
115 
117  Ui::TheoreticalSpectrumGenerationDialogTemplate* ui_;
118 
121 
125  const std::array<CheckBox, 12> check_boxes_;
126 
129  };
130 
131 }
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Management and storage of parameters / INI files.
Definition: Param.h:44
A more convenient string class.
Definition: String.h:34
Dialog which allows to enter an AA or NA sequence and generates a theoretical spectrum for it.
Definition: TheoreticalSpectrumGenerationDialog.h:49
Ui::TheoreticalSpectrumGenerationDialogTemplate * ui_
UI.
Definition: TheoreticalSpectrumGenerationDialog.h:117
SequenceType
type of the input sequence (corresponds to the value of the combo box 'ui_->seq_type')
Definition: TheoreticalSpectrumGenerationDialog.h:76
const MSSpectrum & getSpectrum() const
returns the calculated spectrum
const std::array< CheckBox, 12 > check_boxes_
Definition: TheoreticalSpectrumGenerationDialog.h:125
SequenceType seq_type_
save current sequence setting
Definition: TheoreticalSpectrumGenerationDialog.h:120
void seqTypeSwitch_()
for sequence type changes (combo box)
void calculateSpectrum_()
calculates the spectrum
void listWidgetItemClicked_(QListWidgetItem *item)
change check state of check box on widget click
void modelChanged_()
for isotope model changes
~TheoreticalSpectrumGenerationDialog() override
Destructor.
MSSpectrum spec_
member to save the calculated spectrum to
Definition: TheoreticalSpectrumGenerationDialog.h:128
Param getParam_() const
calculate parameters from UI elements
const String getSequence() const
returns the input sequence (is public for TOPPView)
@ RNA
Definition: MetaData.h:43
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
CheckBoxState
state of an ion (and its intensity)
Definition: TheoreticalSpectrumGenerationDialog.h:36
@ HIDDEN
check box hidden (invisible)
@ PRECHECKED
check box enabled and checked by default
@ ENABLED
check box enabled (visible, but not checked)
Definition: FLASHDeconvWizardBase.h:37
struct for all information about a check box of an ion
Definition: TheoreticalSpectrumGenerationDialog.h:54
QDoubleSpinBox ** ptr_to_spin_box
pointer to the corresponding ion intensity spin box
Definition: TheoreticalSpectrumGenerationDialog.h:59
CheckBox(QDoubleSpinBox **sb, QLabel **l, std::array< CheckBoxState, 3 > s, std::pair< String, String > p_t, std::pair< String, String > p_s)
Constructor.
QLabel ** ptr_to_spin_label
pointer to the label of the spin box
Definition: TheoreticalSpectrumGenerationDialog.h:62
const std::pair< String, String > param_this
parameter with description of this ion
Definition: TheoreticalSpectrumGenerationDialog.h:68
const std::pair< String, String > param_spin
parameter with description of the ion intensity
Definition: TheoreticalSpectrumGenerationDialog.h:71
const std::array< CheckBoxState, 3 > state
State of this check box depending on sequence type ("Peptide", "RNA", "Metabolite")
Definition: TheoreticalSpectrumGenerationDialog.h:65