Example #1
0
        /// <summary>
        /// Determines equality between two <see cref="VoltagePhasorGroup"/> 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 PhasorBase return false.
            VoltagePhasorGroup voltagePhasorGroup = target as VoltagePhasorGroup;

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

            // Return true if the fields match:
            if (!base.Equals(voltagePhasorGroup))
            {
                return(false);
            }
            else if (this.m_measuredNodeID != voltagePhasorGroup.MeasuredNodeID)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Example #2
0
        /// <summary>
        /// Performs a deep copy of the <see cref="VoltagePhasorGroup"/> object.
        /// </summary>
        /// <returns>A deep copy of the target <see cref="VoltagePhasorGroup"/>.</returns>
        public VoltagePhasorGroup Copy()
        {
            VoltagePhasorGroup copy = (VoltagePhasorGroup)this.MemberwiseClone();

            copy.Status           = this.Status.Copy();
            copy.PositiveSequence = PositiveSequence.Copy();
            copy.PhaseA           = PhaseA.Copy();
            copy.PhaseB           = PhaseB.Copy();
            copy.PhaseC           = PhaseC.Copy();
            return(copy);
        }
Example #3
0
        /// <summary>
        /// The designated constructor for the <see cref="LinearStateEstimator.Measurements.ComplexPowerGroup"/> class.
        /// </summary>
        /// <param name="voltage">The <see cref="LinearStateEstimator.Measurements.VoltagePhasorGroup"/> to use to calculate the complex power.</param>
        /// <param name="current">The <see cref="LinearStateEstimator.Measurements.CurrentFlowPhasorGroup"/> to use to calculate the complex power.</param>
        public ComplexPowerGroup(VoltagePhasorGroup voltage, CurrentFlowPhasorGroup current)
        {
            m_voltage = voltage;
            m_current = current;
            PositiveSequence.Measurement.BaseKV = m_voltage.PositiveSequence.Measurement.BaseKV;
            PositiveSequence.Estimate.BaseKV    = m_voltage.PositiveSequence.Estimate.BaseKV;

            PhaseA.Measurement.BaseKV = m_voltage.PhaseA.Measurement.BaseKV;
            PhaseA.Estimate.BaseKV    = m_voltage.PhaseA.Estimate.BaseKV;

            PhaseB.Measurement.BaseKV = m_voltage.PhaseB.Measurement.BaseKV;
            PhaseB.Estimate.BaseKV    = m_voltage.PhaseB.Estimate.BaseKV;

            PhaseC.Measurement.BaseKV = m_voltage.PhaseC.Measurement.BaseKV;
            PhaseC.Estimate.BaseKV    = m_voltage.PhaseC.Estimate.BaseKV;

            InternalID  = m_voltage.InternalID;
            Acronym     = "POWER";
            Description = m_voltage.Description + " | " + m_current.Description;
            Name        = m_voltage.Name + " | " + m_current.Name;
            Number      = m_voltage.Number;
        }