SpectraPac 2.0(r200)
Evaluates PAC Measurements

PacEnergyContainer.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 PACENERGYCONTAINER_H
00022 #define PACENERGYCONTAINER_H
00023 
00024 #include "PacAbstractContainer.h"
00025 #include <QPointer>
00026 #include <QWidget>
00027 #include <QHash>
00028 #include "pacDefinitions.h"
00029 
00030 class PacEnergyInput;
00031 class PacCalibratedEnergyInput;
00032 class PacEnergySpectrum;
00033 class PacCommonEnergyResult;
00034 class QListWidget;
00035 class QListWidgetItem;
00036 class QDoubleSpinBox;
00037 class QToolButton;
00038 class QRadioButton;
00039 
00045 class PacEnergyContainer : public PacAbstractContainer
00046 {
00047   Q_OBJECT
00048 public:
00049     PacEnergyContainer(const PacBasicMeasurementInfo *basicinfo, QObject *parent = 0);
00050     virtual ~PacEnergyContainer();
00051 
00055     void reset();
00056 
00060     virtual void appendWidgets(QTabWidget *tabwidget, QWidget * filetoolbox);
00061 
00062     Pac::ReadoutRange selectedDisplayRange() const;
00063 
00064 signals:
00068     void newDisplayRangeSelected(Pac::ReadoutRange range);
00069 
00074     void receivedSpectra(QWidget *w);
00075 
00079     void calibratedEnergyEvaluationRequested(PacCalibratedEnergyInput *input);
00080 
00081 public slots:
00082     void receiveSpectra(
00083         const PacEnergyInput *input,
00084         const QList <PacCommonEnergyResult*> *beginning,
00085         const QList <PacCommonEnergyResult*> *end
00086         );
00087 
00088 private slots:
00090     void startCalibratedEnergyEvaluation();
00092     void updateDisplayRange();
00094     void updateRedEnergy();
00096     void updateBlueEnergy();
00098     void updateRedLock(bool locked);
00100     void updateBlueLock(bool locked);
00102     void detectorSelected(QListWidgetItem * current, QListWidgetItem * previous);
00103 
00104 protected:
00105     virtual void csvInputHeaderAndData(QTextStream &s) const;
00106     virtual void saveDataInDom(QDomElement &top) const;
00107     virtual void loadDataFromDom(const QDomElement &top);
00108 
00109 private:
00111     void swapSingleChildWidget(QWidget *parent, QWidget *newchild, bool deleteold = false);
00113     void populateDetectorSelector();
00115     void updateRangeSelector();
00116 
00117     // results
00118     const PacEnergyInput *input;
00119     QList<PacEnergySpectrum*> spectra;
00120 
00121     // gui states
00122     PacEnergySpectrum *currentspectrum;
00123     Pac::ReadoutRange displayrange; 
00124 
00125     // tmp widgets, pointers
00126     QPointer<QWidget> plotwidget;
00127     QListWidget *detectorselectionwidget;
00128     QDoubleSpinBox *redenergywidget, *blueenergywidget;
00129     QToolButton *redlockwidget, *bluelockwidget;
00130     QRadioButton *beginningwidget, *bothwidget, *endwidget;
00131 };
00132 
00133 #endif // PACENERGYCONTAINER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines