Diana Software
QGuiCalibrationWindow.cc
Go to the documentation of this file.
2 #include <sstream>
3 #include <string>
4 #include <vector>
5 
6 using std::endl;
7 using std::string;
8 using std::stringstream;
9 using std::vector;
10 
12 {
13 }
14 
16 {
17 }
18 
19 void QGuiCalibrationWindow::AddPeak(const double energy)
20 {
21  fEnergies.push_back(energy);
22 }
23 
25 {
26  stringstream calWindowDump;
27  calWindowDump << CALIBRATION_WINDOW_KEY << endl;
28  if (fOutputFilename != "") {
29  calWindowDump << CALIBRATION_OUTPUT_FILENAME_KEY << " "
31  << endl;
32  }
33  for ( vector<double>::const_iterator iter = fEnergies.begin();
34  iter != fEnergies.end();
35  ++iter ) {
36  calWindowDump << PEAK_KEY << " " << *iter << endl;
37  }
38  return calWindowDump.str();
39 }
#define PEAK_KEY
#define CALIBRATION_OUTPUT_FILENAME_KEY
#define CALIBRATION_WINDOW_KEY
virtual ~QGuiCalibrationWindow()
Destructor.
std::vector< double > fEnergies
Peak energies.
std::string Dump() const
Dump to string to write session file.
void AddPeak(const double energy)
Add peak energy.
QGuiCalibrationWindow()
Default constructor.
std::string fOutputFilename
Output filename.
Base class for GUI session objects like histograms and scatter plots.