RTXI  2.4
The Real-Time eXperiment Interface Documentation
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 (std::string, IO::channel_t *, size_t)
 
virtual ~Device (void)
 
- Public Member Functions inherited from RT::Device
 Device (void)
 
bool getActive (void) const
 
void setActive (bool)
 
- Public Member Functions inherited from RT::List< T >::Node
 Node (void)
 
virtual ~Node (void)
 
bool operator== (const Node &x) const
 
- Public Member Functions inherited from IO::Block
 Block (std::string name, channel_t *channels, size_t size)
 
virtual ~Block (void)
 
std::string getName (void) const
 
virtual size_t getCount (flags_t type) const
 
virtual std::string getName (flags_t type, size_t index) const
 
virtual std::string getDescription (flags_t type, size_t index) const
 
virtual double getValue (flags_t type, size_t index) const
 
double input (size_t index) const
 
double output (size_t index) const
 
- Public Member Functions inherited from Settings::Object
 Object (void)
 
virtual ~Object (void)
 
ID getID (void) const
 
State save (void) const
 
void load (const State &)
 
void deferred (const State &)
 

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 & output (size_t index)
 
- Protected Member Functions inherited from Settings::Object
virtual void doDeferred (const State &)
 

Additional Inherited Members

- Public Types inherited from Settings::Object
typedef unsigned long ID
 
- Static Public Attributes inherited from Settings::Object
const static ID INVALID = 0
 

Detailed Description

Definition at line 30 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 31 of file analogy_device.cpp.

Here is the call graph for this function:

◆ ~AnalogyDevice()

AnalogyDevice::~AnalogyDevice(void )

Definition at line 170 of file analogy_device.cpp.

Member Function Documentation

◆ doLoad()

void AnalogyDevice::doLoad(const Settings::Object::States)
protectedvirtual

Reimplemented from Settings::Object.

Definition at line 651 of file analogy_device.cpp.

Here is the call graph for this function:

◆ doSave()

void AnalogyDevice::doSave(Settings::Object::States)const
protectedvirtual

Reimplemented from Settings::Object.

Definition at line 692 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getAnalogCalibrationActive()

bool AnalogyDevice::getAnalogCalibrationActive(DAQ::type_t type,
DAQ::index_t index 
)const
inlinevirtual

Get the channel's active state of using its calibration.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The channel's active state of using its calibration.

Implements DAQ::Device.

Definition at line 67 of file analogy_device.h.

◆ getAnalogCalibrationState()

bool AnalogyDevice::getAnalogCalibrationState(DAQ::type_t type,
DAQ::index_t index 
)const
inlinevirtual

Get the channel's state of calibration.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The channel's active state of using its calibration.

Implements DAQ::Device.

Definition at line 68 of file analogy_device.h.

◆ getAnalogCalibrationValue()

double AnalogyDevice::getAnalogCalibrationValue(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the calibration of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
the calibration value for the channel.

Implements DAQ::Device.

Definition at line 441 of file analogy_device.cpp.

◆ getAnalogDownsample()

size_t AnalogyDevice::getAnalogDownsample(DAQ::type_t type,
DAQ::index_t channel 
)const
virtual

Implements DAQ::Device.

Definition at line 252 of file analogy_device.cpp.

◆ getAnalogGain()

double AnalogyDevice::getAnalogGain(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the gain of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The gain of the selected channel.

Implements DAQ::Device.

Definition at line 346 of file analogy_device.cpp.

◆ getAnalogOffsetUnits()

index_t AnalogyDevice::getAnalogOffsetUnits(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the index of the units for the selected channel zero offset.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The index of the channel's offset units or INVALID on error.

Implements DAQ::Device.

Definition at line 338 of file analogy_device.cpp.

◆ getAnalogRange()

index_t AnalogyDevice::getAnalogRange(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the index of the range for the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The index of the channel's range or INVALID on error.

Implements DAQ::Device.

Definition at line 314 of file analogy_device.cpp.

◆ getAnalogRangeCount()

size_t AnalogyDevice::getAnalogRangeCount(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the number of available ranges for the specified channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The number of available ranges for the channel.

Implements DAQ::Device.

Definition at line 220 of file analogy_device.cpp.

◆ getAnalogRangeString()

std::string AnalogyDevice::getAnalogRangeString(DAQ::type_t type,
DAQ::index_t index,
DAQ::index_t range 
)const
virtual

Get a string representation of the specified range.

Parameters
typeThe channel's type.
indexThe channel's index.
rangeThe index of the channel's range.
Returns
The string representation of the selected range.

Implements DAQ::Device.

Definition at line 260 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getAnalogReference()

index_t AnalogyDevice::getAnalogReference(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the index of the reference for the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The index of the channel's reference or INVALID on error.

Implements DAQ::Device.

Definition at line 322 of file analogy_device.cpp.

◆ getAnalogReferenceCount()

size_t AnalogyDevice::getAnalogReferenceCount(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the number of available reference for the specified channel.

Parameters
typeThe channel's type. \patam index The channel's index.
Returns
The number of available references for the channel.

Implements DAQ::Device.

Definition at line 236 of file analogy_device.cpp.

◆ getAnalogReferenceString()

std::string AnalogyDevice::getAnalogReferenceString(DAQ::type_t type,
DAQ::index_t index,
DAQ::index_t reference 
)const
virtual

Get a string representation of the specified reference.

Parameters
typeThe channel's type.
indexThe channel's index.
referenceThe index of the channel's reference.
Returns
The string representation of the selected reference.

Implements DAQ::Device.

Definition at line 278 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getAnalogUnits()

index_t AnalogyDevice::getAnalogUnits(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the index of the units for the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The index of the channel's units or INVALID on error.

Implements DAQ::Device.

Definition at line 330 of file analogy_device.cpp.

◆ getAnalogUnitsCount()

size_t AnalogyDevice::getAnalogUnitsCount(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the number of available units for the channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The number of available units for the channel.

Implements DAQ::Device.

Definition at line 244 of file analogy_device.cpp.

◆ getAnalogUnitsString()

std::string AnalogyDevice::getAnalogUnitsString(DAQ::type_t type,
DAQ::index_t index,
DAQ::index_t units 
)const
virtual

Get a string representation of the specifed units.

Parameters
typeThe channel's type.
indexThe channel's index.
unitsThe index of the channel's units.
Returns
The string representation of the selected units.

Implements DAQ::Device.

Definition at line 298 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getAnalogZeroOffset()

double AnalogyDevice::getAnalogZeroOffset(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the offset of the selected channel that makes the signal zero

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The zero offset of the selected channel.

Implements DAQ::Device.

Definition at line 354 of file analogy_device.cpp.

◆ getChannelActive()

bool AnalogyDevice::getChannelActive(DAQ::type_t type,
DAQ::index_t index 
)const
virtual

Get the channel's active state.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The channel's active state.

Implements DAQ::Device.

Definition at line 195 of file analogy_device.cpp.

Here is the call graph for this function:

◆ getChannelCount()

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

Get the number of channels of the specified type.

Parameters
typeThe type of the channels to be counted.
Returns
The number of channels of the specified type.

Implements DAQ::Device.

Definition at line 187 of file analogy_device.cpp.

◆ getDigitalDirection()

direction_t AnalogyDevice::getDigitalDirection(DAQ::index_t index)const
virtual

Get the direction of the specified digital channel.

Parameters
indexThe digital channel's index.
Returns
The direction of the digital channel.

Implements DAQ::Device.

Definition at line 468 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

Reimplemented from RT::Device.

Definition at line 493 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogCalibrationActive()

int AnalogyDevice::setAnalogCalibrationActive(DAQ::type_t type,
DAQ::index_t index,
bool state 
)
inlinevirtual

Set the calibration active state of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 66 of file analogy_device.h.

◆ setAnalogCalibrationValue()

int AnalogyDevice::setAnalogCalibrationValue(DAQ::type_t type,
DAQ::index_t index,
double value 
)
virtual

Set the calibration of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
valueThe calibration value.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 433 of file analogy_device.cpp.

◆ setAnalogConversion()

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

Definition at line 62 of file analogy_device.h.

◆ setAnalogCounter()

int AnalogyDevice::setAnalogCounter(DAQ::type_t type,
DAQ::index_t channel 
)
virtual

Implements DAQ::Device.

Definition at line 458 of file analogy_device.cpp.

◆ setAnalogDownsample()

int AnalogyDevice::setAnalogDownsample(DAQ::type_t type,
DAQ::index_t channel,
size_t downsample_rate 
)
virtual

Implements DAQ::Device.

Definition at line 449 of file analogy_device.cpp.

◆ setAnalogGain()

int AnalogyDevice::setAnalogGain(DAQ::type_t type,
DAQ::index_t index,
double gain 
)
virtual

Set the gain of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
gainThe channel's new gain.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 424 of file analogy_device.cpp.

◆ setAnalogOffsetUnits()

int AnalogyDevice::setAnalogOffsetUnits(DAQ::type_t type,
DAQ::index_t index,
DAQ::index_t units 
)
virtual

Set the offset units of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
unitsThe channel's new offset units index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 406 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogRange()

int AnalogyDevice::setAnalogRange(DAQ::type_t type,
DAQ::index_t index,
DAQ::index_t range 
)
virtual

Set the range of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
rangeThe channel's new range index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 362 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogReference()

int AnalogyDevice::setAnalogReference(DAQ::type_t type,
DAQ::index_t index,
DAQ::index_t reference 
)
virtual

Set the reference of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
referenceThe channel's new reference index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 388 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogUnits()

int AnalogyDevice::setAnalogUnits(DAQ::type_t type,
DAQ::index_t index,
DAQ::index_t units 
)
virtual

Set the units of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
unitsThe channel's new units index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 397 of file analogy_device.cpp.

Here is the call graph for this function:

◆ setAnalogZeroOffset()

int AnalogyDevice::setAnalogZeroOffset(DAQ::type_t type,
DAQ::index_t index,
double offset 
)
virtual

Set the zero offset of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
offsetThe channel's new zero offset index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 415 of file analogy_device.cpp.

◆ setChannelActive()

int AnalogyDevice::setChannelActive(DAQ::type_t type,
DAQ::index_t index,
bool state 
)
virtual

Set the channel's active state.

Parameters
typeThe channel's type.
indexThe channel's index.
stateThe channel's new state.

Implements DAQ::Device.

Definition at line 203 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 477 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

Reimplemented from RT::Device.

Definition at line 577 of file analogy_device.cpp.

Here is the call graph for this function:

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