public static void PopulateAssetFunctionProperties(FTN.AssetFunction cimAssetFunction, ResourceDescription rd) { if ((cimAssetFunction != null) && (rd != null)) { PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimAssetFunction, rd); if (cimAssetFunction.ConfigIDHasValue) { rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_CONFIGID, cimAssetFunction.ConfigID)); } if (cimAssetFunction.FirmwareIDHasValue) { rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_FIRMWAREID, cimAssetFunction.FirmwareID)); } if (cimAssetFunction.HardwareIDHasValue) { rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_HARDWAREID, cimAssetFunction.HardwareID)); } if (cimAssetFunction.PasswordHasValue) { rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_PASSWORD, cimAssetFunction.Password)); } if (cimAssetFunction.ProgramIDHasValue) { rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_PROGRAMID, cimAssetFunction.ProgramID)); } } }
private void ImportAssetFunction() { SortedDictionary <string, object> cimAssetFunctions = concreteModel.GetAllObjectsOfType("FTN.AssetFunction"); if (cimAssetFunctions != null) { foreach (KeyValuePair <string, object> cimAssetFunctionPair in cimAssetFunctions) { FTN.AssetFunction cimAssetFunction = cimAssetFunctionPair.Value as FTN.AssetFunction; ResourceDescription rd = CreateAssetFunctionResourceDescription(cimAssetFunction); if (rd != null) { delta.AddDeltaOperation(DeltaOpType.Insert, rd, true); report.Report.Append("AssetFunction ID = ").Append(cimAssetFunction.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString()); } else { report.Report.Append("AssetFunction ID = ").Append(cimAssetFunction.ID).AppendLine(" FAILED to be converted"); } } report.Report.AppendLine(); } }