SpectraPac 2.0(r200)
Evaluates PAC Measurements
|
00001 /*************************************************************************** 00002 * Copyright (C) 2008-2010 by Matthias Nagl * 00003 * mnagl@uni-goettingen.de * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 #ifndef PACCALIBRATEDENERGYCONTAINER_H 00022 #define PACCALIBRATEDENERGYCONTAINER_H 00023 00024 #include "PacAbstractContainer.h" 00025 #include <QPointer> 00026 #include <QList> 00027 #include <QVector> 00028 #include <qwt_double_rect.h> 00029 #include "pacDefinitions.h" 00030 00031 class PacCalibratedEnergyInput; 00032 class PacCoincidenceInput; 00033 class PacCommonEnergyResult; 00034 class PacKnockoutSelector; 00035 class PacPlot; 00036 class QwtPlotCurve; 00037 class QwtPlotMarker; 00038 class QRadioButton; 00039 class QLabel; 00040 class QDoubleSpinBox; 00041 class QSpinBox; 00042 00048 class PacCalibratedEnergyContainer : public PacAbstractContainer 00049 { 00050 Q_OBJECT 00051 public: 00052 PacCalibratedEnergyContainer(const PacBasicMeasurementInfo *basicinfo, QObject *parent = 0); 00053 virtual ~PacCalibratedEnergyContainer(); 00054 00058 void reset(); 00059 00063 virtual void appendWidgets(QTabWidget *tabwidget, QWidget * filetoolbox); 00064 00065 signals: 00070 void receivedSpectrum(QWidget *w); 00071 00075 void coincidenceEvaluationRequested(PacCoincidenceInput *input); 00076 00077 public slots: 00078 void receiveSpectrum( 00079 const PacCalibratedEnergyInput * input, 00080 const PacCommonEnergyResult* beginning, 00081 const PacCommonEnergyResult* end 00082 ); 00083 00084 private slots: 00086 void startCoincidenceEvaluation(); 00087 void updateSpectrumPlot(); 00088 void setStartMin(double energy); 00089 void setStartMax(double energy); 00090 void setStopMin(double energy); 00091 void setStopMax(double energy); 00092 void selectMarker(QwtDoublePoint p); 00093 void applyNewMarkerPosition(QwtDoublePoint p); 00094 void openKnockoutDialog(); 00095 00096 protected: 00097 virtual void csvInputHeaderAndData(QTextStream &s) const; 00098 virtual void saveDataInDom(QDomElement &top) const; 00099 virtual void loadDataFromDom(const QDomElement &top); 00100 00101 private: 00102 QVector<qreal> spectrumCompleteAsDouble() const; 00103 void initRangeSelector(); 00104 00105 // results 00106 const PacCalibratedEnergyInput * input; 00107 const PacCommonEnergyResult *spectrumbeginning, *spectrumend; 00108 00109 // tmp variables 00110 mutable QVector<qreal> spectrumcomplete; 00111 00112 // widgets 00113 PacPlot * plot; 00114 QwtPlotCurve *curve; 00115 QwtPlotMarker *startminmarker, *startmaxmarker, *stopminmarker, *stopmaxmarker; 00116 QRadioButton *beginningwidget, *bothwidget, *endwidget; 00117 QLabel *infolabel; 00118 QSpinBox *channelswidget; 00119 QDoubleSpinBox *startminwidget, *startmaxwidget, *stopminwidget, *stopmaxwidget; 00120 QDoubleSpinBox *mintdiffwidget, *maxtdiffwidget; 00121 PacKnockoutSelector *knockoutselector; 00122 enum SelectedMarker { 00123 StartMin, 00124 StartMax, 00125 StopMin, 00126 StopMax 00127 } selectedmarker; 00128 }; 00129 00130 #endif // PACCALIBRATEDENERGYCONTAINER_H