qavrg 0.0.28
qavrgacquisitiondata.h
Go to the documentation of this file.
00001 #ifndef QAVRGACQUISITIONDATA_H
00002 #define QAVRGACQUISITIONDATA_H
00003 
00004 #include "qavrgacquisitionparms.h"
00005 
00006 class QavrgAcquisitionThread;
00007 class QavrgApplication;
00008 #include <QFuture>
00009 
00010 class QavrgAcquisitionData : public QavrgAcquisitionParms
00011 {
00012   Q_OBJECT;
00013 
00014 public:
00015   QavrgAcquisitionData(QavrgAcquisitionThread *acq, QavrgApplication *app, QObject *parent);
00016   ~QavrgAcquisitionData();
00017 
00018 public slots:
00019 //  QVector< QVector<double> > get_RawData();
00020   QVector<double> get_RawData(int chan, int start, int nbins);
00021   QVector<double> get_RawData(int chan);
00022   double get_RawData(int chan, int bin);
00023 
00024 //  QVector< QVector<double> > get_ReferenceData();
00025   QVector<double> get_ReferenceData(int chan, int start, int nbins);
00026   QVector<double> get_ReferenceData(int chan);
00027   double get_ReferenceData(int chan, int bin);
00028 
00029 //  QVector< QVector<double> > get_DarkData();
00030   QVector<double> get_DarkData(int chan, int start, int nbins);
00031   QVector<double> get_DarkData(int chan);
00032   double get_DarkData(int chan, int bin);
00033 
00034 //  QVector< QVector<double> > get_FitData();
00035   QVector<double> get_FitData(int chan, int start, int nbins);
00036   QVector<double> get_FitData(int chan);
00037   double get_FitData(int chan, int bin);
00038 //  void   set_FitData(int chan, int bin, double value);
00039 //  void   set_FitData(int chan, QVector<double> fit);
00040 
00041   void setReferenceData();
00042   void setDarkData();
00043 //  void setReferenceAvailable(int f);
00044 //  void setDarkAvailable(int f);
00045 
00046 //  void readData(QString file);
00047 //  void writeData(QString &file);
00048 
00049 signals:
00050   void new_RawData();
00051   void new_ReferenceData();
00052   void new_DarkData();
00053   void new_FitData();
00054   void new_FittingResults();
00055 
00056 public:
00057 //  int referenceAvailable() const;
00058 //  int darkAvailable() const;
00059 
00060   void loadReferenceData();
00061   void saveReferenceData();
00062 
00063   void loadDarkData();
00064   void saveDarkData();
00065 
00066 
00067 //protected:
00068 //  QVector< QFuture<void> >   futures() const;
00069 //
00070 protected:
00071   QVector< QVector<double> > m_Accumulator;
00072 //  QVector< QVector<double> > m_RawData;
00073 //  QVector< QVector<double> > m_DarkData;
00074 //  QVector< QVector<double> > m_ReferenceData;
00075 //  QVector< QVector<double> > m_FitData;
00076 
00077   mutable QMutex             m_AccumulatorMutex;
00078 //  mutable QMutex             m_RawDataMutex;
00079 //  mutable QMutex             m_DarkDataMutex;
00080 //  mutable QMutex             m_ReferenceDataMutex;
00081 //  mutable QMutex             m_FitDataMutex;
00082   QAtomicInt                 m_AcquireCancel;
00083 
00084 //  QVector< QFuture<void> >   m_Futures;
00085 
00086 private:
00087   mutable QMutex             m_AcquisitionDataMutex;
00088 //  QAtomicInt                 m_ReferenceAvailable;
00089 //  QAtomicInt                 m_DarkAvailable;
00090 };
00091 
00092 #endif // QAVRGACQUISITIONDATA_H