Changeset 884 in ntrip for trunk/BNS/bns.cpp


Ignore:
Timestamp:
May 8, 2008, 3:36:12 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bns.cpp

    r874 r884  
    3939  _bnseph = new t_bnseph(parent);
    4040
    41   connect(_bnseph, SIGNAL(newEph(gpsEph*)), this, SLOT(slotNewEph(gpsEph*)));
     41  connect(_bnseph, SIGNAL(newEph(t_eph*)), this, SLOT(slotNewEph(t_eph*)));
    4242  connect(_bnseph, SIGNAL(newMessage(QByteArray)),
    4343          this, SLOT(slotMessage(const QByteArray)));
     
    229229//
    230230////////////////////////////////////////////////////////////////////////////
    231 void t_bns::slotNewEph(gpsEph* ep) {
     231void t_bns::slotNewEph(t_eph* ep) {
    232232
    233233  QMutexLocker locker(&_mutex);
    234234
    235235  t_ephPair* pair;
    236   if ( !_ephList.contains(ep->prn) ) {
     236  if ( !_ephList.contains(ep->prn()) ) {
    237237    pair = new t_ephPair();
    238     _ephList.insert(ep->prn, pair);
    239   }
    240   else {
    241     pair = _ephList[ep->prn];
     238    _ephList.insert(ep->prn(), pair);
     239  }
     240  else {
     241    pair = _ephList[ep->prn()];
    242242  }
    243243
     
    246246  }
    247247  else {
    248     if (ep->GPSweek >  pair->eph->GPSweek ||
    249         (ep->GPSweek == pair->eph->GPSweek && ep->TOC > pair->eph->TOC)) {
     248    if (ep->isNewerThan(pair->eph)) {
    250249      delete pair->oldEph;
    251250      pair->oldEph = pair->eph;
     
    328327        QString      prn;
    329328        ColumnVector xx(4);
    330         gpsEph*      ep = 0;
     329        t_eph*       ep = 0;
    331330
    332331        if (oldEph == 0) {
     
    344343          if ( _ephList.contains(prn) ) {
    345344            t_ephPair* pair = _ephList[prn];
    346             prn = pair->eph->prn;
     345            prn = pair->eph->prn();
    347346            xx  = pair->xx;
    348347            ep  = pair->oldEph;
     
    379378//
    380379////////////////////////////////////////////////////////////////////////////
    381 void t_bns::processSatellite(gpsEph* ep, int GPSweek, double GPSweeks,
     380void t_bns::processSatellite(t_eph* ep, int GPSweek, double GPSweeks,
    382381                             const QString& prn, const ColumnVector& xx,
    383382                             struct ClockOrbit::SatData* sd) {
     
    386385  ColumnVector vv(3);
    387386
    388   satellitePosition(GPSweek, GPSweeks, ep, xB(1), xB(2), xB(3), xB(4),
    389                     vv(1), vv(2), vv(3));
     387  ep->position(GPSweek, GPSweeks, xB, vv);
    390388
    391389  ColumnVector dx   = xx.Rows(1,3) - xB.Rows(1,3);
     
    397395  if (sd) {
    398396    sd->ID                    = prn.mid(1).toInt();
    399     sd->IOD                   = int(ep->IODE);
     397    sd->IOD                   = ep->IOD();
    400398    sd->Clock.DeltaA0         = dClk;
    401399    sd->Orbit.DeltaRadial     = rsw(1);
     
    406404  if (_outStream) {
    407405    QString line;
    408     line.sprintf("%d %.1f %s   %3d %3d   %8.3f   %8.3f %8.3f %8.3f\n",
    409                  GPSweek, GPSweeks, ep->prn.toAscii().data(),
    410                  int(ep->IODC), int(ep->IODE), dClk, rsw(1), rsw(2), rsw(3));
    411      *_outStream << line;
     406    line.sprintf("%d %.1f %s   %3d   %8.3f   %8.3f %8.3f %8.3f\n",
     407                 GPSweek, GPSweeks, ep->prn().toAscii().data(),
     408                 ep->IOD(), dClk, rsw(1), rsw(2), rsw(3));
     409    *_outStream << line;
    412410    _outStream->flush();
    413411  }
Note: See TracChangeset for help on using the changeset viewer.