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

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.