Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs =================================================================== diff -u -ra0e847cda510ac315d678871c6d30b8225ba7b55 -raaeb6b78529e3c46c5035b6bad846b53ec64f1ca --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision a0e847cda510ac315d678871c6d30b8225ba7b55) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision aaeb6b78529e3c46c5035b6bad846b53ec64f1ca) @@ -439,19 +439,27 @@ generalInput, hydraulicBoundaryDatabaseFilePath); - bool dikeHeightCalculated = CalculateDikeHeight(dikeHeightCalculationInput, calculation.Name); + var dikeHeightCalculated = true; - if (canceled) + try { - return null; + PerformCalculation(() => dikeHeightCalculator.Calculate(dikeHeightCalculationInput), + () => dikeHeightCalculator.LastErrorFileContent, + () => dikeHeightCalculator.OutputDirectory, + calculation.Name, + Resources.GrassCoverErosionInwardsCalculationService_DikeHeight); } + catch (HydraRingCalculationException) + { + dikeHeightCalculated = false; + } - if (dikeHeightCalculated) + if (canceled || !dikeHeightCalculated) { - return CreateDikeHeightAssessmentOutput(calculation.Name, dikeHeightCalculationInput.Beta, norm); + return null; } - return null; + return CreateDikeHeightAssessmentOutput(calculation.Name, dikeHeightCalculationInput.Beta, norm); } /// @@ -510,57 +518,6 @@ } /// - /// Performs the dike height calculation. - /// - /// The input of the dike height calculation. - /// The name of the calculation. - /// True when the calculation was successful. False otherwise. - private bool CalculateDikeHeight(DikeHeightCalculationInput dikeHeightCalculationInput, string calculationName) - { - var exceptionThrown = false; - var dikeHeightCalculated = false; - if (!canceled) - { - try - { - dikeHeightCalculator.Calculate(dikeHeightCalculationInput); - } - catch (HydraRingCalculationException) - { - if (!canceled) - { - string lastErrorContent = dikeHeightCalculator.LastErrorFileContent; - if (string.IsNullOrEmpty(lastErrorContent)) - { - log.ErrorFormat(Resources.GrassCoverErosionInwardsCalculationService_Calculate_Error_in_hbn_grass_cover_erosion_inwards_0_calculation_no_error_report, calculationName); - } - else - { - log.ErrorFormat(Resources.GrassCoverErosionInwardsCalculationService_Calculate_Error_in_hbn_grass_cover_erosion_inwards_0_calculation_click_details_for_last_error_report_1, calculationName, lastErrorContent); - } - - exceptionThrown = true; - } - } - finally - { - string lastErrorFileContent = dikeHeightCalculator.LastErrorFileContent; - if (CalculationServiceHelper.HasErrorOccurred(canceled, exceptionThrown, lastErrorFileContent)) - { - log.ErrorFormat(Resources.GrassCoverErosionInwardsCalculationService_Calculate_Error_in_hbn_grass_cover_erosion_inwards_0_calculation_click_details_for_last_error_report_1, calculationName, lastErrorFileContent); - } - if (!exceptionThrown && string.IsNullOrEmpty(lastErrorFileContent)) - { - dikeHeightCalculated = true; - } - - log.InfoFormat(Resources.GrassCoverErosionInwardsCalculationService_CalculateDikeHeight_calculation_temporary_directory_can_be_found_on_location_0, dikeHeightCalculator.OutputDirectory); - } - } - return dikeHeightCalculated; - } - - /// /// Creates the output of a dike height calculation. /// /// The name of the calculation. Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.Designer.cs =================================================================== diff -u -ra0e847cda510ac315d678871c6d30b8225ba7b55 -raaeb6b78529e3c46c5035b6bad846b53ec64f1ca --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a0e847cda510ac315d678871c6d30b8225ba7b55) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision aaeb6b78529e3c46c5035b6bad846b53ec64f1ca) @@ -113,27 +113,6 @@ } /// - /// Looks up a localized string similar to De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken. - ///{1}. - /// - internal static string GrassCoverErosionInwardsCalculationService_Calculate_Error_in_hbn_grass_cover_erosion_inwards_0_calculation_click_details_for_last_error_report_1 { - get { - return ResourceManager.GetString("GrassCoverErosionInwardsCalculationService_Calculate_Error_in_hbn_grass_cover_ero" + - "sion_inwards_0_calculation_click_details_for_last_error_report_1", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Er is geen foutrapport beschikbaar.. - /// - internal static string GrassCoverErosionInwardsCalculationService_Calculate_Error_in_hbn_grass_cover_erosion_inwards_0_calculation_no_error_report { - get { - return ResourceManager.GetString("GrassCoverErosionInwardsCalculationService_Calculate_Error_in_hbn_grass_cover_ero" + - "sion_inwards_0_calculation_no_error_report", resourceCulture); - } - } - - /// /// Looks up a localized string similar to De overslagdebiet berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken. ///{1}. /// @@ -165,16 +144,6 @@ } /// - /// Looks up a localized string similar to Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.. - /// - internal static string GrassCoverErosionInwardsCalculationService_CalculateDikeHeight_calculation_temporary_directory_can_be_found_on_location_0 { - get { - return ResourceManager.GetString("GrassCoverErosionInwardsCalculationService_CalculateDikeHeight_calculation_tempor" + - "ary_directory_can_be_found_on_location_0", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Overslagdebiet berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.. /// internal static string GrassCoverErosionInwardsCalculationService_CalculateOvertoppingRate_calculation_temporary_directory_can_be_found_on_location_0 { @@ -194,7 +163,7 @@ } /// - /// Looks up a localized string similar to De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet geconvergeerd.. + /// Looks up a localized string similar to De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet geconvergeerd.. /// internal static string GrassCoverErosionInwardsCalculationService_DikeHeight_calculation_for_calculation_0_not_converged { get { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.resx =================================================================== diff -u -ra0e847cda510ac315d678871c6d30b8225ba7b55 -raaeb6b78529e3c46c5035b6bad846b53ec64f1ca --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.resx (.../Resources.resx) (revision a0e847cda510ac315d678871c6d30b8225ba7b55) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.resx (.../Resources.resx) (revision aaeb6b78529e3c46c5035b6bad846b53ec64f1ca) @@ -120,18 +120,12 @@ De {0} berekening voor grasbekleding erosie kruin en binnentalud '{1}' is niet gelukt. Er is geen foutrapport beschikbaar. - - De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Er is geen foutrapport beschikbaar. - De overslagdebiet berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Er is geen foutrapport beschikbaar. De {0} berekening is uitgevoerd op de tijdelijke locatie '{1}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden. - - Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden. - Overslagdebiet berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden. @@ -142,16 +136,12 @@ De {0} berekening voor grasbekleding erosie kruin en binnentalud '{1}' is niet gelukt. Bekijk het foutrapport door op details te klikken. {2} - - De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken. -{1} - De overslagdebiet berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken. {1} - De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet geconvergeerd. + De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet geconvergeerd. De overslagdebiet berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet geconvergeerd. Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsCalculationActivityIntegrationTest.cs =================================================================== diff -u -ra0e847cda510ac315d678871c6d30b8225ba7b55 -raaeb6b78529e3c46c5035b6bad846b53ec64f1ca --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsCalculationActivityIntegrationTest.cs (.../GrassCoverErosionInwardsCalculationActivityIntegrationTest.cs) (revision a0e847cda510ac315d678871c6d30b8225ba7b55) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsCalculationActivityIntegrationTest.cs (.../GrassCoverErosionInwardsCalculationActivityIntegrationTest.cs) (revision aaeb6b78529e3c46c5035b6bad846b53ec64f1ca) @@ -233,8 +233,8 @@ StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); - StringAssert.StartsWith(string.Format("De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt.", calculation.Name), msgs[4]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[5]); + StringAssert.StartsWith(string.Format("De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt.", calculation.Name), msgs[4]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[5]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[6]); }); Assert.AreEqual(ActivityState.Executed, activity.State); @@ -382,8 +382,8 @@ StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[4]); - StringAssert.StartsWith(string.Format("De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet geconvergeerd.", calculation.Name), msgs[5]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[4]); + StringAssert.StartsWith(string.Format("De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet geconvergeerd.", calculation.Name), msgs[5]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[6]); }); Assert.AreEqual(ActivityState.Executed, activity.State); @@ -792,8 +792,8 @@ StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); - StringAssert.StartsWith(string.Format("De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", calculation.Name), msgs[4]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[5]); + StringAssert.StartsWith(string.Format("De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", calculation.Name), msgs[4]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[5]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[6]); }); Assert.AreEqual(ActivityState.Executed, activity.State); @@ -839,8 +839,8 @@ StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); - StringAssert.StartsWith(string.Format("De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Er is geen foutrapport beschikbaar.", calculation.Name), msgs[4]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[5]); + StringAssert.StartsWith(string.Format("De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Er is geen foutrapport beschikbaar.", calculation.Name), msgs[4]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[5]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[6]); }); Assert.AreEqual(ActivityState.Executed, activity.State); @@ -887,8 +887,8 @@ StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); - StringAssert.StartsWith(string.Format("De HBN berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", calculation.Name), msgs[4]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[5]); + StringAssert.StartsWith(string.Format("De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", calculation.Name), msgs[4]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[5]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[6]); }); Assert.AreEqual(ActivityState.Executed, activity.State); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs =================================================================== diff -u -ra0e847cda510ac315d678871c6d30b8225ba7b55 -raaeb6b78529e3c46c5035b6bad846b53ec64f1ca --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs (.../GrassCoverErosionInwardsCalculationServiceTest.cs) (revision a0e847cda510ac315d678871c6d30b8225ba7b55) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs (.../GrassCoverErosionInwardsCalculationServiceTest.cs) (revision aaeb6b78529e3c46c5035b6bad846b53ec64f1ca) @@ -622,8 +622,8 @@ Assert.AreEqual(5, msgs.Length); StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[0]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[1]); - StringAssert.StartsWith($"De HBN berekening voor grasbekleding erosie kruin en binnentalud '{calculation.Name}' is niet gelukt.", msgs[2]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); + StringAssert.StartsWith($"De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{calculation.Name}' is niet gelukt.", msgs[2]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); StringAssert.StartsWith($"Berekening van '{calculation.Name}' beëindigd om: ", msgs[4]); }); Assert.IsFalse(expectedExceptionThrown); @@ -997,8 +997,8 @@ Assert.AreEqual(5, msgs.Length); StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[0]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[1]); - StringAssert.StartsWith($"De HBN berekening voor grasbekleding erosie kruin en binnentalud '{calculation.Name}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", msgs[2]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); + StringAssert.StartsWith($"De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{calculation.Name}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", msgs[2]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); StringAssert.StartsWith($"Berekening van '{calculation.Name}' beëindigd om: ", msgs[4]); }); Assert.IsNotNull(calculation.Output); @@ -1061,8 +1061,8 @@ Assert.AreEqual(5, msgs.Length); StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[0]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[1]); - StringAssert.StartsWith($"De HBN berekening voor grasbekleding erosie kruin en binnentalud '{calculation.Name}' is niet gelukt. Er is geen foutrapport beschikbaar.", msgs[2]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); + StringAssert.StartsWith($"De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{calculation.Name}' is niet gelukt. Er is geen foutrapport beschikbaar.", msgs[2]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); StringAssert.StartsWith($"Berekening van '{calculation.Name}' beëindigd om: ", msgs[4]); }); Assert.IsNotNull(calculation.Output); @@ -1126,8 +1126,8 @@ string[] msgs = messages.ToArray(); StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[0]); StringAssert.StartsWith("De overloop en overslag berekening is uitgevoerd op de tijdelijke locatie", msgs[1]); - StringAssert.StartsWith($"De HBN berekening voor grasbekleding erosie kruin en binnentalud '{calculation.Name}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", msgs[2]); - StringAssert.StartsWith("Dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); + StringAssert.StartsWith($"De dijkhoogte berekening voor grasbekleding erosie kruin en binnentalud '{calculation.Name}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", msgs[2]); + StringAssert.StartsWith("De dijkhoogte berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); StringAssert.StartsWith($"Berekening van '{calculation.Name}' beëindigd om: ", msgs[4]); Assert.AreEqual(5, msgs.Length); });