00001 /************************************************************************************************/ 00002 /*! \file DMUAccelerometer.cpp 00003 * \brief The DMUAccelerometer class provides the interface for h/w DMU acclerometers. 00004 * \author $Author: jayhawk_hokie $ 00005 * \version $Revision: 1.5 $ 00006 * \date $Date: 2007/05/22 18:21:11 $ 00007 ************************************************************************************************/ 00008 /*! 00009 * 00010 ************************************************************************************************/ 00011 00012 #include "DMUAccelerometer.h" 00013 #include <iostream> 00014 using namespace std; 00015 00016 /*! \brief DMUAccelerometer constructor 00017 * @ param handle XML handle with current whorl as starting node 00018 * @ param accString name of accelerometer as given in xml config file 00019 */ 00020 00021 DMUAccelerometer::DMUAccelerometer(TiXmlHandle handle, string accString) 00022 { 00023 int response; // error checking for xml 00024 00025 // use xml parser to get config data 00026 00027 TiXmlHandle accelHandle = handle.FirstChild("HARDWARE_PROPERTIES").FirstChild("DMU_ACCELEROMETER").FirstChild(accString); 00028 00029 response = accelHandle.Child("ChannelID",0).Element() -> QueryIntAttribute("value", &m_channelID); 00030 checkResponse(response); 00031 response = accelHandle.Child("Mode",0).Element() -> QueryIntAttribute("value", &m_mode); 00032 checkResponse(response); 00033 response = accelHandle.Child("Offset",0).Element() -> QueryFloatAttribute("value", &m_offset); 00034 checkResponse(response); 00035 response = accelHandle.Child("ScaleFactor",0).Element() -> QueryFloatAttribute("value", &m_accelScaleFactor); 00036 checkResponse(response); 00037 00038 if (DMUAccelerometer::Initialize() != 0) 00039 { 00040 cout << " error, DMUAccelerometer::Initialize() is not happy " << endl; 00041 } 00042 else 00043 { 00044 cerr << "\nSensor Set: " << accString << endl; 00045 } 00046 }; 00047 00048 // Do not change the comments below - they will be added automatically by CVS 00049 /***************************************************************************** 00050 * $Log: DMUAccelerometer.cpp,v $ 00051 * Revision 1.5 2007/05/22 18:21:11 jayhawk_hokie 00052 * *** empty log message *** 00053 * 00054 * Revision 1.4 2007/01/12 20:23:28 bwilliam 00055 * Modified to use XML parser. 00056 * 00057 * Revision 1.3 2004/05/27 19:07:28 shoemaker 00058 * Made changes corresponding to new daq card settings and calibration methods 00059 * 00060 * Revision 1.2 2004/03/29 16:43:11 shoemaker 00061 * Added code to work with analog DAQ card code 00062 * 00063 * Revision 1.1 2003/08/18 19:13:25 mavandyk 00064 * Moved funciton bodies to implementation file 00065 * 00066 * Revision 1.4 2003/07/18 17:22:13 shoemaker 00067 * Now uses Measurement class. Still has timing and data-wasting issues. 00068 * 00069 * Revision 1.3 2003/07/03 16:54:50 shoemaker 00070 * Added semi-working versions of DMU code 00071 * 00072 * Revision 1.2 2003/06/26 20:12:08 mavandyk 00073 * Added code to inline functions for the calls to the DMU class. 00074 * 00075 * Revision 1.1 2003/06/25 21:49:23 mavandyk 00076 * Alter architechture of class structure. 00077 * 00078 * Revision 1.1.1.1 2003/06/06 18:44:15 simpliciter 00079 * Initial submission. 00080 * 00081 * 00082 ******************************************************************************/