QtPdCom  1.4.1
Classes | Signals | Public Member Functions | Properties | Private Attributes | List of all members
QtPdCom::PdVariable Class Reference

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

#include <PdVariable.h>

Inheritance diagram for QtPdCom::PdVariable:
Inheritance graph
[legend]
Collaboration diagram for QtPdCom::PdVariable:
Collaboration graph
[legend]

Classes

class  Impl
 

Signals

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

Public Member Functions

 PdVariable (QObject *=Q_NULLPTR)
 Constructor. More...
 
 ~PdVariable ()
 Destructor. More...
 
void clearVariable ()
 Unsubscribe from a Variable. More...
 
bool hasVariable () const
 Connected state. More...
 
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 More...
 
Q_INVOKABLE void inc ()
 Increments the current value and writes it to the process. More...
 

Properties

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

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()

PdVariable::~PdVariable ( )

Destructor.

References clearVariable().

Member Function Documentation

◆ clearData()

void PdVariable::clearData ( )

◆ clearVariable()

void PdVariable::clearVariable ( )

Unsubscribe from a Variable.

References clearData(), dataPresentChanged(), and impl.

Referenced by updateConnection(), and ~PdVariable().

◆ connectionChanged

void QtPdCom::PdVariable::connectionChanged ( )
signal

Referenced by updateConnection().

◆ dataPresentChanged

void QtPdCom::PdVariable::dataPresentChanged ( bool  )
signal

◆ getConnection()

QtPdCom::PdConnection PdVariable::getConnection ( )

References impl.

◆ getDataPresent()

bool PdVariable::getDataPresent ( )

References impl.

◆ getMTime()

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

References impl.

◆ getMTimeToDouble()

double PdVariable::getMTimeToDouble ( ) const

References impl.

◆ getValue()

QVariant PdVariable::getValue ( ) const

References impl.

Referenced by inc().

◆ getValueAsString()

QString PdVariable::getValueAsString ( ) const

References impl.

◆ hasVariable()

bool PdVariable::hasVariable ( ) const

Connected state.

References impl.

◆ inc()

void PdVariable::inc ( )

Increments the current value and writes it to the process.

This does not update value directly.

References getValue(), and setValue().

◆ pathChanged

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

◆ setConnection()

void PdVariable::setConnection ( QtPdCom::PdConnection const &  conn)

References impl, and updateConnection().

◆ setValue()

void PdVariable::setValue ( QVariant  value)

References impl, setValueAsString(), and value.

Referenced by inc().

◆ setValueAsString()

void PdVariable::setValueAsString ( QString  value)

References impl, and value.

Referenced by setValue().

◆ updateConnection()

void PdVariable::updateConnection ( )

(re)connects to variable

Subscribes to a ProcessVariable.

References clearData(), clearVariable(), connectionChanged(), QtPdCom::Process::disconnected(), QtPdCom::Process::error(), and impl.

Referenced by setConnection().

◆ valueChanged

void QtPdCom::PdVariable::valueChanged ( )
signal

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

Referenced by clearData(), QtPdCom::PdVariable::Impl::Subscription::newValues(), and QtPdCom::PdVariable::Impl::Subscription::stateChanged().

◆ 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.

Referenced by QtPdCom::PdVariable::Impl::Subscription::newValues().

Member Data Documentation

◆ Impl

class Q_DECL_HIDDEN QtPdCom::PdVariable::Impl
private

◆ impl

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

Property Documentation

◆ connected

bool QtPdCom::PdVariable::connected
read

Indicates that the process is connected and data is transfered.

◆ connection

QtPdCom::PdConnection QtPdCom::PdVariable::connection
readwrite

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

QVariant QtPdCom::PdVariable::mtime
read

last modification time of 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.

Referenced by setValue(), and setValueAsString().


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