From eea3c2a5c737787950f86343cc5f669e2c60fa47 Mon Sep 17 00:00:00 2001 From: Bryan Parsons Date: Fri, 20 May 2016 12:52:03 -0500 Subject: [PATCH] RinDump and RinEdit bug fixes, submitted by Brian Tolman. 2-3 important bugs fixed with 1-line fixes. --- core/apps/Rinextools/RinDump.cpp | 5 +++-- ext/apps/Rinextools/RinEdit.cpp | 29 ++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/core/apps/Rinextools/RinDump.cpp b/core/apps/Rinextools/RinDump.cpp index 8dbb15996..0fa1226db 100644 --- a/core/apps/Rinextools/RinDump.cpp +++ b/core/apps/Rinextools/RinDump.cpp @@ -1747,7 +1747,7 @@ try { vector resets; // check for reset of bias on any lc for(i=0; i" << oi << "< data is zero"; - continue; // data is missing + value = 0.0; return value; + //continue; // data is missing } obsid = oi; diff --git a/ext/apps/Rinextools/RinEdit.cpp b/ext/apps/Rinextools/RinEdit.cpp index 99d3d2696..c2c755c4e 100644 --- a/ext/apps/Rinextools/RinEdit.cpp +++ b/ext/apps/Rinextools/RinEdit.cpp @@ -420,8 +420,18 @@ int processFiles(void) throw(Exception) LOG(DEBUG) << "Input header for RINEX file " << filename; Rhead.dump(LOGstrm); } + // dump the obs types + map >::const_iterator kt; + for(kt = Rhead.mapObsTypes.begin(); kt != Rhead.mapObsTypes.end(); kt++) { + sat.fromString(kt->first); + oss.str(""); + oss << "# Header ObsIDs " << sat.systemString3() //<< " " << kt->first + << " (" << kt->second.size() << "):"; + for(i=0; isecond.size(); i++) oss << " " << kt->second[i].asString(); + LOG(INFO) << oss.str(); + } - // we have to set the time system of all the timetags using ttag from file !! + // we have to set the time system of all the timetags using ttag from file vector::iterator jt; for(jt=C.vecCmds.begin(); jt != C.vecCmds.end(); ++jt) jt->ttag.setTimeSystem(Rhead.firstObs.getTimeSystem()); @@ -651,8 +661,8 @@ int processOneEpoch(Rinex3ObsHeader& Rhead, Rinex3ObsHeader& RHout, // for cmds with ttag <= now either execute and delete, or move to current it = C.vecCmds.begin(); while(it != C.vecCmds.end()) { - LOG(DEBUG) << "Process vec cmd " << it->asString(); if(it->ttag <= now || ::fabs(it->ttag - now) < C.timetol) { + LOG(DEBUG) << "Execute vec cmd " << it->asString(); // delete one-time cmds, move others to curr and delete iret = executeEditCmd(it, RHout, RDout); if(iret < 0) return iret; // fatal error @@ -660,15 +670,14 @@ int processOneEpoch(Rinex3ObsHeader& Rhead, Rinex3ObsHeader& RHout, // keep this command on the current list if(iret > 0) toCurr.push_back(*it); // C.currCmds.push_back(*it); - // if this is a '-' cmd to be deleted, find matching '+' and delete it + // if this is a '-' cmd to be deleted, find matching '+' and delete // note fixEditCmdList() forced every - to have a corresponding + if(iret == 0 && it->sign == -1) { for(jt = C.currCmds.begin(); jt != C.currCmds.end(); ++jt) if(jt->type==it->type && jt->sat==it->sat && jt->obs==it->obs) break; - if(jt == C.currCmds.end()) - GPSTK_THROW(Exception(string( - "Execute failed to find + cmd matching ") + it->asString())); + if(jt == C.currCmds.end()) GPSTK_THROW(Exception( + string("Execute failed to find + cmd matching ")+it->asString())); C.currCmds.erase(jt); } @@ -883,8 +892,9 @@ int executeEditCmd(const vector::iterator& it, Rinex3ObsHeader& Rhead, Rdata.obs[sats[j]][i].lli = it->idata; break; // BD bias data ------------------------------------------------------- - case EditCmd::bdCT: - Rdata.obs[sats[j]][i].data += it->data; + case EditCmd::bdCT: // do not bias + if(Rdata.obs[sats[j]][i].data != 0.0 || C.messBZ) + Rdata.obs[sats[j]][i].data += it->data; break; // BS bias SSI -------------------------------------------------------- case EditCmd::bsCT: @@ -1462,9 +1472,10 @@ void fixEditCmdList(void) throw() if(jt->sign == 1) havePair=true; // its a match else if(jt->sign == -1) { // this is an error LOG(ERROR) << it->asString("Error: repeat '-'"); + //LOG(ERROR) << jt->asString("Error: ref here "); it->type = EditCmd::invalidCT; - break; } + break; } if(jt == C.vecCmds.begin()) break; --jt;