Public Member Functions | Public Attributes | List of all members
RTT::FakeAnalogDevice Struct Reference

#include <FakeAnalogDevice.hpp>

Inheritance diagram for RTT::FakeAnalogDevice:
Inheritance graph
[legend]

Public Member Functions

virtual void arefSet (unsigned int, unsigned int)
 
 FakeAnalogDevice (unsigned int channels=32, unsigned int bin_range=4096, double lowest=-5.0, double highest=+5.0)
 
virtual double highest (unsigned int) const
 
virtual double lowest (unsigned int) const
 
virtual unsigned int nbOfChannels () const
 
virtual void rangeSet (unsigned int, unsigned int)
 
virtual unsigned int rawRange () const
 
virtual int rawRead (unsigned int chan, int &value)
 
virtual int rawWrite (unsigned int chan, int value)
 
virtual int read (unsigned int chan, double &value)
 
virtual double resolution (unsigned int) const
 
virtual int write (unsigned int chan, double value)
 
 ~FakeAnalogDevice ()
 
- Public Member Functions inherited from RTT::dev::AnalogInInterface
 AnalogInInterface ()
 
 AnalogInInterface (const std::string &name)
 
int binaryHighest () const
 
int binaryLowest () const
 
unsigned int binaryRange () const
 
virtual ~AnalogInInterface ()
 
- Public Member Functions inherited from RTT::dev::AnalogOutInterface
 AnalogOutInterface ()
 
 AnalogOutInterface (const std::string &name)
 
int binaryHighest () const
 
int binaryLowest () const
 
unsigned int binaryRange () const
 
virtual ~AnalogOutInterface ()
 

Public Attributes

unsigned int mbin_range
 
int * mchannels
 
double mhighest
 
double mlowest
 
unsigned int nbofchans
 

Additional Inherited Members

- Public Types inherited from RTT::dev::AnalogInInterface
enum  AnalogReference { Ground = 0, Common, Differential, Other }
 
- Public Types inherited from RTT::dev::AnalogOutInterface
enum  AnalogReference { Ground = 0, Common, Differential, Other }
 
- Static Public Attributes inherited from RTT::dev::AnalogInInterface
static NameServer< AnalogInInterface * > nameserver
 
- Static Public Attributes inherited from RTT::dev::AnalogOutInterface
static NameServer< AnalogOutInterface * > nameserver
 

Detailed Description

A test class which replaces a real device driver. It reproduces on the output what it gets on the input.

Definition at line 41 of file FakeAnalogDevice.hpp.

Constructor & Destructor Documentation

RTT::FakeAnalogDevice::FakeAnalogDevice ( unsigned int  channels = 32,
unsigned int  bin_range = 4096,
double  lowest = -5.0,
double  highest = +5.0 
)
inline

Definition at line 50 of file FakeAnalogDevice.hpp.

RTT::FakeAnalogDevice::~FakeAnalogDevice ( )
inline

Definition at line 60 of file FakeAnalogDevice.hpp.

Member Function Documentation

virtual void RTT::FakeAnalogDevice::arefSet ( unsigned  chan,
unsigned  aref 
)
inlinevirtual

Set the analog reference of a particular channel. We took (for now) the comedi API for this, where every aref (eg. Analog reference set to ground (aka AREF_GROUND) corresponds to an unsigned int.

See also
AnalogReference

Implements RTT::dev::AnalogInInterface.

Definition at line 67 of file FakeAnalogDevice.hpp.

virtual double RTT::FakeAnalogDevice::highest ( unsigned  chan) const
inlinevirtual

Returns the highest measurable input expressed in MU's for a given channel

Implements RTT::dev::AnalogInInterface.

Definition at line 117 of file FakeAnalogDevice.hpp.

virtual double RTT::FakeAnalogDevice::lowest ( unsigned  chan) const
inlinevirtual

Returns the current lowest measurable input expressed in MU's for a given channel

Implements RTT::dev::AnalogInInterface.

Definition at line 112 of file FakeAnalogDevice.hpp.

virtual unsigned int RTT::FakeAnalogDevice::nbOfChannels ( ) const
inlinevirtual

Returns the total number of channels.

Implements RTT::dev::AnalogInInterface.

Definition at line 70 of file FakeAnalogDevice.hpp.

virtual void RTT::FakeAnalogDevice::rangeSet ( unsigned  chan,
unsigned  range 
)
inlinevirtual

Set the range of a particular channel. We took (for now) the comedi API for this, where every range (eg. -5/+5 V) corresponds to an unsigned int. You should provide a mapping from that int to a particular range in your driver documentation

Implements RTT::dev::AnalogInInterface.

Definition at line 64 of file FakeAnalogDevice.hpp.

virtual unsigned int RTT::FakeAnalogDevice::rawRange ( ) const
inlinevirtual

Returns the absolute maximal range (e.g. 12bits AD -> 4096).

Implements RTT::dev::AnalogInInterface.

Definition at line 107 of file FakeAnalogDevice.hpp.

virtual int RTT::FakeAnalogDevice::rawRead ( unsigned int  chan,
int &  value 
)
inlinevirtual

Read a raw value from channel chan

Returns
0 on sucess.

Implements RTT::dev::AnalogInInterface.

Definition at line 91 of file FakeAnalogDevice.hpp.

virtual int RTT::FakeAnalogDevice::rawWrite ( unsigned int  chan,
int  value 
)
inlinevirtual

Write a raw value to channel chan

Returns
0 on success.

Implements RTT::dev::AnalogOutInterface.

Definition at line 100 of file FakeAnalogDevice.hpp.

virtual int RTT::FakeAnalogDevice::read ( unsigned int  chan,
double &  value 
)
inlinevirtual

Read the real value from channel chan

Returns
0 on sucess.

Implements RTT::dev::AnalogInInterface.

Definition at line 74 of file FakeAnalogDevice.hpp.

virtual double RTT::FakeAnalogDevice::resolution ( unsigned  chan) const
inlinevirtual

Resolution is expressed in bits / MU

Implements RTT::dev::AnalogInInterface.

Definition at line 122 of file FakeAnalogDevice.hpp.

virtual int RTT::FakeAnalogDevice::write ( unsigned int  chan,
double  value 
)
inlinevirtual

Write a MU value to channel chan

Returns
0 on success.

Implements RTT::dev::AnalogOutInterface.

Definition at line 83 of file FakeAnalogDevice.hpp.

Member Data Documentation

unsigned int RTT::FakeAnalogDevice::mbin_range

Definition at line 47 of file FakeAnalogDevice.hpp.

int* RTT::FakeAnalogDevice::mchannels

Definition at line 46 of file FakeAnalogDevice.hpp.

double RTT::FakeAnalogDevice::mhighest

Definition at line 48 of file FakeAnalogDevice.hpp.

double RTT::FakeAnalogDevice::mlowest

Definition at line 48 of file FakeAnalogDevice.hpp.

unsigned int RTT::FakeAnalogDevice::nbofchans

Definition at line 45 of file FakeAnalogDevice.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:41