Changeset 447bfb2f214c07de968760f5ecd00351514d4456

Show
Ignore:
Timestamp:
02/23/10 12:29:12 (5 months ago)
Author:
Tobias Bieniek <Tobias.Bieniek@…>
git-author:
Tobias Bieniek <Tobias.Bieniek@gmx.de> / 2010-02-22T19:44:32Z+0100
Parents:
a9bd51a8a88f04980b6746b3c02dc8c49aab9d9a
Children:
4e12fa19ed512ec4add929770f820c4f4ac99dd0
git-committer:
Tobias Bieniek <Tobias.Bieniek@gmx.de> / 2010-02-23T10:29:12Z+0100
Message:

Math/Units: Removed KNOTSTOMETRESSECOND #define

Location:
src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • src/Device/Driver/CAI302.cpp

    r959be8 r447bfb  
    4949#include "Device/Internal.hpp" 
    5050#include "Protection.hpp" 
    51 #include "Math/Units.h" 
     51#include "Units.hpp" 
    5252#include "NMEA/Info.hpp" 
    5353 
     
    196196  TCHAR  szTmp[32]; 
    197197 
    198   _stprintf(szTmp, _T("!g,m%d\r\n"), int(((MacCready * 10) / KNOTSTOMETRESSECONDS) + 0.5)); 
     198  _stprintf(szTmp, _T("!g,m%d\r\n"), int(Units::ToUserUnit( 
     199      MacCready * 10, unKnots) + 0.5)); 
    199200 
    200201  port->WriteString(szTmp); 
     
    578579  NMEAParser::ExtractParameter(String,ctemp,7); 
    579580  GPS_INFO->TotalEnergyVarioAvailable = true; 
    580   GPS_INFO->TotalEnergyVario = ((_tcstod(ctemp, NULL) - 200.0) / 10.0) 
    581     * KNOTSTOMETRESSECONDS; 
     581  GPS_INFO->TotalEnergyVario = Units::ToSysUnit( 
     582      (_tcstod(ctemp, NULL) - 200.0) / 10.0, unKnots); 
    582583 
    583584  NMEAParser::ExtractParameter(String,ctemp,10); 
    584   GPS_INFO->MacCready = (_tcstod(ctemp, NULL) / 10.0) * KNOTSTOMETRESSECONDS; 
     585  GPS_INFO->MacCready = Units::ToSysUnit(_tcstod(ctemp, NULL) / 10.0, unKnots); 
    585586  if (MacCreadyUpdateTimeout <= 0) { 
    586587  /// @todo: OLD_TASK device MC/bugs/ballast is currently not implemented, have to push MC to master 
  • src/Device/Parser.cpp

    r75ce38 r447bfb  
    584584  GPS_INFO->WaypointDistance = NAUTICALMILESTOMETRES * _tcstod(params[9], NULL); 
    585585  GPS_INFO->WaypointBearing = _tcstod(params[10], NULL); 
    586   GPS_INFO->WaypointSpeed = KNOTSTOMETRESSECONDS * _tcstod(params[11], NULL); 
     586  GPS_INFO->WaypointSpeed =  Units::ToSysUnit(_tcstod(params[11], NULL), unKnots); 
    587587  */ 
    588588 
     
    676676  } 
    677677 
    678   GPS_INFO->GroundSpeed = KNOTSTOMETRESSECONDS * speed; 
     678  GPS_INFO->GroundSpeed = Units::ToSysUnit(speed, unKnots); 
    679679 
    680680  if (GPS_INFO->GroundSpeed > fixed_one) { 
  • src/Math/Units.h

    ra9bd51 r447bfb  
    4141 
    4242#define NAUTICALMILESTOMETRES (double)1851.96 
    43 #define KNOTSTOMETRESSECONDS (double)0.5144 
    4443 
    4544#define TOKNOTS (double)1.944