]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/ray.cxx
Erik Hofman:
[flightgear.git] / src / Network / ray.cxx
index 2644e705789427c480d68d7cd38a6503c68548bd..e93dc3fc27079471d1fd251c23e50cdd7ab41d27 100644 (file)
@@ -104,11 +104,11 @@ bool FGRAY::gen_message() {
        /* Make sure the angles are reasonable onscale */
        /* We use an asymmetric mapping so that the chair behaves
           reasonably when upside down.  Otherwise it oscillates. */
-       while ( ang_pos < -2*SG_PI/3 ) {
-               ang_pos += 2 * SG_PI;
+       while ( ang_pos < -2*SGD_PI/3 ) {
+               ang_pos += 2 * SGD_PI;
        }
-       while ( ang_pos >  4*SG_PI/3 ) {
-               ang_pos -= 2 * SG_PI;
+       while ( ang_pos >  4*SGD_PI/3 ) {
+               ang_pos -= 2 * SGD_PI;
        }
 
        /* Tell interested parties what the situation is */
@@ -131,11 +131,11 @@ bool FGRAY::gen_message() {
 
        /* yaw */
                /* Make sure that we walk through North cleanly */
-               if ( fabs ( ang_pos - chair_heading ) > SG_PI )
+               if ( fabs ( ang_pos - chair_heading ) > SGD_PI )
                {       /* Need to swing chair by 360 degrees */
                        if ( ang_pos < chair_heading )
-                               chair_heading -= 2 * SG_PI;
-                       else    chair_heading += 2 * SG_PI;
+                               chair_heading -= 2 * SGD_PI;
+                       else    chair_heading += 2 * SGD_PI;
                }
                /* Remove the chair heading from the true heading */
                ang_pos -= chair_heading;
@@ -144,7 +144,7 @@ bool FGRAY::gen_message() {
                   can just about represent 30 degrees full scale.  */
                chair_heading += ang_pos * dt * 0.2;
                /* If they turn fast, at 90 deg error subtract 30 deg */
-               if ( fabs(ang_pos) > SG_PI / 2 )
+               if ( fabs(ang_pos) > SGD_PI / 2 )
                        chair_heading += ang_pos / 3;
 
        } else
@@ -178,8 +178,8 @@ bool FGRAY::gen_message() {
                /* Scale to the hardware's full scale range */
                propose /= fullscale [ subaxis ];
                /* Use a sine shaped washout on all axes */
-               if ( propose < -SG_PI / 2 ) *dac = 0x0000; else
-               if ( propose >  SG_PI / 2 ) *dac = 0xFFFF; else
+               if ( propose < -SGD_PI / 2 ) *dac = 0x0000; else
+               if ( propose >  SGD_PI / 2 ) *dac = 0xFFFF; else
                   *dac = (unsigned short) ( 32767 * 
                                ( 1.0 + sin ( propose ) ) );
        }
@@ -196,7 +196,7 @@ bool FGRAY::gen_message() {
 
 // parse RUL message
 bool FGRAY::parse_message() {
-    FG_LOG( FG_IO, FG_ALERT, "RAY input not supported" );
+    SG_LOG( SG_IO, SG_ALERT, "RAY input not supported" );
 
     return false;
 }
@@ -209,11 +209,11 @@ bool FGRAY::process() {
     if ( get_direction() == SG_IO_OUT ) {
        gen_message();
        if ( ! io->write( buf, length ) ) {
-           FG_LOG( FG_IO, FG_ALERT, "Error writing data." );
+           SG_LOG( SG_IO, SG_ALERT, "Error writing data." );
            return false;
        }
     } else if ( get_direction() == SG_IO_IN ) {
-       FG_LOG( FG_IO, FG_ALERT, "in direction not supported for RAY." );
+       SG_LOG( SG_IO, SG_ALERT, "in direction not supported for RAY." );
        return false;
     }