1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copymain (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
23
// --------------------------------------------------------------------------
24
// $Maintainer: Timo Sachsenberg $
25
// $Authors: Marc Sturm $
26
// --------------------------------------------------------------------------s
28
#include <OpenMS/VISUAL/VISUALIZER/InstrumentSettingsVisualizer.h>
31
#include <QtGui/QLineEdit>
32
#include <QtGui/QComboBox>
42
InstrumentSettingsVisualizer::InstrumentSettingsVisualizer(bool editable, QWidget* parent)
43
: BaseVisualizerGUI(editable, parent),
44
BaseVisualizer<InstrumentSettings>()
46
addLabel_("Modify the settings of the instrument.");
48
addComboBox_(instrumentsettings_scan_mode_, "Scan mode");
49
addBooleanComboBox_(zoom_scan_,"Zoom scan");
50
addComboBox_(instrumentsettings_polarity_, "Polarity");
55
void InstrumentSettingsVisualizer::update_()
59
fillComboBox_(instrumentsettings_scan_mode_,& temp_.NamesOfScanMode[temp_.getScanMode()] , 1);
60
fillComboBox_(instrumentsettings_polarity_,& IonSource::NamesOfPolarity[temp_.getPolarity()] , 1);
65
fillComboBox_(instrumentsettings_scan_mode_, InstrumentSettings::NamesOfScanMode , InstrumentSettings::SIZE_OF_SCANMODE);
66
fillComboBox_(instrumentsettings_polarity_, IonSource::NamesOfPolarity , IonSource::SIZE_OF_POLARITY);
69
instrumentsettings_scan_mode_->setCurrentIndex(temp_.getScanMode());
70
zoom_scan_->setCurrentIndex(temp_.getZoomScan());
71
instrumentsettings_polarity_->setCurrentIndex(temp_.getPolarity());
75
void InstrumentSettingsVisualizer::store()
77
ptr_->setScanMode((InstrumentSettings::ScanMode)instrumentsettings_scan_mode_->currentIndex());
78
ptr_->setZoomScan(zoom_scan_->currentIndex());
79
ptr_->setPolarity((IonSource::Polarity)instrumentsettings_polarity_->currentIndex());
84
void InstrumentSettingsVisualizer::undo_()