Beispiel #1
0
 public static void PopulateACLineSegmentProperties(Outage.ACLineSegment cimACLineSegment, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
 {
     if ((cimACLineSegment != null) && (rd != null))
     {
         OutageConverter.PopulateConductorProperties(cimACLineSegment, rd, importHelper, report);
     }
 }
        private ResourceDescription CreateACLineSegmentResourceDescription(Outage.ACLineSegment cimACLineSegment)
        {
            ResourceDescription rd = null;

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

                OutageConverter.PopulateACLineSegmentProperties(cimACLineSegment, rd, importHelper, report);
            }

            return(rd);
        }
        private void ImportACLineSegments()
        {
            SortedDictionary <string, object> cimACLineSegments = concreteModel.GetAllObjectsOfType("Outage.ACLineSegment");

            if (cimACLineSegments != null)
            {
                foreach (KeyValuePair <string, object> cimACLineSegmentPair in cimACLineSegments)
                {
                    Outage.ACLineSegment cimACLineSegment = cimACLineSegmentPair.Value as Outage.ACLineSegment;
                    ResourceDescription  rd = CreateACLineSegmentResourceDescription(cimACLineSegment);
                    if (rd != null)
                    {
                        string mrid = cimACLineSegment.MRID;
                        CreateAndInsertDeltaOperation(mrid, rd);

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