Changeset 5230 in ntrip


Ignore:
Timestamp:
Jun 16, 2013, 4:35:38 PM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
3 edited

Legend:

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

    r5070 r5230  
    439439  azSat  = atan2(neu[1], neu[0]);
    440440}
     441
     442// Degrees -> degrees, minutes, seconds
     443////////////////////////////////////////////////////////////////////////////
     444void deg2DMS(double decDeg, int& deg, int& min, double& sec) {
     445  int sgn = (decDeg < 0.0 ? -1 : 1);
     446  deg = sgn * static_cast<int>(decDeg);
     447  min =       static_cast<int>((decDeg - deg)*60);
     448  sec =       (decDeg - deg - min/60.0) * 3600.0;
     449}
  • trunk/BNC/src/bncutils.h

    r4338 r5230  
    8080           double& rho, double& eleSat, double& azSat);
    8181
     82void deg2DMS(double decDeg, int& deg, int& min, double& sec);
     83
    8284#endif
  • trunk/BNC/src/map/bncmapwin.cpp

    r5229 r5230  
    115115  _currLat = lat;
    116116  _currLon = lon;
     117
     118  int    latDeg, latMin;
     119  double latSec;
     120  deg2DMS(lat, latDeg, latMin, latSec);
     121
     122  int    lonDeg, lonMin;
     123  double lonSec;
     124  deg2DMS(lon, lonDeg, lonMin, lonSec);
     125
     126  QString lblStr=QString("Latitude: %1 %2 %3    Longitude: %4 %5 %6")
     127                         .arg(latDeg).arg(latMin).arg(latSec,0,'f',2)
     128                         .arg(lonDeg).arg(lonMin).arg(lonSec,0,'f',2);
     129  _statusLabel->setText(lblStr);
     130
    117131  QString location = QString("%1, %2").arg(_currLat,0,'f',8).arg(_currLon,0,'f',8);
    118   _statusLabel->setText(location);
    119132  _webView->page()->mainFrame()->evaluateJavaScript(QString("gotoLocation( %1 )").arg(location));
    120133}
Note: See TracChangeset for help on using the changeset viewer.