SpectraPac 2.0(r200)
Evaluates PAC Measurements

PacCoincidenceContainer.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 PACCOINCIDENCECONTAINER_H
00022 #define PACCOINCIDENCECONTAINER_H
00023 
00024 #include "PacAbstractContainer.h"
00025 #include <QVector>
00026 #include <QList>
00027 #include <QSignalMapper>
00028 #include <QPointer>
00029 #include "PacCoincidenceSpectrum.h"
00030 #include "PacKnockoutSettings.h"
00031 #include "pacCoincidenceDefinitions.h"
00032 
00033 class QProgressBar;
00034 class PacCoincidenceSpectrum;
00035 class PacCoincidenceInput;
00036 class PacRTInput;
00037 class PacNewDataWatchdog;
00038 
00044 class PacCoincidenceContainer : public PacAbstractContainer
00045 {
00046   Q_OBJECT
00047 public:
00048     PacCoincidenceContainer(const PacBasicMeasurementInfo *basicinfo, QObject *parent = 0);
00049     virtual ~PacCoincidenceContainer();
00050 
00054     void reset();
00055 
00059     QVector<qreal> spectrumX() const;
00063     QVector<qreal> leftEdgeSpectrumX() const;
00064     const PacCoincidenceSpectrum * spectrum(quint8 startidx, quint8 stopidx) const;
00065 
00069     qreal channelLength() const;
00070 
00075     quint32 channelIdxOfTimeOrigin() const;
00076 
00081     qreal zeroOffset() const;
00086     qreal minCoincidenceLength() const;
00091     qreal maxCoincidenceLength() const;
00092 
00093     quint32 numberOfChannels() const;
00094 
00098     virtual void appendWidgets(QTabWidget *tabwidget, QWidget * filetoolbox);
00099 
00100     bool determinationMethodLock() const;
00101     bool t0FitCutterPositionLock() const;
00102     bool backgroundFitStartPositionLock() const;
00103 
00107     const PacCoincidenceInput * getInputObject() const;
00108 
00109 signals:
00114     void receivedSpectrum(QWidget *w);
00115     void determinationMethodLockChanged(bool locked);
00116     void t0FitCutterPositionLockChanged(bool locked);
00117     void backgroundFitStartPositionLockChanged(bool locked);
00118     void rTUpdateRequired(const PacRTInput *input);
00119 
00120 public slots:
00124     void receiveSpectra(
00125         const PacCoincidenceInput * input,
00126         const PacCoincidenceSearchResults &results,
00127         bool addendum,
00128         bool stillwritten,
00129         quint64 nextcppointerpos
00130         );
00131 
00135     void setDeterminationMethodForAll(Pac::ParameterDeterminationMethod method);
00136     void setDeterminationMethodLock(bool locked);
00137     void setT0FitCutterPositionForAll(double newpercent);
00138     void setT0FitCutterPositionLock(bool locked);
00139     void setBackgroundFitStartPositionForAll(double newstarttime, bool refit = true);
00140     void setBackgroundFitStartPositionLock(bool locked);
00141     void openParameterDialog();
00142     void updateRTSpectrum();
00143     void deactivateWatchdog();
00144 
00145 private slots:
00151     void showSelectedSpectrum(int id);
00152 
00156     void reFit();
00157 
00161     void toggleWatchdog(bool state);
00162 
00163 protected:
00164     virtual void csvInputHeaderAndData(QTextStream &s) const;
00165     virtual void saveDataInDom(QDomElement &top) const;
00166     virtual void loadDataFromDom(const QDomElement &top);
00167 
00168 private:
00169     void createSpectrumSelectionWidget();
00170     void swapSingleChildWidget(QWidget *parent, QWidget *newchild, bool deleteold = false);
00171 
00172     const PacCoincidenceInput * input;
00173     QList< QList< PacCoincidenceSpectrum* > > spectra;
00174     PacNewDataWatchdog *watchdog;
00175     bool stillwritten;
00176 
00178 
00179     PacCoincidenceSpectrum *currentspectrum;
00180     bool determinationmethodlocked;
00181     bool t0fitcutterpositionlocked;
00182     bool backgroundfitstartpositionlocked;
00184 
00186 
00187     QWidget *plotwidget, *controlwidget;
00188     QFrame *spectrumselectionwidget;
00189     QPointer<QDialog> parameterdialog;
00190     QSignalMapper spectrumselectionmapper;
00191     QGroupBox *watchdoggroupbox;
00192     QProgressBar *watchdogindicator;
00193     QToolButton *watchdogbutton;
00195 
00197 
00198     mutable QVector<qreal> spectX; 
00199     mutable QVector<qreal> leftSpectX; 
00200 
00201 };
00202 
00203 #endif // PACCOINCIDENCECONTAINER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines