Ignore:
Timestamp:
Mar 30, 2012, 6:38:05 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/upload/bncrtnetuploadcaster.cpp

    r3591 r3753  
    4646  int         sampl = settings.value("uploadSampl").toInt();
    4747  _samplOrb = settings.value("uploadSamplOrb").toDouble();
     48  if (_samplOrb == 0.0) {
     49    _usedEph = 0;
     50  }
     51  else {
     52    _usedEph = new QMap<QString, t_eph*>;
     53  }
    4854
    4955  // Raw Output
     
    190196  delete _sp3;
    191197  delete _ephUser;
     198  delete _usedEph;
    192199}
    193200
     
    267274    }
    268275
     276    t_eph* eph = 0;
    269277    const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(prn);
    270278    if (ephPair) {
    271       t_eph* eph = ephPair->last;
    272 
    273 // receptDateTime() not (yet?) defined
    274 //      if (ephPair->prev &&
    275 //           eph->receptDateTime().secsTo(QDateTime::currentDateTime()) < 60) {
    276 //        eph = ephPair->prev;
    277 //      }
     279
     280      // Make sure the clock messages refer to same IOD as orbit messages
     281      // ----------------------------------------------------------------
     282      eph = ephPair->last;
     283      if (_usedEph) {
     284        if (fmod(epoTime.gpssec(), _samplOrb) == 0.0) {
     285          (*_usedEph)[prn] = eph;
     286        }
     287        else {
     288          eph = 0;
     289          if (_usedEph->contains(prn)) {
     290            t_eph* usedEph = _usedEph->value(prn);
     291            if      (usedEph == ephPair->last) {
     292              eph = ephPair->last;
     293            }
     294            else if (usedEph == ephPair->prev) {
     295              eph = ephPair->prev;
     296            }
     297          }
     298        }
     299      }
     300
     301      // receptDateTime() not (yet?) defined
     302      //      if (ephPair->prev &&
     303      //           eph->receptDateTime().secsTo(QDateTime::currentDateTime()) < 60) {
     304      //        eph = ephPair->prev;
     305      //      }
     306    }
     307
     308    if (eph) {
    278309
    279310      in >> xx(1) >> xx(2) >> xx(3) >> xx(4) >> xx(5)
Note: See TracChangeset for help on using the changeset viewer.