// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Service;
using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources;
namespace Ringtoets.Integration.Service
{
///
/// This class defines factory methods that can be used to create instances of for
/// hydraulic boundary location calculations on assessment section level.
///
public static class AssessmentSectionHydraulicBoundaryLocationCalculationActivityFactory
{
///
/// Creates a collection of for all hydraulic boundary location calculations
/// in the given .
///
/// The assessment section to create the activities for.
/// A collection of .
/// Thrown when is null.
public static IEnumerable CreateHydraulicBoundaryLocationCalculationActivities(IAssessmentSection assessmentSection)
{
if (assessmentSection == null)
{
throw new ArgumentNullException(nameof(assessmentSection));
}
var activities = new List();
activities.AddRange(CreateDesignWaterLevelCalculationActivities(assessmentSection));
activities.AddRange(CreateWaveHeightCalculationActivities(assessmentSection));
return activities;
}
///
/// Creates a collection of for wave height calculations
/// based on the given .
///
/// The assessment section to create the activities for.
/// A collection of .
/// Thrown when is null.
public static IEnumerable CreateWaveHeightCalculationActivities(IAssessmentSection assessmentSection)
{
if (assessmentSection == null)
{
throw new ArgumentNullException(nameof(assessmentSection));
}
var activities = new List();
activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateWaveHeightCalculationActivities(
assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm,
assessmentSection,
assessmentSection.GetNorm(AssessmentSectionCategoryType.FactorizedSignalingNorm),
RingtoetsCommonDataResources.AssessmentSectionCategoryType_FactorizedSignalingNorm_DisplayName));
activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateWaveHeightCalculationActivities(
assessmentSection.WaveHeightCalculationsForSignalingNorm,
assessmentSection,
assessmentSection.GetNorm(AssessmentSectionCategoryType.SignalingNorm),
RingtoetsCommonDataResources.AssessmentSectionCategoryType_SignalingNorm_DisplayName));
activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateWaveHeightCalculationActivities(
assessmentSection.WaveHeightCalculationsForLowerLimitNorm,
assessmentSection,
assessmentSection.GetNorm(AssessmentSectionCategoryType.LowerLimitNorm),
RingtoetsCommonDataResources.AssessmentSectionCategoryType_LowerLimitNorm_DisplayName));
activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateWaveHeightCalculationActivities(
assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm,
assessmentSection,
assessmentSection.GetNorm(AssessmentSectionCategoryType.FactorizedLowerLimitNorm),
RingtoetsCommonDataResources.AssessmentSectionCategoryType_FactorizedLowerLimitNorm_DisplayName));
return activities;
}
///
/// Creates a collection of for design water level calculations
/// based on the given .
///
/// The assessment section to create the activities for.
/// A collection of .
/// Thrown when is null.
public static IEnumerable CreateDesignWaterLevelCalculationActivities(IAssessmentSection assessmentSection)
{
if (assessmentSection == null)
{
throw new ArgumentNullException(nameof(assessmentSection));
}
var activities = new List();
activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateDesignWaterLevelCalculationActivities(
assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm,
assessmentSection,
assessmentSection.GetNorm(AssessmentSectionCategoryType.FactorizedSignalingNorm),
RingtoetsCommonDataResources.AssessmentSectionCategoryType_FactorizedSignalingNorm_DisplayName));
activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateDesignWaterLevelCalculationActivities(
assessmentSection.WaterLevelCalculationsForSignalingNorm,
assessmentSection,
assessmentSection.GetNorm(AssessmentSectionCategoryType.SignalingNorm),
RingtoetsCommonDataResources.AssessmentSectionCategoryType_SignalingNorm_DisplayName));
activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateDesignWaterLevelCalculationActivities(
assessmentSection.WaterLevelCalculationsForLowerLimitNorm,
assessmentSection,
assessmentSection.GetNorm(AssessmentSectionCategoryType.LowerLimitNorm),
RingtoetsCommonDataResources.AssessmentSectionCategoryType_LowerLimitNorm_DisplayName));
activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateDesignWaterLevelCalculationActivities(
assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm,
assessmentSection,
assessmentSection.GetNorm(AssessmentSectionCategoryType.FactorizedLowerLimitNorm),
RingtoetsCommonDataResources.AssessmentSectionCategoryType_FactorizedLowerLimitNorm_DisplayName));
return activities;
}
}
}