]> git.mxchange.org Git - flightgear.git/commitdiff
NAV1 is now the ILS-28R on airport KMYF,
authorcurt <curt>
Sun, 26 Mar 2000 16:52:36 +0000 (16:52 +0000)
committercurt <curt>
Sun, 26 Mar 2000 16:52:36 +0000 (16:52 +0000)
NAV2 is now the VOR radial 068 from MZB,
ADF  is now the Compass locator on the outer marker.
This combination is more than the legally required to
fly any of KMYF-ILS-28R, KMYF-LOC-28R KMYF-NDB28.
If you don't have access to the approach plates
and would like them, let me know and I'll scan them
(and put them on the webpage area).

The approaches do work; I've checked them all out in
terms of altitude profile, centerlines and other stuff.

In real life, the radar vectoring will basically abandon you
overhead KSEE airport at 4000 ft heading 210 or so.  Sometime
later you'll be turned to a heading of 260 if the controller
doesn't have too much else to do, just before you hit the
extended centerline.  You can't rely on that though.
Maintain 3500ft until established, 2100 ft until the outer marker,
If non-precision, maintain 1340 until crossing the radial,
then 900 thereafter until you miss, based on time from the NDB.
The miss takes you heading 270 to intercept a radial which this
hacky implementation will not let you set up the computer for.

The hacky math implementation does not take range and/or signal
strength into account, so you can fly to San Diego from England
by following the needle indication on the ADF.  It is also
fairly inaccurate math; about as accurate as the real-life signals.
When we have a _real_ radio module, I will be very happy to
throw all that code away.  For now, it makes it demonstratable.

Please notice the nastiness involving the "VARY_E" constant.
This is _not_ something that will go away with the radio module.
As far as I know, we don't have a routine that calculates
magnetic variation as a function of global position.
We will need one, probably within the next two months.

src/Cockpit/panel.cxx
src/Cockpit/steam.cxx
src/Cockpit/steam.hxx

index d6154dc4ecfa84a1b51cab7bec0a4b20d4ceaa09..c75d52d766c25e2a9f2403e3d937fc47aa15533f 100644 (file)
@@ -206,7 +206,7 @@ createTurnCoordinator (int x, int y)
                                // moves with slip/skid
   inst->addLayer(2, createTexture("Textures/Panel/ball.rgb"));
   inst->addTransformation(2, FGInstrumentLayer::ROTATION,
-                         FGSteam::get_TC_radps,
+                         FGSteam::get_TC_rad,
                          -0.1, 0.1, 450.0, 0.0);
 
   return inst;
@@ -382,7 +382,7 @@ createControls (int x, int y)
 
 
 /**
- * Construct a NAV1 gauge (dummy for now).
+ * Construct a NAV1 gauge (hardwired).
  */
 static FGPanelInstrument *
 createNAV1 (int x, int y)
@@ -391,13 +391,31 @@ createNAV1 (int x, int y)
 
                                // Layer 0: background
   inst->addLayer(0, createTexture("Textures/Panel/gyro-bg.rgb"));
+  inst->addTransformation(0, FGInstrumentLayer::ROTATION,
+                         FGSteam::get_HackOBS1_deg,
+                         -360.0, 360.0, -1.0, 0.0);
+                               // Layer 1: long needle
+  inst->addLayer(1, createTexture("Textures/Panel/long-needle.rgb"));
+  inst->addTransformation(1, FGInstrumentLayer::XSHIFT,
+                         FGSteam::get_HackVOR1_deg,
+                         -10.0, 10.0, SIX_W / 40.0, 0.0);
+  inst->addTransformation(1, FGInstrumentLayer::YSHIFT,
+                         -SIX_W / 4.4 );
+  inst->addLayer(2, createTexture("Textures/Panel/long-needle.rgb"));
+  inst->addTransformation(2, FGInstrumentLayer::YSHIFT,
+                         FGSteam::get_HackGS_deg,
+                         -1.0, 1.0, SIX_W / 5.0, 0.0);
+  inst->addTransformation(2, FGInstrumentLayer::XSHIFT,
+                         -SIX_W / 4.4 );
+  inst->addTransformation(2, FGInstrumentLayer::ROTATION,
+                         90 );
 
   return inst;
 }
 
 
 /**
- * Construct a NAV2 gauge (dummy for now).
+ * Construct a NAV2 gauge (hardwired).
  */
 static FGPanelInstrument *
 createNAV2 (int x, int y)
@@ -406,13 +424,22 @@ createNAV2 (int x, int y)
 
                                // Layer 0: background
   inst->addLayer(0, createTexture("Textures/Panel/gyro-bg.rgb"));
+  inst->addTransformation(0, FGInstrumentLayer::ROTATION,
+                         FGSteam::get_HackOBS2_deg,
+                         -360.0, 360.0, -1.0, 0.0);
+  inst->addLayer(1, createTexture("Textures/Panel/long-needle.rgb"));
+  inst->addTransformation(1, FGInstrumentLayer::XSHIFT,
+                         FGSteam::get_HackVOR2_deg,
+                         -10.0, 10.0, SIX_W / 40.0, 0.0);
+  inst->addTransformation(1, FGInstrumentLayer::YSHIFT,
+                         -SIX_W / 4.4 );
 
   return inst;
 }
 
 
 /**
- * Construct an ADF gauge (dummy for now).
+ * Construct an ADF gauge (hardwired).
  */
 static FGPanelInstrument *
 createADF (int x, int y)
@@ -421,6 +448,10 @@ createADF (int x, int y)
 
                                // Layer 0: background
   inst->addLayer(0, createTexture("Textures/Panel/gyro-bg.rgb"));
+  inst->addLayer(1, createTexture("Textures/Panel/long-needle.rgb"));
+  inst->addTransformation(1, FGInstrumentLayer::ROTATION,
+                         FGSteam::get_HackADF_deg,
+                         -720.0, 720.0, 1.0, 0.0);
 
   return inst;
 }
index 860e8e90015d4a862533afc389897207fbed62cd..27ca2bdf0e969fff5bcb97652e61fbd577dbe8ce 100644 (file)
@@ -47,6 +47,9 @@ FG_USING_NAMESPACE(std);
 // Anything that reads the BFI directly is not implemented at all!
 
 
+#define VARY_E         (14)
+
+
 double FGSteam::the_STATIC_inhg = 29.92;
 double FGSteam::the_ALT_ft = 0.0;
 double FGSteam::get_ALT_ft() { _CatchUp(); return the_ALT_ft; }
@@ -60,13 +63,12 @@ double FGSteam::get_VSI_fps() { _CatchUp(); return the_VSI_fps; }
 double FGSteam::the_VACUUM_inhg = 0.0;
 double FGSteam::get_VACUUM_inhg() { _CatchUp(); return the_VACUUM_inhg; }
 
-double FGSteam::get_MH_deg () { return FGBFI::getHeading (); }
-double FGSteam::get_DG_deg () { return FGBFI::getHeading (); }
+double FGSteam::get_MH_deg () { return FGBFI::getHeading () - VARY_E; }
+double FGSteam::get_DG_deg () { return FGBFI::getHeading () - VARY_E; }
 
 double FGSteam::get_TC_rad   () { return FGBFI::getSideSlip (); }
 double FGSteam::get_TC_radps () { return FGBFI::getRoll (); }
 
-
 \f
 ////////////////////////////////////////////////////////////////////////
 // Recording the current time
@@ -167,8 +169,8 @@ void FGSteam::_CatchUp()
        NO capability to have a scaling error of maybe a factor of two.
        */
        the_VSI_fps = ( the_VSI_case - the_STATIC_inhg )
-                   * 7000.0; /* manual scaling factor */       
-       set_lowpass ( & the_VSI_case, the_STATIC_inhg, dt/9.0 );
+                   * 10000.0; /* manual scaling factor */      
+       set_lowpass ( & the_VSI_case, the_STATIC_inhg, dt/6.0 );
 
        /**************************
        The engine driven vacuum pump is directly attached
@@ -202,5 +204,92 @@ void FGSteam::_CatchUp()
   }
 }
 
+\f
+////////////////////////////////////////////////////////////////////////
+// Everything below is a transient hack; expect it to disappear
+////////////////////////////////////////////////////////////////////////
+
+/* KMYF ILS */
+#define NAV1_LOC       (1)
+#define NAV1_Lat       (  32.0 + 48.94/60.0)
+#define NAV1_Lon       (-117.0 - 08.37/60.0)
+#define NAV1_Rad       280.0
+#define NAV1_Alt       423
+
+/* MZB stepdown radial */
+#define NAV2_Lat       (  32.0 + 46.93/60.0)
+#define NAV2_Lon       (-117.0 - 13.53/60.0)
+#define NAV2_Rad       068.0
+
+/* HAILE intersection */
+#define ADF_Lat                (  32.0 + 46.79/60.0)
+#define ADF_Lon                (-117.0 - 02.70/60.0)
+
+
+
+double FGSteam::get_HackGS_deg   ()
+{      double x,y,dme;
+       if (0==NAV1_LOC) return 0.0;
+       y = 60.0 * ( NAV1_Lat - FGBFI::getLatitude () );
+       x = 60.0 * ( NAV1_Lon - FGBFI::getLongitude() )
+                       * cos ( FGBFI::getLatitude () / RAD_TO_DEG );
+       dme = x*x + y*y;
+       if ( dme > 0.1 ) x = sqrt ( dme ); else x = 0.3;
+       y = FGBFI::getAltitude() - NAV1_Alt;
+       return 3.0 - (y/x) * 60.0 / 6000.0;
+}
+
+
+double FGSteam::get_HackVOR1_deg ()
+{      double r;
+       double x,y;
+       y = 60.0 * ( NAV1_Lat - FGBFI::getLatitude () );
+       x = 60.0 * ( NAV1_Lon - FGBFI::getLongitude() )
+                       * cos ( FGBFI::getLatitude () / RAD_TO_DEG );
+       r = atan2 ( x, y ) * RAD_TO_DEG - NAV1_Rad - VARY_E;
+       if (r> 180.0) r-=360.0; else
+       if (r<-180.0) r+=360.0;
+       if ( fabs(r) > 90.0 )
+               r = ( r<0.0 ? -r-180.0 : -r+180.0 );
+       if (NAV1_LOC) r*=5.0;
+       return r;
+}
+
+
+double FGSteam::get_HackVOR2_deg ()
+{      double r;
+       double x,y;
+       y = 60.0 * ( NAV2_Lat - FGBFI::getLatitude () );
+       x = 60.0 * ( NAV2_Lon - FGBFI::getLongitude() )
+                       * cos ( FGBFI::getLatitude () / RAD_TO_DEG );
+       r = atan2 ( x, y ) * RAD_TO_DEG - NAV2_Rad - VARY_E;
+       if (r> 180.0) r-=360.0; else
+       if (r<-180.0) r+=360.0;
+       if ( fabs(r) > 90.0 )
+               r = ( r<0.0 ? -r-180.0 : -r+180.0 );
+       return r;
+}
+
+
+double FGSteam::get_HackOBS1_deg ()
+{      return  NAV1_Rad; 
+}
+
+
+double FGSteam::get_HackOBS2_deg ()
+{      return  NAV2_Rad; 
+}
+
+
+double FGSteam::get_HackADF_deg ()
+{      double r;
+       double x,y;
+       y = 60.0 * ( ADF_Lat - FGBFI::getLatitude () );
+       x = 60.0 * ( ADF_Lon - FGBFI::getLongitude() )
+                      * cos ( FGBFI::getLatitude () / RAD_TO_DEG );
+       r = atan2 ( x, y ) * RAD_TO_DEG - FGBFI::getHeading ();
+       return r;
+}
+
 
 // end of steam.cxx
index 2254dc7fc4f2222c6b25377c2eb7c788dd664413..a0bf479d88297657a81771451c5bb7471d0035c8 100644 (file)
@@ -70,6 +70,15 @@ public:
                                // Engine Gauges
   static double get_VACUUM_inhg ();
 
+                               // Hacks ... temporary stuff
+  static double get_HackVOR1_deg ();
+  static double get_HackOBS1_deg ();
+  static double get_HackGS_deg ();
+  static double get_HackVOR2_deg ();
+  static double get_HackOBS2_deg ();
+  static double get_HackADF_deg ();
+
+
 private:
        static double   the_ALT_ft;
        static double   the_STATIC_inhg, the_VACUUM_inhg;