RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
AnalogyDevice Class Reference

#include <analogy_device.h>

Inheritance diagram for AnalogyDevice:
DAQ::DeviceRT::DeviceIO::BlockRT::List< T >::NodeSettings::Object

Classes

struct  analog_channel_t
 
struct  channel_t
 
struct  digital_channel_t
 
struct  subdevice_t
 

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)
 
int 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 &)
 

Private Member Functions

bool analog_exists (DAQ::type_t, DAQ::index_t) const
 

Private Attributes

std::string deviceName
 
subdevice_t subdevice [3]
 
a4l_desc_t dsc
 

Additional Inherited Members

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

Detailed Description

Definition at line 31 of file analogy_device.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file analogy_device.cpp.

AnalogyDevice::~AnalogyDevice(void )

Definition at line 165 of file analogy_device.cpp.

Member Function Documentation

bool AnalogyDevice::analog_exists(DAQ::type_t type,
DAQ::index_t count 
)const
private

Definition at line 173 of file analogy_device.cpp.

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

Reimplemented from Settings::Object.

Definition at line 647 of file analogy_device.cpp.

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

Reimplemented from Settings::Object.

Definition at line 688 of file analogy_device.cpp.

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.

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.

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 436 of file analogy_device.cpp.

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

Implements DAQ::Device.

Definition at line 247 of file analogy_device.cpp.

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 341 of file analogy_device.cpp.

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 333 of file analogy_device.cpp.

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 309 of file analogy_device.cpp.

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 215 of file analogy_device.cpp.

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 255 of file analogy_device.cpp.

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 317 of file analogy_device.cpp.

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. index The channel's index.
Returns
The number of available references for the channel.

Implements DAQ::Device.

Definition at line 231 of file analogy_device.cpp.

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 273 of file analogy_device.cpp.

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 325 of file analogy_device.cpp.

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 239 of file analogy_device.cpp.

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 293 of file analogy_device.cpp.

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 349 of file analogy_device.cpp.

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 190 of file analogy_device.cpp.

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 182 of file analogy_device.cpp.

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 463 of file analogy_device.cpp.

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 488 of file analogy_device.cpp.

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.

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 428 of file analogy_device.cpp.

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

Definition at line 63 of file analogy_device.h.

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

Implements DAQ::Device.

Definition at line 453 of file analogy_device.cpp.

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

Implements DAQ::Device.

Definition at line 444 of file analogy_device.cpp.

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 419 of file analogy_device.cpp.

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 401 of file analogy_device.cpp.

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 357 of file analogy_device.cpp.

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 383 of file analogy_device.cpp.

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 392 of file analogy_device.cpp.

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 410 of file analogy_device.cpp.

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 198 of file analogy_device.cpp.

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 472 of file analogy_device.cpp.

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 572 of file analogy_device.cpp.

Member Data Documentation

std::string AnalogyDevice::deviceName
private

Definition at line 124 of file analogy_device.h.

a4l_desc_t AnalogyDevice::dsc
private

Definition at line 126 of file analogy_device.h.

subdevice_t AnalogyDevice::subdevice[3]
private

Definition at line 125 of file analogy_device.h.


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