Changeset 4532 in ntrip for trunk/BNC/src/bncrinex.cpp


Ignore:
Timestamp:
Aug 16, 2012, 9:18:57 AM (12 years ago)
Author:
mervart
Message:
 
File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.