00001 #pragma ident "$Id: Dumper.cpp 3140 2012-06-18 15:03:02Z susancummins $"
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 std::string Dumper::getClassName() const
00039 { return "Dumper"; }
00040
00041
00042
00043
00044
00045
00046
00047 satTypeValueMap& Dumper::Process( satTypeValueMap& gData )
00048 throw(ProcessingException)
00049 {
00050
00051 try
00052 {
00053
00054
00055 for( satTypeValueMap::const_iterator it = gData.begin();
00056 it!= gData.end();
00057 it++ )
00058 {
00059
00060
00061 *outStr << (*it).first << " ";
00062
00063
00064 printTypeID( (*it).second );
00065
00066
00067 *outStr << std::endl;
00068
00069 }
00070
00071 return gData;
00072
00073 }
00074 catch(Exception& u)
00075 {
00076
00077 ProcessingException e( getClassName() + ":"
00078 + u.what() );
00079
00080 GPSTK_THROW(e);
00081
00082 }
00083
00084 }
00085
00086
00087
00088
00089
00090
00091
00092 gnssRinex& Dumper::Process( gnssRinex& gData )
00093 throw(ProcessingException)
00094 {
00095
00096 try
00097 {
00098
00099
00100 for( satTypeValueMap::const_iterator it = gData.body.begin();
00101 it!= gData.body.end();
00102 it++ )
00103 {
00104
00105
00106 if( printTime )
00107 {
00108
00109 YDSTime time( gData.header.epoch );
00110
00111 *outStr << time.year << " "
00112 << time.doy << " "
00113 << time.sod << " ";
00114 }
00115
00116
00117 if( printStation )
00118 {
00119 *outStr << gData.header.source << " ";
00120 }
00121
00122
00123 *outStr << (*it).first << " ";
00124
00125
00126 printTypeID( (*it).second );
00127
00128
00129 *outStr << std::endl;
00130
00131 }
00132
00133 return gData;
00134
00135 }
00136 catch(Exception& u)
00137 {
00138
00139 ProcessingException e( getClassName() + ":"
00140 + u.what() );
00141
00142 GPSTK_THROW(e);
00143
00144 }
00145
00146 }
00147
00148
00149
00150
00151
00152
00153
00154
00155 Dumper& Dumper::addTypeSet( const TypeIDSet& printSet )
00156 {
00157
00158
00159 for( TypeIDSet::const_iterator pos = printSet.begin();
00160 pos != printSet.end();
00161 ++pos )
00162 {
00163 printTypeSet.insert(*pos);
00164 }
00165
00166 return (*this);
00167
00168 }
00169
00170
00171
00172
00173 void Dumper::printTypeID( const typeValueMap& tvMap )
00174 {
00175
00176
00177 for( typeValueMap::const_iterator itObs = tvMap.begin();
00178 itObs != tvMap.end();
00179 itObs++ )
00180 {
00181
00182
00183 if( printTypeSet.size() > 0 )
00184 {
00185
00186
00187 if( printTypeSet.find((*itObs).first) != printTypeSet.end() )
00188 {
00189 if( printType )
00190 {
00191 *outStr << (*itObs).first << " ";
00192 }
00193
00194 *outStr << (*itObs).second << " ";
00195 }
00196
00197 }
00198 else
00199 {
00200
00201 if( printType )
00202 {
00203 *outStr << (*itObs).first << " ";
00204 }
00205
00206 *outStr << (*itObs).second << " ";
00207
00208 }
00209
00210 }
00211
00212 return;
00213
00214 }
00215
00216
00217 }