OpenMS
GradientVisualizer.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 $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
14 //OpenMS
18 
19 //STL
20 #include <vector>
21 
22 class QIntValidator;
23 
24 namespace OpenMS
25 {
31  class OPENMS_GUI_DLLAPI GradientVisualizer :
32  public BaseVisualizerGUI,
33  public BaseVisualizer<Gradient>
34  {
35  Q_OBJECT
36 
37 public:
38 
40  GradientVisualizer(bool editable = false, QWidget * parent = nullptr);
41 
42  //Docu in base class
43  void load(Gradient & g);
44 
45 public slots:
46 
47  //Docu in base class
48  void store() override;
49 
50 protected slots:
51 
53  void addTimepoint_();
55  void addEluent_();
57  void deleteData_();
59  void undo_();
60 
61 protected:
63  void loadData_();
65  void removeData_();
66 
67 
74 
78  std::vector<String> eluents_;
79  std::vector<Int> timepoints_;
81 
85  QPushButton * add_eluent_button_;
86  QPushButton * add_timepoint_button_;
87  QPushButton * removebutton_;
89 
91  std::vector<QLineEdit *> gradientdata_;
92 
94  std::vector<QLabel *> gradientlabel_;
95 
98 
100  QIntValidator * timepoint_vali_;
101 
103  int nextrow_;
104 
106  QGridLayout * viewlayout_;
107 
108  //Docu in base class
109  void update_() override;
110  };
111 
112 
113 }
A base class for all visualizer classes.
Definition: BaseVisualizerGUI.h:40
A base class for all visualizer classes.
Definition: BaseVisualizer.h:28
GradientVisualizer is a visualizer class for objects of type gradient.
Definition: GradientVisualizer.h:34
std::vector< QLabel * > gradientlabel_
Array of temporary pointers to gradient labels.
Definition: GradientVisualizer.h:94
void load(Gradient &g)
GradientVisualizer(bool editable=false, QWidget *parent=nullptr)
Constructor.
void deleteData_()
Delete all data from gradient.
QPushButton * add_eluent_button_
Definition: GradientVisualizer.h:85
QIntValidator * timepoint_vali_
A validator to check the input for the new timepoint.
Definition: GradientVisualizer.h:100
void loadData_()
Loads a list of eluent, timepoint and percentage triplets.
void addTimepoint_()
Add new timepoint to the list.
QLineEdit * new_timepoint_
Definition: GradientVisualizer.h:72
int nextrow_
Counter to keep track of the actual row in the layout.
Definition: GradientVisualizer.h:103
QLineEdit * new_eluent_
Definition: GradientVisualizer.h:71
void undo_()
Undo the changes made in the GUI.
void update_() override
Updates the GUI from the temp_ variable.
QLineEdit * percentage_
Pointer to fields with actual data.
Definition: GradientVisualizer.h:97
void addEluent_()
Add new eluent to the list.
QGridLayout * viewlayout_
The layout to display the eluents, timepoints and percentages.
Definition: GradientVisualizer.h:106
std::vector< QLineEdit * > gradientdata_
Array of temporary pointers to gradient edit fields.
Definition: GradientVisualizer.h:91
QPushButton * removebutton_
Definition: GradientVisualizer.h:87
void removeData_()
Remove all data from layout.
QPushButton * add_timepoint_button_
Definition: GradientVisualizer.h:86
std::vector< Int > timepoints_
Definition: GradientVisualizer.h:79
std::vector< String > eluents_
Definition: GradientVisualizer.h:78
Representation of a HPLC gradient.
Definition: Gradient.h:27
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22