// 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;
/**
- * Construct a NAV1 gauge (dummy for now).
+ * Construct a NAV1 gauge (hardwired).
*/
static FGPanelInstrument *
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)
// 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)
// 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;
}
// 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; }
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
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
}
}
+\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
// 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;