Changeset 2058 in ntrip


Ignore:
Timestamp:
Dec 1, 2009, 11:49:03 AM (14 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncmodel.cpp

    r2057 r2058  
    4242
    4343#include "bncmodel.h"
     44#include "bncpppclient.h"
     45#include "bancroft.h"
    4446
    4547using namespace std;
     
    5557}
    5658
     59// Constructor
     60////////////////////////////////////////////////////////////////////////////
     61bncModel::bncModel() {
     62  _xcBanc.ReSize(4);
     63}
     64
     65// Destructor
     66////////////////////////////////////////////////////////////////////////////
     67bncModel::~bncModel() {
     68}
     69
     70// Bancroft Solution
     71////////////////////////////////////////////////////////////////////////////
     72t_irc bncModel::cmpBancroft(t_epoData* epoData) {
     73
     74  const unsigned MINOBS = 4;
     75
     76  if (epoData->size() < MINOBS) {
     77    return failure;
     78  }
     79
     80  Matrix BB(epoData->size(), 4);
     81
     82  QMapIterator<QString, t_satData*> it(epoData->satData);
     83  int iObs = 0;
     84  while (it.hasNext()) {
     85    it.next();
     86    QString    prn     = it.key();
     87    t_satData* satData = it.value();
     88    ++iObs;
     89    BB(iObs, 1) = satData->xx(1);
     90    BB(iObs, 2) = satData->xx(2);
     91    BB(iObs, 3) = satData->xx(3);
     92    BB(iObs, 4) = satData->P3 + satData->clk;
     93  }
     94
     95  bancroft(BB, _xcBanc);
     96
     97  return success;
     98}
  • trunk/BNC/bncmodel.h

    r2057 r2058  
    2727
    2828#include <QtCore>
     29#include <newmat.h>
    2930
    30 #include <newmat.h>
     31#include "bncconst.h"
     32
     33class t_epoData;
    3134
    3235class bncParam {
    3336 public:
     37  enum type {CRD_X, CRD_Y, CRD_Z, TROPO, AMB_L3};
    3438  bncParam();
    3539  ~bncParam();
     40  double x0;
     41};
    3642
     43class bncModel {
     44 public:
     45  bncModel();
     46  ~bncModel();
     47  t_irc cmpBancroft(t_epoData* epoData);
     48  const ColumnVector& xcBanc() const {return _xcBanc;}
     49 
    3750 private:
     51  Matrix       _QQ;
     52  ColumnVector _xx;
     53  ColumnVector _xcBanc;
    3854};
    3955
  • trunk/BNC/bncpppclient.cpp

    r2055 r2058  
    4646#include "bncutils.h"
    4747#include "bncconst.h"
    48 #include "bancroft.h"
     48#include "bncmodel.h"
    4949
    5050extern "C" {
     
    5959  _staID   = staID;
    6060  _epoData = 0;
     61  _model   = new bncModel();
    6162}
    6263
     
    6465////////////////////////////////////////////////////////////////////////////
    6566bncPPPclient::~bncPPPclient() {
     67  delete _model;
    6668  delete _epoData;
    6769  QMapIterator<QString, t_eph*> it(_eph);
     
    288290void bncPPPclient::processEpoch() {
    289291
    290   const unsigned MINOBS = 4;
    291 
    292292  // Data Pre-Processing
    293293  // -------------------
     
    305305  }
    306306
    307   if (_epoData->size() < MINOBS) {
    308     return;
    309   }
    310 
    311307  // Bancroft Solution
    312308  // -----------------
    313   Matrix BB(_epoData->size(), 4);
    314 
    315   QMapIterator<QString, t_satData*> it(_epoData->satData);
    316   int iObs = 0;
    317   while (it.hasNext()) {
    318     it.next();
    319     QString    prn     = it.key();
    320     t_satData* satData = it.value();
    321     ++iObs;
    322     BB(iObs, 1) = satData->xx(1);
    323     BB(iObs, 2) = satData->xx(2);
    324     BB(iObs, 3) = satData->xx(3);
    325     BB(iObs, 4) = satData->P3 + satData->clk;
    326   }
    327 
    328   ColumnVector pos(4);
    329   bancroft(BB, pos);
     309  if (_model->cmpBancroft(_epoData) != success) {
     310    return;
     311  }
    330312
    331313  ostringstream str;
    332314  str.setf(ios::fixed);
    333   str << "    PPP "
     315  str << "    PPP " << _staID.data() << " "
    334316      << _epoData->tt.timestr(1) << " " << _epoData->size() << " "
    335       << setw(14) << setprecision(3) << pos(1)              << "  "
    336       << setw(14) << setprecision(3) << pos(2)              << "  "
    337       << setw(14) << setprecision(3) << pos(3);
     317      << setw(14) << setprecision(3) << _model->xcBanc()(1) << "  "
     318      << setw(14) << setprecision(3) << _model->xcBanc()(2) << "  "
     319      << setw(14) << setprecision(3) << _model->xcBanc()(3);
    338320
    339321  emit newMessage(QString(str.str().c_str()).toAscii(), true);
  • trunk/BNC/bncpppclient.h

    r2057 r2058  
    3434#include "RTCM/GPSDecoder.h"
    3535#include "RTCM3/ephemeris.h"
     36
     37class bncModel;
    3638
    3739class t_satData {
     
    102104  QMap<QString, t_corr*> _corr;
    103105  t_epoData*             _epoData;
     106  bncModel*              _model;
    104107};
    105108
Note: See TracChangeset for help on using the changeset viewer.