Changeset 6083 in ntrip for trunk/BNC/src/PPP_free/pppClient.h


Ignore:
Timestamp:
Sep 7, 2014, 6:35:49 PM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP_free/pppClient.h

    r6067 r6083  
    1 #ifndef PPPCLIENT_H
    2 #define PPPCLIENT_H
     1// Part of BNC, a utility for retrieving decoding and
     2// converting GNSS data streams from NTRIP broadcasters.
     3//
     4// Copyright (C) 2007
     5// German Federal Agency for Cartography and Geodesy (BKG)
     6// http://www.bkg.bund.de
     7// Czech Technical University Prague, Department of Geodesy
     8// http://www.fsv.cvut.cz
     9//
     10// Email: euref-ip@bkg.bund.de
     11//
     12// This program is free software; you can redistribute it and/or
     13// modify it under the terms of the GNU General Public License
     14// as published by the Free Software Foundation, version 2.
     15//
     16// This program is distributed in the hope that it will be useful,
     17// but WITHOUT ANY WARRANTY; without even the implied warranty of
     18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     19// GNU General Public License for more details.
     20//
     21// You should have received a copy of the GNU General Public License
     22// along with this program; if not, write to the Free Software
     23// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    324
    4 #include <sstream>
     25#ifndef BNCPPPCLIENT_H
     26#define BNCPPPCLIENT_H
     27
    528#include <vector>
    6 #include "pppInclude.h"
    7 #include "ephemeris.h"
    8 #include "pppOptions.h"
    9 #include "bncpppclient.h"
     29#include "bncephuser.h"
    1030
    1131namespace BNC_PPP {
     32 
     33class bncModel;
     34class t_pppOptions;
     35class t_satObs;
     36class t_satData;
     37class t_epoData;
     38class t_output;
     39class t_orbCorr;
     40class t_clkCorr;
     41class t_satBias;
    1242
    13 class t_pppClient {
     43class bncPPPclient : public bncEphUser {
    1444 public:
    15   t_pppClient(const t_pppOptions* opt);                                                     
    16   ~t_pppClient();                                                     
    17 
    18   void putEphemeris(const t_eph* eph);                 
    19   void putOrbCorrections(const std::vector<t_orbCorr*>& corr);
    20   void putClkCorrections(const std::vector<t_clkCorr*>& corr);
    21   void putBiases(const std::vector<t_satBias*>& satBias);   
    22   void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output);
    23 
    24   static t_pppClient* instance();
    25   std::ostringstream& log() {return *_log;}
     45  bncPPPclient(const t_pppOptions* opt);
     46  ~bncPPPclient();
     47  void                 processEpoch(const std::vector<t_satObs*>& satObs, t_output* output);
     48  void                 putEphemeris(const t_eph* eph);                 
     49  void                 putOrbCorrections(const std::vector<t_orbCorr*>& corr);
     50  void                 putClkCorrections(const std::vector<t_clkCorr*>& corr);
     51  void                 putBiases(const std::vector<t_satBias*>& satBias);   
     52  QByteArray           staID() const {return _staID;}
     53  const t_pppOptions*  opt() const {return _opt;}
     54  static bncPPPclient* instance();
     55  std::ostringstream&  log() {return *_log;}
    2656
    2757 private:
     58  t_irc getSatPos(const bncTime& tt, const QString& prn, ColumnVector& xc, ColumnVector& vv);
     59  void  putNewObs(t_satData* satData);
     60  t_irc cmpToT(t_satData* satData);
     61
     62  t_pppOptions*       _opt;
     63  QByteArray          _staID;
     64  t_epoData*          _epoData;
     65  bncModel*           _model;
    2866  std::ostringstream* _log;
    29   t_pppOptions*       _opt;
    30   bncPPPclient*       _client;
    3167};
    3268
    33 }; // namespace BNC_PPP
     69class t_satData {
     70 public:
     71  t_satData() {
     72    obsIndex = 0;
     73    P1 = 0.0;
     74    P2 = 0.0;
     75    P5 = 0.0;
     76    P3 = 0.0;
     77    L1 = 0.0;
     78    L2 = 0.0;
     79    L5 = 0.0;
     80    L3 = 0.0;
     81  }
     82  ~t_satData() {}
     83  bncTime      tt;
     84  QString      prn;
     85  double       P1;
     86  double       P2;
     87  double       P5;
     88  double       P3;
     89  double       L1;
     90  double       L2;
     91  double       L5;
     92  double       L3;
     93  ColumnVector xx;
     94  ColumnVector vv;
     95  double       clk;
     96  double       eleSat;
     97  double       azSat;
     98  double       rho;
     99  bool         slipFlag;
     100  double       lambda3;
     101  unsigned     obsIndex;
     102  char system() const {return prn.toAscii()[0];}
     103};
     104
     105class t_epoData {
     106 public:
     107  t_epoData() {}
     108
     109  ~t_epoData() {
     110    clear();
     111  }
     112
     113  void clear() {
     114    QMapIterator<QString, t_satData*> it(satData);
     115    while (it.hasNext()) {
     116      it.next();
     117      delete it.value();
     118    }
     119    satData.clear();
     120    tt.reset();
     121  }
     122
     123  void deepCopy(const t_epoData* from) {
     124    clear();
     125    tt = from->tt;
     126    QMapIterator<QString, t_satData*> it(from->satData);
     127    while (it.hasNext()) {
     128      it.next();
     129      satData[it.key()] = new t_satData(*it.value());
     130    }
     131  }
     132
     133  unsigned sizeSys(char system) const {
     134    unsigned ans = 0;
     135    QMapIterator<QString, t_satData*> it(satData);
     136    while (it.hasNext()) {
     137      it.next();
     138      if (it.value()->system() == system) {
     139        ++ans;
     140      }
     141    }
     142    return ans;
     143  }
     144  unsigned sizeAll() const {return satData.size();}
     145
     146  bncTime                   tt;
     147  QMap<QString, t_satData*> satData;
     148};
     149
     150}
    34151
    35152#define LOG (BNC_PPP::t_pppClient::instance()->log())
Note: See TracChangeset for help on using the changeset viewer.