예제 #1
0
        public void Adapt(IISIS isis, FlightData flightData)
        {
            var altbits = (AltBits)flightData.altBits;
            var hsibits = (HsiBits)flightData.hsiBits;

            isis.InstrumentState.AirspeedKnots            = flightData.kias;
            isis.InstrumentState.IndicatedAltitudeFeetMSL = -flightData.aauz;
            isis.Options.PressureAltitudeUnits            = ((altbits & AltBits.CalType) == AltBits.CalType)
                                ? PressureUnits.InchesOfMercury
                                : PressureUnits.Millibars;

            isis.InstrumentState.BarometricPressure            = flightData.AltCalReading;
            isis.InstrumentState.RadarAltitudeAGL              = ((flightData.ExtensionData as FlightDataExtensionData ?? new FlightDataExtensionData {
                AltitudeAGL = float.NaN
            }).AltitudeAGL);
            isis.InstrumentState.MachNumber                    = flightData.mach;
            isis.InstrumentState.MagneticHeadingDegrees        = (360 + (flightData.yaw / Common.Math.Constants.RADIANS_PER_DEGREE)) % 360;
            isis.InstrumentState.NeverExceedSpeedKnots         = 850;
            isis.InstrumentState.PitchDegrees                  = ((flightData.pitch / Common.Math.Constants.RADIANS_PER_DEGREE));
            isis.InstrumentState.RollDegrees                   = ((flightData.roll / Common.Math.Constants.RADIANS_PER_DEGREE));
            isis.InstrumentState.VerticalVelocityFeetPerMinute = -flightData.zDot * 60.0f;
            isis.InstrumentState.OffFlag        = ((hsibits & HsiBits.ADI_OFF) == HsiBits.ADI_OFF);
            isis.InstrumentState.AuxFlag        = ((hsibits & HsiBits.ADI_AUX) == HsiBits.ADI_AUX);
            isis.InstrumentState.GlideslopeFlag = ((hsibits & HsiBits.ADI_GS) == HsiBits.ADI_GS);
            isis.InstrumentState.LocalizerFlag  = ((hsibits & HsiBits.ADI_LOC) == HsiBits.ADI_LOC);
        }
예제 #2
0
 private static void SetISISToOffState(IISIS isis)
 {
     isis.InstrumentState.PitchDegrees = 0;
     isis.InstrumentState.RollDegrees  = 0;
     isis.InstrumentState.GlideslopeDeviationDegrees = 0;
     isis.InstrumentState.LocalizerDeviationDegrees  = 0;
     isis.InstrumentState.ShowCommandBars            = false;
 }
예제 #3
0
        private static void UpdateNavigationMode(IHorizontalSituationIndicator hsi, IEHSI ehsi, IADI adi, IISIS isis, FlightData flightData)
        {
            /*
             *  This value is called navMode and is unsigned char type with 4 possible values: ILS_TACAN = 0, and TACAN = 1,
             *  NAV = 2, ILS_NAV = 3
             */

            byte bmsNavMode = flightData.navMode;

            switch (bmsNavMode)
            {
            case 0:     //NavModes.PlsTcn:
                hsi.InstrumentState.ShowToFromFlag  = false;
                ehsi.InstrumentState.ShowToFromFlag = false;
                ehsi.InstrumentState.InstrumentMode = InstrumentModes.PlsTacan;
                break;

            case 1:     //NavModes.Tcn:
                hsi.InstrumentState.ShowToFromFlag   = true;
                ehsi.InstrumentState.ShowToFromFlag  = true;
                ehsi.InstrumentState.InstrumentMode  = InstrumentModes.Tacan;
                adi.InstrumentState.ShowCommandBars  = false;
                isis.InstrumentState.ShowCommandBars = false;
                break;

            case 2:     //NavModes.Nav:
                hsi.InstrumentState.ShowToFromFlag   = false;
                ehsi.InstrumentState.ShowToFromFlag  = false;
                ehsi.InstrumentState.InstrumentMode  = InstrumentModes.Nav;
                adi.InstrumentState.ShowCommandBars  = false;
                isis.InstrumentState.ShowCommandBars = false;
                break;

            case 3:     //NavModes.PlsNav:
                hsi.InstrumentState.ShowToFromFlag  = false;
                ehsi.InstrumentState.ShowToFromFlag = false;
                ehsi.InstrumentState.InstrumentMode = InstrumentModes.PlsNav;
                break;
            }
        }
예제 #4
0
 private static void SetISISPitchAndRoll(IISIS isis, FlightData flightData)
 {
     isis.InstrumentState.PitchDegrees = ((flightData.pitch / Common.Math.Constants.RADIANS_PER_DEGREE));
     isis.InstrumentState.RollDegrees  = ((flightData.roll / Common.Math.Constants.RADIANS_PER_DEGREE));
 }