RTXI  3.0.0
The Real-Time eXperiment Interface Reference Manual
Data Structures | Public Member Functions | Protected Member Functions
AnalogyDevice Class Reference

#include <analogy_device.h>

Inheritance diagram for AnalogyDevice:
Inheritance graph
Collaboration diagram for AnalogyDevice:
Collaboration graph

Public Member Functions

 AnalogyDevice (a4l_desc_t *, std::string, IO::channel_t *, size_t)
 
 ~AnalogyDevice (void)
 
size_t getChannelCount (DAQ::type_t) const
 
bool getChannelActive (DAQ::type_t, DAQ::index_t) const
 
int setChannelActive (DAQ::type_t, DAQ::index_t, bool)
 
size_t getAnalogRangeCount (DAQ::type_t, DAQ::index_t) const
 
size_t getAnalogReferenceCount (DAQ::type_t, DAQ::index_t) const
 
size_t getAnalogUnitsCount (DAQ::type_t, DAQ::index_t) const
 
size_t getAnalogDownsample (DAQ::type_t, DAQ::index_t) const
 
std::string getAnalogRangeString (DAQ::type_t, DAQ::index_t, DAQ::index_t) const
 
std::string getAnalogReferenceString (DAQ::type_t, DAQ::index_t, DAQ::index_t) const
 
std::string getAnalogUnitsString (DAQ::type_t, DAQ::index_t, DAQ::index_t) const
 
double getAnalogGain (DAQ::type_t, DAQ::index_t) const
 
double getAnalogZeroOffset (DAQ::type_t, DAQ::index_t) const
 
DAQ::index_t getAnalogRange (DAQ::type_t, DAQ::index_t) const
 
DAQ::index_t getAnalogReference (DAQ::type_t, DAQ::index_t) const
 
DAQ::index_t getAnalogUnits (DAQ::type_t, DAQ::index_t) const
 
DAQ::index_t getAnalogOffsetUnits (DAQ::type_t, DAQ::index_t) const
 
int setAnalogGain (DAQ::type_t, DAQ::index_t, double)
 
int setAnalogZeroOffset (DAQ::type_t, DAQ::index_t, double)
 
int setAnalogRange (DAQ::type_t, DAQ::index_t, DAQ::index_t)
 
int setAnalogReference (DAQ::type_t, DAQ::index_t, DAQ::index_t)
 
int setAnalogUnits (DAQ::type_t, DAQ::index_t, DAQ::index_t)
 
int setAnalogOffsetUnits (DAQ::type_t, DAQ::index_t, DAQ::index_t)
 
int setAnalogDownsample (DAQ::type_t, DAQ::index_t, size_t)
 
int setAnalogCounter (DAQ::type_t, DAQ::index_t)
 
void setAnalogConversion (DAQ::type_t, DAQ::index_t)
 
int setAnalogCalibrationValue (DAQ::type_t, DAQ::index_t, double)
 
double getAnalogCalibrationValue (DAQ::type_t, DAQ::index_t) const
 
int setAnalogCalibrationActive (DAQ::type_t, DAQ::index_t, bool)
 
bool getAnalogCalibrationActive (DAQ::type_t, DAQ::index_t) const
 
bool getAnalogCalibrationState (DAQ::type_t, DAQ::index_t) const
 
DAQ::direction_t getDigitalDirection (DAQ::index_t) const
 
int setDigitalDirection (DAQ::index_t, DAQ::direction_t)
 
void read (void)
 
void write (void)
 
- Public Member Functions inherited from DAQ::Device
 Device (const std::string &dev_name, const std::vector< IO::channel_t > &channels)
 
virtual size_t getChannelCount (ChannelType::type_t type) const =0
 
virtual bool getChannelActive (ChannelType::type_t type, index_t index) const =0
 
virtual int setChannelActive (ChannelType::type_t type, index_t index, bool state)=0
 
virtual size_t getAnalogRangeCount (index_t index) const =0
 
virtual size_t getAnalogReferenceCount (index_t index) const =0
 
virtual size_t getAnalogUnitsCount (index_t index) const =0
 
virtual size_t getAnalogDownsample (ChannelType::type_t type, index_t index) const =0
 
virtual std::string getAnalogRangeString (ChannelType::type_t type, index_t index, index_t range) const =0
 
virtual std::string getAnalogReferenceString (ChannelType::type_t type, index_t index, index_t reference) const =0
 
virtual std::string getAnalogUnitsString (ChannelType::type_t type, index_t index, index_t units) const =0
 
virtual double getAnalogGain (ChannelType::type_t type, index_t index) const =0
 
virtual double getAnalogZeroOffset (ChannelType::type_t type, index_t index) const =0
 
virtual index_t getAnalogRange (ChannelType::type_t type, index_t index) const =0
 
virtual index_t getAnalogReference (ChannelType::type_t type, index_t index) const =0
 
virtual index_t getAnalogUnits (ChannelType::type_t type, index_t index) const =0
 
virtual index_t getAnalogOffsetUnits (ChannelType::type_t type, index_t index) const =0
 
virtual int setAnalogGain (ChannelType::type_t type, index_t index, double gain)=0
 
virtual int setAnalogRange (ChannelType::type_t type, index_t index, index_t range)=0
 
virtual int setAnalogZeroOffset (ChannelType::type_t type, index_t index, double offset)=0
 
virtual int setAnalogReference (ChannelType::type_t type, index_t index, index_t reference)=0
 
virtual int setAnalogUnits (ChannelType::type_t type, index_t index, index_t units)=0
 
virtual int setAnalogOffsetUnits (ChannelType::type_t type, index_t index, index_t units)=0
 
virtual int setAnalogDownsample (ChannelType::type_t type, index_t index, size_t downsample)=0
 
virtual int setAnalogCounter (ChannelType::type_t type, index_t index)=0
 
virtual int setAnalogCalibrationValue (ChannelType::type_t type, index_t index, double value)=0
 
virtual double getAnalogCalibrationValue (ChannelType::type_t type, index_t index) const =0
 
virtual int setAnalogCalibrationActive (ChannelType::type_t type, index_t index, bool state)=0
 
virtual bool getAnalogCalibrationActive (ChannelType::type_t type, index_t index) const =0
 
virtual bool getAnalogCalibrationState (ChannelType::type_t type, index_t index) const =0
 
- Public Member Functions inherited from RT::Device
 Device (std::string n, const std::vector< IO::channel_t > &c)
 
 Device (const Device &)=default
 
Deviceoperator= (const Device &)=default
 
 Device (Device &&)=delete
 
Deviceoperator= (Device &&)=delete
 
 ~Device () override=default
 
- Public Member Functions inherited from IO::Block
 Block (std::string blockname, const std::vector< channel_t > &channels, bool isdependent)
 
 Block (const Block &block)=default
 
Blockoperator= (const Block &block)=default
 
 Block (Block &&)=delete
 
Blockoperator= (Block &&)=delete
 
virtual ~Block ()=default
 
std::string getName () const
 
size_t getCount (flags_t type) const
 
std::string getChannelName (IO::flags_t type, size_t index) const
 
std::string getChannelDescription (IO::flags_t type, size_t index) const
 
void writeinput (size_t index, const double &data)
 
const double & readPort (IO::flags_t direction, size_t index)
 
bool dependent () const
 
bool getActive () const
 
void setActive (bool act)
 
void assignID (size_t block_id)
 
size_t getID () const
 

Protected Member Functions

virtual void doLoad (const Settings::Object::State &)
 
virtual void doSave (Settings::Object::State &) const
 
- Protected Member Functions inherited from IO::Block
double & readinput (size_t index)
 
void writeoutput (size_t index, const double &data)
 

Detailed Description

Definition at line 31 of file analogy_device.h.

Constructor & Destructor Documentation

◆ AnalogyDevice()

AnalogyDevice::AnalogyDevice(a4l_desc_t * d,
std::string name,
IO::channel_tchan,
size_t size 
)

Definition at line 32 of file analogy_device.cpp.

Here is the call graph for this function:

◆ ~AnalogyDevice()

AnalogyDevice::~AnalogyDevice(void )

Definition at line 163 of file analogy_device.cpp.

Member Function Documentation

◆ doLoad()

void AnalogyDevice::doLoad(const Settings::Object::State & s)
protectedvirtual

Definition at line 694 of file analogy_device.cpp.

Here is the call graph for this function:

◆ doSave()

void AnalogyDevice::doSave(Settings::Object::State & s)const
protectedvirtual

Definition at line 745 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getAnalogCalibrationActive()

bool AnalogyDevice::getAnalogCalibrationActive(DAQ::type_t ,
DAQ::index_t  
)const
inline

Definition at line 73 of file analogy_device.h.

◆ getAnalogCalibrationState()

bool AnalogyDevice::getAnalogCalibrationState(DAQ::type_t ,
DAQ::index_t  
)const
inline

Definition at line 77 of file analogy_device.h.

◆ getAnalogCalibrationValue()

double AnalogyDevice::getAnalogCalibrationValue(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 460 of file analogy_device.cpp.

◆ getAnalogDownsample()

size_t AnalogyDevice::getAnalogDownsample(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 250 of file analogy_device.cpp.

◆ getAnalogGain()

double AnalogyDevice::getAnalogGain(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 352 of file analogy_device.cpp.

◆ getAnalogOffsetUnits()

index_t AnalogyDevice::getAnalogOffsetUnits(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 344 of file analogy_device.cpp.

◆ getAnalogRange()

index_t AnalogyDevice::getAnalogRange(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 320 of file analogy_device.cpp.

◆ getAnalogRangeCount()

size_t AnalogyDevice::getAnalogRangeCount(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 217 of file analogy_device.cpp.

◆ getAnalogRangeString()

std::string AnalogyDevice::getAnalogRangeString(DAQ::type_t ,
DAQ::index_t ,
DAQ::index_t  
)const

Definition at line 258 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getAnalogReference()

index_t AnalogyDevice::getAnalogReference(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 328 of file analogy_device.cpp.

◆ getAnalogReferenceCount()

size_t AnalogyDevice::getAnalogReferenceCount(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 233 of file analogy_device.cpp.

◆ getAnalogReferenceString()

std::string AnalogyDevice::getAnalogReferenceString(DAQ::type_t ,
DAQ::index_t ,
DAQ::index_t  
)const

Definition at line 280 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getAnalogUnits()

index_t AnalogyDevice::getAnalogUnits(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 336 of file analogy_device.cpp.

◆ getAnalogUnitsCount()

size_t AnalogyDevice::getAnalogUnitsCount(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 242 of file analogy_device.cpp.

◆ getAnalogUnitsString()

std::string AnalogyDevice::getAnalogUnitsString(DAQ::type_t ,
DAQ::index_t ,
DAQ::index_t  
)const

Definition at line 302 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getAnalogZeroOffset()

double AnalogyDevice::getAnalogZeroOffset(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 360 of file analogy_device.cpp.

◆ getChannelActive()

bool AnalogyDevice::getChannelActive(DAQ::type_t ,
DAQ::index_t  
)const

Definition at line 192 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getChannelCount()

size_t AnalogyDevice::getChannelCount(DAQ::type_t )const

Definition at line 184 of file analogy_device.cpp.

◆ getDigitalDirection()

direction_t AnalogyDevice::getDigitalDirection(DAQ::index_t channel)const

Definition at line 490 of file analogy_device.cpp.

◆ read()

void AnalogyDevice::read(void )
virtual

Function called by the realtime task at the beginning of each period.

See also
RT::System

Implements RT::Device.

Definition at line 517 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogCalibrationActive()

int AnalogyDevice::setAnalogCalibrationActive(DAQ::type_t ,
DAQ::index_t ,
bool  
)
inline

Definition at line 72 of file analogy_device.h.

◆ setAnalogCalibrationValue()

int AnalogyDevice::setAnalogCalibrationValue(DAQ::type_t ,
DAQ::index_t ,
double  
)

Definition at line 449 of file analogy_device.cpp.

◆ setAnalogConversion()

void AnalogyDevice::setAnalogConversion(DAQ::type_t ,
DAQ::index_t  
)
inline

Definition at line 68 of file analogy_device.h.

◆ setAnalogCounter()

int AnalogyDevice::setAnalogCounter(DAQ::type_t ,
DAQ::index_t  
)

Definition at line 480 of file analogy_device.cpp.

◆ setAnalogDownsample()

int AnalogyDevice::setAnalogDownsample(DAQ::type_t ,
DAQ::index_t ,
size_t  
)

Definition at line 469 of file analogy_device.cpp.

◆ setAnalogGain()

int AnalogyDevice::setAnalogGain(DAQ::type_t ,
DAQ::index_t ,
double  
)

Definition at line 440 of file analogy_device.cpp.

◆ setAnalogOffsetUnits()

int AnalogyDevice::setAnalogOffsetUnits(DAQ::type_t ,
DAQ::index_t ,
DAQ::index_t  
)

Definition at line 417 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogRange()

int AnalogyDevice::setAnalogRange(DAQ::type_t ,
DAQ::index_t ,
DAQ::index_t  
)

Definition at line 368 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogReference()

int AnalogyDevice::setAnalogReference(DAQ::type_t ,
DAQ::index_t ,
DAQ::index_t  
)

Definition at line 395 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogUnits()

int AnalogyDevice::setAnalogUnits(DAQ::type_t ,
DAQ::index_t ,
DAQ::index_t  
)

Definition at line 407 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogZeroOffset()

int AnalogyDevice::setAnalogZeroOffset(DAQ::type_t ,
DAQ::index_t ,
double  
)

Definition at line 429 of file analogy_device.cpp.

◆ setChannelActive()

int AnalogyDevice::setChannelActive(DAQ::type_t ,
DAQ::index_t ,
bool  
)

Definition at line 200 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setDigitalDirection()

int AnalogyDevice::setDigitalDirection(DAQ::index_t index,
DAQ::direction_t direction 
)
virtual

Set the direction of the specified digital channel.

Parameters
indexThe digital channel's index.
directionThe digital channel's new direction.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 499 of file analogy_device.cpp.

◆ write()

void AnalogyDevice::write(void )
virtual

Function called by the realtime task at the end of each period.

See also
RT::System

Implements RT::Device.

Definition at line 610 of file analogy_device.cpp.

Here is the call graph for this function:

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