public static void PopulateAnalogValueProperties(DERMS.AnalogValue cimAnalogValue, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report) { if ((cimAnalogValue != null) && (rd != null)) { DERMSConveter.PopulateMeasurementValueProperties(cimAnalogValue, rd, importHelper, report); if (cimAnalogValue.ValueHasValue) { rd.AddProperty(new Property(ModelCode.ANALOGVALUE_VALUE, cimAnalogValue.Value)); } } }
private ResourceDescription CreateAnalogValueResourceDescription(DERMS.AnalogValue cimAnalogValue) { ResourceDescription rd = null; if (cimAnalogValue != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.ANALOGVALUE, importHelper.CheckOutIndexForDMSType(DMSType.ANALOGVALUE)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimAnalogValue.ID, gid); ////populate ResourceDescription DERMSConveter.PopulateAnalogValueProperties(cimAnalogValue, rd, importHelper, report); } return(rd); }
private void ImportAnalogValues() { SortedDictionary <string, object> cimAnalogValues = concreteModel.GetAllObjectsOfType("DERMS.AnalogValue"); if (cimAnalogValues != null) { foreach (KeyValuePair <string, object> cimAnalogValuePair in cimAnalogValues) { DERMS.AnalogValue cimAnalogValue = cimAnalogValuePair.Value as DERMS.AnalogValue; ResourceDescription rd = CreateAnalogValueResourceDescription(cimAnalogValue); if (rd != null) { delta.AddDeltaOperation(DeltaOpType.Insert, rd, true); report.Report.Append("AnalogValue ID = ").Append(cimAnalogValue.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString()); } else { report.Report.Append("AnalogValue ID = ").Append(cimAnalogValue.ID).AppendLine(" FAILED to be converted"); } } report.Report.AppendLine(); } }