SpectraPac 2.0(r200)
Evaluates PAC Measurements

PacRTContainer.h

Go to the documentation of this file.
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 PACRTCONTAINER_H
00022 #define PACRTCONTAINER_H
00023 
00024 #include "PacAbstractContainer.h"
00025 #include <QPointer>
00026 #include <QWidget>
00027 #include "pacDefinitions.h"
00028 
00029 class QPushButton;
00030 class QLabel;
00031 class PacRTInput;
00032 class PacPlotErrorCurve;
00033 class FourierComponent;
00034 class PacPlot;
00035 class QwtPlotCurve;
00036 
00042 class PacRTContainer : public PacAbstractContainer
00043 {
00044   Q_OBJECT
00045 public:
00046     explicit PacRTContainer(const PacBasicMeasurementInfo *basicinfo, QObject *parent = 0);
00047     virtual ~PacRTContainer();
00048 
00052     void resetSpectrum();
00053 
00057     virtual void appendWidgets(QTabWidget *tabwidget, QWidget * filetoolbox);
00058 
00059 signals:
00060 
00061 public slots:
00062     void receiveSpectrum(
00063         const PacRTInput * input
00064     );
00065 
00066 private slots:
00067     void updatePlot();
00068     void exportAsTRN();
00069 
00070 protected:
00071     virtual void csvInputHeaderAndData(QTextStream &s) const;
00072     virtual void saveDataInDom(QDomElement &top) const;
00073     virtual void loadDataFromDom(const QDomElement &top);
00074 
00075 private:
00081     qreal nanosecondsToChannelDifference(qreal ns) const;
00082 
00083     qreal channelDifferenceToNanoseconds(qreal channels) const;
00084 
00089     quint32 channelIdxOfTimeOrigin() const;
00090 
00094     qreal timeOfChannelCenter(quint32 channel) const;
00095 
00099     qreal channelLength() const;
00100 
00101     QVector<qreal> xValues() const;
00102 
00106     qreal timeResolutionAverage() const;
00110     qreal timeResoltionStdDeviation() const;
00111 
00112     // results
00113     const PacRTInput * input;
00114     QVector<qreal> rt;
00115     QVector<qreal> errors;
00116     qreal tmin, tmax;
00117 
00118     // tmp
00119     mutable QVector<qreal> xvals;
00120     QVector<qreal> xdisplay, rtdisplay, lowererrorsdisplay, uppererrorsdisplay;
00121     qreal minlowererrorsdisplay, maxuppererrorsdisplay;
00122     mutable qreal timeresavg, timeresstd;
00123 
00124     // widgets
00125     PacPlot * plot;
00126     QwtPlotCurve *rtcurve;
00127     PacPlotErrorCurve *errorcurve;
00128     QPushButton *errorbarstyle;
00129     QPushButton *inversion;
00130     QPointer<QWidget> fourier;
00131     FourierComponent *fc;
00132     QLabel *timeres;
00133 };
00134 
00135 #endif // PACRTCONTAINER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines