public static void PopulateBaseVoltageProperties(Outage.BaseVoltage cimBaseVoltage, ResourceDescription rd) { if ((cimBaseVoltage != null) && (rd != null)) { OutageConverter.PopulateIdentifiedObjectProperties(cimBaseVoltage, rd); if (cimBaseVoltage.NominalVoltageHasValue) { rd.AddProperty(new Property(ModelCode.BASEVOLTAGE_NOMINALVOLTAGE, cimBaseVoltage.NominalVoltage)); } } }
private ResourceDescription CreateBaseVoltageResourceDescription(Outage.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); OutageConverter.PopulateBaseVoltageProperties(cimBaseVoltage, rd); } return(rd); }
private void ImportBaseVoltages() { SortedDictionary <string, object> cimBaseVoltages = concreteModel.GetAllObjectsOfType("Outage.BaseVoltage"); if (cimBaseVoltages != null) { foreach (KeyValuePair <string, object> cimBaseVoltagePair in cimBaseVoltages) { Outage.BaseVoltage cimBaseVoltage = cimBaseVoltagePair.Value as Outage.BaseVoltage; ResourceDescription rd = CreateBaseVoltageResourceDescription(cimBaseVoltage); if (rd != null) { string mrid = cimBaseVoltage.MRID; CreateAndInsertDeltaOperation(mrid, rd); report.Report.Append("BaseVoltage ID: ").Append(cimBaseVoltage.ID).Append(" SUCCESSFULLY converted to GID: ").AppendLine($"0x{rd.Id:X16}"); } else { report.Report.Append("BaseVoltage ID: ").Append(cimBaseVoltage.ID).AppendLine(" FAILED to be converted"); } } } }