Changeset 4428 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Jul 22, 2012, 5:48:30 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/RTCM3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp

    r3428 r4428  
    4848#include "bncsettings.h"
    4949#include "rtcm3torinex.h"
     50#include "bnctime.h"
    5051
    5152using namespace std;
     
    7374  connect(this, SIGNAL(newCorrLine(QString, QString, long)),
    7475          (bncApp*) qApp, SLOT(slotNewCorrLine(QString, QString, long)));
     76
     77  connect(this, SIGNAL(newMessage(QByteArray,bool)),
     78          (bncApp*) qApp, SLOT(slotMessage(const QByteArray,bool)));
    7579
    7680  memset(&_co, 0, sizeof(_co));
     
    217221                                                   _co, &_bias);
    218222
    219         long coTime = GPSweek * 7*24*3600 + long(floor(_GPSweeks+0.5));
    220 
    221223        QStringListIterator it(asciiLines);
    222224        while (it.hasNext()) {
    223225          QString line = it.next();
    224           printLine(line, coTime);
     226          printLine(line, GPSweek, _GPSweeks);
    225227        }
    226228
     
    240242//
    241243////////////////////////////////////////////////////////////////////////////
    242 void RTCM3coDecoder::printLine(const QString& line, long coTime) {
     244void RTCM3coDecoder::printLine(const QString& line, int GPSweek,
     245                               double GPSweeks) {
    243246  if (_out) {
    244247    *_out << line.toAscii().data() << endl;
     
    246249  }
    247250
    248   emit newCorrLine(line, _staID, coTime);
     251  int    currWeek;
     252  double currSec;
     253  currentGPSWeeks(currWeek, currSec);
     254  bncTime currTime(currWeek, currSec);
     255
     256  bncTime corrTime(GPSweek, GPSweeks);
     257
     258  double dt = currTime - corrTime;
     259  const double MAXDT = 10 * 60.0;
     260  if (fabs(dt) > MAXDT) {
     261    emit newMessage("suspicious correction", false);
     262  }
     263  else {
     264    long coTime = GPSweek * 7*24*3600 + long(floor(_GPSweeks+0.5));
     265    emit newCorrLine(line, _staID, coTime);
     266  }
    249267}
    250268
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.h

    r3578 r4428  
    5151 signals:
    5252  void newCorrLine(QString line, QString staID, long coTime);
     53  void newMessage(QByteArray msg, bool showOnScreen);
    5354
    5455 private:
    55   void printLine(const QString& line, long coTime);
     56  void printLine(const QString& line, int GPSweek, double GPSweeks);
    5657  std::ofstream* _out;
    5758  QString        _staID;
Note: See TracChangeset for help on using the changeset viewer.