Changeset 2990 in ntrip for trunk/BNC


Ignore:
Timestamp:
Feb 8, 2011, 6:33:13 PM (14 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/combination
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/combination/bnccomb.cpp

    r2989 r2990  
    6666}
    6767
    68 
     68//
     69////////////////////////////////////////////////////////////////////////////
     70QString cmbParam::toString() const {
     71
     72  QString outStr;
     73 
     74  if      (type == AC_offset) {
     75    outStr = "AC offset  " + AC;
     76  }
     77  else if (type == Sat_offset) {
     78    outStr = "Sat Offset " + prn;
     79  }
     80  else if (type == clk) {
     81    outStr = "Clk Corr   " + prn;
     82  }
     83
     84  return outStr;
     85}
    6986
    7087// Constructor
     
    90107
    91108  _caster = new cmbCaster();
    92   connect(_caster, SIGNAL(error(const QByteArray)),
    93           this, SLOT(slotError(const QByteArray)));
    94   connect(_caster, SIGNAL(newMessage(const QByteArray)),
    95           this, SLOT(slotMessage(const QByteArray)));
     109  connect(this, SIGNAL(newMessage(QByteArray,bool)),
     110          ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
    96111
    97112  // Initialize Parameters
     
    251266}
    252267
    253 // Print one correction
    254 ////////////////////////////////////////////////////////////////////////////
    255 void bncComb::printSingleCorr(const QString& acName, const t_corr* corr) {
    256   cout.setf(ios::fixed);
    257   cout << acName.toAscii().data()                             << " "
    258        << corr->prn.toAscii().data()                          << " "
    259        << corr->tt.timestr()                                  << " "
    260        << setw(4) << corr->iod                                << " "
    261        << setw(8) << setprecision(4) << corr->dClk * t_CST::c << "   "
    262        << setw(8) << setprecision(4) << corr->rao[0]          << " "
    263        << setw(8) << setprecision(4) << corr->rao[1]          << " "
    264        << setw(8) << setprecision(4) << corr->rao[2]          << endl;
    265 }
    266 
    267268// Send results to caster
    268269////////////////////////////////////////////////////////////////////////////
     
    325326}
    326327
    327 // Write an Error Message
    328 ////////////////////////////////////////////////////////////////////////////
    329 void bncComb::slotError(const QByteArray msg) {
    330   cout << msg.data() << endl;
    331 }
    332 
    333 // Write a Message
    334 ////////////////////////////////////////////////////////////////////////////
    335 void bncComb::slotMessage(const QByteArray msg) {
    336   cout << msg.data() << endl;
    337 }
    338 
    339328// Change the correction so that it refers to last received ephemeris
    340329////////////////////////////////////////////////////////////////////////////
     
    370359////////////////////////////////////////////////////////////////////////////
    371360void bncComb::processEpochs(const QList<cmbEpoch*>& epochs) {
     361
     362  _log.clear();
     363
     364  QTextStream out(&_log, QIODevice::WriteOnly);
     365
     366  out <<                  "Combination:" << endl
     367      << "-----------------------------" << endl;
    372368
    373369  // Predict Parameters Values, Add White Noise
     
    441437
    442438        ll(iObs) = corr->dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
    443    
    444         printSingleCorr(epo->acName, corr);
     439
    445440        delete corr;
    446441      }
     
    459454        }
    460455      }
    461     }
    462  
    463     cout << "vv = " << vv.t();
     456      out.setRealNumberNotation(QTextStream::FixedNotation);
     457      out.setFieldWidth(8);
     458      out.setRealNumberPrecision(4);
     459      out << pp->toString() << " "
     460          << pp->xx << " +- " << _QQ(pp->index,pp->index) << endl;
     461    }
    464462  }
    465463
    466464  dumpResults(resTime, resCorr);
    467465
    468   cout << "Corrections processed" << endl << endl;
    469 }
     466  emit newMessage(_log, false);
     467}
  • trunk/BNC/combination/bnccomb.h

    r2986 r2990  
    1515  ~cmbParam();
    1616  double partial(const QString& acIn, t_corr* corr);
     17  QString toString() const;
    1718  parType type;
    1819  int     index;
     
    3435  void newMessage(QByteArray msg, bool showOnScreen);
    3536
    36  private slots:
    37   void slotMessage(const QByteArray msg);
    38   void slotError(const QByteArray msg);
    39 
    4037 private:
    41 
    4238  class cmbEpoch {
    4339   public:
     
    7167
    7268  void processEpochs(const QList<cmbEpoch*>& epochs);
    73   void printSingleCorr(const QString& acName, const t_corr* corr);
    7469  void dumpResults(const bncTime& resTime,
    7570                   const QMap<QString, t_corr*>& resCorr);
     
    8580  double                _sigClk;
    8681  SymmetricMatrix       _QQ;
     82  QByteArray            _log;
    8783};
    8884
  • trunk/BNC/combination/cmbcaster.cpp

    r2925 r2990  
    1919#include "bncsettings.h"
    2020#include "bncversion.h"
     21#include "bncapp.h"
    2122
    2223using namespace std;
     
    2930  _outSocket  = 0;
    3031  _sOpenTrial = 0;
     32  connect(this, SIGNAL(newMessage(QByteArray,bool)),
     33          ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
    3134}
    3235
     
    7578    delete _outSocket;
    7679    _outSocket = 0;
    77     emit(newMessage("Broadcaster: Connect timeout"));
     80    emit(newMessage("Broadcaster: Connect timeout", true));
    7881    return;
    7982  }
     
    9295    delete _outSocket;
    9396    _outSocket = 0;
    94     emit(newMessage("Broadcaster: Connection broken"));
     97    emit(newMessage("Broadcaster: Connection broken", true));
    9598  }
    9699  else {
    97     emit(newMessage("Broadcaster: Connection opened"));
     100    emit(newMessage("Broadcaster: Connection opened", true));
    98101    _sOpenTrial = 0;
    99102  }
  • trunk/BNC/combination/cmbcaster.h

    r2925 r2990  
    1414
    1515 signals:
    16   void error(const QByteArray msg);
    17   void newMessage(const QByteArray msg);
     16  void newMessage(QByteArray msg, bool showOnScreen);
    1817
    1918 private:
Note: See TracChangeset for help on using the changeset viewer.