Example #1
0
 /// <summary>
 /// The designated constructor for the class.
 /// </summary>
 /// <param name="measurement">A measured phasor - <see cref="PhasorMeasurement"/>.</param>
 /// <param name="estimate">An estimated phasor - <see cref="PhasorEstimate"/>.</param>
 public Phasor(PhasorMeasurement measurement, PhasorEstimate estimate)
 {
     m_phasorMeasurement          = measurement;
     m_phasorEstimate             = estimate;
     m_magnitudeResidualOutputKey = "Undefined";
     m_angleResidualOutputKey     = "Undefined";
 }
Example #2
0
        /// <summary>
        /// Performs a deep copy of the <see cref="LinearStateEstimator.Measurements.PhasorMeasurement"/>.
        /// </summary>
        /// <returns>A deep copy of the target <see cref="LinearStateEstimator.Measurements.PhasorMeasurement"/>.</returns>
        public new PhasorMeasurement DeepCopy()
        {
            PhasorMeasurement copy = (PhasorMeasurement)this.MemberwiseClone();

            copy.BaseKV = BaseKV.DeepCopy();
            copy.Type   = Type;
            return(copy);
        }
Example #3
0
        /// <summary>
        /// Determines equality between to <see cref="LinearStateEstimator.Measurements.PhasorMeasurement"/> objects
        /// </summary>
        /// <param name="target">The target object for equality testing.</param>
        /// <returns>A bool representing the result of the equality check.</returns>
        public override bool Equals(object target)
        {
            // If parameter is null return false.
            if (target == null)
            {
                return(false);
            }

            // If parameter cannot be cast to PhasorMeasurement return false.
            PhasorMeasurement phasorMeasurement = target as PhasorMeasurement;

            if ((object)phasorMeasurement == null)
            {
                return(false);
            }

            // Return true if the fields match:
            if (!base.Equals(target))
            {
                return(false);
            }
            else if (!this.BaseKV.Equals(phasorMeasurement.BaseKV))
            {
                return(false);
            }
            else if (this.m_measurementVariance != phasorMeasurement.MeasurementVariance)
            {
                return(false);
            }
            else if (this.m_measurementShouldBeCalibrated != phasorMeasurement.MeasurementShouldBeCalibrated)
            {
                return(false);
            }
            else if (this.m_rcf != phasorMeasurement.RCF)
            {
                return(false);
            }
            else if (this.m_pacf != phasorMeasurement.PACF)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Example #4
0
 /// <summary>
 /// A constructor for the <see cref="Phasor"/> class which only specifies the <see cref="PhasorMeasurement"/>.
 /// </summary>
 /// <param name="measurement"></param>
 public Phasor(PhasorMeasurement measurement)
     : this(measurement, new PhasorEstimate())
 {
 }