Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs
===================================================================
diff -u -r3d52cbd45282bbae5eb2200eaa04c23a583f1f30 -r349fb98a7545060b1dd16dfb4298997fa9ad9461
--- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs (.../MacroStabilityInwardsCalculationGroupExporter.cs) (revision 3d52cbd45282bbae5eb2200eaa04c23a583f1f30)
+++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs (.../MacroStabilityInwardsCalculationGroupExporter.cs) (revision 349fb98a7545060b1dd16dfb4298997fa9ad9461)
@@ -57,7 +57,7 @@
/// The extension of the files.
///
/// for obtaining the normative assessment level.
- /// Thrown when ,
+ /// Thrown when ,
/// or is null.
/// Thrown when is invalid.
/// A valid path:
@@ -98,9 +98,9 @@
return ExportCalculationItemsRecursively(calculationGroup, folderPath);
}
- private bool ExportCalculationItemsRecursively(CalculationGroup groupToExport, string nestedFolderPath)
+ private bool ExportCalculationItemsRecursively(CalculationGroup groupToExport, string currentFolderPath)
{
- CreateDirectory(nestedFolderPath);
+ CreateDirectory(currentFolderPath);
var continueExport = true;
var exportedGroups = new List();
@@ -111,13 +111,13 @@
switch (calculationItem)
{
case CalculationGroup nestedGroup:
- continueExport = ExportCalculationGroup(nestedGroup, nestedFolderPath, exportedGroups);
+ continueExport = ExportCalculationGroup(nestedGroup, currentFolderPath, exportedGroups);
break;
case MacroStabilityInwardsCalculation calculation when !calculation.HasOutput:
log.WarnFormat(Resources.MacroStabilityInwardsCalculationGroupExporter_Export_Calculation_0_has_no_output_and_is_skipped, calculation.Name);
break;
case MacroStabilityInwardsCalculation calculation:
- continueExport = ExportCalculation(calculation, nestedFolderPath, exportedCalculations);
+ continueExport = ExportCalculation(calculation, currentFolderPath, exportedCalculations);
break;
}
@@ -130,19 +130,19 @@
return true;
}
- private static void CreateDirectory(string nestedFolderPath)
+ private static void CreateDirectory(string currentFolderPath)
{
- if (!Directory.Exists(nestedFolderPath))
+ if (!Directory.Exists(currentFolderPath))
{
- Directory.CreateDirectory(nestedFolderPath);
+ Directory.CreateDirectory(currentFolderPath);
}
}
- private bool ExportCalculationGroup(CalculationGroup nestedGroup, string nestedFolderPath, ICollection exportedGroups)
+ private bool ExportCalculationGroup(CalculationGroup nestedGroup, string currentFolderPath, ICollection exportedGroups)
{
string uniqueGroupName = NamingHelper.GetUniqueName(exportedGroups, nestedGroup.Name, group => group.Name);
- bool exportSucceeded = ExportCalculationItemsRecursively(nestedGroup, Path.Combine(nestedFolderPath, uniqueGroupName));
+ bool exportSucceeded = ExportCalculationItemsRecursively(nestedGroup, Path.Combine(currentFolderPath, uniqueGroupName));
if (!exportSucceeded)
{
return false;
@@ -152,9 +152,9 @@
return true;
}
- private bool ExportCalculation(MacroStabilityInwardsCalculation calculation, string nestedFolderPath, ICollection exportedCalculations)
+ private bool ExportCalculation(MacroStabilityInwardsCalculation calculation, string currentFolderPath, ICollection exportedCalculations)
{
- string filePath = GetCalculationFilePath(calculation, nestedFolderPath, exportedCalculations);
+ string filePath = GetCalculationFilePath(calculation, currentFolderPath, exportedCalculations);
var exporter = new MacroStabilityInwardsCalculationExporter(calculation, persistenceFactory, filePath, () => getNormativeAssessmentLevelFunc(calculation));
bool exportSucceeded = exporter.Export();
@@ -169,11 +169,11 @@
return true;
}
- private string GetCalculationFilePath(ICalculationBase calculation, string nestedFolderPath, IEnumerable exportedCalculations)
+ private string GetCalculationFilePath(ICalculationBase calculation, string currentFolderPath, IEnumerable exportedCalculations)
{
string uniqueName = NamingHelper.GetUniqueName(exportedCalculations, calculation.Name, c => c.Name);
string fileNameWithExtension = $"{uniqueName}.{fileExtension}";
- return Path.Combine(nestedFolderPath, fileNameWithExtension);
+ return Path.Combine(currentFolderPath, fileNameWithExtension);
}
}
}
\ No newline at end of file
Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs
===================================================================
diff -u -r9bc99bcba3174753901344b318919aba37c9f899 -r349fb98a7545060b1dd16dfb4298997fa9ad9461
--- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision 9bc99bcba3174753901344b318919aba37c9f899)
+++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision 349fb98a7545060b1dd16dfb4298997fa9ad9461)
@@ -183,9 +183,9 @@
yield return new ExportInfo
{
Name = Resources.MacroStabilityInwardsCalculationExporter_DisplayName,
- Extension = StixFileFilterExtension,
- CreateFileExporter = (context, filePath) => new MacroStabilityInwardsCalculationGroupExporter(context.WrappedData, new PersistenceFactory(), filePath, StixFileFilterExtension,
- calculation => GetNormativeAssessmentLevel(context.AssessmentSection, calculation)),
+ Extension = Resources.Stix_file_filter_extension,
+ CreateFileExporter = (context, folderPath) => new MacroStabilityInwardsCalculationGroupExporter(context.WrappedData, new PersistenceFactory(), folderPath, Resources.Stix_file_filter_extension,
+ calculation => GetNormativeAssessmentLevel(context.AssessmentSection, calculation)),
IsEnabled = context => context.WrappedData.HasOutput(),
GetExportPath = () => ExportHelper.GetFolderPath(GetInquiryHelper())
};
@@ -430,12 +430,6 @@
};
}
- #region ExportInfos
-
- private static string StixFileFilterExtension => Resources.Stix_file_filter_extension;
-
- #endregion
-
private static RoundedDouble GetNormativeAssessmentLevel(IAssessmentSection assessmentSection, MacroStabilityInwardsCalculation calculation)
{
return assessmentSection.GetNormativeAssessmentLevel(calculation.InputParameters.HydraulicBoundaryLocation);