Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs
===================================================================
diff -u -r1007 -r1641
--- DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 1007)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 1641)
@@ -58,31 +58,31 @@
///
/// Type of the segment failure mechanism.
///
- public SoilProfile1D GetMostProbableProfile(FailureMechanismSystemType? segmentFailureMechanismType)
+ public SoilProfile1D GetMostProbableProfile1D(FailureMechanismSystemType? segmentFailureMechanismType)
{
- IEnumerable spps = from SoilGeometryProbability spp in this.soilGeometryProbabilities
- where !spp.SegmentFailureMechanismType.HasValue || !segmentFailureMechanismType.HasValue || spp.SegmentFailureMechanismType == segmentFailureMechanismType
- orderby spp.Probability descending
- select spp;
- if (spps.Any())
- return spps.First().SoilProfile1D;
- else
- return null;
+ var mostProbableSoilGeometryProbability = GetMostProbableSoilGeometryProbability(segmentFailureMechanismType);
+ return mostProbableSoilGeometryProbability?.SoilProfile1D;
}
///
- /// Gets the name of the most probable geometry2dname (name of profile2D).
+ /// Gets the name of the most probable sti filename (name of MStab .sti file).
///
/// Type of the segment failure mechanism.
///
- public string GetMostProbableGeometry2DName(FailureMechanismSystemType? segmentFailureMechanismType)
+ public string GetMostProbableProfile2DStiFileName(FailureMechanismSystemType? segmentFailureMechanismType)
{
+ var mostProbableSoilGeometryProbability = GetMostProbableSoilGeometryProbability(segmentFailureMechanismType);
+ return mostProbableSoilGeometryProbability?.FullStiFileName;
+ }
+
+ public SoilGeometryProbability GetMostProbableSoilGeometryProbability(FailureMechanismSystemType? segmentFailureMechanismType)
+ {
IEnumerable spps = from SoilGeometryProbability spp in this.soilGeometryProbabilities
where !spp.SegmentFailureMechanismType.HasValue || !segmentFailureMechanismType.HasValue || spp.SegmentFailureMechanismType == segmentFailureMechanismType
orderby spp.Probability descending
select spp;
if (spps.Any())
- return spps.First().FullStiFileName;
+ return spps.First();
else
return null;
}