1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
9
// This library is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU Lesser General Public
11
// License as published by the Free Software Foundation; either
12
// version 2.1 of the License, or (at your option) any later version.
14
// this library is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
// Lesser General Public License for more details.
19
// You should have received a copy of the GNU Lesser General Public
20
// License along with this library; if not, write to the Free Software
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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-2013.
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.
23
30
// --------------------------------------------------------------------------
24
31
// $Maintainer: Timo Sachsenberg $
42
MassAnalyzerVisualizer::MassAnalyzerVisualizer(bool editable, QWidget* parent)
43
: BaseVisualizerGUI(editable, parent),
44
BaseVisualizer<MassAnalyzer>()
46
addLabel_("Modify massanalyzer information.");
49
addIntLineEdit_(order_, "Order" );
50
addComboBox_(type_, "Type");
51
addComboBox_(res_method_, "Resolution method");
52
addComboBox_(res_type_, "Resolution type");
53
addComboBox_(scan_dir_, "Scan direction");
54
addComboBox_(scan_law_, "Scan law");
55
addComboBox_(reflectron_state_, "Reflectron state");
57
addDoubleLineEdit_(res_, "Resolution" );
58
addDoubleLineEdit_(acc_, "Accuracy" );
59
addDoubleLineEdit_(scan_rate_, "Scan rate (in s)" );
60
addDoubleLineEdit_(scan_time_, "Scan time (in s)" );
61
addDoubleLineEdit_(TOF_, "TOF Total path length (in meter)" );
62
addDoubleLineEdit_(iso_, "Isolation width (in m/z)" );
63
addDoubleLineEdit_(final_MS_, "Final MS exponent" );
64
addDoubleLineEdit_(magnetic_fs_, "Magnetic field strength (in T)" );
69
void MassAnalyzerVisualizer::update_()
73
fillComboBox_(type_,& temp_.NamesOfAnalyzerType[temp_.getType()] , 1);
74
fillComboBox_(res_method_,& temp_.NamesOfResolutionMethod[temp_.getResolutionMethod()] , 1);
75
fillComboBox_(res_type_,& temp_.NamesOfResolutionType[temp_.getResolutionType()] , 1);
76
fillComboBox_(scan_dir_,& temp_.NamesOfScanDirection[temp_.getScanDirection()] , 1);
77
fillComboBox_(scan_law_,& temp_.NamesOfScanLaw[temp_.getScanLaw()] , 1);
78
fillComboBox_(reflectron_state_,& temp_.NamesOfReflectronState[temp_.getReflectronState()] , 1);
82
fillComboBox_(type_, temp_.NamesOfAnalyzerType , MassAnalyzer::SIZE_OF_ANALYZERTYPE);
83
fillComboBox_(res_method_, temp_.NamesOfResolutionMethod , MassAnalyzer::SIZE_OF_RESOLUTIONMETHOD);
84
fillComboBox_(res_type_, temp_.NamesOfResolutionType , MassAnalyzer::SIZE_OF_RESOLUTIONTYPE);
85
fillComboBox_(scan_dir_, temp_.NamesOfScanDirection , MassAnalyzer::SIZE_OF_SCANDIRECTION);
86
fillComboBox_(scan_law_, temp_.NamesOfScanLaw , MassAnalyzer::SIZE_OF_SCANLAW);
87
fillComboBox_(reflectron_state_, temp_.NamesOfReflectronState , MassAnalyzer::SIZE_OF_REFLECTRONSTATE);
89
type_->setCurrentIndex(temp_.getType());
90
res_method_->setCurrentIndex(temp_.getResolutionMethod());
91
res_type_->setCurrentIndex(temp_.getResolutionType());
92
scan_dir_->setCurrentIndex(temp_.getScanDirection());
93
scan_law_->setCurrentIndex(temp_.getScanLaw());
94
reflectron_state_->setCurrentIndex(temp_.getReflectronState());
97
order_->setText(String(temp_.getOrder()).c_str());
98
res_->setText(String( temp_.getResolution() ).c_str());
99
acc_->setText(String( temp_.getAccuracy() ).c_str());
100
scan_rate_->setText(String( temp_.getScanRate() ).c_str());
101
scan_time_->setText(String( temp_.getScanTime() ).c_str());
102
TOF_->setText(String( temp_.getTOFTotalPathLength() ).c_str());
103
iso_->setText(String( temp_.getIsolationWidth() ).c_str());
104
final_MS_->setText(String( temp_.getFinalMSExponent() ).c_str());
105
magnetic_fs_->setText(String( temp_.getMagneticFieldStrength() ).c_str());
108
void MassAnalyzerVisualizer::store()
110
ptr_->setOrder(order_->text().toInt());
111
ptr_->setType((MassAnalyzer::AnalyzerType)type_->currentIndex());
112
ptr_->setResolutionMethod((MassAnalyzer::ResolutionMethod)res_method_->currentIndex());
113
ptr_->setResolutionType((MassAnalyzer::ResolutionType)res_type_->currentIndex());
114
ptr_->setScanDirection((MassAnalyzer::ScanDirection)scan_dir_->currentIndex());
115
ptr_->setScanLaw((MassAnalyzer::ScanLaw)scan_law_->currentIndex());
116
ptr_->setReflectronState((MassAnalyzer::ReflectronState)reflectron_state_->currentIndex());
118
ptr_->setResolution(res_->text().toDouble());
119
ptr_->setAccuracy(acc_->text().toDouble());
120
ptr_->setScanRate(scan_rate_->text().toDouble());
121
ptr_->setScanTime(scan_time_->text().toDouble());
122
ptr_->setTOFTotalPathLength(TOF_->text().toDouble());
123
ptr_->setIsolationWidth(iso_->text().toDouble());
124
ptr_->setFinalMSExponent(final_MS_->text().toInt());
125
ptr_->setMagneticFieldStrength(magnetic_fs_->text().toDouble() );
130
void MassAnalyzerVisualizer::undo_()
49
MassAnalyzerVisualizer::MassAnalyzerVisualizer(bool editable, QWidget * parent) :
50
BaseVisualizerGUI(editable, parent),
51
BaseVisualizer<MassAnalyzer>()
53
addLabel_("Modify massanalyzer information.");
56
addIntLineEdit_(order_, "Order");
57
addComboBox_(type_, "Type");
58
addComboBox_(res_method_, "Resolution method");
59
addComboBox_(res_type_, "Resolution type");
60
addComboBox_(scan_dir_, "Scan direction");
61
addComboBox_(scan_law_, "Scan law");
62
addComboBox_(reflectron_state_, "Reflectron state");
64
addDoubleLineEdit_(res_, "Resolution");
65
addDoubleLineEdit_(acc_, "Accuracy");
66
addDoubleLineEdit_(scan_rate_, "Scan rate (in s)");
67
addDoubleLineEdit_(scan_time_, "Scan time (in s)");
68
addDoubleLineEdit_(TOF_, "TOF Total path length (in meter)");
69
addDoubleLineEdit_(iso_, "Isolation width (in m/z)");
70
addDoubleLineEdit_(final_MS_, "Final MS exponent");
71
addDoubleLineEdit_(magnetic_fs_, "Magnetic field strength (in T)");
76
void MassAnalyzerVisualizer::update_()
80
fillComboBox_(type_, &temp_.NamesOfAnalyzerType[temp_.getType()], 1);
81
fillComboBox_(res_method_, &temp_.NamesOfResolutionMethod[temp_.getResolutionMethod()], 1);
82
fillComboBox_(res_type_, &temp_.NamesOfResolutionType[temp_.getResolutionType()], 1);
83
fillComboBox_(scan_dir_, &temp_.NamesOfScanDirection[temp_.getScanDirection()], 1);
84
fillComboBox_(scan_law_, &temp_.NamesOfScanLaw[temp_.getScanLaw()], 1);
85
fillComboBox_(reflectron_state_, &temp_.NamesOfReflectronState[temp_.getReflectronState()], 1);
89
fillComboBox_(type_, temp_.NamesOfAnalyzerType, MassAnalyzer::SIZE_OF_ANALYZERTYPE);
90
fillComboBox_(res_method_, temp_.NamesOfResolutionMethod, MassAnalyzer::SIZE_OF_RESOLUTIONMETHOD);
91
fillComboBox_(res_type_, temp_.NamesOfResolutionType, MassAnalyzer::SIZE_OF_RESOLUTIONTYPE);
92
fillComboBox_(scan_dir_, temp_.NamesOfScanDirection, MassAnalyzer::SIZE_OF_SCANDIRECTION);
93
fillComboBox_(scan_law_, temp_.NamesOfScanLaw, MassAnalyzer::SIZE_OF_SCANLAW);
94
fillComboBox_(reflectron_state_, temp_.NamesOfReflectronState, MassAnalyzer::SIZE_OF_REFLECTRONSTATE);
96
type_->setCurrentIndex(temp_.getType());
97
res_method_->setCurrentIndex(temp_.getResolutionMethod());
98
res_type_->setCurrentIndex(temp_.getResolutionType());
99
scan_dir_->setCurrentIndex(temp_.getScanDirection());
100
scan_law_->setCurrentIndex(temp_.getScanLaw());
101
reflectron_state_->setCurrentIndex(temp_.getReflectronState());
104
order_->setText(String(temp_.getOrder()).c_str());
105
res_->setText(String(temp_.getResolution()).c_str());
106
acc_->setText(String(temp_.getAccuracy()).c_str());
107
scan_rate_->setText(String(temp_.getScanRate()).c_str());
108
scan_time_->setText(String(temp_.getScanTime()).c_str());
109
TOF_->setText(String(temp_.getTOFTotalPathLength()).c_str());
110
iso_->setText(String(temp_.getIsolationWidth()).c_str());
111
final_MS_->setText(String(temp_.getFinalMSExponent()).c_str());
112
magnetic_fs_->setText(String(temp_.getMagneticFieldStrength()).c_str());
115
void MassAnalyzerVisualizer::store()
117
ptr_->setOrder(order_->text().toInt());
118
ptr_->setType((MassAnalyzer::AnalyzerType)type_->currentIndex());
119
ptr_->setResolutionMethod((MassAnalyzer::ResolutionMethod)res_method_->currentIndex());
120
ptr_->setResolutionType((MassAnalyzer::ResolutionType)res_type_->currentIndex());
121
ptr_->setScanDirection((MassAnalyzer::ScanDirection)scan_dir_->currentIndex());
122
ptr_->setScanLaw((MassAnalyzer::ScanLaw)scan_law_->currentIndex());
123
ptr_->setReflectronState((MassAnalyzer::ReflectronState)reflectron_state_->currentIndex());
125
ptr_->setResolution(res_->text().toDouble());
126
ptr_->setAccuracy(acc_->text().toDouble());
127
ptr_->setScanRate(scan_rate_->text().toDouble());
128
ptr_->setScanTime(scan_time_->text().toDouble());
129
ptr_->setTOFTotalPathLength(TOF_->text().toDouble());
130
ptr_->setIsolationWidth(iso_->text().toDouble());
131
ptr_->setFinalMSExponent(final_MS_->text().toInt());
132
ptr_->setMagneticFieldStrength(magnetic_fs_->text().toDouble());
137
void MassAnalyzerVisualizer::undo_()