]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/garmin.cxx
SG_ namespace
[flightgear.git] / src / Network / garmin.cxx
index ca00dd414f3d6accdac829e02cb07ec9fc76ad33..00a266f47f6496daa6f924f2268372e31ee2ec1c 100644 (file)
@@ -74,7 +74,7 @@ bool FGGarmin::gen_message() {
             t->getGmt()->tm_hour, t->getGmt()->tm_min, t->getGmt()->tm_sec );
 
     char lat[20];
-    double latd = cur_fdm_state->get_Latitude() * RAD_TO_DEG;
+    double latd = cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
     if ( latd < 0.0 ) {
        latd *= -1.0;
        dir = 'S';
@@ -86,7 +86,7 @@ bool FGGarmin::gen_message() {
     sprintf( lat, "%02d%06.3f,%c", abs(deg), min, dir);
 
     char lon[20];
-    double lond = cur_fdm_state->get_Longitude() * RAD_TO_DEG;
+    double lond = cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
     if ( lond < 0.0 ) {
        lond *= -1.0;
        dir = 'W';
@@ -101,7 +101,7 @@ bool FGGarmin::gen_message() {
     sprintf( speed, "%05.1f", cur_fdm_state->get_V_equiv_kts() );
 
     char heading[10];
-    sprintf( heading, "%05.1f", cur_fdm_state->get_Psi() * RAD_TO_DEG );
+    sprintf( heading, "%05.1f", cur_fdm_state->get_Psi() * SGD_RADIANS_TO_DEGREES );
 
     char altitude_m[10];
     sprintf( altitude_m, "%02d", 
@@ -236,7 +236,7 @@ bool FGGarmin::parse_message() {
                lat *= -1;
            }
 
-           cur_fdm_state->set_Latitude( lat * DEG_TO_RAD );
+           cur_fdm_state->set_Latitude( lat * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lat = " << lat );
 
            // lon val
@@ -265,9 +265,10 @@ bool FGGarmin::parse_message() {
                lon *= -1;
            }
 
-           cur_fdm_state->set_Longitude( lon * DEG_TO_RAD );
+           cur_fdm_state->set_Longitude( lon * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  lon = " << lon );
 
+#if 0
            double sl_radius, lat_geoc;
            sgGeodToGeoc( cur_fdm_state->get_Latitude(), 
                          cur_fdm_state->get_Altitude(), 
@@ -275,6 +276,7 @@ bool FGGarmin::parse_message() {
            cur_fdm_state->set_Geocentric_Position( lat_geoc, 
                           cur_fdm_state->get_Longitude(), 
                           sl_radius + cur_fdm_state->get_Altitude() );
+#endif
 
            // speed
            end = msg.find(",", begin);
@@ -285,8 +287,8 @@ bool FGGarmin::parse_message() {
            string speed_str = msg.substr(begin, end - begin);
            begin = end + 1;
            speed = atof( speed_str.c_str() );
-           cur_fdm_state->set_V_equiv_kts( speed );
-           cur_fdm_state->set_V_ground_speed( speed );
+           cur_fdm_state->set_V_calibrated_kts( speed );
+           // cur_fdm_state->set_V_ground_speed( speed );
            FG_LOG( FG_IO, FG_INFO, "  speed = " << speed );
 
            // heading
@@ -300,7 +302,7 @@ bool FGGarmin::parse_message() {
            heading = atof( hdg_str.c_str() );
            cur_fdm_state->set_Euler_Angles( cur_fdm_state->get_Phi(), 
                                             cur_fdm_state->get_Theta(), 
-                                            heading * DEG_TO_RAD );
+                                            heading * SGD_DEGREES_TO_RADIANS );
            FG_LOG( FG_IO, FG_INFO, "  heading = " << heading );
        } else if ( sentence == "PGRMZ" ) {
            // altitude