Changeset 6352 in ntrip


Ignore:
Timestamp:
Nov 26, 2014, 7:08:04 PM (9 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/orbComp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/orbComp/sp3Comp.cpp

    r6351 r6352  
    9696
    9797  try {
    98     compare();
     98    ostringstream msg;
     99    compare(msg);
     100    *_log << msg.str().c_str();
    99101  }
    100102  catch (const string& error) {
     
    192194// Main Routine
    193195////////////////////////////////////////////////////////////////////////////////
    194 void t_sp3Comp::compare() const {
     196void t_sp3Comp::compare(ostringstream& out) const {
    195197
    196198  // Synchronize reading of two sp3 files
     
    262264      }
    263265      else {
    264         cerr << "not found: " << prn << endl;
     266        throw "not found: " + prn.toString();
    265267      }
    266268    }
     
    277279  const string all = "ZZZ";
    278280
    279   cout.setf(ios::fixed);
    280   cout << "!\n!  MJD       PRN  radial   along   out        clk    clkRed   iPRN"
     281  out.setf(ios::fixed);
     282  out << "!\n!  MJD       PRN  radial   along   out        clk    clkRed   iPRN"
    281283           "\n! ----------------------------------------------------------------\n";
    282284  for (unsigned ii = 0; ii < epochs.size(); ii++) {
     
    287289      const t_prn&  prn = it->first;
    288290      const ColumnVector& rao = it->second;
    289       cout << setprecision(6) << epo->_tt.mjddec() << ' ' << prn << ' '
    290            << setw(7) << setprecision(4) << rao[0] << ' '
    291            << setw(7) << setprecision(4) << rao[1] << ' '
    292            << setw(7) << setprecision(4) << rao[2] << "    ";
     291      out << setprecision(6) << epo->_tt.mjddec() << ' ' << prn << ' '
     292          << setw(7) << setprecision(4) << rao[0] << ' '
     293          << setw(7) << setprecision(4) << rao[1] << ' '
     294          << setw(7) << setprecision(4) << rao[2] << "    ";
    293295      stat[prn.toString()]._rao += SP(rao, rao); // Schur product
    294296      stat[prn.toString()]._nr  += 1;
     
    298300        double clkRes    = dc.find(prn)->second;
    299301        double clkResRed = clkRes - it->second[0]; // clock minus radial component
    300         cout << setw(7) << setprecision(4) << clkRes << ' '
    301              << setw(7) << setprecision(4) << clkResRed;
     302        out << setw(7) << setprecision(4) << clkRes << ' '
     303            << setw(7) << setprecision(4) << clkResRed;
    302304        stat[prn.toString()]._dc    += clkRes * clkRes;
    303305        stat[prn.toString()]._dcRed += clkResRed * clkResRed;
     
    308310      }
    309311      else {
    310         cout << "  .       .    ";
    311       }
    312       cout << "    " << setw(2) << int(prn) << endl;
     312        out << "  .       .    ";
     313      }
     314      out << "    " << setw(2) << int(prn) << endl;
    313315    }
    314316    delete epo;
     
    317319  // Print Summary
    318320  // -------------
    319   cout << "!\n! RMS:\n";
     321  out << "!\n! RMS:\n";
    320322  for (map<string, t_stat>::iterator it = stat.begin(); it != stat.end(); it++) {
    321323    const string& prn  = it->first;
     
    326328      stat._rao[2] = sqrt(stat._rao[2] / stat._nr);
    327329      if (prn == all) {
    328         cout << "!\n!          Total ";
     330        out << "!\n!          Total ";
    329331      }
    330332      else {
    331         cout << "!            " << prn << ' ';
    332       }
    333       cout << setw(7) << setprecision(4) << stat._rao[0] << ' '
    334            << setw(7) << setprecision(4) << stat._rao[1] << ' '
    335            << setw(7) << setprecision(4) << stat._rao[2] << "    ";
     333        out << "!            " << prn << ' ';
     334      }
     335      out << setw(7) << setprecision(4) << stat._rao[0] << ' '
     336          << setw(7) << setprecision(4) << stat._rao[1] << ' '
     337          << setw(7) << setprecision(4) << stat._rao[2] << "    ";
    336338      if (stat._nc > 0) {
    337339        stat._dc    = sqrt(stat._dc / stat._nc);
    338340        stat._dcRed = sqrt(stat._dcRed / stat._nc);
    339         cout << setw(7) << setprecision(4) << stat._dc << ' '
    340              << setw(7) << setprecision(4) << stat._dcRed;
     341        out << setw(7) << setprecision(4) << stat._dc << ' '
     342            << setw(7) << setprecision(4) << stat._dcRed;
    341343        if (prn != all) {
    342           cout << "    offset " << setw(7) << setprecision(4) << stat._offset;
     344          out << "    offset " << setw(7) << setprecision(4) << stat._offset;
    343345        }
    344346      }
    345347      else {
    346         cout << "  .       .    ";
    347       }
    348       cout << endl;
    349     }
    350   }
    351 }
     348        out << "  .       .    ";
     349      }
     350      out << endl;
     351    }
     352  }
     353}
  • trunk/BNC/src/orbComp/sp3Comp.h

    r6348 r6352  
    3030#include <vector>
    3131#include <string>
     32#include <sstream>
    3233#include <QtCore>
    3334#include <newmat.h>
     
    8384  void processClocks(const std::set<t_prn>& clkSats, std::vector<t_epoch*>& epochs,
    8485                     std::map<std::string, t_stat>& stat) const;
    85   void compare() const;
     86  void compare(std::ostringstream& out) const;
    8687
    8788  QStringList  _sp3FileNames;
Note: See TracChangeset for help on using the changeset viewer.