// Copyright (C) Stichting Deltares 2019. All rights reserved.
//
// This file is part of the Dam Engine.
//
// The Dam Engine is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero 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.Collections.Generic;
using Deltares.DamEngine.Data.General.Results;
using Deltares.DamEngine.Data.General.Sensors;
using Deltares.DamEngine.Data.General.TimeSeries;
using Deltares.DamEngine.Data.Standard.Language;
using Deltares.DamEngine.Data.Standard.Logging;
using Deltares.DamEngine.Data.Standard.Validation;
namespace Deltares.DamEngine.Data.General
{
public class DamProjectData
{
private IList segments;
private Dike dike;
private DamProjectCalculationSpecification damProjectCalculationSpecification;
private DamProjectType damProjectType = DamProjectType.Operational;
private List designCalculations;
private TimeSerieCollection outputTimeSerieCollection;
private SensorData sensorData;
private string calculationMap = "";
private string projectPath = "";
private int maxCalculationCores = 1;
///
/// Gets or sets the calculation messages.
///
///
/// The calculation messages.
///
public List CalculationMessages { get; set; } = null;
///
/// Gets or sets the output time serie collection.
///
///
/// Output time series for operational use
///
public TimeSerieCollection OutputTimeSerieCollection
{
get
{
return outputTimeSerieCollection;
}
set
{
outputTimeSerieCollection = value;
}
}
///
/// Constructor
///
public DamProjectData()
{
damProjectCalculationSpecification = new DamProjectCalculationSpecification();
dike = new Dike();
segments = new List();
}
///
/// Gets the name.
///
///
/// The name.
///
public virtual string Name
{
get { return String.Format(LocalizationManager.GetTranslatedText(this, "WaterBoard")); }
}
///
/// Gets or sets the segments.
///
///
/// The segments.
///
public virtual IList Segments
{
get { return segments; }
set { segments = value; }
}
///
/// Gets the dike.
/// Is a helper property to be able to show the soil table. When more Dikes than one are allowed,
/// this has to become a "real" property set by the onselectionchanged event.
///
///
/// The selected dike.
///
public Dike Dike
{
get
{
return dike;
}
set
{
dike = value;
}
}
///
/// calculation specification for the project
///
/// Composite relationship
[Validate]
public DamProjectCalculationSpecification DamProjectCalculationSpecification
{
get { return damProjectCalculationSpecification; }
set { damProjectCalculationSpecification = value; }
}
///
/// Gets or sets the type of the dam project.
///
///
/// The type of the dam project.
///
public virtual DamProjectType DamProjectType
{
get { return damProjectType; }
set
{
damProjectType = value;
Location.DamProjectType = value;
DamFailureMechanismeCalculationSpecification.DamProjectType = value;
}
}
///
/// Gets or sets the design calculations.
///
///
/// The design calculations.
///
public List DesignCalculations
{
get
{
return designCalculations;
}
set
{
designCalculations = value;
}
}
///
/// Gets or sets the project path.
///
///
/// The project path.
///
public string ProjectPath
{
get { return projectPath; }
set { projectPath = value ?? ""; }
}
///
/// Gets or sets the calculation map.
/// This does not include a full path but can include a relative path
///
///
/// The calculation map.
///
public string CalculationMap
{
get { return calculationMap; }
set { calculationMap = value ?? ""; }
}
///
/// Gets or sets the maximum calculation cores.
///
///
/// The maximum calculation cores.
///
public int MaxCalculationCores
{
get
{
return maxCalculationCores;
}
set
{
maxCalculationCores = value;
}
}
///
/// Gets or sets the sensor data.
///
///
/// The sensor data.
///
public SensorData SensorData
{
get { return sensorData; }
set { sensorData = value; }
}
///
/// Returns a that represents this instance.
///
///
/// A that represents this instance.
///
public override string ToString()
{
return Name;
}
}
}