Follow this link to skip to the main content

analog_out.h

Go to the documentation of this file.
00001 // -*-c++-*- 
00002 //---------------------------< /-/ CLARAty /-/ >------------------------------
00003 /** 
00004  * @file  analog_out.h
00005  *
00006  * Analog output class.
00007  *
00008  * <br>@b Designer(s):  Issa Nesnas,
00009  *                      Won Kim
00010  * <br>@b Author(s):    Won Kim,
00011  *                      Issa Nesnas
00012  * <br>@b Date:         August 16, 2002
00013  *
00014  * <b>Software License:</b><br>
00015  * <code>  http://claraty.jpl.nasa.gov/license/open_src/  or
00016  *         file: license/open_src.txt  </code>
00017  *
00018  * &copy; 2006, Jet Propulsion Laboratory, California Institute of Technology<br>
00019  *
00020  * $Revision: 1.3 $
00021  */ 
00022 //-----------------------------------------------------------------------------
00023 
00024 #if !defined (__ANALOG_OUT_H)
00025 #define __ANALOG_OUT_H
00026 
00027 // Changed common_defs.h to share.h on Feb 26, 2007
00028 #include "claraty/share.h"
00029 #include "claraty/analog_out_impl.h"
00030 
00031 namespace claraty {
00032 
00033 //-------------------------------------------------------------------------
00034 //---------------<< analaog_out Class >>----------------------
00035 //-------------------------------------------------------------------------
00036 
00037 class AO {
00038 
00039  public:
00040   AO (AO_impl& ao_impl, int channel, float gain=0.0, float offset=0.0);
00041 
00042   AO_impl& impl() { return _ao_impl;}
00043   int get_channel() { return _channel;}
00044   void set_gain(float gain) {_gain = gain;}
00045   void set_offset(float offset) {_offset = offset;}
00046   float get_gain() { return _gain;}
00047   float get_offset() { return _offset;}
00048 
00049   void set_gain_for_V();                // unit in V
00050   void set_offset_for_V();              // unit in V
00051 
00052   int output(float data);       // data in physical unit, e.g., volt
00053                                 // convert to digital number for AO_impl
00054 
00055 private:
00056   AO_impl& _ao_impl;
00057   int _channel;
00058   float _gain;
00059   float _offset;
00060 };
00061 //-------------------------------------------------------------------------
00062 
00063 } // namespace claraty
00064 
00065 #endif // __ANALOG_OUT_H