Changeset 4532 in ntrip


Ignore:
Timestamp:
Aug 16, 2012, 9:18:57 AM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncrinex.cpp

    r4506 r4532  
    177177// Read Skeleton Header File
    178178////////////////////////////////////////////////////////////////////////////
    179 void bncRinex::readSkeleton() {
     179bool bncRinex::readSkeleton() {
     180
     181  bool readDone = false;
    180182
    181183  // Read the local file
     
    183185  QFile skl(_sklName);
    184186  if ( skl.exists() && skl.open(QIODevice::ReadOnly) ) {
     187    readDone = true;
    185188    QTextStream in(&skl);
    186189    _header.read(&in);
     
    193196    QDate currDate = currentDateAndTimeGPS().date();
    194197    if ( !_skeletonDate.isValid() || _skeletonDate != currDate ) {
    195       downloadSkeleton();
     198      if (downloadSkeleton() == success) {
     199        readDone = true;
     200      }
    196201      _skeletonDate = currDate;
    197202    }
    198203  }
     204
     205  return readDone;
    199206}
    200207
     
    335342  // Read Skeleton Header
    336343  // --------------------
    337   readSkeleton();
     344  bool skelRead = readSkeleton();
    338345
    339346  // Set RINEX Version
     
    348355  // A Few Additional Comments
    349356  // -------------------------
    350   QStringList addComments;
    351   addComments << format.left(6) + " " + _mountPoint.host() + _mountPoint.path();
    352 
    353   if (_nmea == "yes") {
    354     addComments << "NMEA LAT=" + _latitude + " " + "LONG=" + _longitude;
     357  if (skelRead || _addComments.size() == 0) {
     358    _addComments.clear();
     359    _addComments << format.left(6) + " "
     360                                   + _mountPoint.host() + _mountPoint.path();
     361    if (_nmea == "yes") {
     362      _addComments << "NMEA LAT=" + _latitude + " " + "LONG=" + _longitude;
     363    }
    355364  }
    356365
     
    371380  // ---------------------------
    372381  if (_header._obsTypesV3.size() == 0) {
    373     if (_header._version >= 3.0) {
    374       addComments << "Default set of observation types used";
     382    if (skelRead && _header._version >= 3.0) {
     383      _addComments << "Default set of observation types used";
    375384    }
    376385    _header._obsTypesV3['G'] << "C1C" << "L1C" << "D1C" << "S1C"
     
    410419
    411420  QMap<QString, QString> txtMap;
    412   txtMap["COMMENT"] = addComments.join("\\n");
     421  txtMap["COMMENT"] = _addComments.join("\\n");
    413422
    414423  _header.write(&outHlp, &txtMap);
  • trunk/BNC/src/bncrinex.h

    r4502 r4532  
    5555   static std::string obsToStr(double val, int width = 14, int precision = 3);
    5656   void resolveFileName(const QDateTime& datTim);
    57    void readSkeleton();
     57   bool readSkeleton();
    5858   void writeHeader(const QByteArray& format, const QDateTime& datTimNom);
    5959   void closeFile();
     
    7878   QDate         _skeletonDate;
    7979   int           _samplingRate;
     80   QStringList   _addComments;
    8081
    8182   QMap<QString, int>  _slip_cnt_L1;
Note: See TracChangeset for help on using the changeset viewer.