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 PACDATAHANDLER_H 00022 #define PACDATAHANDLER_H 00023 00024 #include <QString> 00025 #include <QByteArray> 00026 #include <QFile> 00027 #include <QDateTime> 00028 #include <QVector> 00029 #include <QHash> 00030 #include <QMap> 00031 #include <QMessageBox> 00032 #include "pacDataTypes.h" 00033 #include "PaceventsMetaInfo.h" 00034 #include "PacKnockoutSettings.h" 00035 00036 class PacAbstractContainer; 00037 //class PacInitialContainer; 00038 //class PacEnergyContainer; 00039 //class PacCalibratedEnergyContainer; 00040 //class PacCoincidenceContainer; 00041 //class PacRTContainer; 00042 class PacDataReader; 00043 class PacEnergyThread; 00044 class PacCalibratedEnergyThread; 00045 class PacCoincidenceSearchThread; 00046 class PacEnergyInput; 00047 class PacCalibratedEnergyInput; 00048 class PacCoincidenceInput; 00049 class PacBasicMeasurementInfo; 00050 class QTabWidget; 00051 00060 class PacDataHandler : public QObject 00061 { 00062 Q_OBJECT 00063 public: 00065 PacDataHandler(const QString &filename, QWidget * filetoolbox, QTabWidget * tabwidget, QObject *parent = 0); 00066 ~PacDataHandler(); 00067 00069 00072 bool validFile() const { return valid; }; 00073 QString openedFileName() const; 00074 QString associatedSpectrapacFile() const; 00076 00077 public slots: 00078 void save() const; 00079 void saveAs() const; 00080 00081 private slots: 00086 void startEnergyThread(PacEnergyInput *input); 00087 void startCalibratedEnergyThread(PacCalibratedEnergyInput *input); 00088 void startCoincidenceSearchThread(PacCoincidenceInput *input); 00090 00091 00092 signals: 00093 void evaluationFinished(QWidget *w); 00094 void associatedSpectrapacFileChanged(const QString &filename) const; 00095 00096 00097 private: 00098 void openSpectrapacFile(); 00099 void openPaceventsFile(); 00100 void openZsFile(); 00101 void initializeContainers(); 00102 void createWidgets(); 00103 00104 PacEnergyThread * energyThread(); 00105 PacCalibratedEnergyThread * calibratedEnergyThread(); 00106 PacCoincidenceSearchThread * coincidenceSearchThread(); 00107 00109 bool valid; 00110 PacBasicMeasurementInfo *basicinfo; 00111 00113 enum ContainerTypes { 00114 InitialContainer, 00115 EnergyContainer, 00116 CalibratedEnergyContainer, 00117 CoincidenceContainer, 00118 RTContainer, 00119 }; 00120 QMap<ContainerTypes, PacAbstractContainer*> containers; 00121 00122 // pointers to mainwindow widgets 00123 QWidget *filetoolbox; 00124 QTabWidget *tabwidget; 00125 00131 QString initiallyopenedfile; 00137 mutable QString associatedspectrapacfile; 00138 }; 00139 00140 #endif