QXRD  0.11.16
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
QcepDoubleVectorProperty Class Reference

#include <qcepproperty.h>

Inheritance diagram for QcepDoubleVectorProperty:
Inheritance graph
[legend]
Collaboration diagram for QcepDoubleVectorProperty:
Collaboration graph
[legend]

Public Slots

void setValue (QcepDoubleVector val, int index)
 
void setValue (QcepDoubleVector val)
 
void incValue (QcepDoubleVector step)
 
void setDefaultValue (QcepDoubleVector val)
 
void resetValue ()
 
void clear ()
 
void appendValue (double val)
 

Signals

void valueChanged (QcepDoubleVector val, int index)
 

Public Member Functions

 QcepDoubleVectorProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepDoubleVector value, QString toolTip)
 
QcepDoubleVector value () const
 
QcepDoubleVector defaultValue () const
 
QString toString (const QcepDoubleVector &list)
 
- Public Member Functions inherited from QcepProperty
 QcepProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
 
virtual void printMessage (QString msg, QDateTime dt=QDateTime::currentDateTime())
 
QString name () const
 
void setName (QString name)
 
QString parentName () const
 
QString toolTip () const
 
void setToolTip (QString tip)
 
QString expandedToolTip () const
 
void setWidgetToolTip (QWidget *widget)
 
int index ()
 
int incIndex (int step)
 
int debug () const
 
void setDebug (int dbg)
 
void setSaver (QcepSettingsSaverWPtr saver)
 

Private Attributes

QcepDoubleVector m_Default
 
QcepDoubleVector m_Value
 

Additional Inherited Members

- Static Public Member Functions inherited from QcepProperty
static void registerMetaTypes ()
 
static void setSettingsValue (QSettings *settings, QString name, QVariant value)
 
static void writeSettings (QObject *object, QSettings *settings, QString section)
 
static void readSettings (QObject *object, QSettings *settings, QString section)
 
static void writeSettings (QObject *object, const QMetaObject *meta, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void readSettings (QObject *object, const QMetaObject *meta, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void writeSettings (QObject *object, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void readSettings (QObject *object, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void registerCustomSaver (QString typeName, CustomSettingsSaver *saver)
 
- Protected Attributes inherited from QcepProperty
QMutex m_Mutex
 
QcepSettingsSaverWPtr m_Saver
 

Detailed Description

Definition at line 377 of file qcepproperty.h.

Constructor & Destructor Documentation

QcepDoubleVectorProperty::QcepDoubleVectorProperty ( QcepSettingsSaverWPtr  saver,
QObject *  parent,
const char *  name,
QcepDoubleVector  value,
QString  toolTip 
)

Definition at line 1841 of file qcepproperty.cpp.

1842  : QcepProperty(saver, parent, name, toolTip),
1843  m_Default(value),
1844  m_Value(value)
1845 {
1846 }
QcepDoubleVector m_Default
Definition: qcepproperty.h:399
QcepDoubleVector value() const
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QString toolTip() const
QcepDoubleVector m_Value
Definition: qcepproperty.h:400

Member Function Documentation

void QcepDoubleVectorProperty::appendValue ( double  val)
slot

Definition at line 1903 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, setValue(), and value().

1904 {
1905  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1906 
1907  QcepDoubleVector list = value();
1908  list.append(val);
1909 
1910  setValue(list);
1911 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(QcepDoubleVector val, int index)
QVector< double > QcepDoubleVector
Definition: qcepmacros.h:19
QcepDoubleVector value() const

Here is the call graph for this function:

void QcepDoubleVectorProperty::clear ( )
slot

Definition at line 1896 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and setValue().

1897 {
1898  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1899 
1901 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(QcepDoubleVector val, int index)
QVector< double > QcepDoubleVector
Definition: qcepmacros.h:19

Here is the call graph for this function:

QcepDoubleVector QcepDoubleVectorProperty::defaultValue ( ) const

Definition at line 1855 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

Referenced by resetValue().

1856 {
1857  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1858 
1859  return m_Default;
1860 }
QMutex m_Mutex
Definition: qcepproperty.h:69
QcepDoubleVector m_Default
Definition: qcepproperty.h:399

Here is the caller graph for this function:

void QcepDoubleVectorProperty::incValue ( QcepDoubleVector  step)
slot

Definition at line 1874 of file qcepproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, QcepProperty::incIndex(), QcepProperty::m_Mutex, QcepProperty::m_Saver, m_Value, QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), and valueChanged().

1875 {
1876  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1877 
1878  if (qcepDebug(DEBUG_PROPERTIES) || debug()) {
1879  printMessage(tr("%1: QcepDoubleVectorProperty::incValue(QcepDoubleVector %2...)")
1880  .arg(name()).arg(step.value(0)));
1881  }
1882 
1883  for (int i=0; i<m_Value.count(); i++) {
1884  m_Value[i] += step.value(i);
1885  }
1886 
1888 
1889  if (saver) {
1890  saver->changed(this);
1891  }
1892 
1893  emit valueChanged(m_Value, incIndex(1));
1894 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QMutex m_Mutex
Definition: qcepproperty.h:69
int incIndex(int step)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
int debug() const
void valueChanged(QcepDoubleVector val, int index)
QcepDoubleVector m_Value
Definition: qcepproperty.h:400
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

void QcepDoubleVectorProperty::resetValue ( )
slot

Definition at line 1967 of file qcepproperty.cpp.

References DEBUG_PROPERTIES, defaultValue(), QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), and setValue().

1968 {
1969  if (qcepDebug(DEBUG_PROPERTIES)) {
1970  printMessage(tr("%1: QcepDoubleVectorProperty::resetValue").arg(name()));
1971  }
1972 
1974 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QcepDoubleVector defaultValue() const
void setValue(QcepDoubleVector val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const

Here is the call graph for this function:

void QcepDoubleVectorProperty::setDefaultValue ( QcepDoubleVector  val)
slot

Definition at line 1960 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

1961 {
1962  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1963 
1964  m_Default = val;
1965 }
QMutex m_Mutex
Definition: qcepproperty.h:69
QcepDoubleVector m_Default
Definition: qcepproperty.h:399
void QcepDoubleVectorProperty::setValue ( QcepDoubleVector  val,
int  index 
)
slot

Definition at line 1862 of file qcepproperty.cpp.

References QcepProperty::debug(), QcepProperty::index(), QcepProperty::name(), QcepProperty::printMessage(), and toString().

Referenced by appendValue(), clear(), and resetValue().

1863 {
1864  if (debug()) {
1865  printMessage(tr("%1 QcepDoubleVectorProperty::setValue(QcepDoubleVector %2, int %3) [%4]")
1866  .arg(name()).arg(toString(val)).arg(index).arg(this->index()));
1867  }
1868 
1869  if (index == this->index()) {
1870  setValue(val);
1871  }
1872 }
void setValue(QcepDoubleVector val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
int debug() const
QString toString(const QcepDoubleVector &list)

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepDoubleVectorProperty::setValue ( QcepDoubleVector  val)
slot

Definition at line 1933 of file qcepproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, QcepProperty::incIndex(), QcepProperty::index(), QcepProperty::m_Mutex, QcepProperty::m_Saver, m_Value, QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), toString(), and valueChanged().

1934 {
1935  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1936 
1937  if (qcepDebug(DEBUG_PROPERTIES)) {
1938  printMessage(tr("%1 QcepDoubleVectorProperty::setValue(QcepDoubleVector %2)")
1939  .arg(name()).arg(toString(val)));
1940  }
1941 
1942  if (val != m_Value) {
1943  if (debug()) {
1944  printMessage(tr("%1: QcepDoubleVectorProperty::setValue(QcepDoubleVector %2) [%3]")
1945  .arg(name()).arg(toString(val)).arg(index()));
1946  }
1947 
1948  m_Value = val;
1949 
1951 
1952  if (saver) {
1953  saver->changed(this);
1954  }
1955 
1956  emit valueChanged(m_Value, incIndex(1));
1957  }
1958 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QMutex m_Mutex
Definition: qcepproperty.h:69
int incIndex(int step)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
int debug() const
void valueChanged(QcepDoubleVector val, int index)
QString toString(const QcepDoubleVector &list)
QcepDoubleVector m_Value
Definition: qcepproperty.h:400
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

QString QcepDoubleVectorProperty::toString ( const QcepDoubleVector list)

Definition at line 1913 of file qcepproperty.cpp.

References QcepProperty::m_Mutex.

Referenced by setValue().

1914 {
1915  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1916 
1917  QString res = "[";
1918  int ct = val.count();
1919 
1920  for (int i=0; i<ct; i++) {
1921  if (i<(ct-1)) {
1922  res += tr("%1, ").arg(val[i]);
1923  } else {
1924  res += tr("%1").arg(val[i]);
1925  }
1926  }
1927 
1928  res += "]";
1929 
1930  return res;
1931 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

QcepDoubleVector QcepDoubleVectorProperty::value ( ) const

Definition at line 1848 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and m_Value.

Referenced by appendValue().

1849 {
1850  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1851 
1852  return m_Value;
1853 }
QMutex m_Mutex
Definition: qcepproperty.h:69
QcepDoubleVector m_Value
Definition: qcepproperty.h:400

Here is the caller graph for this function:

void QcepDoubleVectorProperty::valueChanged ( QcepDoubleVector  val,
int  index 
)
signal

Referenced by incValue(), QxrdAcquisitionScalerModel::QxrdAcquisitionScalerModel(), and setValue().

Here is the caller graph for this function:

Member Data Documentation

QcepDoubleVector QcepDoubleVectorProperty::m_Default
private

Definition at line 399 of file qcepproperty.h.

Referenced by defaultValue(), and setDefaultValue().

QcepDoubleVector QcepDoubleVectorProperty::m_Value
private

Definition at line 400 of file qcepproperty.h.

Referenced by incValue(), setValue(), and value().


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