claraty::AO Class Reference
#include <analog_out.h>
Collaboration diagram for claraty::AO:

Public Member Functions | |
| AO (AO_impl &ao_impl, int channel, float gain=0.0, float offset=0.0) | |
| AO_impl & | impl () |
| int | get_channel () |
| void | set_gain (float gain) |
| void | set_offset (float offset) |
| float | get_gain () |
| float | get_offset () |
| void | set_gain_for_V () |
| void | set_offset_for_V () |
| int | output (float data) |
Private Attributes | |
| AO_impl & | _ao_impl |
| int | _channel |
| float | _gain |
| float | _offset |
Detailed Description
Definition at line 37 of file analog_out.h.
Constructor & Destructor Documentation
| claraty::AO::AO | ( | AO_impl & | ao_impl, | |
| int | channel, | |||
| float | gain = 0.0, |
|||
| float | offset = 0.0 | |||
| ) |
Definition at line 40 of file analog_out.cc.
References _gain, _offset, output(), set_gain_for_V(), and set_offset_for_V().
00040 : 00041 _ao_impl (ao_impl), 00042 _channel (channel), 00043 _gain (gain), 00044 _offset (offset) 00045 { 00046 /* 00047 * if gain is 0 (default), assume conversion to Volt 00048 */ 00049 if (gain == 0.0) { 00050 set_gain_for_V(); // unit in V 00051 set_offset_for_V(); // unit in V 00052 } 00053 00054 #ifdef VERBOSE 00055 // logMsg("AO: channel= %d, gain= %f, offset= %f\n", _channel, _gain, _offset); 00056 cout << "AO: channel = " << channel << "; gain = " << _gain << "; offset = " << _offset << endl; 00057 #endif 00058 00059 00060 output(0.); // initialize to 0 V output 00061 00062 }
Here is the call graph for this function:

Member Function Documentation
| AO_impl& claraty::AO::impl | ( | ) | [inline] |
| int claraty::AO::get_channel | ( | ) | [inline] |
| void claraty::AO::set_gain | ( | float | gain | ) | [inline] |
| void claraty::AO::set_offset | ( | float | offset | ) | [inline] |
| float claraty::AO::get_gain | ( | ) | [inline] |
| float claraty::AO::get_offset | ( | ) | [inline] |
| void claraty::AO::set_gain_for_V | ( | ) |
Definition at line 81 of file analog_out.cc.
References _ao_impl, _channel, _gain, and claraty::AO_impl::get_gain_for_V().
Referenced by AO().
Here is the call graph for this function:

| void claraty::AO::set_offset_for_V | ( | ) |
Definition at line 87 of file analog_out.cc.
References _ao_impl, _channel, _offset, and claraty::AO_impl::get_offset_for_V().
Referenced by AO().
Here is the call graph for this function:

| int claraty::AO::output | ( | float | data | ) |
Definition at line 64 of file analog_out.cc.
References _ao_impl, _channel, _gain, _offset, and claraty::AO_impl::output().
Referenced by AO().
00065 { 00066 00067 int data2 = (int) (data * _gain + _offset); 00068 00069 _ao_impl.output(_channel, data2); 00070 00071 #ifdef VERBOSE 00072 // logMsg("AO::output(%f): _ao_impl.output(%d, %d)\n", data, _channel, data2); 00073 cout << "AO::output(" << dec << data << "): _ao_impl.output(" 00074 << _channel << ", " << hex << data2 << "): " << dec << endl; 00075 #endif 00076 00077 return 0; 00078 }
Here is the call graph for this function:

Member Data Documentation
AO_impl& claraty::AO::_ao_impl [private] |
Definition at line 56 of file analog_out.h.
Referenced by impl(), output(), set_gain_for_V(), and set_offset_for_V().
int claraty::AO::_channel [private] |
Definition at line 57 of file analog_out.h.
Referenced by get_channel(), output(), set_gain_for_V(), and set_offset_for_V().
float claraty::AO::_gain [private] |
Definition at line 58 of file analog_out.h.
Referenced by AO(), get_gain(), output(), set_gain(), and set_gain_for_V().
float claraty::AO::_offset [private] |
Definition at line 59 of file analog_out.h.
Referenced by AO(), get_offset(), output(), set_offset(), and set_offset_for_V().
The documentation for this class was generated from the following files: