コード例 #1
0
 public static void PopulateDayTypeProperties(FTN.DayType cimDayType, ResourceDescription rd)
 {
     if ((cimDayType != null) && (rd != null))
     {
         PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimDayType, rd);
     }
 }
コード例 #2
0
        private ResourceDescription CreateDayTypeResourceDescription(FTN.DayType cimDayType)
        {
            ResourceDescription rd = null;

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

                ////populate ResourceDescription
                PowerTransformerConverter.PopulateDayTypeProperties(cimDayType, rd);
            }
            return(rd);
        }
コード例 #3
0
        private void ImportDayTypes()
        {
            SortedDictionary <string, object> DayTypes = concreteModel.GetAllObjectsOfType("FTN.DayType");

            if (DayTypes != null)
            {
                foreach (KeyValuePair <string, object> DayTypePair in DayTypes)
                {
                    FTN.DayType cimDayType = DayTypePair.Value as FTN.DayType;

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