Changeset 622 in ntrip


Ignore:
Timestamp:
Dec 16, 2007, 4:27:13 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM/GPSDecoder.h

    r621 r622  
    2929#include <QList>
    3030
    31 class Observation : public QObject{
    32   public:
    33   Observation() {
    34     flags     = 0;
    35     StatID[0] = '\0';
    36     satSys    = 'G';
    37     satNum    = 0;
    38     slot      = 0;
    39     GPSWeek   = 0;
    40     GPSWeeks  = 0.0;
    41     C1        = 0.0;
    42     C2        = 0.0;
    43     P1        = 0.0;
    44     P2        = 0.0;
    45     L1        = 0.0;
    46     L2        = 0.0;
    47     S1        = 0.0;
    48     S2        = 0.0;
    49     SNR1      = 0;
    50     SNR2      = 0;
    51   }
     31class t_obsInternal {
     32 public:
    5233  int    flags;
    5334  char   StatID[20+1];// Station ID
     
    6950};
    7051
    71 typedef QPointer<Observation> p_obs;
     52class t_obs : public QObject{
     53 public:
     54
     55  t_obs() {
     56    _o.flags     = 0;
     57    _o.StatID[0] = '\0';
     58    _o.satSys    = 'G';
     59    _o.satNum    = 0;
     60    _o.slot      = 0;
     61    _o.GPSWeek   = 0;
     62    _o.GPSWeeks  = 0.0;
     63    _o.C1        = 0.0;
     64    _o.C2        = 0.0;
     65    _o.P1        = 0.0;
     66    _o.P2        = 0.0;
     67    _o.L1        = 0.0;
     68    _o.L2        = 0.0;
     69    _o.S1        = 0.0;
     70    _o.S2        = 0.0;
     71    _o.SNR1      = 0;
     72    _o.SNR2      = 0;
     73  }
     74
     75  t_obsInternal _o;
     76};
     77
     78typedef QPointer<t_obs> p_obs;
    7279
    7380class GPSDecoder {
    74   public:
    75     virtual void Decode(char* buffer, int bufLen) = 0;
    76     virtual ~GPSDecoder() {}
    77     QList<p_obs> _obsList;
     81 public:
     82  virtual void Decode(char* buffer, int bufLen) = 0;
     83
     84  virtual ~GPSDecoder() {
     85    QListIterator<p_obs> it(_obsList);
     86    while (it.hasNext()) {
     87      delete it.next();
     88    }
     89  }
     90
     91  QList<p_obs> _obsList;
    7892};
    7993
  • trunk/BNC/RTCM/RTCM2Decoder.cpp

    r621 r622  
    5858
    5959RTCM2Decoder::~RTCM2Decoder() {
    60   QListIterator<p_obs> it(_obsList);
    61   while (it.hasNext()) {
    62     delete it.next();
    63   }
    64   _obsList.clear();
    6560}
    6661
     
    9186         
    9287        for (int iSat=0; iSat < _ObsBlock.nSat; iSat++) {
    93           Observation* obs = new Observation();
     88          p_obs obs = new t_obs();
    9489          if (_ObsBlock.PRN[iSat] > 100) {
    95             obs->satNum = _ObsBlock.PRN[iSat] % 100;
    96             obs->satSys = 'R';
     90            obs->_o.satNum = _ObsBlock.PRN[iSat] % 100;
     91            obs->_o.satSys = 'R';
    9792          }
    9893          else {
    99             obs->satNum = _ObsBlock.PRN[iSat];
    100             obs->satSys = 'G';
     94            obs->_o.satNum = _ObsBlock.PRN[iSat];
     95            obs->_o.satSys = 'G';
    10196          }
    102           obs->GPSWeek  = epochWeek;
    103           obs->GPSWeeks = epochSecs;
    104           obs->C1       = _ObsBlock.rng_C1[iSat];
    105           obs->P1       = _ObsBlock.rng_P1[iSat];
    106           obs->P2       = _ObsBlock.rng_P2[iSat];
    107           obs->L1       = _ObsBlock.resolvedPhase_L1(iSat);
    108           obs->L2       = _ObsBlock.resolvedPhase_L2(iSat);
     97          obs->_o.GPSWeek  = epochWeek;
     98          obs->_o.GPSWeeks = epochSecs;
     99          obs->_o.C1       = _ObsBlock.rng_C1[iSat];
     100          obs->_o.P1       = _ObsBlock.rng_P1[iSat];
     101          obs->_o.P2       = _ObsBlock.rng_P2[iSat];
     102          obs->_o.L1       = _ObsBlock.resolvedPhase_L1(iSat);
     103          obs->_o.L2       = _ObsBlock.resolvedPhase_L2(iSat);
    109104
    110105          _obsList.push_back(obs);
  • trunk/BNC/RTCM3/RTCM3Decoder.cpp

    r621 r622  
    8484////////////////////////////////////////////////////////////////////////////
    8585RTCM3Decoder::~RTCM3Decoder() {
    86   QListIterator<p_obs> it(_obsList);
    87   while (it.hasNext()) {
    88     delete it.next();
    89   }
    90   _obsList.clear();
    9186}
    9287
     
    116111         
    117112          for (int ii = 0; ii < _Parser.Data.numsats; ii++) {
    118             Observation* obs = new Observation();
     113            p_obs obs = new t_obs();
    119114            if      (_Parser.Data.satellites[ii] <= PRN_GPS_END) {
    120               obs->satSys = 'G';
    121               obs->satNum = _Parser.Data.satellites[ii];
     115              obs->_o.satSys = 'G';
     116              obs->_o.satNum = _Parser.Data.satellites[ii];
    122117            }
    123118            else if (_Parser.Data.satellites[ii] <= PRN_GLONASS_END) {
    124               obs->satSys = 'R';
    125               obs->satNum = _Parser.Data.satellites[ii] - PRN_GLONASS_START + 1;
     119              obs->_o.satSys = 'R';
     120              obs->_o.satNum = _Parser.Data.satellites[ii] - PRN_GLONASS_START + 1;
    126121            }
    127122            else {
    128               obs->satSys = 'S';
    129               obs->satNum = _Parser.Data.satellites[ii] - PRN_WAAS_START + 20;
     123              obs->_o.satSys = 'S';
     124              obs->_o.satNum = _Parser.Data.satellites[ii] - PRN_WAAS_START + 20;
    130125            }
    131             obs->GPSWeek  = _Parser.Data.week;
    132             obs->GPSWeeks = _Parser.Data.timeofweek / 1000.0;
     126            obs->_o.GPSWeek  = _Parser.Data.week;
     127            obs->_o.GPSWeeks = _Parser.Data.timeofweek / 1000.0;
    133128         
    134129            for (int jj = 0; jj < _Parser.numdatatypesGPS; jj++) {
     
    155150            {
    156151              if      (_Parser.dataflag[jj] & GNSSDF_C1DATA) {
    157                 obs->C1 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
     152                obs->_o.C1 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
    158153              }
    159154              else if (_Parser.dataflag[jj] & GNSSDF_C2DATA) {
    160                 obs->C2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
     155                obs->_o.C2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
    161156              }
    162157              else if (_Parser.dataflag[jj] & GNSSDF_P1DATA) {
    163                 obs->P1 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
     158                obs->_o.P1 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
    164159              }
    165160              else if (_Parser.dataflag[jj] & GNSSDF_P2DATA) {
    166                 obs->P2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
     161                obs->_o.P2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
    167162              }
    168163              else if (df & (GNSSDF_L1CDATA|GNSSDF_L1PDATA)) {
    169                 obs->L1   = _Parser.Data.measdata[ii][pos];
    170                 obs->SNR1 = _Parser.Data.snrL1[ii];
     164                obs->_o.L1   = _Parser.Data.measdata[ii][pos];
     165                obs->_o.SNR1 = _Parser.Data.snrL1[ii];
    171166              }
    172167              else if (df & (GNSSDF_L2CDATA|GNSSDF_L2PDATA)) {
    173                 obs->L2   = _Parser.Data.measdata[ii][pos];
    174                 obs->SNR2 = _Parser.Data.snrL2[ii];
     168                obs->_o.L2   = _Parser.Data.measdata[ii][pos];
     169                obs->_o.SNR2 = _Parser.Data.snrL2[ii];
    175170              }
    176171              else if (df & (GNSSDF_S1CDATA|GNSSDF_S1PDATA)) {
    177                 obs->S1   = _Parser.Data.measdata[ii][pos];
     172                obs->_o.S1   = _Parser.Data.measdata[ii][pos];
    178173              }
    179174              else if (df & (GNSSDF_S2CDATA|GNSSDF_S2PDATA)) {
    180                 obs->S2   = _Parser.Data.measdata[ii][pos];
     175                obs->_o.S2   = _Parser.Data.measdata[ii][pos];
    181176              }
    182177            }
  • trunk/BNC/RTIGS/RTIGSDecoder.cpp

    r621 r622  
    5555////////////////////////////////////////////////////////////////////////////
    5656RTIGSDecoder::~RTIGSDecoder() {
    57   QListIterator<p_obs> it(_obsList);
    58   while (it.hasNext()) {
    59     delete it.next();
    60   }
    61   _obsList.clear();
    6257}
    6358
     
    109104
    110105    for (short ii = 0; ii < numObs; ii++) {
    111       Observation* obs = new Observation();
    112       obs->satSys   = 'G';
    113       obs->satNum   = _GPSTrans.DecObs.Obs[ii].sat_prn;
    114       obs->GPSWeek  = _GPSTrans.DecObs.Obs[ii].GPSTime / (7 * 86400);
    115       obs->GPSWeeks = _GPSTrans.DecObs.Obs[ii].GPSTime % (7 * 86400);
    116       obs->C1       = _GPSTrans.DecObs.Obs[ii].l1_pseudo_range;
    117       obs->P1       = _GPSTrans.DecObs.Obs[ii].p1_pseudo_range;
    118       obs->P2       = _GPSTrans.DecObs.Obs[ii].p2_pseudo_range;
    119       obs->L1       = _GPSTrans.DecObs.Obs[ii].p1_phase;
    120       obs->L2       = _GPSTrans.DecObs.Obs[ii].p2_phase;
    121       obs->S1       = _GPSTrans.DecObs.Obs[ii].l1_sn;
    122       obs->S2       = _GPSTrans.DecObs.Obs[ii].l2_sn;
    123       obs->SNR1     = int(ceil(_GPSTrans.DecObs.Obs[ii].l1_sn / 60.0 * 9.0));
    124       obs->SNR2     = int(ceil(_GPSTrans.DecObs.Obs[ii].l2_sn / 60.0 * 9.0));
     106      p_obs obs = new t_obs();
     107      obs->_o.satSys   = 'G';
     108      obs->_o.satNum   = _GPSTrans.DecObs.Obs[ii].sat_prn;
     109      obs->_o.GPSWeek  = _GPSTrans.DecObs.Obs[ii].GPSTime / (7 * 86400);
     110      obs->_o.GPSWeeks = _GPSTrans.DecObs.Obs[ii].GPSTime % (7 * 86400);
     111      obs->_o.C1       = _GPSTrans.DecObs.Obs[ii].l1_pseudo_range;
     112      obs->_o.P1       = _GPSTrans.DecObs.Obs[ii].p1_pseudo_range;
     113      obs->_o.P2       = _GPSTrans.DecObs.Obs[ii].p2_pseudo_range;
     114      obs->_o.L1       = _GPSTrans.DecObs.Obs[ii].p1_phase;
     115      obs->_o.L2       = _GPSTrans.DecObs.Obs[ii].p2_phase;
     116      obs->_o.S1       = _GPSTrans.DecObs.Obs[ii].l1_sn;
     117      obs->_o.S2       = _GPSTrans.DecObs.Obs[ii].l2_sn;
     118      obs->_o.SNR1     = int(ceil(_GPSTrans.DecObs.Obs[ii].l1_sn / 60.0 * 9.0));
     119      obs->_o.SNR2     = int(ceil(_GPSTrans.DecObs.Obs[ii].l2_sn / 60.0 * 9.0));
    125120
    126121      _obsList.push_back(obs);
  • trunk/BNC/bnccaster.cpp

    r605 r622  
    8383  }
    8484
    85   _epochs = new QMultiMap<long, Observation*>;
     85  _epochs = new QMultiMap<long, p_obs>;
    8686
    8787  _lastDumpSec   = 0;
     
    109109  delete _sockets;
    110110  if (_epochs) {
    111     QListIterator<Observation*> it(_epochs->values());
     111    QListIterator<p_obs> it(_epochs->values());
    112112    while (it.hasNext()) {
    113113      delete it.next();
     
    119119// New Observations
    120120////////////////////////////////////////////////////////////////////////////
    121 void bncCaster::newObs(const QByteArray staID, bool firstObs,
    122                        Observation* obs) {
     121void bncCaster::newObs(const QByteArray staID, bool firstObs, p_obs obs) {
    123122
    124123  QMutexLocker locker(&_mutex);
    125124
    126   long iSec    = long(floor(obs->GPSWeeks+0.5));
    127   long newTime = obs->GPSWeek * 7*24*3600 + iSec;
     125  long iSec    = long(floor(obs->_o.GPSWeeks+0.5));
     126  long newTime = obs->_o.GPSWeek * 7*24*3600 + iSec;
    128127
    129128  // Rename the Station
    130129  // ------------------
    131   strncpy(obs->StatID, staID.constData(),sizeof(obs->StatID));
    132   obs->StatID[sizeof(obs->StatID)-1] = '\0';
     130  strncpy(obs->_o.StatID, staID.constData(),sizeof(obs->_o.StatID));
     131  obs->_o.StatID[sizeof(obs->_o.StatID)-1] = '\0';
    133132       
    134133  // First time, set the _lastDumpSec immediately
     
    174173////////////////////////////////////////////////////////////////////////////
    175174void bncCaster::addGetThread(bncGetThread* getThread) {
    176   connect(getThread, SIGNAL(newObs(const QByteArray, bool, Observation*)),
    177           this,      SLOT(newObs(const QByteArray, bool, Observation*)));
     175  connect(getThread, SIGNAL(newObs(const QByteArray, bool, p_obs)),
     176          this,      SLOT(newObs(const QByteArray, bool, p_obs)));
    178177
    179178  connect(getThread, SIGNAL(error(const QByteArray)),
     
    208207
    209208    bool first = true;
    210     QList<Observation*> allObs = _epochs->values(sec);
    211     QListIterator<Observation*> it(allObs);
     209    QList<p_obs> allObs = _epochs->values(sec);
     210    QListIterator<p_obs> it(allObs);
    212211    while (it.hasNext()) {
    213       Observation* obs = it.next();
     212      p_obs obs = it.next();
    214213
    215214      if (_samplingRate == 0 || sec % _samplingRate == 0) {
     
    221220            _out->setFieldWidth(1); *_out << begEpoch << endl;;
    222221          }
    223           _out->setFieldWidth(0); *_out << obs->StatID;
    224           _out->setFieldWidth(1); *_out << " " << obs->satSys;
     222          _out->setFieldWidth(0); *_out << obs->_o.StatID;
     223          _out->setFieldWidth(1); *_out << " " << obs->_o.satSys;
    225224          _out->setPadChar('0');
    226           _out->setFieldWidth(2); *_out << obs->satNum;
     225          _out->setFieldWidth(2); *_out << obs->_o.satNum;
    227226          _out->setPadChar(' ');
    228227          _out->setFieldWidth(1); *_out << " ";
    229           _out->setFieldWidth(4); *_out << obs->GPSWeek;
    230           _out->setFieldWidth(1); *_out << " ";
    231           _out->setFieldWidth(14); _out->setRealNumberPrecision(7); *_out << obs->GPSWeeks;
    232           _out->setFieldWidth(1); *_out << " ";
    233           _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->C1;
    234           _out->setFieldWidth(1); *_out << " ";
    235           _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->C2;
    236           _out->setFieldWidth(1); *_out << " ";
    237           _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->P1;
    238           _out->setFieldWidth(1); *_out << " ";
    239           _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->P2;
    240           _out->setFieldWidth(1); *_out << " ";
    241           _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->L1;
    242           _out->setFieldWidth(1); *_out << " ";
    243           _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->L2;
    244           _out->setFieldWidth(1); *_out << " ";
    245           _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->S1;
    246           _out->setFieldWidth(1); *_out << " ";
    247           _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->S2;
     228          _out->setFieldWidth(4); *_out << obs->_o.GPSWeek;
     229          _out->setFieldWidth(1); *_out << " ";
     230          _out->setFieldWidth(14); _out->setRealNumberPrecision(7); *_out << obs->_o.GPSWeeks;
     231          _out->setFieldWidth(1); *_out << " ";
     232          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->_o.C1;
     233          _out->setFieldWidth(1); *_out << " ";
     234          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->_o.C2;
     235          _out->setFieldWidth(1); *_out << " ";
     236          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->_o.P1;
     237          _out->setFieldWidth(1); *_out << " ";
     238          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->_o.P2;
     239          _out->setFieldWidth(1); *_out << " ";
     240          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->_o.L1;
     241          _out->setFieldWidth(1); *_out << " ";
     242          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->_o.L2;
     243          _out->setFieldWidth(1); *_out << " ";
     244          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->_o.S1;
     245          _out->setFieldWidth(1); *_out << " ";
     246          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->_o.S2;
    248247          _out->setFieldWidth(1);
    249           *_out << " " << obs->SNR1 << " " << obs->SNR2 << endl;
     248          *_out << " " << obs->_o.SNR1 << " " << obs->_o.SNR2 << endl;
    250249          if (!it.hasNext()) {
    251250            _out->setFieldWidth(1); *_out << endEpoch << endl;
     
    257256        // ----------------------
    258257        if (_sockets) {
    259           int numBytes = sizeof(*obs);
     258          int numBytes = sizeof(obs->_o);
    260259          QListIterator<QTcpSocket*> is(*_sockets);
    261260          while (is.hasNext()) {
     
    266265              }
    267266              sock->write(&begObs, 1);
    268               sock->write((char*) obs, numBytes);
     267              sock->write((char*) &obs->_o, numBytes);
    269268              if (!it.hasNext()) {
    270269                sock->write(&endEpoch, 1);
  • trunk/BNC/bnccaster.h

    r464 r622  
    4444
    4545 public slots:
    46    void newObs(const QByteArray staID, bool firstObs, Observation* obs);
     46   void newObs(const QByteArray staID, bool firstObs, p_obs obs);
    4747
    4848 signals:
     
    5757   void dumpEpochs(long minTime, long maxTime);
    5858
    59    QFile*                         _outFile;
    60    int                            _port;
    61    QTextStream*                   _out;
    62    QMultiMap<long, Observation*>* _epochs;
    63    long                           _lastDumpSec;
    64    QTcpServer*                    _server;
    65    QList<QTcpSocket*>*            _sockets;
    66    QList<QByteArray>              _staIDs;
    67    QList<bncGetThread*>           _threads;
    68    int                            _samplingRate;
    69    long                           _waitTime;
    70    QMutex                         _mutex;
     59   QFile*                  _outFile;
     60   int                     _port;
     61   QTextStream*            _out;
     62   QMultiMap<long, p_obs>* _epochs;
     63   long                    _lastDumpSec;
     64   QTcpServer*             _server;
     65   QList<QTcpSocket*>*     _sockets;
     66   QList<QByteArray>       _staIDs;
     67   QList<bncGetThread*>    _threads;
     68   int                     _samplingRate;
     69   long                    _waitTime;
     70   QMutex                  _mutex;
    7171};
    7272
  • trunk/BNC/bncgetthread.cpp

    r621 r622  
    417417          const double maxDt      = 600.0;           
    418418
    419           if (week < obs->GPSWeek) {
     419          if (week < obs->_o.GPSWeek) {
    420420            week += 1;
    421421            sec  -= secPerWeek;
    422422          }
    423           if (week > obs->GPSWeek) {
     423          if (week > obs->_o.GPSWeek) {
    424424            week -= 1;
    425425            sec  += secPerWeek;
    426426          }
    427           double dt = fabs(sec - obs->GPSWeeks);
    428           if (week != obs->GPSWeek || dt > maxDt) {
     427          double dt = fabs(sec - obs->_o.GPSWeeks);
     428          if (week != obs->_o.GPSWeek || dt > maxDt) {
    429429            emit( newMessage("Wrong observation epoch") );
    430430            delete obs;
     
    435435          // ------------
    436436          if (_rnx) {
    437              long iSec    = long(floor(obs->GPSWeeks+0.5));
    438              long newTime = obs->GPSWeek * 7*24*3600 + iSec;
     437             long iSec    = long(floor(obs->_o.GPSWeeks+0.5));
     438             long newTime = obs->_o.GPSWeek * 7*24*3600 + iSec;
    439439            if (_samplingRate == 0 || iSec % _samplingRate == 0) {
    440440              _rnx->deepCopy(obs);
  • trunk/BNC/bncgetthread.h

    r464 r622  
    5252 signals:
    5353   void newBytes(const QByteArray staID, double nbyte);
    54    void newObs(const QByteArray staID, bool firstObs, Observation* obs);
     54   void newObs(const QByteArray staID, bool firstObs, p_obs obs);
    5555   void error(const QByteArray staID);
    5656   void newMessage(const QByteArray msg);
  • trunk/BNC/bncrinex.cpp

    r607 r622  
    9696////////////////////////////////////////////////////////////////////////////
    9797bncRinex::~bncRinex() {
    98   QListIterator<Observation*> it(_obs);
     98  QListIterator<p_obs> it(_obs);
    9999  while (it.hasNext()) {
    100100    delete it.next();
     
    466466// Stores Observation into Internal Array
    467467////////////////////////////////////////////////////////////////////////////
    468 void bncRinex::deepCopy(const Observation* obs) {
    469   Observation* newObs = new Observation();
     468void bncRinex::deepCopy(const p_obs obs) {
     469  p_obs newObs = new t_obs();
    470470  memcpy(newObs, obs, sizeof(*obs));
    471471  _obs.push_back(newObs);
     
    478478  // Select observations older than maxTime
    479479  // --------------------------------------
    480   QList<Observation*> dumpList;
    481   QMutableListIterator<Observation*> mIt(_obs);
     480  QList<p_obs> dumpList;
     481  QMutableListIterator<p_obs> mIt(_obs);
    482482  while (mIt.hasNext()) {
    483     Observation* ob = mIt.next();
    484     if (ob->GPSWeek * 7*24*3600 + ob->GPSWeeks < maxTime - 0.05) {
    485       dumpList.push_back(ob);
     483    p_obs obs = mIt.next();
     484    if (obs->_o.GPSWeek * 7*24*3600 + obs->_o.GPSWeeks < maxTime - 0.05) {
     485      dumpList.push_back(obs);
    486486      mIt.remove();
    487487    }
     
    496496  // Time of Epoch
    497497  // -------------
    498   Observation* fObs = *dumpList.begin();
    499   QDateTime datTim    = dateAndTimeFromGPSweek(fObs->GPSWeek, fObs->GPSWeeks);
    500   QDateTime datTimNom = dateAndTimeFromGPSweek(fObs->GPSWeek,
    501                                                floor(fObs->GPSWeeks+0.5));
     498  p_obs fObs = *dumpList.begin();
     499  QDateTime datTim    = dateAndTimeFromGPSweek(fObs->_o.GPSWeek, fObs->_o.GPSWeeks);
     500  QDateTime datTimNom = dateAndTimeFromGPSweek(fObs->_o.GPSWeek,
     501                                               floor(fObs->_o.GPSWeeks+0.5));
    502502
    503503  // Close the file
     
    514514  }
    515515
    516   double sec = double(datTim.time().second()) + fmod(fObs->GPSWeeks,1.0);
     516  double sec = double(datTim.time().second()) + fmod(fObs->_o.GPSWeeks,1.0);
    517517
    518518  // RINEX Version 3
     
    523523         << "  " << 0 << setw(3)  << dumpList.size() << endl;
    524524
    525     QListIterator<Observation*> it(dumpList);
     525    QListIterator<p_obs> it(dumpList);
    526526    while (it.hasNext()) {
    527       Observation* ob = it.next();
    528       _out << ob->satSys
    529            << setw(2) << setfill('0') << ob->satNum << setfill(' ')
    530            << setw(14) << setprecision(3) << ob->C1 << "  " 
    531            << setw(14) << setprecision(3) << ob->L1 << " "
    532            << setw(1)                     << ob->SNR1
    533            << setw(14) << setprecision(3) << ob->S1 << "  "
    534            << setw(14) << setprecision(3) << ob->P2 << "  "
    535            << setw(14) << setprecision(3) << ob->L2 << " "
    536            << setw(1)                     << ob->SNR2
    537            << setw(14) << setprecision(3) << ob->S2
     527      p_obs obs = it.next();
     528      _out << obs->_o.satSys
     529           << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ')
     530           << setw(14) << setprecision(3) << obs->_o.C1 << "  " 
     531           << setw(14) << setprecision(3) << obs->_o.L1 << " "
     532           << setw(1)                     << obs->_o.SNR1
     533           << setw(14) << setprecision(3) << obs->_o.S1 << "  "
     534           << setw(14) << setprecision(3) << obs->_o.P2 << "  "
     535           << setw(14) << setprecision(3) << obs->_o.L2 << " "
     536           << setw(1)                     << obs->_o.SNR2
     537           << setw(14) << setprecision(3) << obs->_o.S2
    538538           << endl;
    539       delete ob;
     539      delete obs;
    540540    }
    541541  }
     
    548548         << "  " << 0 << setw(3)  << dumpList.size();
    549549   
    550     QListIterator<Observation*> it(dumpList); int iSat = 0;
     550    QListIterator<p_obs> it(dumpList); int iSat = 0;
    551551    while (it.hasNext()) {
    552552      iSat++;
    553       Observation* ob = it.next();
    554       _out << ob->satSys << setw(2) << ob->satNum;
     553      p_obs obs = it.next();
     554      _out << obs->_o.satSys << setw(2) << obs->_o.satNum;
    555555      if (iSat == 12 && it.hasNext()) {
    556556        _out << endl << "                                ";
     
    562562    it.toFront();
    563563    while (it.hasNext()) {
    564       Observation* ob = it.next();
     564      p_obs obs = it.next();
    565565   
    566566      char lli = ' ';
    567567      char snr = ' ';
    568       _out << setw(14) << setprecision(3) << ob->C1 << lli << snr;
    569       _out << setw(14) << setprecision(3) << ob->C2 << lli << snr;
    570       _out << setw(14) << setprecision(3) << ob->P1 << lli << snr;
    571       _out << setw(14) << setprecision(3) << ob->P2 << lli << snr;
    572       _out << setw(14) << setprecision(3) << ob->L1 << lli
    573            << setw(1) << ob->SNR1 << endl;
    574       _out << setw(14) << setprecision(3) << ob->L2 << lli
    575            << setw(1) << ob->SNR2;
    576       _out << setw(14) << setprecision(3) << ob->S1 ;
    577       _out << setw(16) << setprecision(3) << ob->S2 ;
     568      _out << setw(14) << setprecision(3) << obs->_o.C1 << lli << snr;
     569      _out << setw(14) << setprecision(3) << obs->_o.C2 << lli << snr;
     570      _out << setw(14) << setprecision(3) << obs->_o.P1 << lli << snr;
     571      _out << setw(14) << setprecision(3) << obs->_o.P2 << lli << snr;
     572      _out << setw(14) << setprecision(3) << obs->_o.L1 << lli
     573           << setw(1) << obs->_o.SNR1 << endl;
     574      _out << setw(14) << setprecision(3) << obs->_o.L2 << lli
     575           << setw(1) << obs->_o.SNR2;
     576      _out << setw(14) << setprecision(3) << obs->_o.S1 ;
     577      _out << setw(16) << setprecision(3) << obs->_o.S2 ;
    578578      _out << endl;
    579579   
    580       delete ob;
     580      delete obs;
    581581    }
    582582  }
  • trunk/BNC/bncrinex.h

    r539 r622  
    4141            const QByteArray& longitude, const QByteArray& nmea);
    4242   ~bncRinex();
    43    void deepCopy(const Observation* obs);
     43   void deepCopy(const p_obs obs);
    4444   void dumpEpoch(long maxTime);
    4545   void setReconnectFlag(bool flag){_reconnectFlag = flag;}
     
    5252   t_irc downloadSkeleton();
    5353
    54    QByteArray          _statID;
    55    QByteArray          _fName;
    56    QList<Observation*> _obs;
    57    std::ofstream       _out;
    58    QStringList         _headerLines;
    59    bool                _headerWritten;
    60    QDateTime           _nextCloseEpoch;
    61    QString             _rnxScriptName;
    62    QUrl                _mountPoint;
    63    QString             _pgmName;
    64    QString             _userName;
    65    QString             _sklName;
    66    QByteArray          _format;
    67    QByteArray          _latitude;
    68    QByteArray          _longitude;
    69    QByteArray          _nmea;
    70    bool                _reconnectFlag;
    71    QDate               _skeletonDate;
    72    QMutex              _mutex;
    73    int                 _rinexVers;
     54   QByteArray    _statID;
     55   QByteArray    _fName;
     56   QList<p_obs> _obs;
     57   std::ofstream _out;
     58   QStringList   _headerLines;
     59   bool          _headerWritten;
     60   QDateTime     _nextCloseEpoch;
     61   QString       _rnxScriptName;
     62   QUrl          _mountPoint;
     63   QString       _pgmName;
     64   QString       _userName;
     65   QString       _sklName;
     66   QByteArray    _format;
     67   QByteArray    _latitude;
     68   QByteArray    _longitude;
     69   QByteArray    _nmea;
     70   bool          _reconnectFlag;
     71   QDate         _skeletonDate;
     72   QMutex        _mutex;
     73   int           _rinexVers;
    7474};
    7575
Note: See TracChangeset for help on using the changeset viewer.