private ResourceDescription CreateCurveResourceDescription(FTN.Curve cimCurve) { ResourceDescription rd = null; if (cimCurve != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.CURVE, importHelper.CheckOutIndexForDMSType(DMSType.CURVE)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimCurve.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulateCurveProperties(cimCurve, rd); } return(rd); }
public static void PopulateCurveProperties(FTN.Curve cimCurve, ResourceDescription rd) { if ((cimCurve != null) && (rd != null)) { Converter.PopulateIdentifiedObjectProperties(cimCurve, rd); if (cimCurve.CurveStyleHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_CURVESTLYE, (short)GetDMSCurveStyle(cimCurve.CurveStyle))); } if (cimCurve.XMultiplierHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_XMULTIPLIER, (short)GetDMSUnitMultiplier(cimCurve.XMultiplier))); } if (cimCurve.XUnitHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_XUNIT, (short)GetDMSUnitSymbol(cimCurve.XUnit))); } if (cimCurve.Y1MultiplierHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_Y1MULTIPLIER, (short)GetDMSUnitMultiplier(cimCurve.Y1Multiplier))); } if (cimCurve.Y1UnitHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_Y1UNIT, (short)GetDMSUnitSymbol(cimCurve.Y1Unit))); } if (cimCurve.Y2MultiplierHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_Y2MULTIPLIER, (short)GetDMSUnitMultiplier(cimCurve.Y2Multiplier))); } if (cimCurve.Y2UnitHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_Y2UNIT, (short)GetDMSUnitSymbol(cimCurve.Y2Unit))); } if (cimCurve.Y3MultiplierHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_Y3MULTIPLIER, (short)GetDMSUnitMultiplier(cimCurve.Y3Multiplier))); } if (cimCurve.Y3UnitHasValue) { rd.AddProperty(new Property(ModelCode.CURVE_Y3UNIT, (short)GetDMSUnitSymbol(cimCurve.Y3Unit))); } } }
private void ImportCurve() { SortedDictionary <string, object> cimCurves = concreteModel.GetAllObjectsOfType("FTN.Curve"); if (cimCurves != null) { foreach (KeyValuePair <string, object> cimCurvePair in cimCurves) { FTN.Curve cimCurve = cimCurvePair.Value as FTN.Curve; ResourceDescription rd = CreateCurveResourceDescription(cimCurve); if (rd != null) { delta.AddDeltaOperation(DeltaOpType.Insert, rd, true); report.Report.Append("Curve ID = ").Append(cimCurve.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString()); } else { report.Report.Append("Curve ID = ").Append(cimCurve.ID).AppendLine(" FAILED to be converted"); } } report.Report.AppendLine(); } }