Changeset 7716 in ntrip for trunk


Ignore:
Timestamp:
Feb 2, 2016, 4:40:56 PM (8 years ago)
Author:
stuerze
Message:

minor changes

Location:
trunk/BNC/src
Files:
2 edited

Legend:

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

    r7208 r7716  
    3434 * Created:    27-Jan-2011
    3535 *
    36  * Changes:   
     36 * Changes:
    3737 *
    3838 * -----------------------------------------------------------------------*/
     
    5151    connect(BNC_CORE, SIGNAL(newGPSEph(t_ephGPS)),
    5252            this, SLOT(slotNewGPSEph(t_ephGPS)), Qt::DirectConnection);
    53  
     53
    5454    connect(BNC_CORE, SIGNAL(newGlonassEph(t_ephGlo)),
    5555            this, SLOT(slotNewGlonassEph(t_ephGlo)), Qt::DirectConnection);
    56  
     56
    5757    connect(BNC_CORE, SIGNAL(newGalileoEph(t_ephGal)),
    5858            this, SLOT(slotNewGalileoEph(t_ephGal)), Qt::DirectConnection);
     
    7979}
    8080
    81 // New GPS Ephemeris 
     81// New GPS Ephemeris
    8282////////////////////////////////////////////////////////////////////////////
    8383void bncEphUser::slotNewGPSEph(t_ephGPS eph) {
    8484  putNewEph(&eph, false);
    8585}
    86    
     86
    8787// New Glonass Ephemeris
    8888////////////////////////////////////////////////////////////////////////////
     
    109109}
    110110
    111 // 
     111//
    112112////////////////////////////////////////////////////////////////////////////
    113113t_irc bncEphUser::putNewEph(t_eph* eph, bool check) {
     
    159159    ephOld = 0;
    160160  }
    161  
     161
    162162  if ((ephOld == 0 || newEph->isNewerThan(ephOld)) &&
    163163      (eph->checkState() != t_eph::bad ||
     
    178178}
    179179
    180 // 
     180//
    181181////////////////////////////////////////////////////////////////////////////
    182182void bncEphUser::checkEphemeris(t_eph* eph) {
     
    257257
    258258    // some lines to allow update of ephemeris data sets after outage
    259     if      ((eph->type() == t_eph::GPS ||
    260               eph->type() == t_eph::Galileo)  && dt > 4*3600) {
    261       ephL->setCheckState(t_eph::outdated);
    262       return;
    263     }
    264     else if ((eph->type() == t_eph::GLONASS ||
    265               eph->type() == t_eph::QZSS)     && dt > 2*3600) {
    266       ephL->setCheckState(t_eph::outdated);
    267       return;
    268     }
    269     else if  (eph->type() == t_eph::SBAS      && dt > 1*3600)   {
    270       ephL->setCheckState(t_eph::outdated);
    271       return;
    272     }
    273     else if  (eph->type() == t_eph::BDS       && dt > 6*3600)   {
     259    if      (eph->type() == t_eph::GPS    && dt > 4*3600) {
     260      ephL->setCheckState(t_eph::outdated);
     261      return;
     262    }
     263    else if (eph->type() == t_eph::Galileo && dt > 4*3600) {
     264      ephL->setCheckState(t_eph::outdated);
     265      return;
     266    }
     267    else if (eph->type() == t_eph::GLONASS && dt > 1*3600) {
     268      ephL->setCheckState(t_eph::outdated);
     269      return;
     270    }
     271    else if (eph->type() == t_eph::QZSS    && dt > 1*1800) {
     272      ephL->setCheckState(t_eph::outdated);
     273      return;
     274    }
     275    else if  (eph->type() == t_eph::SBAS   && dt > 600)   {
     276      ephL->setCheckState(t_eph::outdated);
     277      return;
     278    }
     279    else if  (eph->type() == t_eph::BDS    && dt > 6*3600)   {
    274280      ephL->setCheckState(t_eph::outdated);
    275281      return;
  • trunk/BNC/src/upload/bncephuploadcaster.cpp

    r6600 r7716  
    1111 * Created:    03-Apr-2011
    1212 *
    13  * Changes:   
     13 * Changes:
    1414 *
    1515 * -----------------------------------------------------------------------*/
     
    1717#include <iostream>
    1818#include <math.h>
    19 #include "bncephuploadcaster.h" 
     19#include "bncephuploadcaster.h"
    2020#include "bncsettings.h"
    2121#include "RTCM3/ephEncoder.h"
     
    3838    int     sampl    = settings.value("uploadEphSample").toInt();
    3939
    40     _ephUploadCaster = new bncUploadCaster(mountpoint, outHost, outPort, 
     40    _ephUploadCaster = new bncUploadCaster(mountpoint, outHost, outPort,
    4141                                           password, -1, sampl);
    4242
    43     connect(_ephUploadCaster, SIGNAL(newBytes(QByteArray,double)), 
     43    connect(_ephUploadCaster, SIGNAL(newBytes(QByteArray,double)),
    4444          this, SIGNAL(newBytes(QByteArray,double)));
    4545
     
    6262    QByteArray outBuffer;
    6363
     64    QDateTime now = currentDateAndTimeGPS();
     65    bncTime currentTime(now.toString(Qt::ISODate).toStdString());
     66
    6467    QListIterator<QString> it(prnList());
    6568    while (it.hasNext()) {
    6669      const t_eph* eph = ephLast(it.next());
     70
     71      bncTime toc = eph->TOC();
     72      double timeDiff = fabs(toc - currentTime);
    6773
    6874      const t_ephGPS*  ephGPS  = dynamic_cast<const t_ephGPS*>(eph);
     
    7682
    7783      if (ephGPS) {
    78         size = t_ephEncoder::RTCM3(*ephGPS, Array);
     84        if (eph->checkState() == t_eph::ok && timeDiff <= 4*3600) {
     85          size = t_ephEncoder::RTCM3(*ephGPS, Array);
     86        }
    7987      }
    8088      else if (ephGlo) {
    81         size = t_ephEncoder::RTCM3(*ephGlo, Array);
     89        if (eph->checkState() == t_eph::ok && timeDiff <= 1*3600) {
     90          size = t_ephEncoder::RTCM3(*ephGlo, Array);
     91        }
    8292      }
    8393      else if (ephGal) {
    84         size = t_ephEncoder::RTCM3(*ephGal, Array);
     94        if (eph->checkState() == t_eph::ok && timeDiff <= 4*3600) {
     95          size = t_ephEncoder::RTCM3(*ephGal, Array);
     96        }
    8597      }
    8698      else if (ephSBAS) {
    87         size = t_ephEncoder::RTCM3(*ephSBAS, Array);
     99        if (eph->checkState() == t_eph::ok && timeDiff <= 600) {
     100          size = t_ephEncoder::RTCM3(*ephSBAS, Array);
     101        }
    88102      }
    89103      else if (ephBDS) {
    90         size = t_ephEncoder::RTCM3(*ephBDS, Array);
     104        if (eph->checkState() == t_eph::ok && timeDiff <= 6*3600) {
     105          size = t_ephEncoder::RTCM3(*ephBDS, Array);
     106        }
    91107      }
    92108      if (size > 0) {
Note: See TracChangeset for help on using the changeset viewer.