Пример #1
0
        /// <summary>
        /// Performs a deep copy of the target <see cref="LinearStateEstimator.Modeling.Substation"/> object.
        /// </summary>
        /// <returns>A deep copy of the target <see cref="LinearStateEstimator.Modeling.Substation"/> object.</returns>
        public Substation DeepCopy()
        {
            // Incomplete
            Substation copy = (Substation)this.MemberwiseClone();

            List <Node>           copyNodes           = new List <Node>();
            List <Transformer>    copyTransformers    = new List <Transformer>();
            List <CircuitBreaker> copyCircuitBreakers = new List <CircuitBreaker>();

            foreach (Node node in m_childrenNodes)
            {
                //copyNodes.Add(node.Copy());
            }

            foreach (Transformer transformer in m_childrenTransformers)
            {
                //copyTransformers.Add(transformer.Copy());
            }

            foreach (CircuitBreaker circuitBreaker in m_childrenCircuitBreakers)
            {
                //copyCircuitBreakers.Add(circuitBreaker.Copy());
            }

            copy.Nodes           = copyNodes;
            copy.Transformers    = copyTransformers;
            copy.CircuitBreakers = copyCircuitBreakers;

            return(copy); // Incomplete
        }
Пример #2
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);
 }
 /// <summary>
 /// The designated initializer for the <see cref="SynchrophasorAnalytics.Modeling.Node"/> class which requires the <see cref="SynchrophasorAnalytics.Modeling.VoltageLevel.InternalID"/> of the <see cref="SynchrophasorAnalytics.Modeling.VoltageLevel"/> and the required properties defined by the <see cref="SynchrophasorAnalytics.Modeling.INetworkDescribable"/> interface as well as references to its parent <see cref="SynchrophasorAnalytics.Modeling.Substation"/> and/or <see cref="SynchrophasorAnalytics.Modeling.TransmissionLine"/>.
 /// </summary>
 /// <param name="internalID">An integer identifier for each <see cref="SynchrophasorAnalytics.Modeling.Node"/> which is intended to be unique among other objects of the same type.</param>
 /// <param name="number">A descriptive integer for the instance of the <see cref="SynchrophasorAnalytics.Modeling.Node"/>. There are no restrictions on uniqueness.</param>
 /// <param name="acronym">A string acronym for the instance of the <see cref="SynchrophasorAnalytics.Modeling.Node"/>.</param>
 /// <param name="name">The string name of the instance of the <see cref="SynchrophasorAnalytics.Modeling.Node"/>.</param>
 /// <param name="description">A string description of the instance of the <see cref="SynchrophasorAnalytics.Modeling.Node"/>.</param>
 /// <param name="voltageLevelID">The <see cref="SynchrophasorAnalytics.Modeling.VoltageLevel.InternalID"/> of the <see cref="SynchrophasorAnalytics.Modeling.VoltageLevel"/> of the <see cref="SynchrophasorAnalytics.Modeling.Node"/>.</param>
 /// <param name="parentSubstation">The parent <see cref="SynchrophasorAnalytics.Modeling.Substation"/> of the <see cref="SynchrophasorAnalytics.Modeling.Node"/>.</param>
 /// <param name="parentTransmissionLine">The parent <see cref="SynchrophasorAnalytics.Modeling.TransmissionLine"/> of the <see cref="SynchrophasorAnalytics.Modeling.Node"/>.</param>
 public Node(int internalID, int number, string acronym, string name, string description, int voltageLevelID, Substation parentSubstation, TransmissionLine parentTransmissionLine)
 {
     m_internalID             = internalID;
     m_number                 = number;
     m_acronym                = acronym;
     m_name                   = name;
     m_description            = description;
     m_voltageLevelID         = voltageLevelID;
     m_parentSubstation       = parentSubstation;
     m_parentTransmissionLine = parentTransmissionLine;
 }
Пример #4
0
        /// <summary>
        /// Determines equality between to <see cref="LinearStateEstimator.Modeling.Substation"/> objects. Children objects are not included in the equality check.
        /// </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.
            Substation substation = target as Substation;

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

            // Return true if the fields match:
            if (this.m_internalID != substation.InternalID)
            {
                return(false);
            }
            else if (this.m_number != substation.Number)
            {
                return(false);
            }
            else if (!this.m_acronym.Equals(substation.Acronym))
            {
                return(false);
            }
            else if (this.m_name != substation.Name)
            {
                return(false);
            }
            else if (this.m_description != substation.Description)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Пример #5
0
 public static List <Substation> FindConnectedSubstations(Substation root, List <Substation> connectedSubstations, NetworkModel model)
 {
     foreach (TransmissionLine transmissionLine in model.TransmissionLines)
     {
         if (transmissionLine.FromSubstation == root)
         {
             if (!connectedSubstations.Contains(transmissionLine.ToSubstation))
             {
                 connectedSubstations.Add(transmissionLine.ToSubstation);
                 List <Substation> subConnectedSubstations = ObservableIsland.FindConnectedSubstations(transmissionLine.ToSubstation, connectedSubstations, model);
             }
         }
         else if (transmissionLine.ToSubstation == root)
         {
             if (!connectedSubstations.Contains(transmissionLine.FromSubstation))
             {
                 connectedSubstations.Add(transmissionLine.FromSubstation);
                 List <Substation> subConnectedSubstations = ObservableIsland.FindConnectedSubstations(transmissionLine.FromSubstation, connectedSubstations, model);
             }
         }
     }
     return(connectedSubstations);
 }
Пример #6
0
 public ObservableIsland(Substation root)
     : this()
 {
     m_substations.Add(root);
 }