Changeset 3186 in ntrip for trunk


Ignore:
Timestamp:
Mar 29, 2011, 8:52:57 PM (14 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/upload
Files:
4 edited

Legend:

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

    r3182 r3186  
    5252  bncSettings settings;
    5353
    54   _year = 0;
    55 
    5654  // List of upload casters
    5755  // ----------------------
     
    6967  QTextStream in(line.toAscii());
    7068  QString hlp;
    71   in >> hlp >> _year >> _month >> _day >> _hour >> _min >> _sec;
    72   GPSweekFromYMDhms(_year, _month, _day, _hour, _min, _sec, _GPSweek, _GPSweeks);
     69  int     year, month, day, hour, min;
     70  double  sec;
     71  in >> hlp >> year >> month >> day >> hour >> min >> sec;
     72  _epoTime.set( year, month, day, hour, min, sec);
    7373}
    7474
     
    9191        readEpochTime(hlpLines[ii]);
    9292      }
    93       else if (_year != 0) {
     93      else if (_epoTime.valid()) {
    9494        lines << hlpLines[ii];
    9595      }
     
    101101  if (lines.size() > 0) {
    102102    for (int ic = 0; ic < _caster.size(); ic++) {
    103       _caster.at(ic)->uploadClockOrbitBias(lines, _eph, _year, _month, _day,
    104                                            _GPSweek, _GPSweeks);
     103      _caster.at(ic)->uploadClockOrbitBias(_epoTime, _eph, lines);
    105104    }
    106105  }
  • trunk/BNC/upload/bncrtnetdecoder.h

    r3182 r3186  
    2929#include <QtCore>
    3030#include "bncephuser.h"
     31#include "bnctime.h"
    3132#include "bncuploadcaster.h"
    3233#include "RTCM/GPSDecoder.h"
     
    4142  QList<bncUploadCaster*> _caster;
    4243  QString                 _buffer;
    43   int                     _GPSweek;
    44   double                  _GPSweeks;
    45   int                     _year;
    46   int                     _month;
    47   int                     _day;
    48   int                     _hour;
    49   int                     _min;
    50   double                  _sec;
     44  bncTime                 _epoTime;
    5145};
    5246
  • trunk/BNC/upload/bncuploadcaster.cpp

    r3185 r3186  
    262262// Encode and Upload Clocks, Orbits, and Biases
    263263////////////////////////////////////////////////////////////////////////////
    264 void bncUploadCaster::uploadClockOrbitBias(const QStringList& lines,
    265                            const QMap<QString, bncEphUser::t_ephPair*>& ephMap,
    266                            int year, int month, int day,
    267                            int GPSweek, double GPSweeks) {
    268 
     264void bncUploadCaster::uploadClockOrbitBias(const bncTime& epoTime,
     265                            const QMap<QString, bncEphUser::t_ephPair*>& ephMap,
     266                            const QStringList& lines) {
    269267  this->open();
     268
     269  unsigned year, month, day;
     270  epoTime.civil_date(year, month, day);
    270271 
    271272  struct ClockOrbit co;
    272273  memset(&co, 0, sizeof(co));
    273   co.GPSEpochTime      = (int)GPSweeks;
    274   co.GLONASSEpochTime  = (int)fmod(GPSweeks, 86400.0)
     274  co.GPSEpochTime      = static_cast<int>(epoTime.gpssec());
     275  co.GLONASSEpochTime  = static_cast<int>(fmod(epoTime.gpssec(), 86400.0))
    275276                       + 3 * 3600 - gnumleap(year, month, day);
    276277  co.ClockDataSupplied = 1;
     
    280281  struct Bias bias;
    281282  memset(&bias, 0, sizeof(bias));
    282   bias.GPSEpochTime      = (int)GPSweeks;
    283   bias.GLONASSEpochTime  = (int)fmod(GPSweeks, 86400.0)
    284                          + 3 * 3600 - gnumleap(year, month, day);
     283  bias.GPSEpochTime      = co.GPSEpochTime;
     284  bias.GLONASSEpochTime  = co.GLONASSEpochTime;
    285285 
    286286  for (int ii = 0; ii < lines.size(); ii++) {
     
    335335      if (sd) {
    336336        QString outLine;
    337         processSatellite(ep, GPSweek, GPSweeks, prn, xx, sd, outLine);
     337        processSatellite(ep, epoTime.gpsw(), epoTime.gpssec(), prn, xx, sd, outLine);
    338338        if (_outFile) {
    339           _outFile->write(GPSweek, GPSweeks, outLine);
     339          _outFile->write(epoTime.gpsw(), epoTime.gpssec(), outLine);
    340340        }
    341341      }
  • trunk/BNC/upload/bncuploadcaster.h

    r3185 r3186  
    44#include <QtNetwork>
    55#include "bncephuser.h"
     6#include "bnctime.h"
    67
    78class bncoutf;
     
    2425  void printAscii(const QString& line);
    2526  bool usedSocket() const {return _outSocket;}
    26   void uploadClockOrbitBias(const QStringList& lines,
     27  void uploadClockOrbitBias(const bncTime& epoTime,
    2728                            const QMap<QString, bncEphUser::t_ephPair*>& ephMap,
    28                             int year, int month, int day,
    29                             int GPSweek, double GPSweeks);
     29                            const QStringList& lines);
    3030
    3131 signals:
Note: See TracChangeset for help on using the changeset viewer.