private static void ToProbabilisticConfiguration(PipingCalculationConfiguration calculationConfiguration,
                                                         ProbabilisticPipingInput input)
        {
            if (input.HydraulicBoundaryLocation != null)
            {
                calculationConfiguration.HydraulicBoundaryLocationName = input.HydraulicBoundaryLocation.Name;
            }

            calculationConfiguration.ShouldProfileSpecificIllustrationPointsBeCalculated = input.ShouldProfileSpecificIllustrationPointsBeCalculated;
            calculationConfiguration.ShouldSectionSpecificIllustrationPointsBeCalculated = input.ShouldSectionSpecificIllustrationPointsBeCalculated;
        }
 private static void ToSemiProbabilisticConfiguration(PipingCalculationConfiguration calculationConfiguration,
                                                      SemiProbabilisticPipingInput input)
 {
     if (input.UseAssessmentLevelManualInput)
     {
         calculationConfiguration.AssessmentLevel = input.AssessmentLevel;
     }
     else if (input.HydraulicBoundaryLocation != null)
     {
         calculationConfiguration.HydraulicBoundaryLocationName = input.HydraulicBoundaryLocation.Name;
     }
 }
        /// <inheritdoc/>
        /// <exception cref="NotSupportedException">Thrown when <paramref name="calculation"/>
        /// is of an unsupported type.</exception>
        protected override PipingCalculationConfiguration ToConfiguration(IPipingCalculationScenario <PipingInput> calculation)
        {
            PipingInput input = calculation.InputParameters;
            PipingCalculationConfigurationType calculationConfigurationType = GetCalculationConfigurationType(calculation);

            var calculationConfiguration = new PipingCalculationConfiguration(calculation.Name, calculationConfigurationType)
            {
                DampingFactorExit = input.DampingFactorExit.ToStochastConfiguration(),
                PhreaticLevelExit = input.PhreaticLevelExit.ToStochastConfiguration(),
                Scenario          = calculation.ToScenarioConfiguration()
            };

            if (input.SurfaceLine != null)
            {
                calculationConfiguration.SurfaceLineName = input.SurfaceLine.Name;
                calculationConfiguration.EntryPointL     = input.EntryPointL;
                calculationConfiguration.ExitPointL      = input.ExitPointL;
            }

            if (input.StochasticSoilModel != null)
            {
                calculationConfiguration.StochasticSoilModelName   = input.StochasticSoilModel.Name;
                calculationConfiguration.StochasticSoilProfileName = input.StochasticSoilProfile?.SoilProfile.Name;
            }

            if (calculationConfigurationType == PipingCalculationConfigurationType.SemiProbabilistic)
            {
                ToSemiProbabilisticConfiguration(calculationConfiguration, (SemiProbabilisticPipingInput)calculation.InputParameters);
            }

            if (calculationConfigurationType == PipingCalculationConfigurationType.Probabilistic)
            {
                ToProbabilisticConfiguration(calculationConfiguration, (ProbabilisticPipingInput)calculation.InputParameters);
            }

            return(calculationConfiguration);
        }