Example #1
0
 public VoltageLevelGroup(int internalID, VoltageLevel baseKv, Node observedNode)
 {
     m_internalID = internalID;
     m_nodes      = new List <Node>();
     m_nodes.Add(observedNode);
     m_baseKv = baseKv.DeepCopy();
 }
        /// <summary>
        /// Determines equality between to <see cref="SynchrophasorAnalytics.Modeling.VoltageLevel"/> 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.
            VoltageLevel voltageLevel = target as VoltageLevel;

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

            // Return true if the fields match:
            if (this.m_internalID != voltageLevel.InternalID)
            {
                return(false);
            }
            else if (this.m_voltageLevel != voltageLevel.Value)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Example #3
0
 public VoltageLevelGroup(int internalID, VoltageLevel baseKv, List <Node> observedNodes)
 {
     m_internalID            = internalID;
     m_nodes                 = observedNodes;
     m_baseKv                = baseKv.DeepCopy();
     m_observedBuses         = new List <ObservedBus>();
     m_directlyObservedNodes = new List <Node>();
 }
Example #4
0
 public void AppendTransmissionLinesAtVoltageLevel(NetworkModel model, VoltageLevel baseKv)
 {
     foreach (TransmissionLine transmissionLine in model.TransmissionLines)
     {
         if (transmissionLine.FromNode.BaseKV.InternalID == baseKv.InternalID)
         {
             if (Substations.Contains(transmissionLine.FromSubstation))
             {
                 if (!TransmissionLines.Contains(transmissionLine))
                 {
                     TransmissionLines.Add(transmissionLine);
                 }
             }
         }
     }
 }
        /// <summary>
        /// Performs a deep copy of the target <see cref="SynchrophasorAnalytics.Modeling.VoltageLevel"/> object.
        /// </summary>
        /// <returns>A deep copy of the target <see cref="SynchrophasorAnalytics.Modeling.VoltageLevel"/> object.</returns>
        public VoltageLevel DeepCopy()
        {
            VoltageLevel copy = (VoltageLevel)this.MemberwiseClone();

            return(copy);
        }
Example #6
0
 public VoltageLevelGroup(VoltageLevel baseKv)
     : this(DEFAULT_INTERNAL_ID, baseKv, new List <Node>())
 {
 }
Example #7
0
 public static List <Substation> FindConnectedSubstationsAtVoltageLevel(Substation root, List <Substation> connectedSubstations, NetworkModel model, VoltageLevel baseKv)
 {
     foreach (TransmissionLine transmissionLine in model.TransmissionLines)
     {
         if (transmissionLine.FromNode.BaseKV.InternalID == baseKv.InternalID)
         {
             if (transmissionLine.FromSubstation == root)
             {
                 if (!connectedSubstations.Contains(transmissionLine.ToSubstation))
                 {
                     connectedSubstations.Add(transmissionLine.ToSubstation);
                     List <Substation> subConnectedSubstations = ObservableIsland.FindConnectedSubstationsAtVoltageLevel(transmissionLine.ToSubstation, connectedSubstations, model, baseKv);
                 }
             }
             else if (transmissionLine.ToSubstation == root)
             {
                 if (!connectedSubstations.Contains(transmissionLine.FromSubstation))
                 {
                     connectedSubstations.Add(transmissionLine.FromSubstation);
                     List <Substation> subConnectedSubstations = ObservableIsland.FindConnectedSubstationsAtVoltageLevel(transmissionLine.FromSubstation, connectedSubstations, model, baseKv);
                 }
             }
         }
     }
     return(connectedSubstations);
 }