Changeset 2754 in ntrip


Ignore:
Timestamp:
Dec 1, 2010, 2:09:21 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnc.qrc

    r2657 r2754  
    55    <file>bnchelp.html</file>
    66    <file>bncabout.html</file>
     7    <file>worldmap.dat</file>
    78</qresource>
    89<qresource prefix="/bnchelp">
  • trunk/BNC/bncmap.cpp

    r2753 r2754  
    5050void bncMap::slotReadMap()
    5151{   
    52   QString mapFile = "worldmap.dat";
    53   QFile world(mapFile);
     52  QFile world(":worldmap.dat");
    5453  float fi, la;
    5554
    56   if( world.open(QIODevice::ReadOnly) ){
     55  world.open(QIODevice::ReadOnly | QIODevice::Text);
    5756     
    58     QTextStream in(&world);
    59     in.setRealNumberNotation(QTextStream::FixedNotation);
     57  QTextStream in(&world);
     58  in.setRealNumberNotation(QTextStream::FixedNotation);
    6059
    61     while( ! in.atEnd() ){
     60  while( ! in.atEnd() ){
    6261
    63       in >> la >> fi;
    64       _worldMap << QPointF( la, -fi );
    65          
    66     }
    67   }else{
    68     std::cerr << QString("World map cannot be found : %1\n").arg(mapFile).toAscii().data();
     62    in >> la >> fi;
     63    _worldMap << QPointF( la, -fi );
     64         
    6965  }
     66
    7067  world.close();
    7168}
     
    8279    if( _worldMap.at(i).x() == 0.0 and _worldMap.at(i).y() == 0.0 ){
    8380      if( i > 0 ){
    84         endIdx = i-1;
     81        endIdx = i-1;
    8582        while( begIdx < endIdx ){
    8683
    87           int l1 = 0;
    88           int l2 = 0;
     84          int l1 = 0;
     85          int l2 = 0;
    8986
    9087          float la1 = _worldMap.at(begIdx+0).x() + _LaOff;
     
    9390          float fi2 = _worldMap.at(begIdx+1).y();
    9491          begIdx++;
    95            
    96           while( la1 <    0 ){ la1 += 360; l1++; }
    97           while( la1 >= 360 ){ la1 -= 360; l1--; }
    98           while( la2 <    0 ){ la2 += 360; l2++; }
    99           while( la2 >= 360 ){ la2 -= 360; l2--; }
     92           
     93          while( la1 <    0 ){ la1 += 360; l1++; }
     94          while( la1 >= 360 ){ la1 -= 360; l1--; }
     95          while( la2 <    0 ){ la2 += 360; l2++; }
     96          while( la2 >= 360 ){ la2 -= 360; l2--; }
    10097
    101           if( l1 != 0 and l2 == 0 ){ continue; } // break this line
    102           if( l2 != 0 and l1 == 0 ){ continue; } // break this line
     98          if( l1 != 0 and l2 == 0 ){ continue; } // break this line
     99          if( l2 != 0 and l1 == 0 ){ continue; } // break this line
    103100
    104101          _mapScen->addLine(la1*_scale, fi1*_scale, la2*_scale, fi2*_scale, QPen(QBrush(Qt::black),1));
Note: See TracChangeset for help on using the changeset viewer.