qavrg 0.0.28
|
00001 #ifndef QAVRGACQUISITIONPARMS_H 00002 #define QAVRGACQUISITIONPARMS_H 00003 00004 #include <QObject> 00005 #include <QVector> 00006 #include <QVariant> 00007 #include "qcepproperty.h" 00008 #include "qcepsettingssaver.h" 00009 00010 class QavrgFitter; 00011 00012 class QavrgAcquisitionParms : public QObject 00013 { 00014 Q_OBJECT 00015 00016 private: 00017 QcepSettingsSaverPtr m_SettingsSaver; 00018 00019 public: 00020 Q_PROPERTY( double bucketSeparation READ get_BucketSeparation WRITE set_BucketSeparation STORED false) 00021 Q_PROPERTY( QcepBoolVector fillPattern READ get_FillPattern WRITE set_FillPattern STORED false) 00022 Q_PROPERTY( QcepIntVector filledBuckets READ get_FilledBuckets STORED false) 00023 Q_PROPERTY( QcepBoolVector customFillPattern READ get_CustomFillPattern WRITE set_CustomFillPattern) 00024 Q_PROPERTY( int filledBucketsPerOrbit READ get_FilledBucketsPerOrbit STORED false) 00025 00026 Q_PROPERTY( int channels READ get_NChannels WRITE set_NChannels) 00027 QCEP_INTEGER_PROPERTY(NChannels) 00028 Q_PROPERTY( int samples READ get_NSamples WRITE set_NSamples) 00029 QCEP_INTEGER_PROPERTY(NSamples) 00030 00031 Q_PROPERTY( double integrationTime READ get_IntegrationTime WRITE set_IntegrationTime) 00032 QCEP_DOUBLE_PROPERTY(IntegrationTime) 00033 Q_PROPERTY( double scopeIntegrationTime READ get_ScopeIntegrationTime WRITE set_ScopeIntegrationTime) 00034 QCEP_DOUBLE_PROPERTY(ScopeIntegrationTime) 00035 Q_PROPERTY( double acquireIntegrationTime READ get_AcquireIntegrationTime WRITE set_AcquireIntegrationTime STORED false) 00036 QCEP_DOUBLE_PROPERTY(AcquireIntegrationTime) 00037 Q_PROPERTY( int repeats READ get_NRepeats WRITE set_NRepeats) 00038 QCEP_INTEGER_PROPERTY(NRepeats) 00039 Q_PROPERTY( int darkRepeats READ get_DarkNRepeats WRITE set_DarkNRepeats) 00040 QCEP_INTEGER_PROPERTY(DarkNRepeats) 00041 Q_PROPERTY( int referenceRepeats READ get_ReferenceNRepeats WRITE set_ReferenceNRepeats) 00042 QCEP_INTEGER_PROPERTY(ReferenceNRepeats) 00043 00044 Q_PROPERTY( int bucketsPerOrbit READ get_BucketsPerOrbit WRITE set_BucketsPerOrbit) 00045 QCEP_INTEGER_PROPERTY(BucketsPerOrbit) 00046 Q_PROPERTY( double samplesPerOrbit READ get_SamplesPerOrbit WRITE set_SamplesPerOrbit) 00047 QCEP_DOUBLE_PROPERTY(SamplesPerOrbit) 00048 Q_PROPERTY( int fillPatternMode READ get_FillPatternMode WRITE set_FillPatternMode) 00049 QCEP_INTEGER_PROPERTY(FillPatternMode) 00050 Q_PROPERTY( int customFilledBucketsPerOrbit READ get_CustomFilledBucketsPerOrbit WRITE set_CustomFilledBucketsPerOrbit) 00051 QCEP_INTEGER_PROPERTY(CustomFilledBucketsPerOrbit) 00052 00053 Q_PROPERTY( double triggerLevel READ get_TriggerLevel WRITE set_TriggerLevel) 00054 QCEP_DOUBLE_PROPERTY(TriggerLevel) 00055 Q_PROPERTY( int triggerSlope READ get_TriggerSlope WRITE set_TriggerSlope) 00056 QCEP_INTEGER_PROPERTY(TriggerSlope) 00057 Q_PROPERTY( int triggerSource READ get_TriggerSource WRITE set_TriggerSource) 00058 QCEP_INTEGER_PROPERTY(TriggerSource) 00059 00060 Q_PROPERTY( QString outputDirectory READ get_OutputDirectory WRITE set_OutputDirectory) 00061 QCEP_STRING_PROPERTY(OutputDirectory) 00062 00063 Q_PROPERTY( QString fileName READ get_FileName WRITE set_FileName) 00064 QCEP_STRING_PROPERTY(FileName) 00065 00066 Q_PROPERTY( QString filePath READ get_FilePath WRITE set_FilePath) 00067 QCEP_STRING_PROPERTY(FilePath) 00068 00069 Q_PROPERTY( int scanNumber READ get_ScanNumber WRITE set_ScanNumber) 00070 QCEP_INTEGER_PROPERTY(ScanNumber) 00071 00072 Q_PROPERTY( int simulationMode READ get_SimulationMode WRITE set_SimulationMode STORED false) 00073 QCEP_INTEGER_PROPERTY(SimulationMode) 00074 00075 // Q_PROPERTY( int instrument READ get_Instrument WRITE set_Instrument STORED false) 00076 // QCEP_INTEGER_PROPERTY(Instrument) 00077 00078 // Q_PROPERTY( int concurrent READ get_Concurrent WRITE set_Concurrent STORED false) 00079 // QCEP_INTEGER_PROPERTY(Concurrent) 00080 00081 Q_PROPERTY( int status READ get_Status WRITE set_Status STORED false) 00082 QCEP_INTEGER_PROPERTY(Status) 00083 00084 Q_PROPERTY(double laserRepRate READ get_LaserRepRate WRITE set_LaserRepRate) 00085 QCEP_DOUBLE_PROPERTY(LaserRepRate) 00086 00087 public: 00088 QavrgAcquisitionParms(QObject *parent); 00089 00090 QavrgFitter *fitter(int chan); 00091 00092 double get_BucketSeparation() const; 00093 void set_BucketSeparation(const double sep); 00094 00095 QcepBoolVector get_FillPattern() const; 00096 void set_FillPattern(const QcepBoolVector patt); 00097 QcepBoolVector get_CustomFillPattern() const; 00098 void set_CustomFillPattern(const QcepBoolVector patt); 00099 QcepIntVector get_FilledBuckets() const; 00100 int get_FilledBucketsPerOrbit() const; 00101 00102 enum AcquisitionMode { AcquireDone = 0, AcquireData, AcquireDark, AcquireReference, AcquireOnce, AcquireScope }; 00103 AcquisitionMode get_AcquisitionMode() const; 00104 void set_AcquisitionMode(AcquisitionMode mode); 00105 00106 int incr_NQueuedResults(); 00107 int decr_NQueuedResults(); 00108 00109 public: 00110 virtual QcepSettingsSaverWPtr saver() const = 0; 00111 00112 void readSettings(QSettings *settings); 00113 void writeSettings(QSettings *settings); 00114 00115 public slots: 00116 void properties() const; 00117 00118 void set_CustomFillPattern(int bucket, bool value); 00119 bool get_CustomFillPattern(int bucket) const; 00120 00121 signals: 00122 void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime()); 00123 void warningMessage(QString msg); 00124 00125 protected: 00126 mutable QMutex m_FittersMutex; 00127 QVector< QavrgFitter* > m_Fitters; 00128 00129 private: 00130 // mutable QMutex m_Mutex; 00131 mutable QMutex m_AcqModeMutex; 00132 mutable QMutex m_FillPatternMutex; 00133 QcepBoolVector m_FillPattern; 00134 QcepBoolVector m_CustomFillPattern; 00135 AcquisitionMode m_AcquisitionMode; 00136 QAtomicInt m_NQueuedResults; 00137 }; 00138 00139 #endif