00001 #pragma ident "$Id: Dumper.cpp 1972 2009-06-23 17:01:38Z architest $"
00002
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "Dumper.hpp"
00032
00033
00034 namespace gpstk
00035 {
00036
00037
00038 int Dumper::classIndex = 8200000;
00039
00040
00041
00042 int Dumper::getIndex() const
00043 { return index; }
00044
00045
00046
00047 std::string Dumper::getClassName() const
00048 { return "Dumper"; }
00049
00050
00051
00052
00053
00054
00055
00056 satTypeValueMap& Dumper::Process( satTypeValueMap& gData )
00057 throw(ProcessingException)
00058 {
00059
00060 try
00061 {
00062
00063
00064 for( satTypeValueMap::const_iterator it = gData.begin();
00065 it!= gData.end();
00066 it++ )
00067 {
00068
00069
00070 *outStr << (*it).first << " ";
00071
00072
00073 printTypeID( (*it).second );
00074
00075
00076 *outStr << std::endl;
00077
00078 }
00079
00080 return gData;
00081
00082 }
00083 catch(Exception& u)
00084 {
00085
00086 ProcessingException e( getClassName() + ":"
00087 + StringUtils::asString( getIndex() ) + ":"
00088 + u.what() );
00089
00090 GPSTK_THROW(e);
00091
00092 }
00093
00094 }
00095
00096
00097
00098
00099
00100
00101
00102 gnssRinex& Dumper::Process( gnssRinex& gData )
00103 throw(ProcessingException)
00104 {
00105
00106 try
00107 {
00108
00109
00110 for( satTypeValueMap::const_iterator it = gData.body.begin();
00111 it!= gData.body.end();
00112 it++ )
00113 {
00114
00115
00116 if( printTime )
00117 {
00118 *outStr << gData.header.epoch.year() << " "
00119 << gData.header.epoch.DOY() << " "
00120 << gData.header.epoch.DOYsecond() << " ";
00121 }
00122
00123
00124 if( printStation )
00125 {
00126 *outStr << gData.header.source << " ";
00127 }
00128
00129
00130 *outStr << (*it).first << " ";
00131
00132
00133 printTypeID( (*it).second );
00134
00135
00136 *outStr << std::endl;
00137
00138 }
00139
00140 return gData;
00141
00142 }
00143 catch(Exception& u)
00144 {
00145
00146 ProcessingException e( getClassName() + ":"
00147 + StringUtils::asString( getIndex() ) + ":"
00148 + u.what() );
00149
00150 GPSTK_THROW(e);
00151
00152 }
00153
00154 }
00155
00156
00157
00158
00159
00160
00161
00162
00163 Dumper& Dumper::addTypeSet( const TypeIDSet& printSet )
00164 {
00165
00166
00167 for( TypeIDSet::const_iterator pos = printSet.begin();
00168 pos != printSet.end();
00169 ++pos )
00170 {
00171 printTypeSet.insert(*pos);
00172 }
00173
00174 return (*this);
00175
00176 }
00177
00178
00179
00180
00181 void Dumper::printTypeID( const typeValueMap& tvMap )
00182 {
00183
00184
00185 for( typeValueMap::const_iterator itObs = tvMap.begin();
00186 itObs != tvMap.end();
00187 itObs++ )
00188 {
00189
00190
00191 if( printTypeSet.size() > 0 )
00192 {
00193
00194
00195 if( printTypeSet.find((*itObs).first) != printTypeSet.end() )
00196 {
00197 if( printType )
00198 {
00199 *outStr << (*itObs).first << " ";
00200 }
00201
00202 *outStr << (*itObs).second << " ";
00203 }
00204
00205 }
00206 else
00207 {
00208
00209 if( printType )
00210 {
00211 *outStr << (*itObs).first << " ";
00212 }
00213
00214 *outStr << (*itObs).second << " ";
00215
00216 }
00217
00218 }
00219
00220 return;
00221
00222 }
00223
00224
00225
00226 }