Changeset 78 in ntrip for trunk/BNC/bncrinex.cpp


Ignore:
Timestamp:
Aug 27, 2006, 11:09:02 AM (18 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncrinex.cpp

    r77 r78  
    3939// Write RINEX Header
    4040////////////////////////////////////////////////////////////////////////////
    41 void bncRinex::writeHeader() {
     41void bncRinex::writeHeader(struct converttimeinfo& cti, double second) {
    4242
    4343  // Open the Output File
     
    4646  _out.open(fname.data());
    4747
     48  // Write mandatory Records
     49  // -----------------------
     50  _out.setf(ios::fixed);
     51  _out.setf(ios::left);
     52
     53  double approxPos[3];  approxPos[0]  = approxPos[1]  = approxPos[2]  = 0.0;
     54  double antennaNEU[3]; antennaNEU[0] = antennaNEU[1] = antennaNEU[2] = 0.0;
     55
     56  _out << "     2.10           OBSERVATION DATA    G (GPS)             RINEX VERSION / TYPE" << endl;
     57  _out << "BNC                 LM                  27-Aug-2006         PGM / RUN BY / DATE"  << endl;
     58  _out << setw(60) << _statID.data()                               << "MARKER NAME"          << endl;
     59  _out << setw(60) << "BKG"                                        << "OBSERVER / AGENCY"    << endl;
     60  _out << setw(20) << "unknown"   
     61       << setw(20) << "unknown"
     62       << setw(20) << "unknown"                                    << "REC # / TYPE / VERS"  << endl;
     63  _out << setw(20) << "unknown"
     64       << setw(20) << "unknown"
     65       << setw(20) << " "                                          << "ANT # / TYPE"         << endl;
     66  _out.unsetf(ios::left);
     67  _out << setw(14) << setprecision(4) << approxPos[0]
     68       << setw(14) << setprecision(4) << approxPos[1]
     69       << setw(14) << setprecision(4) << approxPos[2]
     70       << "                  "                                     << "APPROX POSITION XYZ"  << endl;
     71  _out << setw(14) << setprecision(4) << antennaNEU[0]
     72       << setw(14) << setprecision(4) << antennaNEU[1]
     73       << setw(14) << setprecision(4) << antennaNEU[2]
     74       << "                  "                                     << "ANTENNA: DELTA H/E/N" << endl;
     75  _out << "     1     1                                                WAVELENGTH FACT L1/2" << endl;
     76  _out << "     4    P1    P2    L1    L2                              # / TYPES OF OBSERV"  << endl;
     77  _out << setw(6) << cti.year
     78       << setw(6) << cti.month
     79       << setw(6) << cti.day
     80       << setw(6) << cti.hour
     81       << setw(6) << cti.minute
     82       << setw(13) << setprecision(7) << second
     83       << "                 "                                      << "TIME OF FIRST OBS"    << endl;
     84  _out << "                                                            END OF HEADER"        << endl;
    4885
    4986  _headerWritten = true;
     
    68105  }
    69106
    70   // Write RINEX Header
    71   // ------------------
    72   if (!_headerWritten) {
    73     writeHeader();
    74   }
    75 
    76107  // Time of Epoch
    77108  // -------------
     
    79110  Observation* firstObs = *_obs.begin();
    80111  converttime(&cti, firstObs->GPSWeek, firstObs->GPSWeeks);
     112
     113  // Write RINEX Header
     114  // ------------------
     115  if (!_headerWritten) {
     116    writeHeader(cti, cti.second + fmod(firstObs->sec, 1.0));
     117  }
    81118
    82119  _out.setf(std::ios::fixed);
Note: See TracChangeset for help on using the changeset viewer.