using System.ComponentModel; using Deltares.Geotechnics; using Deltares.Standard; using Deltares.Standard.Attributes; using Deltares.Standard.EventPublisher; using Deltares.Standard.Units; namespace Deltares.DeltaModel { /// /// Asphalt segment which is part of an asphalt cross section. /// public class AsphaltSegment : SurfaceLineRevetmentSegment, ICloneable { private AsphaltDescription asphaltDescription; private double stabilityFactor; private double safetyFactor; public AsphaltSegment(IHasSurfaceLine surfaceLineProvider) : this(surfaceLineProvider, new AsphaltDescription()) {} private AsphaltSegment() {} private AsphaltSegment(IHasSurfaceLine surfaceLineProvider, AsphaltDescription asphaltDescription) : base(surfaceLineProvider) { this.asphaltDescription = asphaltDescription; } /// /// The data attached to the segment, being the asphalt description. /// /// /// Only for xml storage. /// [Browsable(false)] public AsphaltDescription AsphaltDescription { get { return asphaltDescription; } set { this.SetAndNotify2(out asphaltDescription, value, s => s.AsphaltDescription); } } /// /// Gets or sets the Beta-dependent safety factor. /// [Unit(UnitType.ProbabilityPerYear)] [Category("Allowed safety factors")] [Format("F3")] [PropertyOrder(4, 1)] public double SafetyFactor { get { return safetyFactor; } set { if (value != safetyFactor) { this.SetAndNotify2(out safetyFactor, value, a => a.SafetyFactor); } } } /// /// Gets or sets the calculated stability factor for this segment /// [Category("Safety factors")] [PropertyOrder(5, 1)] public double StabilityFactor { get { return stabilityFactor; } set { if (value != stabilityFactor) { this.SetAndNotify2(out stabilityFactor, value, a => a.StabilityFactor); } } } /// /// The data attached to the segment, being the asphalt description. /// [Browsable(false)] public override ISegmentDescription SegmentDescription { get { return AsphaltDescription; } set { AsphaltDescription = value as AsphaltDescription; } } public AsphaltSegment Clone() { return new AsphaltSegment(SurfaceLineProvider, asphaltDescription.Clone() as AsphaltDescription) { StartX = StartX, EndX = EndX, safetyFactor = safetyFactor, stabilityFactor = stabilityFactor }; } } }