QtPdCom  1.5.2
PdVariable Class Reference

Scalar/Vector/Matrix Variant to be used in QML applications. More...

#include <PdVariable.h>

Inheritance diagram for PdVariable:
Collaboration diagram for PdVariable:

Classes

class  Impl

Signals

void valueChanged ()
 Emitted, when the value changes, or the variable is disconnected.
void valueUpdated (std::chrono::nanoseconds mtime)
 Emitted also when value does not change but got an update from the msr process.
void pathChanged (QString)
void connectionChanged ()
void dataPresentChanged (bool)

Public Member Functions

 PdVariable (QObject *=Q_NULLPTR)
 Constructor.
 ~PdVariable ()
 Destructor.
void clearVariable ()
 Unsubscribe from a Variable.
bool hasVariable () const
 Connected state.
void clearData ()
QVariant getValue () const
Q_INVOKABLE void setValue (QVariant)
QString getValueAsString () const
Q_INVOKABLE void setValueAsString (QString)
bool getDataPresent ()
std::chrono::nanoseconds getMTime () const
double getMTimeToDouble () const
PdConnection getConnection ()
void setConnection (PdConnection const &)
void updateConnection ()
 (re)connects to variable
Q_INVOKABLE void inc ()
 Increments the current value and writes it to the process.

Properties

QtPdCom::PdConnection connection
 Connection property which describes the variable to connect to.
bool connected
 Indicates that the process is connected and data is transfered.
QVariant value
 Process value.
QString text
 Interpret the elements of an process variable array as string.
QVariant mtime
 Last modification time of the process variable.

Private Attributes

class Q_DECL_HIDDEN Impl
std::unique_ptr< Implimpl

Detailed Description

Scalar/Vector/Matrix Variant to be used in QML applications.

Constructor & Destructor Documentation

◆ PdVariable()

PdVariable::PdVariable ( QObject * parent = Q_NULLPTR)

Constructor.

◆ ~PdVariable()

Destructor.

Member Function Documentation

◆ clearData()

◆ clearVariable()

Unsubscribe from a Variable.

◆ connectionChanged

◆ dataPresentChanged

◆ getConnection()

◆ getDataPresent()

◆ getMTime()

std::chrono::nanoseconds PdVariable::getMTime ( ) const

◆ getMTimeToDouble()

double PdVariable::getMTimeToDouble ( ) const

◆ getValue()

QVariant PdVariable::getValue ( ) const

◆ getValueAsString()

QString PdVariable::getValueAsString ( ) const

◆ hasVariable()

bool PdVariable::hasVariable ( ) const

Connected state.

◆ inc()

void PdVariable::inc ( )

Increments the current value and writes it to the process.

This does not update value directly.

◆ pathChanged

void QtPdCom::PdVariable::pathChanged ( QString )
signal

◆ setConnection()

◆ setValue()

void PdVariable::setValue ( QVariant value)

◆ setValueAsString()

void PdVariable::setValueAsString ( QString value)

◆ updateConnection()

(re)connects to variable

Subscribes to a ProcessVariable.

◆ valueChanged

Emitted, when the value changes, or the variable is disconnected.

◆ valueUpdated

void QtPdCom::PdVariable::valueUpdated ( std::chrono::nanoseconds mtime)
signal

Emitted also when value does not change but got an update from the msr process.

Member Data Documentation

◆ Impl

class Q_DECL_HIDDEN QtPdCom::PdVariable::Impl
private

◆ impl

std::unique_ptr<Impl> QtPdCom::PdVariable::impl
private

Property Documentation

◆ connected

Indicates that the process is connected and data is transfered.

◆ connection

Connection property which describes the variable to connect to.

connection {
process: pdProcess // process instance, if null: use default.
path: "/osc/cos" // path (string)
period: 0.2 // sample time, 0 for event,
// "poll" for manual poll mode,
// negative values for timer-basedpolling
offset: 0.0 // offset (double), default 0
scale: 1.0, // scale (double), default 1.0
tau: 0.0 // Low Pass Filter time constant
// (double, in seconds). if 0: no filter
}

The default Process instance is accessible via the DefaultProcess singleton which is instantiated when importing the QtPdCom library.

◆ mtime

Last modification time of the process variable.

◆ text

QString QtPdCom::PdVariable::text
readwrite

Interpret the elements of an process variable array as string.

◆ value

QVariant QtPdCom::PdVariable::value
readwrite

Process value.


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