// Copyright (C) Stichting Deltares 2016. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets 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;
using Core.Common.Base;
using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
namespace Ringtoets.Common.Data.Hydraulics
{
///
/// Location of a hydraulic boundary.
///
public class HydraulicBoundaryLocation : Observable
{
///
/// Creates a new instance of .
///
/// Id of the .
/// Name of the .
/// X-coordinate of the .
/// Y-coordinate of the .
/// Thrown when is null.
public HydraulicBoundaryLocation(long id, string name, double coordinateX, double coordinateY)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
Id = id;
Name = name;
Location = new Point2D(coordinateX, coordinateY);
}
///
/// Gets the database id of the hydraulic boundary location.
///
public long Id { get; private set; }
///
/// Gets the name of the hydraulic boundary location.
///
public string Name { get; private set; }
///
/// Gets the coordinates of the hydraulic boundary location.
///
public Point2D Location { get; private set; }
///
/// Gets or sets the output of a design water level calculation.
///
public HydraulicBoundaryLocationOutput DesignWaterLevelOutput { get; set; }
///
/// Gets the design water level of the hydraulic boundary location.
///
public RoundedDouble DesignWaterLevel
{
get
{
return DesignWaterLevelOutput == null
? RoundedDouble.NaN
: DesignWaterLevelOutput.Result;
}
}
///
/// Gets the convergence status of the design waterlevel calculation.
///
public CalculationConvergence DesignWaterLevelCalculationConvergence
{
get
{
return DesignWaterLevelOutput == null
? CalculationConvergence.NotCalculated
: DesignWaterLevelOutput.CalculationConvergence;
}
}
///
/// Gets or sets the output of a wave height calculation.
///
public HydraulicBoundaryLocationOutput WaveHeightOutput { get; set; }
///
/// Gets the wave height of the hydraulic boundary location.
///
public RoundedDouble WaveHeight
{
get
{
return WaveHeightOutput == null
? RoundedDouble.NaN
: WaveHeightOutput.Result;
}
}
///
/// Gets the convergence status of the waveheight calculation.
///
public CalculationConvergence WaveHeightCalculationConvergence
{
get
{
return WaveHeightOutput == null
? CalculationConvergence.NotCalculated
: WaveHeightOutput.CalculationConvergence;
}
}
public override string ToString()
{
return Name;
}
}
}