Example #1
0
 public static void PopulateFuseProperties(Outage.Fuse cimFuse, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
 {
     if ((cimFuse != null) && (rd != null))
     {
         OutageConverter.PopulateSwitchProperties(cimFuse, rd, importHelper, report);
     }
 }
        private ResourceDescription CreateFuseResourceDescription(Outage.Fuse cimFuse)
        {
            ResourceDescription rd = null;

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

                OutageConverter.PopulateFuseProperties(cimFuse, rd, importHelper, report);
            }

            return(rd);
        }
        private void ImportFuses()
        {
            SortedDictionary <string, object> cimFuses = concreteModel.GetAllObjectsOfType("Outage.Fuse");

            if (cimFuses != null)
            {
                foreach (KeyValuePair <string, object> cimFusePair in cimFuses)
                {
                    Outage.Fuse         cimFuse = cimFusePair.Value as Outage.Fuse;
                    ResourceDescription rd      = CreateFuseResourceDescription(cimFuse);
                    if (rd != null)
                    {
                        string mrid = cimFuse.MRID;
                        CreateAndInsertDeltaOperation(mrid, rd);

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