Esempio n. 1
0
        public static void PopulateBreakerProperties(Outage.Breaker cimBreaker, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimBreaker != null) && (rd != null))
            {
                OutageConverter.PopulateProtectedSwitchProperties(cimBreaker, rd, importHelper, report);

                if (cimBreaker.NoReclosingHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BREAKER_NORECLOSING, cimBreaker.NoReclosing));
                }
            }
        }
        private ResourceDescription CreateBreakerResourceDescription(Outage.Breaker cimBreaker)
        {
            ResourceDescription rd = null;

            if (cimBreaker != null)
            {
                long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.BREAKER, importHelper.CheckOutIndexForDMSType(DMSType.BREAKER));
                rd = new ResourceDescription(gid);
                importHelper.DefineIDMapping(cimBreaker.ID, gid);

                OutageConverter.PopulateBreakerProperties(cimBreaker, rd, importHelper, report);
            }

            return(rd);
        }
        private void ImportBreakers()
        {
            SortedDictionary <string, object> cimBreakers = concreteModel.GetAllObjectsOfType("Outage.Breaker");

            if (cimBreakers != null)
            {
                foreach (KeyValuePair <string, object> cimBreakerPair in cimBreakers)
                {
                    Outage.Breaker      cimBreaker = cimBreakerPair.Value as Outage.Breaker;
                    ResourceDescription rd         = CreateBreakerResourceDescription(cimBreaker);
                    if (rd != null)
                    {
                        string mrid = cimBreaker.MRID;
                        CreateAndInsertDeltaOperation(mrid, rd);

                        report.Report.Append("Breaker ID: ").Append(cimBreaker.ID).Append(" SUCCESSFULLY converted to GID: ").AppendLine($"0x{rd.Id:X16}");
                    }
                    else
                    {
                        report.Report.Append("Breaker ID: ").Append(cimBreaker.ID).AppendLine(" FAILED to be converted");
                    }
                }
            }
        }