// 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 System.Globalization;
using Core.Common.Base.Data;
using Core.Common.Controls.DataGrid;
using Ringtoets.HydraRing.Data;
using Ringtoets.Piping.Data;
namespace Ringtoets.Piping.Forms.Views
{
///
/// This class represents a row of in the .
///
internal class PipingCalculationRow
{
private readonly PipingCalculationScenario pipingCalculation;
///
/// Creates a new instance of .
///
/// The this row contains.
/// Thrown when is null.
public PipingCalculationRow(PipingCalculationScenario pipingCalculation)
{
if (pipingCalculation == null)
{
throw new ArgumentNullException("pipingCalculation");
}
this.pipingCalculation = pipingCalculation;
}
///
/// Gets the this row contains.
///
public PipingCalculationScenario PipingCalculation
{
get
{
return pipingCalculation;
}
}
///
/// Gets or sets the is relevant.
///
public bool IsRelevant
{
get
{
return pipingCalculation.IsRelevant;
}
set
{
pipingCalculation.IsRelevant = value;
pipingCalculation.NotifyObservers();
}
}
///
/// Gets or sets the contribution of the .
///
public RoundedDouble Contribution
{
get
{
return new RoundedDouble(0, pipingCalculation.Contribution * 100);
}
set
{
pipingCalculation.Contribution = (RoundedDouble)(value / 100);
pipingCalculation.NotifyObservers();
}
}
///
/// Gets or sets the name of the .
///
public string Name
{
get
{
return pipingCalculation.Name;
}
set
{
pipingCalculation.Name = value;
pipingCalculation.NotifyObservers();
}
}
///
/// Gets or sets the stochastic soil model of the .
///
public DataGridViewComboBoxItemWrapper StochasticSoilModel
{
get
{
return new DataGridViewComboBoxItemWrapper(pipingCalculation.InputParameters.StochasticSoilModel);
}
set
{
pipingCalculation.InputParameters.StochasticSoilModel = value != null
? value.WrappedObject
: null;
pipingCalculation.InputParameters.NotifyObservers();
}
}
///
/// Gets or sets the stochastic soil profile of the .
///
public DataGridViewComboBoxItemWrapper StochasticSoilProfile
{
get
{
return new DataGridViewComboBoxItemWrapper(pipingCalculation.InputParameters.StochasticSoilProfile);
}
set
{
pipingCalculation.InputParameters.StochasticSoilProfile = value != null
? value.WrappedObject
: null;
pipingCalculation.InputParameters.NotifyObservers();
}
}
///
/// Gets the stochastic soil profile probability of the .
///
public string StochasticSoilProfileProbability
{
get
{
return pipingCalculation.InputParameters.StochasticSoilProfile != null
? new RoundedDouble(3, pipingCalculation.InputParameters.StochasticSoilProfile.Probability * 100).Value.ToString(CultureInfo.CurrentCulture)
: new RoundedDouble(3).Value.ToString(CultureInfo.CurrentCulture);
}
}
///
/// Gets or sets the hydraulic boundary location of the .
///
public DataGridViewComboBoxItemWrapper HydraulicBoundaryLocation
{
get
{
return new DataGridViewComboBoxItemWrapper(pipingCalculation.InputParameters.HydraulicBoundaryLocation);
}
set
{
pipingCalculation.InputParameters.HydraulicBoundaryLocation = value != null
? value.WrappedObject
: null;
pipingCalculation.InputParameters.NotifyObservers();
}
}
///
/// Gets or sets the damping factory exit mean of the .
///
public RoundedDouble DampingFactorExitMean
{
get
{
return pipingCalculation.InputParameters.DampingFactorExit.Mean;
}
set
{
pipingCalculation.InputParameters.DampingFactorExit.Mean = value;
pipingCalculation.InputParameters.NotifyObservers();
}
}
///
/// Gets or sets the phreatic level exit mean of the .
///
public RoundedDouble PhreaticLevelExitMean
{
get
{
return pipingCalculation.InputParameters.PhreaticLevelExit.Mean;
}
set
{
pipingCalculation.InputParameters.PhreaticLevelExit.Mean = value;
pipingCalculation.InputParameters.NotifyObservers();
}
}
///
/// Gets or sets the entry point l of the .
///
public RoundedDouble EntryPointL
{
get
{
return pipingCalculation.InputParameters.EntryPointL;
}
set
{
pipingCalculation.InputParameters.EntryPointL = value;
pipingCalculation.InputParameters.NotifyObservers();
}
}
///
/// Gets or sets the exit point l of the .
///
public RoundedDouble ExitPointL
{
get
{
return pipingCalculation.InputParameters.ExitPointL;
}
set
{
pipingCalculation.InputParameters.ExitPointL = value;
pipingCalculation.InputParameters.NotifyObservers();
}
}
}
}