Beispiel #1
0
        private ResourceDescription CreateDiscreteValueResourceDescription(DERMS.DiscreteValue cimDiscretValue)
        {
            ResourceDescription rd = null;

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

                ////populate ResourceDescription
                DERMSConveter.PopulateDiscreteValueProperties(cimDiscretValue, rd, importHelper, report);
            }
            return(rd);
        }
Beispiel #2
0
        private void ImportDiscretValues()
        {
            SortedDictionary <string, object> cimDiscretValues = concreteModel.GetAllObjectsOfType("DERMS.DiscreteValue");

            if (cimDiscretValues != null)
            {
                foreach (KeyValuePair <string, object> cimDiscretValuePair in cimDiscretValues)
                {
                    DERMS.DiscreteValue cimDiscretValue = cimDiscretValuePair.Value as DERMS.DiscreteValue;

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