Esempio n. 1
0
        private static void UpdateDisplay(FlightSimMonitor.DataReceivedEventArgs args)
        {
            //int heading = Convert.ToInt32(args.Heading * (180 / Math.PI));
            // Column 1
            UpdateFieldValue(12, 1, 15, $"{args.Latitude.ToString("0.000")},{args.Longitude.ToString("0.000")}");   // Position
            UpdateFieldValue(12, 2, 7, $"{args.Altitude.ToString("0")}ft");                                         // Altitude
            UpdateFieldValue(12, 3, 7, $"{args.Pitch.ToString("0.00")}°");
            UpdateFieldValue(12, 4, 7, $"{args.Bank.ToString("0.00")}°");
            UpdateFieldValue(12, 5, 4, $"{args.HeadingMagnetic.ToString("0")}°");                                   // Heading
            UpdateFieldValue(12, 6, 7, $"{args.FlapsHandleIndex.ToString("0")} notch of {args.FlapsNumHandlePositions.ToString("0")}");
            UpdateFieldValue(12, 7, 6, $"{args.Airspeed_Indicated.ToString("0")}kts");                              // Indicated Speed
            UpdateFieldValue(12, 8, 6, $"{args.Airspeed_True.ToString("0")}kts");                                   // True Airspeed
            UpdateFieldValue(12, 9, 6, $"{args.GPSGroundSpeed.ToString("0")}kts");                                  // Groundspeed
            UpdateFieldValue(12, 10, 8, $"{(args.VerticalSpeed * 60).ToString("0")}fpm");                           // Vertical Speed

            // Column 2
            string engine1State = (args.Engine1Combusting) ? "Running" : args.Engine1Starter ? "Armed" : "Off";
            string engine2State = args.NumberOfEngines < 2 ? "N/A" : args.Engine2Combusting ? "Running" : args.Engine2Starter ? "Armed" : "Off";
            string engine3State = args.NumberOfEngines < 3 ? "N/A" : args.Engine3Combusting ? "Running" : args.Engine3Starter ? "Armed" : "Off";
            string engine4State = args.NumberOfEngines < 4 ? "N/A" : args.Engine4Combusting ? "Running" : args.Engine4Starter ? "Armed" : "Off";

            UpdateFieldValue(58, 1, 16, engine1State);
            UpdateFieldValue(58, 2, 16, engine2State);
            UpdateFieldValue(58, 3, 16, engine3State);
            UpdateFieldValue(58, 4, 16, engine4State);
            UpdateFieldValue(58, 5, 16, $"{OnOffState(args.Lights.Nav)}");
            UpdateFieldValue(58, 6, 16, $"{OnOffState(args.Lights.Beacon)}");
            UpdateFieldValue(58, 7, 16, $"{OnOffState(args.Lights.Landing)}");
            UpdateFieldValue(58, 8, 16, $"{OnOffState(args.Lights.Taxi)}");
            UpdateFieldValue(58, 9, 16, $"{OnOffState(args.Lights.Strobe)}");
            UpdateFieldValue(58, 10, 16, $"{OnOffState(args.Lights.Panel)}");
            UpdateFieldValue(58, 11, 16, $"{OnOffState(args.Lights.Recognition)}");
            UpdateFieldValue(58, 12, 16, $"{OnOffState(args.Lights.Wing)}");
            UpdateFieldValue(58, 13, 16, $"{OnOffState(args.Lights.Logo)}");
            UpdateFieldValue(58, 14, 16, $"{OnOffState(args.Lights.Cabin)}");

            // Column 3
            UpdateFieldValue(97, 1, 8, $"{args.FlightState}");
            UpdateFieldValue(97, 2, 8, $"{args.ParkingBrakeState}");

            // Update Last Updated
            UpdateFieldValue(_lastUpdatePosition, 30, 19, $"{args.Timestamp.ToString("yyyy-MM-dd HH:mm:ss")}");
        }
Esempio n. 2
0
 private static void _fsMon_DataReceived(object sender, FlightSimMonitor.DataReceivedEventArgs e)
 {
     UpdateDisplay(e);
 }