Ejemplo n.º 1
0
        private PerLengthImpedance createPerLengthImpedanceObject(CableConfiguration configuration, string acLineSegment_mrid)
        {
            PerLengthSequenceImpedance pli = new PerLengthSequenceImpedance();

            if (!perLengthImpedanceContainer.ContainsKey(configuration.Name))
            {
                if (configuration.Name != "xfm_1")
                {
                    string pli_mrid = acLineSegment_mrid + "_PLI";

                    pli.ID   = pli_mrid;
                    pli.MRID = pli_mrid;
                    pli.Name = configuration.Name;
                    pli.Bch  = (float)configuration.Susceptance;
                    pli.B0ch = 0;
                    pli.R    = (float)configuration.Primar_value.Real_part;
                    pli.R0   = 0;
                    pli.X    = (float)configuration.Primar_value.Imaginary_part;
                    pli.X0   = 0;

                    perLengthImpedanceContainer.Add(configuration.Name, pli);

                    addComponentToGlobalDictionary(pli, pli.GetType());
                }
            }
            else
            {
                pli = (PerLengthSequenceImpedance)perLengthImpedanceContainer[configuration.Name];
                return(pli);
            }



            return(pli);
        }
Ejemplo n.º 2
0
        private void addComponentToGlobalDictionary(IdentifiedObject component, Type type)
        {
            if (!globalComponentDictionary.ContainsKey(type))
            {
                globalComponentDictionary.Add(type, new Dictionary <string, IdentifiedObject>());
            }


            if (type.Equals(typeof(ACLineSegment)))
            {
                ACLineSegment acl = (ACLineSegment)component;

                globalComponentDictionary[type].Add(acl.MRID, acl);
            }
            else if (type.Equals(typeof(Terminal)))
            {
                Terminal tp = (Terminal)component;

                globalComponentDictionary[tp.GetType()].Add(tp.MRID, tp);
            }
            else if (type.Equals(typeof(Circuit)))
            {
                Circuit cr = (Circuit)component;

                globalComponentDictionary[cr.GetType()].Add(cr.MRID, cr);
            }
            else if (type.Equals(typeof(WireInfo)))
            {
                WireInfo wi = (WireInfo)component;
                globalComponentDictionary[wi.GetType()].Add(wi.MRID, wi);
            }
            else if (type.Equals(typeof(PerLengthSequenceImpedance)))
            {
                PerLengthSequenceImpedance pli = (PerLengthSequenceImpedance)component;
                globalComponentDictionary[pli.GetType()].Add(pli.MRID, pli);
            }
            else if (type.Equals(typeof(ConnectivityNode)))
            {
                ConnectivityNode cn = (ConnectivityNode)component;
                globalComponentDictionary[cn.GetType()].Add(cn.MRID, cn);
            }
            else if (type.Equals(typeof(PowerTransformer)))
            {
                PowerTransformer pt = (PowerTransformer)component;
                globalComponentDictionary[pt.GetType()].Add(pt.MRID, pt);
            }
            else if (type.Equals(typeof(PowerTransformerEnd)))
            {
                PowerTransformerEnd pt = (PowerTransformerEnd)component;
                globalComponentDictionary[pt.GetType()].Add(pt.MRID, pt);
            }
            else if (type.Equals(typeof(UsagePoint)))
            {
                UsagePoint us = (UsagePoint)component;
                globalComponentDictionary[us.GetType()].Add(us.MRID, us);
            }
            else if (type.Equals(typeof(PSRType)))
            {
                PSRType psr = (PSRType)component;
                globalComponentDictionary[psr.GetType()].Add(psr.Name, psr);
            }
            else if (type.Equals(typeof(SynchronousMachine)))
            {
                SynchronousMachine sm = (SynchronousMachine)component;
                globalComponentDictionary[sm.GetType()].Add(sm.Name, sm);
            }
        }