Example #1
0
        /// <summary>
        /// If <see cref="DebugReport"/> is set to true, prints a report that displays the status of
        /// the component and the values it is using for the light estimation.
        /// </summary>
        private void PrintDebugReport()
        {
            if (FakeWeather)
            {
                ScreenDebugger.Print("  Using fake weather report");
            }
            else if (weatherService == null)
            {
                ScreenDebugger.Print("  No weather service");
            }

            if (currentWeather == null)
            {
                ScreenDebugger.Print("  No weather report");
            }
            else if (currentWeather.ErrorMessage != null)
            {
                ScreenDebugger.Print($"  ERROR: {currentWeather.ErrorMessage}");
            }
            else
            {
                ScreenDebugger.Print($"  City: {currentWeather.City}, {currentWeather.Country}:");
                ScreenDebugger.Print($"  Report time: {currentWeather.ReportTime.FixTime()}");
                ScreenDebugger.Print($"  Current time: {EditableDateTime.Now.FixTime()}");
                ScreenDebugger.Print($"  Time since report: {EditableDateTime.Now - currentWeather.ReportTime}");
                ScreenDebugger.Print($"  Conditions: {currentWeather.Conditions}");
                ScreenDebugger.Print($"  Cloud coverage: {currentWeather.CloudCover.Label(UnitOfMeasure.Proportion)}");
                ScreenDebugger.Print($"  Temperature: {currentWeather.Temperature.Label(UnitOfMeasure.Celsius)}");
                ScreenDebugger.Print($"  Humidity: {currentWeather.Humidity.Label(UnitOfMeasure.Proportion)}");
                ScreenDebugger.Print($"  Pressure: {currentWeather.AtmosphericPressure.Label(UnitOfMeasure.Hectopascals)}");
                ScreenDebugger.Print($"  Visibility: {currentWeather.AtmosphericVisibility.Label(UnitOfMeasure.Meters)}");
                ScreenDebugger.Print($"  Wind Direction {WindDirection.Label(UnitOfMeasure.Degrees)}");
                ScreenDebugger.Print($"  Wind Speed {WindSpeed.Label(UnitOfMeasure.MetersPerSecond)}");
                ScreenDebugger.Print($"  Sunrise: {currentWeather.SunriseTime?.FixTime()}");
                ScreenDebugger.Print($"  Sunset: {currentWeather.SunsetTime?.FixTime()}");
            }
        }