LRAUV  revA
AnalogToDigital Class Reference

This class allows one to control loads on a load controller channel. More...

#include <AnalogToDigital.h>

Collaboration diagram for AnalogToDigital:

Public Member Functions

 AnalogToDigital (const ConfigURI &adCfg, const ConfigURI &vrefCfg, const ConfigURI &resCfg, bool useHardware, Logger &logger)
 Constructor. More...
 
 AnalogToDigital (const ConfigURI &adCfg, const ConfigURI &vrefCfg, const ConfigURI &resCfg, const ConfigURI &timeoutCfg, bool useHardware, Logger &logger)
 
virtual ~AnalogToDigital ()
 
void startRead ()
 Starts a read from the device Useful for slow devices. More...
 
float readCounts ()
 Reads from the device. More...
 
float readVolts ()
 Reads from the device and multiplies by vref per bit. More...
 
float read (float scale)
 Reads from the device and multiplies by scale. More...
 

Static Private Member Functions

static double ReadTimeout (const ConfigURI &timeoutUri, Logger &logger)
 
static float ReadVRefPerBit (const ConfigURI &vrefCfg, const ConfigURI &resCfg, Logger &logger)
 

Private Attributes

bool useHardware_
 
DeviceIOStream io_
 
float vrefPerBit_
 
Timespan timeout_
 
bool started_
 
Timestamp startTime_
 
Logger & logger_
 

Detailed Description

This class allows one to control loads on a load controller channel.

Constructor & Destructor Documentation

AnalogToDigital::AnalogToDigital ( const ConfigURI &  adCfg,
const ConfigURI &  vrefCfg,
const ConfigURI &  resCfg,
bool  useHardware,
Logger &  logger 
)

Constructor.

AnalogToDigital::AnalogToDigital ( const ConfigURI &  adCfg,
const ConfigURI &  vrefCfg,
const ConfigURI &  resCfg,
const ConfigURI &  timeoutCfg,
bool  useHardware,
Logger &  logger 
)
AnalogToDigital::~AnalogToDigital ( )
virtual

Member Function Documentation

float AnalogToDigital::read ( float  scale)
inline

Reads from the device and multiplies by scale.

References readCounts().

Referenced by readVolts(), Depth_Keller::run(), and Turner_Cyclops_rhodamine::runnable().

double AnalogToDigital::ReadTimeout ( const ConfigURI &  timeoutUri,
Logger &  logger 
)
staticprivate

References Slate::ReadOnce(), and Units::SECOND.

float AnalogToDigital::readVolts ( )
inline

Reads from the device and multiplies by vref per bit.

References read(), and vrefPerBit_.

Referenced by Onboard::run(), and CBIT::scanGFChan().

float AnalogToDigital::ReadVRefPerBit ( const ConfigURI &  vrefCfg,
const ConfigURI &  resCfg,
Logger &  logger 
)
staticprivate

Member Data Documentation

DeviceIOStream AnalogToDigital::io_
private

Referenced by readCounts(), and startRead().

Logger& AnalogToDigital::logger_
private

Referenced by readCounts().

bool AnalogToDigital::started_
private

Referenced by readCounts(), and startRead().

Timestamp AnalogToDigital::startTime_
private

Referenced by readCounts(), and startRead().

Timespan AnalogToDigital::timeout_
private

Referenced by readCounts().

bool AnalogToDigital::useHardware_
private
float AnalogToDigital::vrefPerBit_
private

Referenced by readVolts().


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