Changeset 8204 in ntrip for trunk/BNC/src/rinex/rnxobsfile.cpp


Ignore:
Timestamp:
Dec 11, 2017, 3:00:40 PM (6 years ago)
Author:
wiese
Message:

CHANGE: #105 toAscii deprecated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/rnxobsfile.cpp

    r8168 r8204  
    9292    }
    9393    else if (key == "RINEX VERSION / TYPE") {
    94       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     94      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    9595      in >> _version;
    9696    }
     
    118118    }
    119119    else if (key == "INTERVAL") {
    120       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     120      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    121121      in >> _interval;
    122122    }
     
    125125    }
    126126    else if (key == "WAVELENGTH FACT L1/2") {
    127       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     127      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    128128      int wlFactL1 = 0;
    129129      int wlFactL2 = 0;
     
    149149    }
    150150    else if (key == "APPROX POSITION XYZ") {
    151       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     151      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    152152      in >> _xyz[0] >> _xyz[1] >> _xyz[2];
    153153    }
    154154    else if (key == "ANTENNA: DELTA H/E/N") {
    155       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     155      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    156156      in >> _antNEU[2] >> _antNEU[1] >> _antNEU[0];
    157157    }
    158158    else if (key == "ANTENNA: DELTA X/Y/Z") {
    159       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     159      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    160160      in >> _antXYZ[0] >> _antXYZ[1] >> _antXYZ[2];
    161161    }
    162162    else if (key == "ANTENNA: B.SIGHT XYZ") {
    163       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     163      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    164164      in >> _antBSG[0] >> _antBSG[1] >> _antBSG[2];
    165165    }
     
    168168        _version = defaultRnxObsVersion2;
    169169      }
    170       QTextStream* in = new QTextStream(value.toAscii(), QIODevice::ReadOnly);
     170      QTextStream* in = new QTextStream(value.toLatin1(), QIODevice::ReadOnly);
    171171      int nTypes;
    172172      *in >> nTypes;
    173       char sys0 = _usedSystems[0].toAscii();
     173      char sys0 = _usedSystems[0].toLatin1();
    174174      _obsTypes[sys0].clear();
    175175      for (int ii = 0; ii < nTypes; ii++) {
     
    177177          line = stream->readLine(); ++numLines;
    178178          delete in;
    179           in = new QTextStream(line.left(60).toAscii(), QIODevice::ReadOnly);
     179          in = new QTextStream(line.left(60).toLatin1(), QIODevice::ReadOnly);
    180180        }
    181181        QString hlp;
     
    184184      }
    185185      for (int ii = 1; ii < _usedSystems.length(); ii++) {
    186         char sysI = _usedSystems[ii].toAscii();
     186        char sysI = _usedSystems[ii].toLatin1();
    187187        _obsTypes[sysI] = _obsTypes[sys0];
    188188      }
     
    192192        _version = defaultRnxObsVersion3;
    193193      }
    194       QTextStream* in = new QTextStream(value.toAscii(), QIODevice::ReadOnly);
     194      QTextStream* in = new QTextStream(value.toLatin1(), QIODevice::ReadOnly);
    195195      char sys;
    196196      int nTypes;
     
    201201          line = stream->readLine(); ++numLines;
    202202          delete in;
    203           in = new QTextStream(line.toAscii(), QIODevice::ReadOnly);
     203          in = new QTextStream(line.toLatin1(), QIODevice::ReadOnly);
    204204        }
    205205        QString hlp;
     
    213213    }
    214214    else if (key == "TIME OF FIRST OBS") {
    215       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     215      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    216216      int year, month, day, hour, min;
    217217      double sec;
     
    220220    }
    221221    else if (key == "SYS / PHASE SHIFT"){
    222       QTextStream* in = new QTextStream(value.toAscii(), QIODevice::ReadOnly);
     222      QTextStream* in = new QTextStream(value.toLatin1(), QIODevice::ReadOnly);
    223223      char        sys;
    224224      QString     obstype;
     
    233233            line = stream->readLine(); ++numLines;
    234234            delete in;
    235             in = new QTextStream(line.left(60).toAscii(), QIODevice::ReadOnly);
     235            in = new QTextStream(line.left(60).toLatin1(), QIODevice::ReadOnly);
    236236          }
    237237          *in >> sat;
     
    243243    }
    244244    else if (key == "GLONASS COD/PHS/BIS"){
    245       QTextStream in(value.toAscii(), QIODevice::ReadOnly);
     245      QTextStream in(value.toLatin1(), QIODevice::ReadOnly);
    246246      for (int ii = 0; ii < 4; ii++) {
    247247        QString type;
     
    253253    }
    254254    else if (key == "GLONASS SLOT / FRQ #") {
    255       QTextStream* in = new QTextStream(value.toAscii(), QIODevice::ReadOnly);
     255      QTextStream* in = new QTextStream(value.toLatin1(), QIODevice::ReadOnly);
    256256      int nSlots = 0;
    257257      *in >> nSlots;
     
    260260          line = stream->readLine(); ++numLines;
    261261          delete in;
    262           in = new QTextStream(line.left(60).toAscii(), QIODevice::ReadOnly);
     262          in = new QTextStream(line.left(60).toLatin1(), QIODevice::ReadOnly);
    263263        }
    264264        QString sat;
     
    457457            QString type = header.obsType(sys, iType, _version);
    458458            for (int jSys = 0; jSys < _usedSystems.length(); jSys++) {
    459               char thisSys  = _usedSystems[jSys].toAscii();
     459              char thisSys  = _usedSystems[jSys].toLatin1();
    460460              if (!_obsTypes[thisSys].contains(type)) {
    461461                _obsTypes[thisSys].push_back(type);
     
    473473        if (hlp.size() == 2 && hlp[0].length() == 1) {
    474474          if (_version >= 3.0) {
    475             char    sys  = hlp[0][0].toAscii();
     475            char    sys  = hlp[0][0].toLatin1();
    476476            QString type = t_rnxObsFile::type2to3(sys, hlp[1]);
    477477            if (!_obsTypes[sys].contains(type)) {
     
    481481          else {
    482482            for (int iSys = 0; iSys < _usedSystems.length(); iSys++) {
    483               char    sys  = _usedSystems[iSys].toAscii();
     483              char    sys  = _usedSystems[iSys].toLatin1();
    484484              QString type = t_rnxObsFile::type3to2(sys, hlp[1]);
    485485              if (!_obsTypes[sys].contains(type)) {
     
    492492      else {
    493493        for (int iSys = 0; iSys < _usedSystems.length(); iSys++) {
    494           char    sys  = _usedSystems[iSys].toAscii();
     494          char    sys  = _usedSystems[iSys].toLatin1();
    495495          QString type = _version >= 3.0 ? t_rnxObsFile::type2to3(sys, useObsTypes->at(iType)) :
    496496                                           t_rnxObsFile::type3to2(sys, useObsTypes->at(iType));
     
    936936  QStringList strList;
    937937  if (_version < 3.0) {
    938     char sys0 = _usedSystems[0].toAscii();
     938    char sys0 = _usedSystems[0].toLatin1();
    939939    QString hlp;
    940940    QTextStream(&hlp) << QString("%1").arg(_obsTypes[sys0].size(), 6);
     
    11311131    }
    11321132
    1133     QTextStream in(line.mid(1).toAscii(), QIODevice::ReadOnly);
     1133    QTextStream in(line.mid(1).toLatin1(), QIODevice::ReadOnly);
    11341134
    11351135    // Epoch Time
     
    11511151    for (int iSat = 0; iSat < numSat; iSat++) {
    11521152      line = _stream->readLine();
    1153       t_prn prn; prn.set(line.left(3).toAscii().data());
     1153      t_prn prn; prn.set(line.left(3).toLatin1().data());
    11541154      _currEpo.rnxSat[iSat].prn = prn;
    11551155      char sys = prn.system();
     
    12021202    }
    12031203
    1204     QTextStream in(line.toAscii(), QIODevice::ReadOnly);
     1204    QTextStream in(line.toLatin1(), QIODevice::ReadOnly);
    12051205
    12061206    // Epoch Time
     
    12331233      }
    12341234
    1235       char sys = line.toAscii()[pos];
     1235      char sys = line.toLatin1()[pos];
    12361236      if (sys == ' ') {
    12371237        sys = 'G';
     
    15121512void t_rnxObsFile::setObsFromRnx(const t_rnxObsFile* rnxObsFile, const t_rnxObsFile::t_rnxEpo* epo,
    15131513                                 const t_rnxObsFile::t_rnxSat& rnxSat, t_satObs& obs) {
    1514   obs._staID = rnxObsFile->markerName().toAscii().constData();
     1514  obs._staID = rnxObsFile->markerName().toLatin1().constData();
    15151515  obs._prn   = rnxSat.prn;
    15161516  obs._time  = epo->tt;
     
    15391539      const t_rnxObs& rnxObs = rnxSat.obs[type];
    15401540      if (rnxObs.value != 0.0) {
    1541         string type2ch(typeV3.mid(1).toAscii().data());
     1541        string type2ch(typeV3.mid(1).toLatin1().data());
    15421542
    15431543        t_frqObs* frqObs = 0;
     
    15541554        }
    15551555
    1556         switch( typeV3.toAscii().data()[0] ) {
     1556        switch( typeV3.toLatin1().data()[0] ) {
    15571557        case 'C':
    15581558          frqObs->_codeValid = true;
Note: See TracChangeset for help on using the changeset viewer.