qavrg 0.0.28
Public Types | Public Slots | Signals | Public Member Functions | Protected Attributes | Properties | Private Attributes
QavrgAcquisitionParms Class Reference

#include <qavrgacquisitionparms.h>

Inheritance diagram for QavrgAcquisitionParms:
Inheritance graph
[legend]

List of all members.

Public Types

enum  AcquisitionMode {
  AcquireDone = 0, AcquireData, AcquireDark, AcquireReference,
  AcquireOnce, AcquireScope
}

Public Slots

void properties () const
void set_CustomFillPattern (int bucket, bool value)
bool get_CustomFillPattern (int bucket) const

Signals

void printMessage (QString msg, QDateTime ts=QDateTime::currentDateTime())
void warningMessage (QString msg)

Public Member Functions

 QavrgAcquisitionParms (QObject *parent)
QavrgFitterfitter (int chan)
double get_BucketSeparation () const
void set_BucketSeparation (const double sep)
QcepBoolVector get_FillPattern () const
void set_FillPattern (const QcepBoolVector patt)
QcepBoolVector get_CustomFillPattern () const
void set_CustomFillPattern (const QcepBoolVector patt)
QcepIntVector get_FilledBuckets () const
int get_FilledBucketsPerOrbit () const
AcquisitionMode get_AcquisitionMode () const
void set_AcquisitionMode (AcquisitionMode mode)
int incr_NQueuedResults ()
int decr_NQueuedResults ()
virtual QcepSettingsSaverWPtr saver () const =0
void readSettings (QSettings *settings)
void writeSettings (QSettings *settings)

Protected Attributes

QMutex m_FittersMutex
QVector< QavrgFitter * > m_Fitters

Properties

double bucketSeparation
QcepBoolVector fillPattern
QcepIntVector filledBuckets
QcepBoolVector customFillPattern
int filledBucketsPerOrbit
int channels
int samples
double integrationTime
double scopeIntegrationTime
double acquireIntegrationTime
int repeats
int darkRepeats
int referenceRepeats
int bucketsPerOrbit
double samplesPerOrbit
int fillPatternMode
int customFilledBucketsPerOrbit
double triggerLevel
int triggerSlope
int triggerSource
QString outputDirectory
QString fileName
QString filePath
int scanNumber
int simulationMode
int status
double laserRepRate

Private Attributes

QcepSettingsSaverPtr m_SettingsSaver
QMutex m_AcqModeMutex
QMutex m_FillPatternMutex
QcepBoolVector m_FillPattern
QcepBoolVector m_CustomFillPattern
AcquisitionMode m_AcquisitionMode
QAtomicInt m_NQueuedResults

Detailed Description

Definition at line 12 of file qavrgacquisitionparms.h.


Member Enumeration Documentation

Enumerator:
AcquireDone 
AcquireData 
AcquireDark 
AcquireReference 
AcquireOnce 
AcquireScope 

Definition at line 102 of file qavrgacquisitionparms.h.


Constructor & Destructor Documentation

QavrgAcquisitionParms::QavrgAcquisitionParms ( QObject *  parent)

Definition at line 7 of file qavrgacquisitionparms.cpp.

  : QObject(parent),
    m_SettingsSaver(new QcepSettingsSaver(this)),
    m_NChannels(m_SettingsSaver, this, "channels", 4, "Number of Channels"),
    m_NSamples(m_SettingsSaver, this, "samples", 900000, "Number of Samples per Channel"),
    m_IntegrationTime(m_SettingsSaver, this, "integrationTime", 4, "Integration Time"),
    m_ScopeIntegrationTime(m_SettingsSaver, this, "scopeIntegrationTime", 1, "Integration Time in Scope Mode"),
    m_AcquireIntegrationTime(m_SettingsSaver, this, "acquireIntegrationTime", 1, "Acquisition Integration Time"),
    m_NRepeats(m_SettingsSaver, this, "repeats", 1, "Number of Repeats"),
    m_DarkNRepeats(m_SettingsSaver, this, "darkRepeats", 1, "Number of Dark Repeats"),
    m_ReferenceNRepeats(m_SettingsSaver, this, "referenceRepeats", 1, "Number of Reference Repeats"),
    m_BucketsPerOrbit(m_SettingsSaver, this,"bucketsPerOrbit",1296, "Buckets per Orbit"),
    m_SamplesPerOrbit(m_SettingsSaver, this,"samplesPerOrbit",3683.5, "Samples per Orbit"),
    m_FillPatternMode(m_SettingsSaver, this,"fillPatternMode",0, "Fill Pattern Mode"),
    m_CustomFilledBucketsPerOrbit(m_SettingsSaver, this, "customFilledBucketsPerOrbit", 24, "Filled Buckets per Orbit (custom)"),
    m_TriggerLevel(m_SettingsSaver, this,"triggerLevel",1.0, "Trigger Level"),
    m_TriggerSlope(m_SettingsSaver, this,"triggerSlope",0, "Trigger Slope"),
    m_TriggerSource(m_SettingsSaver, this,"triggerSource",0, "Trigger Source"),
    m_OutputDirectory(m_SettingsSaver, this,"outputDirectory",".","Output Directory"),
    m_FileName(m_SettingsSaver, this,"fileName","saveddata", "File Name"),
    m_FilePath(m_SettingsSaver, this,"filePath","saveddata", "File Path"),
    m_ScanNumber(m_SettingsSaver, this,"scanNumber",1, "Scan Number"),
    m_SimulationMode(m_SettingsSaver, this,"simulationMode",0, "Simulation Mode"),
//    m_Instrument(m_SettingsSaver, this, "instrument", 0),
//    m_Concurrent(m_SettingsSaver, this,"concurrent",3),
    m_Status(QcepSettingsSaverWPtr(), this,"status",AcquireDone, "Acquisition Status"),
    m_LaserRepRate(m_SettingsSaver, this,"laserRepRate",1000, "Laser Rep Rate")
//    m_Mutex(QMutex::Recursive),
{
}

Member Function Documentation

int QavrgAcquisitionParms::decr_NQueuedResults ( )

Definition at line 167 of file qavrgacquisitionparms.cpp.

References m_NQueuedResults.

{
  int res = m_NQueuedResults.fetchAndAddOrdered(-1);

//  printf("QavrgAcquisitionParms::decr_NQueuedResults = %d\n", res);

  return res;
}
QavrgFitter * QavrgAcquisitionParms::fitter ( int  chan)
QavrgAcquisitionParms::AcquisitionMode QavrgAcquisitionParms::get_AcquisitionMode ( ) const
double QavrgAcquisitionParms::get_BucketSeparation ( ) const

Definition at line 45 of file qavrgacquisitionparms.cpp.

{
  return get_SamplesPerOrbit()/get_BucketsPerOrbit();
}
bool QavrgAcquisitionParms::get_CustomFillPattern ( int  bucket) const [slot]

Definition at line 119 of file qavrgacquisitionparms.cpp.

References m_CustomFillPattern, and m_FillPatternMutex.

{
  QMutexLocker lock(&m_FillPatternMutex);

  return m_CustomFillPattern.value(bin);
}
QcepBoolVector QavrgAcquisitionParms::get_CustomFillPattern ( ) const

Definition at line 112 of file qavrgacquisitionparms.cpp.

References m_CustomFillPattern, and m_FillPatternMutex.

Referenced by QavrgAcquisition::fillPatternChanged().

{
  QMutexLocker lock(&m_FillPatternMutex);

  return m_CustomFillPattern;
}
QVector< int > QavrgAcquisitionParms::get_FilledBuckets ( ) const

Definition at line 62 of file qavrgacquisitionparms.cpp.

References m_FillPattern, and m_FillPatternMutex.

{
  QMutexLocker lock(&m_FillPatternMutex);

  QVector<int> res;
  int sz = m_FillPattern.size();

  for (int i=0; i<sz; i++) {
    if (m_FillPattern.value(i)) {
      res.append(i);
    }
  }

  return res;
}
int QavrgAcquisitionParms::get_FilledBucketsPerOrbit ( ) const

Definition at line 78 of file qavrgacquisitionparms.cpp.

References m_FillPattern, and m_FillPatternMutex.

Referenced by QavrgAcquisition::bucketNumber(), and QavrgAcquisition::orbitNumber().

{
  QMutexLocker lock(&m_FillPatternMutex);

  int res=0;
  int sz = m_FillPattern.size();

  for (int i=0; i<sz; i++) {
    if (m_FillPattern.value(i)) {
      res++;
    }
  }

  return res;
}
QcepBoolVector QavrgAcquisitionParms::get_FillPattern ( ) const

Definition at line 55 of file qavrgacquisitionparms.cpp.

References m_FillPattern, and m_FillPatternMutex.

{
  QMutexLocker lock(&m_FillPatternMutex);

  return m_FillPattern;
}
int QavrgAcquisitionParms::incr_NQueuedResults ( )

Definition at line 158 of file qavrgacquisitionparms.cpp.

References m_NQueuedResults.

Referenced by QavrgAcquisitionSimulated::calculateSimulatedAcquisition(), and QavrgAcquisition::readoutAcquisition().

{
  int res = m_NQueuedResults.fetchAndAddOrdered(1);

//  printf("QavrgAcquisitionParms::incr_NQueuedResults = %d\n", res);

  return res;
}
void QavrgAcquisitionParms::printMessage ( QString  msg,
QDateTime  ts = QDateTime::currentDateTime() 
) [signal]
void QavrgAcquisitionParms::properties ( ) const [slot]

Definition at line 176 of file qavrgacquisitionparms.cpp.

{
  printf("Static Properties:\n");

  const QMetaObject *meta = &staticMetaObject;

  int count = meta->propertyCount();
  int offset= meta->propertyOffset();

  for (int i=offset; i<count; i++) {
    QMetaProperty metaprop = meta->property(i);

    printf("%d : %s = %s\n", i, metaprop.name(), qPrintable(metaprop.read(this).toString()));
  }

  printf("Dynamic Properties:\n");

  int i=0;
  foreach(QByteArray nm, dynamicPropertyNames()) {
    printf("%d : %s = %s\n", i, nm.data(), qPrintable(property(nm.data()).toString()));
  }
}
void QavrgAcquisitionParms::readSettings ( QSettings *  settings)

Definition at line 199 of file qavrgacquisitionparms.cpp.

References m_Fitters.

{
//  QMutexLocker lock(&m_Mutex);

  QcepProperty::readSettings(this, &staticMetaObject, "acquisition", settings);

  foreach (QavrgFitter* f, m_Fitters) {
    f -> readSettings(settings);
  }
}
virtual QcepSettingsSaverWPtr QavrgAcquisitionParms::saver ( ) const [pure virtual]

Implemented in QavrgAcquisition.

void QavrgAcquisitionParms::set_AcquisitionMode ( QavrgAcquisitionParms::AcquisitionMode  mode)
void QavrgAcquisitionParms::set_BucketSeparation ( const double  sep)

Definition at line 50 of file qavrgacquisitionparms.cpp.

{
  set_SamplesPerOrbit(sep*get_BucketsPerOrbit());
}
void QavrgAcquisitionParms::set_CustomFillPattern ( int  bucket,
bool  value 
) [slot]

Definition at line 133 of file qavrgacquisitionparms.cpp.

References m_CustomFillPattern, and m_FillPatternMutex.

{
  QMutexLocker lock(&m_FillPatternMutex);

  if (bin >= m_CustomFillPattern.size()) {
    m_CustomFillPattern.resize(bin+1);
  }

  m_CustomFillPattern[bin] = val;
}
void QavrgAcquisitionParms::set_CustomFillPattern ( const QcepBoolVector  patt)

Definition at line 126 of file qavrgacquisitionparms.cpp.

References m_CustomFillPattern, and m_FillPatternMutex.

{
  QMutexLocker lock(&m_FillPatternMutex);

  m_CustomFillPattern = patt;
}
void QavrgAcquisitionParms::set_FillPattern ( const QcepBoolVector  patt)

Definition at line 94 of file qavrgacquisitionparms.cpp.

References m_FillPattern, and m_FillPatternMutex.

Referenced by QavrgAcquisition::fillPatternChanged().

{
  QMutexLocker lock(&m_FillPatternMutex);

//  printf("set fill pattern = ");
//  int sz = patt.size();
//
//  for(int i=0; i<sz; i++) {
//    if (patt.value(i)) {
//      printf("%d ", i);
//    }
//  }
//
//  printf(";\n");

  m_FillPattern = patt;
}
void QavrgAcquisitionParms::warningMessage ( QString  msg) [signal]
void QavrgAcquisitionParms::writeSettings ( QSettings *  settings)

Definition at line 210 of file qavrgacquisitionparms.cpp.

References m_Fitters.

{
//  QMutexLocker lock(&m_Mutex);

  QcepProperty::writeSettings(this, &staticMetaObject, "acquisition", settings);

  foreach (QavrgFitter* f, m_Fitters) {
    f -> writeSettings(settings);
  }
}

Member Data Documentation

QMutex QavrgAcquisitionParms::m_AcqModeMutex [mutable, private]

Definition at line 131 of file qavrgacquisitionparms.h.

Referenced by get_AcquisitionMode(), and set_AcquisitionMode().

Definition at line 135 of file qavrgacquisitionparms.h.

Referenced by get_AcquisitionMode(), and set_AcquisitionMode().

Definition at line 134 of file qavrgacquisitionparms.h.

Referenced by get_CustomFillPattern(), and set_CustomFillPattern().

QcepBoolVector QavrgAcquisitionParms::m_FillPattern [private]
QMutex QavrgAcquisitionParms::m_FillPatternMutex [mutable, private]
QMutex QavrgAcquisitionParms::m_FittersMutex [mutable, protected]

Definition at line 126 of file qavrgacquisitionparms.h.

Referenced by QavrgAcquisition::findDevices(), and fitter().

Definition at line 136 of file qavrgacquisitionparms.h.

Referenced by decr_NQueuedResults(), and incr_NQueuedResults().

QcepSettingsSaverPtr QavrgAcquisitionParms::m_SettingsSaver [private]

Definition at line 17 of file qavrgacquisitionparms.h.


Property Documentation

double QavrgAcquisitionParms::acquireIntegrationTime [read, write]

Definition at line 35 of file qavrgacquisitionparms.h.

double QavrgAcquisitionParms::bucketSeparation [read, write]

Definition at line 20 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::bucketsPerOrbit [read, write]

Definition at line 44 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::channels [read, write]

Definition at line 26 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::customFilledBucketsPerOrbit [read, write]

Definition at line 50 of file qavrgacquisitionparms.h.

QcepBoolVector QavrgAcquisitionParms::customFillPattern [read, write]

Definition at line 23 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::darkRepeats [read, write]

Definition at line 39 of file qavrgacquisitionparms.h.

QString QavrgAcquisitionParms::fileName [read, write]

Definition at line 63 of file qavrgacquisitionparms.h.

QString QavrgAcquisitionParms::filePath [read, write]

Definition at line 66 of file qavrgacquisitionparms.h.

Referenced by QavrgAcquisition::newSaveFile().

QcepIntVector QavrgAcquisitionParms::filledBuckets [read]

Definition at line 22 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::filledBucketsPerOrbit [read]

Definition at line 24 of file qavrgacquisitionparms.h.

QcepBoolVector QavrgAcquisitionParms::fillPattern [read, write]

Definition at line 21 of file qavrgacquisitionparms.h.

Referenced by QavrgAcquisition::fillPatternChanged().

int QavrgAcquisitionParms::fillPatternMode [read, write]

Definition at line 48 of file qavrgacquisitionparms.h.

double QavrgAcquisitionParms::integrationTime [read, write]

Definition at line 31 of file qavrgacquisitionparms.h.

double QavrgAcquisitionParms::laserRepRate [read, write]

Definition at line 84 of file qavrgacquisitionparms.h.

QString QavrgAcquisitionParms::outputDirectory [read, write]

Definition at line 60 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::referenceRepeats [read, write]

Definition at line 41 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::repeats [read, write]

Definition at line 37 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::samples [read, write]

Definition at line 28 of file qavrgacquisitionparms.h.

double QavrgAcquisitionParms::samplesPerOrbit [read, write]
int QavrgAcquisitionParms::scanNumber [read, write]

Definition at line 69 of file qavrgacquisitionparms.h.

double QavrgAcquisitionParms::scopeIntegrationTime [read, write]

Definition at line 33 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::simulationMode [read, write]

Definition at line 72 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::status [read, write]
double QavrgAcquisitionParms::triggerLevel [read, write]

Definition at line 53 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::triggerSlope [read, write]

Definition at line 55 of file qavrgacquisitionparms.h.

int QavrgAcquisitionParms::triggerSource [read, write]

Definition at line 57 of file qavrgacquisitionparms.h.


The documentation for this class was generated from the following files: