#include <SambaFileReader.h>
Inherits Interpolator::FileReader.
Inheritance diagram for Interpolator::SambaFileReader:


Public Member Functions | ||||
| SambaFileReader () | ||||
| Default constructor. | ||||
| SambaFileReader (const std::string &sFileName) | ||||
This constructor requires 1 parameter :
| ||||
| SambaFileReader (const std::string &sFileName, long lNbColumns, long lNbLines) | ||||
This constructor requires 3 parameters :
| ||||
| virtual | ~SambaFileReader () | |||
| Destructor. | ||||
| virtual void | Parse () | |||
| This method parse the buffer to read a Samba file In this case only the 2 and 5 columns are extracted The column 2 is the theta encoder value variable column The column 5 is the theta real value variable column. | ||||
| double * | getThetaEncoder () const | |||
| Return the encoder theta values array. | ||||
| double * | getThetaReal () const | |||
| Return the real theta values array. | ||||
| double * | getThetaDiff () const | |||
| Return the (theta encoder - theta real) values array. | ||||
| double | getXValue (int i) const | |||
Return the ith value of the X part of the array (in this case Theta Encoder values)
| ||||
| double | getYValue (int i) const | |||
Return the ith value of the Y part of the array (in this case Theta Real values)
| ||||
| double | getThetaEncoderValue (int i) const | |||
Return the ith value of Theta Encoder array
| ||||
| double | getThetaRealValue (int i) const | |||
Return the ith value of Theta Real array
| ||||
Private Attributes | ||||
| double * | _mThetaEncoder | |||
| double * | _mThetaReal | |||
| double * | _mThetaDiff | |||
Definition at line 23 of file SambaFileReader.h.
|
|
Default constructor.
Definition at line 21 of file SambaFileReader.cpp.
|
|
|
This constructor requires 1 parameter :
Definition at line 52 of file SambaFileReader.cpp. References Parse(). 00052 : FileReader(sFileName) 00053 { 00054 Parse(); 00055 }
Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
This constructor requires 3 parameters :
Definition at line 61 of file SambaFileReader.cpp. References Parse(). 00061 : FileReader(sFileName,lNbColumns,lNbLines) 00062 { 00063 Parse(); 00064 }
Here is the call graph for this function: ![]() |
|
|
Destructor.
Definition at line 27 of file SambaFileReader.cpp. References _mThetaDiff, _mThetaEncoder, and _mThetaReal. 00028 { 00029 00030 if (_mThetaEncoder) 00031 { 00032 delete [] _mThetaEncoder; 00033 _mThetaEncoder = 0; 00034 } 00035 00036 if (_mThetaReal) 00037 { 00038 delete [] _mThetaReal; 00039 _mThetaReal = 0; 00040 } 00041 00042 if (_mThetaDiff) 00043 { 00044 delete [] _mThetaDiff; 00045 _mThetaDiff = 0; 00046 } 00047 00048 }
|
|
|
Return the (theta encoder - theta real) values array.
Definition at line 157 of file SambaFileReader.cpp. References _mThetaDiff. 00158 { 00159 if (_mThetaDiff == 0) throw NullPointerException("_mThetaDiff","SambaFileReader::getThetaDiff()",__FILE__,__LINE__); 00160 return _mThetaDiff; 00161 }
|
|
|
Return the encoder theta values array.
Definition at line 143 of file SambaFileReader.cpp. References _mThetaEncoder. 00144 { 00145 if (_mThetaEncoder == 0) throw NullPointerException("_mThetaEncoder","SambaFileReader::getThetaEncoder()",__FILE__,__LINE__); 00146 return _mThetaEncoder; 00147 }
|
|
|
Return the ith value of Theta Encoder array
Definition at line 189 of file SambaFileReader.cpp. 00190 { 00191 00192 if ((0<=i) && (i<getNbData())) 00193 { 00194 return getXValue(i); 00195 } 00196 else throw IndexOutOfBoundException("i",i,0,getNbData(),"SambaFileReader::getThetaEncoderValue(int i)",__FILE__,__LINE__); 00197 }
|
|
|
Return the real theta values array.
Definition at line 150 of file SambaFileReader.cpp. References _mThetaReal. 00151 { 00152 if (_mThetaReal == 0) throw NullPointerException("_mThetaEncoder","SambaFileReader::getThetaEncoder()",__FILE__,__LINE__); 00153 return _mThetaReal; 00154 }
|
|
|
Return the ith value of Theta Real array
Definition at line 201 of file SambaFileReader.cpp. 00202 { 00203 00204 if ((0<=i) && (i<getNbData())) 00205 { 00206 return getYValue(i); 00207 } 00208 else throw IndexOutOfBoundException("i",i,0,getNbData(),"SambaFileReader::getThetaRealValue(int i)",__FILE__,__LINE__); 00209 }
|
|
|
Return the ith value of the X part of the array (in this case Theta Encoder values)
Definition at line 165 of file SambaFileReader.cpp. 00166 { 00167 if ((0<=i) && (i<getNbData())) 00168 { 00169 return _mThetaEncoder[i]; 00170 } 00171 else throw IndexOutOfBoundException("i",i,0,getNbData(),"SambaFileReader::getXValue(int i)",__FILE__,__LINE__); 00172 }
|
|
|
Return the ith value of the Y part of the array (in this case Theta Real values)
Definition at line 176 of file SambaFileReader.cpp. 00177 { 00178 00179 if ((0<=i) && (i<getNbData())) 00180 { 00181 return _mThetaReal[i]; 00182 } 00183 else throw IndexOutOfBoundException("i",i,0,getNbData(),"SambaFileReader::getYValue(int i)",__FILE__,__LINE__); 00184 00185 }
|
|
|
This method parse the buffer to read a Samba file We convert the dValue given in degre in the file into radians in order to work properly with the library Implements Interpolator::FileReader. Definition at line 70 of file SambaFileReader.cpp. References _mThetaDiff, _mThetaEncoder, _mThetaReal, Interpolator::Interpolator::_verb, Interpolator::FileReader::extractDouble(), Interpolator::FileReader::extractString(), Interpolator::FileReader::getNbData(), and Interpolator::FileReader::getNbVariables(). Referenced by SambaFileReader(). 00071 { 00072 00073 int iNbData = getNbData(); 00074 if(Interpolator::_verb == true) cout << "NbData : " << iNbData << endl; 00075 00076 int iNbVariables = getNbVariables(); 00077 if(Interpolator::_verb == true) cout << "NbVariables : " << iNbVariables << endl; 00078 00079 //Reading of the first line to extract the variables names 00080 std::string sColumn1Name; 00081 00082 int i=0; 00083 00084 for (i=0;i<iNbVariables;i++) 00085 { 00086 sColumn1Name = extractString(); 00087 if(Interpolator::_verb == true) cout << "Column " << i << " --> " << sColumn1Name << endl; 00088 } 00089 00090 _mThetaEncoder = new double[iNbData]; 00091 _mThetaReal = new double[iNbData]; 00092 _mThetaDiff = new double[iNbData]; 00093 double dValue; 00094 00096 for (i=0;i<iNbData;i++) 00097 { 00098 for (int j=0;j<iNbVariables;j++) 00099 { 00100 dValue = extractDouble(); 00101 00102 if (j==1) 00103 { 00104 _mThetaEncoder[i] = DegresToRadians(dValue); 00105 } 00106 if (j==4) 00107 { 00108 _mThetaReal[i] = DegresToRadians(dValue); 00109 } 00110 if (j==5) 00111 { 00112 _mThetaDiff[i] = DegresToRadians(dValue); 00113 } 00114 } 00115 00116 } 00117 00118 if(Interpolator::_verb == true) cout << "_mThetaEncoder" <<endl; 00119 for (int k=0;k<iNbData;k++) 00120 { 00121 if(Interpolator::_verb == true) cout.precision(10); 00122 if(Interpolator::_verb == true) cout << "k=" << k << " --> " << _mThetaEncoder[k] << endl; 00123 } 00124 00125 if(Interpolator::_verb == true) cout << "_mThetaReal" <<endl; 00126 for (int l=0;l<iNbData;l++) 00127 { 00128 if(Interpolator::_verb == true) cout.precision(10); 00129 if(Interpolator::_verb == true) cout << "l=" << l << " --> " << _mThetaReal[l] << endl; 00130 } 00131 00132 if(Interpolator::_verb == true) cout << "ThetaEncoder-ThetaReal" <<endl; 00133 for (int m=0;m<iNbData;m++) 00134 { 00135 if(Interpolator::_verb == true) cout.precision(10); 00136 if(Interpolator::_verb == true) cout << "m=" << m << " --> " << _mThetaDiff[m] << endl; 00137 } 00138 00139 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 47 of file SambaFileReader.h. Referenced by getThetaDiff(), Parse(), and ~SambaFileReader(). |
|
|
Definition at line 45 of file SambaFileReader.h. Referenced by getThetaEncoder(), Parse(), and ~SambaFileReader(). |
|
|
Definition at line 46 of file SambaFileReader.h. Referenced by getThetaReal(), Parse(), and ~SambaFileReader(). |
1.4.5