Exemple #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((ReferencePoint.GetHashCode() * 397) ^ AngleInDegrees.GetHashCode());
     }
 }
Exemple #2
0
        /// <summary>
        /// A verbose descriptive string representation of the <see cref="LinearStateEstimator.Measurements.PhasorEstimate"/> class.
        /// </summary>
        /// <returns>A verbose descriptive string representation of the <see cref="LinearStateEstimator.Measurements.PhasorEstimate"/> class.</returns>
        public new string ToVerboseString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("----- Phasor Estimate ----------------------------------------------------------");
            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("            Type: " + Type.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("         Base KV: " + BaseKV.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("     MagnitudKey: " + MagnitudeKey + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        AngleKey: " + AngleKey + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("       Magnitude: " + Magnitude.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("           Angle: " + AngleInDegrees.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        Reported: " + MeasurementWasReported.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendLine();
            return(stringBuilder.ToString());
        }
Exemple #3
0
        /// <summary>
        /// A verbose descriptive string representation of the <see cref="PhasorMeasurement"/> class.
        /// </summary>
        /// <returns>A verbose descriptive string representation of the <see cref="PhasorMeasurement"/> class.</returns>
        public new string ToVerboseString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("----- Phasor Measurement -------------------------------------------------------");
            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("            Type: " + Type.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("         Base KV: " + BaseKV.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("     MagnitudKey: " + MagnitudeKey + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        AngleKey: " + AngleKey + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("       Magnitude: " + Magnitude.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("           Angle: " + AngleInDegrees.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        Reported: " + MeasurementWasReported.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        Variance: " + m_measurementVariance.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("             RCF: " + m_rcf.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("            PACF: " + m_pacf.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat(" ShouldCalibrate: " + m_measurementShouldBeCalibrated.ToString() + "{0}", Environment.NewLine);
            //stringBuilder.AppendFormat("CalibrationSttng: " + m_calibrationSetting.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendLine();
            return(stringBuilder.ToString());
        }
Exemple #4
0
        public bool IsPointOnRay(Point2D point)
        {
            if (!LineEquation.ContainsPoint(point))
            {
                return(false);
            }

            var normalizedAngle = AngleInDegrees.NormalizeAngleInDegrees();

            if (normalizedAngle.IsGreaterThanOrApproximatelyEqualTo(0) && normalizedAngle < 90)
            {
                return(point.X.IsGreaterThanOrApproximatelyEqualTo(ReferencePoint.X));
            }
            if (normalizedAngle.IsGreaterThanOrApproximatelyEqualTo(90) && normalizedAngle < 180)
            {
                return(point.Y.IsGreaterThanOrApproximatelyEqualTo(ReferencePoint.Y));
            }
            if (normalizedAngle.IsGreaterThanOrApproximatelyEqualTo(180) && normalizedAngle < 270)
            {
                return(point.X.IsLessThanOrApproximatelyEqualTo(ReferencePoint.X));
            }

            return(point.Y.IsLessThanOrApproximatelyEqualTo(ReferencePoint.Y));
        }
Exemple #5
0
 public override string ToString() => $"{ReferencePoint} {AngleInDegrees.ToInvariantString()}°";
Exemple #6
0
 public bool Equals(Ray2D other) => ReferencePoint.Equals(other.ReferencePoint) && AngleInDegrees.Equals(other.AngleInDegrees);