qpidctrl  0.7.1
Public Member Functions | Private Attributes | List of all members
QWatlowCommand< T > Class Template Reference

#include <qwatlowdevice.h>

Inheritance diagram for QWatlowCommand< T >:
Inheritance graph

Public Member Functions

 QWatlowCommand (QWatlowDevice *device, QString cmd, T *property)
 
bool replyExpected () const
 
bool processReply (QString reply)
 
void issueCommand ()
 
QString cmd () const
 
template<>
bool processReply (QString)
 
template<>
bool processReply (QString reply)
 
template<>
bool processReply (QString reply)
 
- Public Member Functions inherited from QPidDeviceCommand
 QPidDeviceCommand ()
 
virtual ~QPidDeviceCommand ()
 

Private Attributes

QWatlowDevicem_Device
 
QString m_Command
 
T * m_Property
 

Detailed Description

template<class T>
class QWatlowCommand< T >

Definition at line 80 of file qwatlowdevice.h.

Constructor & Destructor Documentation

template<class T >
QWatlowCommand< T >::QWatlowCommand ( QWatlowDevice device,
QString  cmd,
T *  property 
)

Definition at line 327 of file qwatlowdevice.cpp.

327  :
328  m_Device(device),
329  m_Command(cmd),
330  m_Property(property)
331 {
332 }
QWatlowDevice * m_Device
Definition: qwatlowdevice.h:92
QString m_Command
Definition: qwatlowdevice.h:93
QString cmd() const

Member Function Documentation

template<class T >
QString QWatlowCommand< T >::cmd ( ) const

Definition at line 372 of file qwatlowdevice.cpp.

373 {
374  return m_Command;
375 }
QString m_Command
Definition: qwatlowdevice.h:93
template<class T >
void QWatlowCommand< T >::issueCommand ( )
virtual

Implements QPidDeviceCommand.

Definition at line 378 of file qwatlowdevice.cpp.

379 {
381 }
QWatlowDevice * m_Device
Definition: qwatlowdevice.h:92
void writeOutput(QString cmd)
QString cmd() const
template<class T >
bool QWatlowCommand< T >::processReply ( QString  reply)
virtual

Implements QPidDeviceCommand.

template<>
bool QWatlowCommand< void >::processReply ( QString  )
virtual

Implements QPidDeviceCommand.

Definition at line 341 of file qwatlowdevice.cpp.

342 {
343  return false;
344 }
template<>
bool QWatlowCommand< QcepDoubleProperty >::processReply ( QString  reply)
virtual

Implements QPidDeviceCommand.

Definition at line 347 of file qwatlowdevice.cpp.

348 {
349  bool ok;
350  double value = reply.toDouble(&ok);
351 
352  if (ok && m_Property) {
353  m_Property->setValue(value);
354  }
355 
356  return (ok && m_Property);
357 }
template<>
bool QWatlowCommand< QcepBoolProperty >::processReply ( QString  reply)
virtual

Implements QPidDeviceCommand.

Definition at line 360 of file qwatlowdevice.cpp.

361 {
362  bool value = reply.startsWith("On");
363 
364  if (m_Property) {
365  m_Property->setValue(value);
366  }
367 
368  return (value && m_Property);
369 }
template<class T >
bool QWatlowCommand< T >::replyExpected ( ) const
virtual

Implements QPidDeviceCommand.

Definition at line 335 of file qwatlowdevice.cpp.

336 {
337  return m_Property;
338 }

Member Data Documentation

template<class T >
QString QWatlowCommand< T >::m_Command
private

Definition at line 93 of file qwatlowdevice.h.

template<class T >
QWatlowDevice* QWatlowCommand< T >::m_Device
private

Definition at line 92 of file qwatlowdevice.h.

template<class T >
T* QWatlowCommand< T >::m_Property
private

Definition at line 94 of file qwatlowdevice.h.


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