示例#1
0
        /// <summary>
        /// Prints a report showing the internal state of the component.
        /// </summary>
        private void PrintDebugReport()
        {
            ScreenDebugger.PrintFormat("  {0}", currentTime.ToLocalTime().FixTime());
            if (location == null)
            {
                ScreenDebugger.Print("  No location service");
            }
            else if (!location.HasCoord)
            {
                ScreenDebugger.Print("  No location yet");
            }

            if (compass == null)
            {
                ScreenDebugger.Print("  No compass service");
            }
            else if (!compass.HasHeading)
            {
                ScreenDebugger.Print("  No compass heading yet");
            }

            if (CanCalculateCurrentLocalPosition)
            {
                ScreenDebugger.PrintFormat("  Azimuth {0}, Altitude {1}",
                                           orientation.AzimuthDegrees.Label(UnitOfMeasure.Degrees, 3),
                                           orientation.AltitudeDegrees.Label(UnitOfMeasure.Degrees, 3));
            }
        }
示例#2
0
        /// <summary>
        /// Prints a report to the screen that reveals the internal state of the component.
        /// </summary>
        private void PrintDebugReport()
        {
            if (torques == null)
            {
                ScreenDebugger.Print("Torque sampling hasn't started yet.");
            }
            else
            {
                ScreenDebugger.PrintFormat("Torqued {3} = |{0}| >{1}< {2}",
                                           torques.Mean.Label(UnitOfMeasure.Degrees, 3),
                                           torques.StandardDeviation.Label(UnitOfMeasure.Degrees),
                                           TorqueK,
                                           HasTorqued);
            }

            if (accelerations == null)
            {
                ScreenDebugger.Print("Acceleration sampling hasn't started yet.");
            }
            else
            {
                ScreenDebugger.PrintFormat("Acceled {3} = |{0}| >{1}< {2}",
                                           accelerations.Mean.Label(UnitOfMeasure.Degrees, 3),
                                           accelerations.StandardDeviation.Label(UnitOfMeasure.Degrees),
                                           ForceK,
                                           HasAccelerated);
                ScreenDebugger.PrintFormat("F{0} L{1} m{2} M{3} _|_{4} |{5}| >{6}< {7}", accelerations.Mean, accelerations.StandardDeviation, ForceK);
            }

            ScreenDebugger.PrintFormat("Acceled {0} || Torqued {1} = Shaken {2}", HasAccelerated, HasTorqued, HasShaken);
        }
示例#3
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>
        protected virtual void PrintDebugReport()
        {
            if (UseFakeIntensity)
            {
                ScreenDebugger.Print("Using fake light estimate");
            }

            ScreenDebugger.PrintFormat("  Raw: int {0:0.000} col {1}", IntensityEstimate, ColorEstimate);
        }
示例#4
0
        /// <summary>
        /// Prints the internal state of the GPS tracking.
        /// </summary>
        private void PrintDebugReport()
        {
            if (UseFakeCoord)
            {
                ScreenDebugger.Print("  Using fake location");
            }
            else if (!UnityInput.location.isEnabledByUser)
            {
                ScreenDebugger.Print("  User has disabled location services");
            }
            else if (UnityInput.location.status == LocationServiceStatus.Stopped)
            {
                ScreenDebugger.Print("  Starting location services");
            }
            else if (UnityInput.location.status == LocationServiceStatus.Initializing)
            {
                ScreenDebugger.Print("  Initializing location services");
            }
            else if (UnityInput.location.status == LocationServiceStatus.Failed)
            {
                ScreenDebugger.Print("  Unable to determine device location");
            }

            if (!HasCoord)
            {
                ScreenDebugger.Print("  Waiting for location lock");
            }
            else
            {
                if (!UseFakeCoord)
                {
                    var ts          = lastLocation.timestamp.UnixTimestampToDateTime();
                    var sinceUpdate = EditableDateTime.Now - ts;
                    ScreenDebugger.PrintFormat("  At [{0:mm\\:ss\\.fff}]: accuracy [+-{1}], altitude {2}",
                                               sinceUpdate,
                                               lastLocation.horizontalAccuracy.Label(UnitOfMeasure.Meters, 3),
                                               lastLocation.altitude.Label(UnitOfMeasure.Meters, 3));
                }

                ScreenDebugger.PrintFormat("  Coordinate: {0}", HasCoord ? Coord.ToDMS(5) : "N/A");
            }
        }
示例#5
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>
        /// <param name="ambientIntensity">    Ambient intensity.</param>
        /// <param name="ambientColor">        Ambient color.</param>
        /// <param name="directionalIntensity">Directional intensity.</param>
        /// <param name="directionalColor">    Directional color.</param>
        /// <param name="shadowStrength">      Shadow strength.</param>
        private void PrintDebugReport(float ambientIntensity, Color ambientColor, float directionalIntensity, Color directionalColor, float shadowStrength)
        {
            if (measurement == null)
            {
                ScreenDebugger.Print("  no light measurement");
            }

            ScreenDebugger.Print($"  Sun Position: <{SunRotation.x.Label(UnitOfMeasure.Degrees, 4)}, {SunRotation.y.Label(UnitOfMeasure.Degrees, 4)}, {SunRotation.z.Label(UnitOfMeasure.Degrees, 4)}>");
            ScreenDebugger.PrintFormat("  Ambient: int {0:0.000} col {1}", ambientIntensity, ambientColor);
            ScreenDebugger.PrintFormat("  Directional: int {0:0.000} col {1}", directionalIntensity, directionalColor);
            ScreenDebugger.PrintFormat("  Shadow strength: {0:0.000}", shadowStrength);

            if (sun == null)
            {
                ScreenDebugger.Print("  no directional light");
            }
            else
            {
                ScreenDebugger.Print($"  sun orientation: {sun.transform.eulerAngles}");
            }
        }