// Copyright (C) Stichting Deltares 2024. All rights reserved.
//
// This file is part of the D-Soil Model application.
//
// The D-Soil Model application is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
//
// All names, logos, and references to "Deltares" are registered trademarks of
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
using System.ComponentModel;
using Deltares.Geotechnics.Soils;
using Deltares.Standard.Attributes;
using Deltares.Standard.EventPublisher;
using Deltares.Standard.Language;
using Deltares.Standard.Units;
namespace Deltares.DSoilModel.Data
{
///
/// Helper class to be able to draw the CenterCrestLocation property of a SoilProfile2D.
///
public class CenterCrestLocation
{
private double location = double.NaN;
private SoilProfile2D soilProfile2D;
///
/// Gets or sets the location.
///
///
/// The location.
///
[Unit(UnitType.Length)]
[Format("F3")]
public double Location
{
get
{
return location;
}
set
{
if (value != location)
{
DataEventPublisher.BeforeChange(this, ccl => ccl.Location);
location = value;
DataEventPublisher.AfterChange(this, ccl => ccl.Location);
}
}
}
///
/// Gets or sets the profile2d.
///
///
/// The profile2 d.
///
[ReadOnly(true)]
public SoilProfile2D SoilProfile2D
{
get
{
return soilProfile2D;
}
set
{
soilProfile2D = value;
}
}
///
/// Returns a that represents this instance.
///
public override string ToString()
{
var locationLabel = LocalizationManager.GetTranslatedText(typeof(SoilProfile2D), "CenterCrestLocation").ToLower();
return locationLabel;
}
}
}