private void ImportBaseVoltages()
        {
            SortedDictionary <string, object> cimBaseVoltages = concreteModel.GetAllObjectsOfType("FTN.BaseVoltage");

            if (cimBaseVoltages != null)
            {
                foreach (KeyValuePair <string, object> cimBaseVoltagePair in cimBaseVoltages)
                {
                    FTN.BaseVoltage cimBaseVoltage = cimBaseVoltagePair.Value as FTN.BaseVoltage;

                    ResourceDescription rd = CreateBaseVoltageResourceDecription(cimBaseVoltage);

                    if (rd != null)
                    {
                        delta.AddDeltaOperation(DeltaOpType.Insert, rd, true);
                        report.Report.Append("BaseVoltage ID = ").Append(cimBaseVoltage.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString());
                    }
                    else
                    {
                        report.Report.Append("BaseVoltage ID = ").Append(cimBaseVoltage.ID).AppendLine(" FAILED to be converted");
                    }
                }
                report.Report.AppendLine();
            }
        }
        public static void PopulateBaseVoltageProperties(FTN.BaseVoltage cimBaseVoltage, ResourceDescription rd)
        {
            if ((cimBaseVoltage != null) && (rd != null))
            {
                LoadFlowConverter.PopulateIdentifiedObjectProperties(cimBaseVoltage, rd);

                if (cimBaseVoltage.NameHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASEVOLTAGE_NOMINALVOLTAGE, cimBaseVoltage.NominalVoltage));
                }
            }
        }
예제 #3
0
        private ResourceDescription CreateBaseVoltageResourceDescription(FTN.BaseVoltage cimBaseVoltage)
        {
            ResourceDescription rd = null;

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

                ////populate ResourceDescription
                PowerTransformerConverter.PopulateBaseVoltageProperties(cimBaseVoltage, rd);
            }
            return(rd);
        }