Changeset 6141 in ntrip for trunk/BNC/src/bnccore.cpp


Ignore:
Timestamp:
Sep 13, 2014, 5:08:22 PM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnccore.cpp

    r6051 r6141  
    118118  _userName = _userName.leftJustified(20, ' ', true);
    119119
    120   _corrs = new QMultiMap<bncTime, QString>;
     120  _corrs = new QMultiMap<bncTime, t_clkCorr>;
    121121
    122122  _dateAndTimeGPS = 0;
     
    633633////////////////////////////////////////////////////////////////////////////
    634634void t_bncCore::slotQuit() {
    635   cout << "t_bncCore::slotQuit" << endl;
    636635  delete _caster; _caster = 0;
    637636  qApp->quit();
     
    640639//
    641640////////////////////////////////////////////////////////////////////////////
    642 void t_bncCore::slotNewCorrLine(QString line, QString staID, bncTime coTime) {
    643 
     641void t_bncCore::slotNewOrbCorrections(QList<t_orbCorr> orbCorrections) {
     642  emit newOrbCorrections(orbCorrections);
     643}
     644
     645//
     646////////////////////////////////////////////////////////////////////////////
     647void t_bncCore::slotNewClkCorrections(QList<t_clkCorr> clkCorrections) {
    644648  QMutexLocker locker(&_mutex);
     649
     650  if (clkCorrections.size() == 0) {
     651    return;
     652  }
     653  bncTime coTime = clkCorrections[0]._time;
     654  QString staID(clkCorrections[0]._staID.c_str());
    645655
    646656  // Combination of Corrections
     
    648658#ifdef USE_COMBINATION
    649659  if (_bncComb) {
    650     _bncComb->processCorrLine(staID, line);
     660    _bncComb->processClkCorrections(clkCorrections);
    651661  }
    652662#endif
     
    677687  }
    678688
    679   _corrs->insert(coTime, QString(line + " " + staID));
     689  for (int ii = 0; ii < clkCorrections.size(); ii++) {
     690    _corrs->insert(coTime, clkCorrections[ii]);
     691  }
    680692
    681693  // Dump Corrections
     
    693705////////////////////////////////////////////////////////////////////////////
    694706void t_bncCore::dumpCorrs(bncTime minTime, bncTime maxTime) {
    695   QStringList allCorrs;
    696   QMutableMapIterator<bncTime, QString> it(*_corrs);
     707  QList<t_clkCorr> allCorrs;
     708  QMutableMapIterator<bncTime, t_clkCorr> it(*_corrs);
    697709  while (it.hasNext()) {
    698710    it.next();
     
    709721////////////////////////////////////////////////////////////////////////////
    710722void t_bncCore::dumpCorrs() {
    711   QStringList allCorrs;
    712   QMutableMapIterator<bncTime, QString> it(*_corrs);
     723  QList<t_clkCorr> allCorrs;
     724  QMutableMapIterator<bncTime, t_clkCorr> it(*_corrs);
    713725  while (it.hasNext()) {
    714726    allCorrs << it.next().value();
     
    720732// Dump List of Corrections
    721733////////////////////////////////////////////////////////////////////////////
    722 void t_bncCore::dumpCorrs(const QStringList& allCorrs) {
    723   emit newCorrections(allCorrs);
     734void t_bncCore::dumpCorrs(const QList<t_clkCorr>& allCorrs) {
     735  emit newClkCorrections(allCorrs);
    724736  if (_socketsCorr) {
    725     QListIterator<QString> it(allCorrs);
     737    QListIterator<t_clkCorr> it(allCorrs);
    726738    while (it.hasNext()) {
    727       QString corrLine = it.next() + "\n";
    728    
     739      const t_clkCorr& corr = it.next();
    729740      QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
    730741      while (is.hasNext()) {
    731742        QTcpSocket* sock = is.next();
    732743        if (sock->state() == QAbstractSocket::ConnectedState) {
    733           if (sock->write(corrLine.toAscii()) == -1) {
     744          if (sock->write(corr.toString().c_str()) == -1) {
    734745            delete sock;
    735746            is.remove();
Note: See TracChangeset for help on using the changeset viewer.