Changeset 366 in ntrip for trunk/BNC/bncrinex.cpp


Ignore:
Timestamp:
Jan 17, 2007, 4:17:20 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncrinex.cpp

    r356 r366  
    6262////////////////////////////////////////////////////////////////////////////
    6363bncRinex::bncRinex(const char* StatID, const QUrl& mountPoint,
    64                    const QByteArray& format) {
     64                   const QByteArray& format, const QByteArray& latitude,
     65                   const QByteArray& longitude, const QByteArray& nmea) {
    6566  _statID        = StatID;
    6667  _mountPoint    = mountPoint;
    6768  _format        = format.left(6);
     69  _latitude      = latitude;
     70  _longitude     = longitude;
     71  _nmea          = nmea;
    6872  _headerWritten = false;
    6973
     
    145149      const int timeOut = 10*1000;
    146150      QString msg;
    147       QTcpSocket* socket = bncGetThread::request(url, timeOut, msg);
     151      QByteArray _latitude;
     152      QByteArray _longitude;
     153      QByteArray _nmea;
     154      QTcpSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg);
    148155
    149156      if (socket) {
     
    154161            line.chop(1);
    155162            if (line.indexOf("RINEX VERSION") != -1) {
    156               _headerLines.append("     2.10           OBSERVATION DATA"
     163              _headerLines.append("     2.11           OBSERVATION DATA"
    157164                                  "    M (MIXED)"
    158165                                  "           RINEX VERSION / TYPE");
     
    294301
    295302  QSettings settings;
    296 //  double lat, lon;
    297 //  int vrsstream = 0;
    298 //  lat = settings.value("approxLat", 0).toDouble();
    299 //  lon = settings.value("approxLon", 0).toDouble();
    300 //  if ((lat != 0.0) && (lon != 0.0)) {vrsstream=1;}
    301303
    302304  // Open the Output File
     
    332334      }
    333335      else if (line.indexOf("# / TYPES OF OBSERV") != -1) {
    334         _out << "     5    C1    P1    P2    L1    L2"
    335                 "                        # / TYPES OF OBSERV"  << endl;
     336        _out << "     6    C1    C2    P1    P2    L1    L2"
     337                "                  # / TYPES OF OBSERV"  << endl;
    336338      }
    337339      else if (line.indexOf("TIME OF FIRST OBS") != -1) {
     
    342344                      _mountPoint.path())).leftJustified(60, ' ', true);
    343345        _out << hlp.toAscii().data() << "COMMENT" << endl;
    344 //        hlp = QString("Approx VRS Position %1%2").arg(lat, -20, 'f', 4).arg(lon, -20, 'f', 4);
    345 //        _out << hlp.toAscii().data() << "COMMENT" << endl;
    346346      }
    347347      else {
     
    357357    double antennaNEU[3]; antennaNEU[0] = antennaNEU[1] = antennaNEU[2] = 0.0;
    358358   
    359     _out << "     2.10           OBSERVATION DATA    M (MIXED)           RINEX VERSION / TYPE" << endl;
     359    _out << "     2.11           OBSERVATION DATA    M (MIXED)           RINEX VERSION / TYPE" << endl;
    360360    QString hlp = QDate::currentDate().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
    361361    _out << _pgmName.toAscii().data() << _userName.toAscii().data()
     
    380380         << "                  "                                     << "ANTENNA: DELTA H/E/N" << endl;
    381381    _out << "     1     1                                                WAVELENGTH FACT L1/2" << endl;
    382     _out << "     5    C1    P1    P2    L1    L2                        # / TYPES OF OBSERV"  << endl;
     382    _out << "     6    C1    C2    P1    P2    L1    L2                  # / TYPES OF OBSERV"  << endl;
    383383        _out << datTim.toString("  yyyy    MM    dd"
    384384                                "    hh    mm   ss.zzz0000").toAscii().data();
     
    387387          _mountPoint.path())).leftJustified(60, ' ', true);
    388388    _out << hlp.toAscii().data() << "COMMENT" << endl;
    389 //    hlp = QString("Approx VRS Position %1%2").arg(lat, -20, 'f', 4).arg(lon, -20, 'f', 4);
    390 //    _out << hlp.toAscii().data() << "COMMENT" << endl;
     389
     390    if (_nmea == "VRS") {
     391    hlp = ("VRS LAT=" + _latitude + " " + "LONG=" + _longitude).leftJustified(60, ' ',true);
     392    _out << hlp.toAscii().data() << "COMMENT" << endl; }
     393
    391394    _out << "                                                            END OF HEADER"        << endl;
    392395  }
     
    469472    char snr = ' ';
    470473    _out << setw(14) << setprecision(3) << ob->C1 << lli << snr;
     474    _out << setw(14) << setprecision(3) << ob->C2 << lli << snr;
    471475    _out << setw(14) << setprecision(3) << ob->P1 << lli << snr;
    472476    _out << setw(14) << setprecision(3) << ob->P2 << lli << snr;
    473477    _out << setw(14) << setprecision(3) << ob->L1 << lli
    474          << setw(1) << ob->SNR1;
     478         << setw(1) << ob->SNR1 << endl;
    475479    _out << setw(14) << setprecision(3) << ob->L2 << lli
    476480         << setw(1) << ob->SNR2;
Note: See TracChangeset for help on using the changeset viewer.