QtPdCom  1.3.3
Public Member Functions | Private Member Functions | Private Attributes | List of all members
QtPdCom::ScalarVariable< T > Class Template Reference

Scalar Value Template. More...

#include <ScalarVariable.h>

Inheritance diagram for QtPdCom::ScalarVariable< T >:
Inheritance graph
[legend]
Collaboration diagram for QtPdCom::ScalarVariable< T >:
Collaboration graph
[legend]

Public Member Functions

 ScalarVariable (QObject *parent=nullptr)
 Constructor. More...
 
virtual ~ScalarVariable ()
 Destructor. More...
 
void clearData ()
 
bool hasData () const
 
getValue () const
 
std::chrono::nanoseconds getMTime () const
 
void inc ()
 Increments the current value and writes it to the process. More...
 
- Public Member Functions inherited from QtPdCom::AbstractScalarVariable
template<typename T >
std::enable_if< std::is_arithmetic< T >::value, void >::type copyData (T &dest) const
 
- Public Member Functions inherited from QtPdCom::ScalarSubscriber
 ScalarSubscriber ()
 Constructor. More...
 
virtual ~ScalarSubscriber ()
 Destructor. More...
 
void setVariable (PdCom::Variable pv, const PdCom::Selector &selector={}, const Transmission &=event_mode, double scale=1.0, double offset=0.0, double tau=0.0)
 Subscribe to a process variable via variable. More...
 
void setVariable (PdCom::Process *process, const QString &path, const PdCom::Selector &selector={}, const Transmission &=event_mode, double scale=1.0, double offset=0.0, double tau=0.0)
 Subscribe to a process variable via process and path. More...
 
void clearVariable ()
 Unsubscribe from a Variable. More...
 
bool hasVariable () const
 Subscription active. More...
 
virtual void stateChange (PdCom::Subscription::State)
 
template<class T >
void writeValue (T)
 Write a value to the process. More...
 
double getFilterConstant () const
 
PdCom::Variable getVariable () const
 
const void * getData () const
 

Private Member Functions

void newValues (std::chrono::nanoseconds) override
 This virtual method is called by the ProcessVariable, if its value changes. More...
 

Private Attributes

value
 Current value. More...
 
std::chrono::nanoseconds mTime
 Modification Time of Current value. More...
 
bool dataPresent
 There is a process value to display. More...
 

Additional Inherited Members

- Signals inherited from QtPdCom::AbstractScalarVariable
void valueChanged ()
 Emitted, when the value changes, or the variable is disconnected. More...
 
- Protected Member Functions inherited from QtPdCom::ScalarSubscriber
const PdCom::Selector & getSelector () const
 
- Protected Attributes inherited from QtPdCom::ScalarSubscriber
double scale
 
double offset
 

Detailed Description

template<class T>
class QtPdCom::ScalarVariable< T >

Scalar Value Template.

Constructor & Destructor Documentation

◆ ScalarVariable()

template<class T >
QtPdCom::ScalarVariable< T >::ScalarVariable ( QObject *  parent = nullptr)

Constructor.

◆ ~ScalarVariable()

template<class T >
QtPdCom::ScalarVariable< T >::~ScalarVariable ( )
virtual

Destructor.

Member Function Documentation

◆ clearData()

template<class T >
void QtPdCom::ScalarVariable< T >::clearData ( )

◆ getMTime()

template<class T >
std::chrono::nanoseconds QtPdCom::ScalarVariable< T >::getMTime ( ) const
inline
Returns
The current Modification Time.

◆ getValue()

template<class T >
T QtPdCom::ScalarVariable< T >::getValue ( ) const
inline
Returns
The current value.

Referenced by QtPdCom::MessageModel::Impl::stateChanged().

◆ hasData()

template<class T >
bool QtPdCom::ScalarVariable< T >::hasData ( ) const
inline
Returns
true, if data are present.

Referenced by QtPdCom::MessageModel::Impl::stateChanged().

◆ inc()

template<class T >
void QtPdCom::ScalarVariable< T >::inc ( )

Increments the current value and writes it to the process.

This does not update value directly.

◆ newValues()

template<class T >
void QtPdCom::ScalarVariable< T >::newValues ( std::chrono::nanoseconds  ts)
overrideprivatevirtual

This virtual method is called by the ProcessVariable, if its value changes.

Implements QtPdCom::ScalarSubscriber.

Member Data Documentation

◆ dataPresent

template<class T>
bool QtPdCom::ScalarVariable< T >::dataPresent
private

There is a process value to display.

◆ mTime

template<class T>
std::chrono::nanoseconds QtPdCom::ScalarVariable< T >::mTime
private

Modification Time of Current value.

◆ value

template<class T>
T QtPdCom::ScalarVariable< T >::value
private

Current value.


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