コード例 #1
0
 public static void PopulateDCLineSegmentProperties(FTN.DCLineSegment cimDCLineSegment, ResourceDescription rd)
 {
     if ((cimDCLineSegment != null) && (rd != null))
     {
         PowerTransformerConverter.PopulateConductorProperties(cimDCLineSegment, rd);
     }
 }
コード例 #2
0
 public static void PopulateDCLineSegmentProperties(FTN.DCLineSegment cimDCLineSegment, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
 {
     if ((cimDCLineSegment != null) && (rd != null))
     {
         PowerTransformerConverter.PopulateConductorProperties(cimDCLineSegment, rd, importHelper, report);
     }
 }
コード例 #3
0
        private ResourceDescription CreateDCLineSegmentResourceDescription(FTN.DCLineSegment cimDCLineSegment)
        {
            ResourceDescription rd = null;

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

                ////populate ResourceDescription
                PowerTransformerConverter.PopulateDCLineSegmentProperties(cimDCLineSegment, rd, importHelper, report);
            }
            return(rd);
        }
コード例 #4
0
        private void ImportDCLineSegments()
        {
            SortedDictionary <string, object> cimDCLineSegments = concreteModel.GetAllObjectsOfType("FTN.DCLineSegment");

            if (cimDCLineSegments != null)
            {
                foreach (KeyValuePair <string, object> cimDCLineSegmentPair in cimDCLineSegments)
                {
                    FTN.DCLineSegment cimDCLineSegment = cimDCLineSegmentPair.Value as FTN.DCLineSegment;

                    ResourceDescription rd = CreateDCLineSegmentResourceDescription(cimDCLineSegment);
                    if (rd != null)
                    {
                        delta.AddDeltaOperation(DeltaOpType.Insert, rd, true);
                        report.Report.Append("DCLineSegment ID = ").Append(cimDCLineSegment.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString());
                    }
                    else
                    {
                        report.Report.Append("DCLineSegment ID = ").Append(cimDCLineSegment.ID).AppendLine(" FAILED to be converted");
                    }
                }
                report.Report.AppendLine();
            }
        }