Index: Core/Common/src/Core.Common.Base/Data/RoundedDouble.cs
===================================================================
diff -u -r2d299fe3ac16308a763adf12b4adcffdd97924b4 -r9f494a06e4dd1e8b3bc6a7abbf193e11c4ba2c93
--- Core/Common/src/Core.Common.Base/Data/RoundedDouble.cs (.../RoundedDouble.cs) (revision 2d299fe3ac16308a763adf12b4adcffdd97924b4)
+++ Core/Common/src/Core.Common.Base/Data/RoundedDouble.cs (.../RoundedDouble.cs) (revision 9f494a06e4dd1e8b3bc6a7abbf193e11c4ba2c93)
@@ -176,21 +176,6 @@
return left.Value >= right;
}
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj))
- {
- return false;
- }
-
- if (obj.GetType() != GetType())
- {
- return false;
- }
-
- return Equals((RoundedDouble) obj);
- }
-
public override int GetHashCode()
{
return Value.GetHashCode();
@@ -201,6 +186,21 @@
return ToString(null, null);
}
+ public string ToString(string format, IFormatProvider formatProvider)
+ {
+ if (double.IsPositiveInfinity(Value))
+ {
+ return Resources.RoundedDouble_ToString_PositiveInfinity;
+ }
+
+ if (double.IsNegativeInfinity(Value))
+ {
+ return Resources.RoundedDouble_ToString_NegativeInfinity;
+ }
+
+ return Value.ToString(format ?? GetFormat(), formatProvider ?? CultureInfo.CurrentCulture);
+ }
+
public int CompareTo(object obj)
{
if (obj == null)
@@ -241,19 +241,19 @@
return Value.Equals(other.Value);
}
- public string ToString(string format, IFormatProvider formatProvider)
+ public override bool Equals(object obj)
{
- if (double.IsPositiveInfinity(Value))
+ if (ReferenceEquals(null, obj))
{
- return Resources.RoundedDouble_ToString_PositiveInfinity;
+ return false;
}
- if (double.IsNegativeInfinity(Value))
+ if (obj.GetType() != GetType())
{
- return Resources.RoundedDouble_ToString_NegativeInfinity;
+ return false;
}
- return Value.ToString(format ?? GetFormat(), formatProvider ?? CultureInfo.CurrentCulture);
+ return Equals((RoundedDouble)obj);
}
private static double RoundDouble(double value, int numberOfDecimalPlaces)
Index: Core/Components/src/Core.Components.OxyPlot.Forms/ChartControl.cs
===================================================================
diff -u -rfcc528ff894c3ef3521a3d4ec8adcda05ea5b54e -r9f494a06e4dd1e8b3bc6a7abbf193e11c4ba2c93
--- Core/Components/src/Core.Components.OxyPlot.Forms/ChartControl.cs (.../ChartControl.cs) (revision fcc528ff894c3ef3521a3d4ec8adcda05ea5b54e)
+++ Core/Components/src/Core.Components.OxyPlot.Forms/ChartControl.cs (.../ChartControl.cs) (revision 9f494a06e4dd1e8b3bc6a7abbf193e11c4ba2c93)
@@ -200,17 +200,6 @@
return extent;
}
- private static Extent CreateExtentFor(XYAxisSeries chartData)
- {
- return new Extent
- (
- chartData.MinX,
- chartData.MaxX,
- chartData.MinY,
- chartData.MaxY
- );
- }
-
///
/// Defines the area taken up by the visible chart data based on the provided chart data.
///
@@ -229,6 +218,17 @@
return envelope;
}
+ private static Extent CreateExtentFor(XYAxisSeries chartData)
+ {
+ return new Extent
+ (
+ chartData.MinX,
+ chartData.MaxX,
+ chartData.MinY,
+ chartData.MaxY
+ );
+ }
+
private void InitializePlotView()
{
plotController = new DynamicPlotController();
Index: Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Calculators/Assembly/FailureMechanismSectionAssemblyCalculator.cs
===================================================================
diff -u -rae0e1bf1a6ee360a04463afd81ac7450889d1fc5 -r9f494a06e4dd1e8b3bc6a7abbf193e11c4ba2c93
--- Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Calculators/Assembly/FailureMechanismSectionAssemblyCalculator.cs (.../FailureMechanismSectionAssemblyCalculator.cs) (revision ae0e1bf1a6ee360a04463afd81ac7450889d1fc5)
+++ Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Calculators/Assembly/FailureMechanismSectionAssemblyCalculator.cs (.../FailureMechanismSectionAssemblyCalculator.cs) (revision 9f494a06e4dd1e8b3bc6a7abbf193e11c4ba2c93)
@@ -337,14 +337,6 @@
}
}
- private CategoriesList GetWbi01Categories(AssemblyCategoriesInput assemblyCategoriesInput)
- {
- ICategoryLimitsCalculator categoriesKernel = factory.CreateAssemblyCategoriesKernel();
- return categoriesKernel.CalculateFmSectionCategoryLimitsWbi01(
- new AssessmentSection(1, assemblyCategoriesInput.SignalingNorm, assemblyCategoriesInput.LowerLimitNorm),
- new FailureMechanism(assemblyCategoriesInput.N, assemblyCategoriesInput.FailureMechanismContribution));
- }
-
public FailureMechanismSectionAssembly AssembleTailorMadeAssessment(TailorMadeAssessmentProbabilityCalculationResultType tailorMadeAssessmentResult,
double probability,
double failureMechanismSectionN,
@@ -397,6 +389,14 @@
}
}
+ private CategoriesList GetWbi01Categories(AssemblyCategoriesInput assemblyCategoriesInput)
+ {
+ ICategoryLimitsCalculator categoriesKernel = factory.CreateAssemblyCategoriesKernel();
+ return categoriesKernel.CalculateFmSectionCategoryLimitsWbi01(
+ new AssessmentSection(1, assemblyCategoriesInput.SignalingNorm, assemblyCategoriesInput.LowerLimitNorm),
+ new FailureMechanism(assemblyCategoriesInput.N, assemblyCategoriesInput.FailureMechanismContribution));
+ }
+
#endregion
#region Combined Assembly
Index: Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs
===================================================================
diff -u -r144d88de33a93734bc90e9567cc90d2e9fd3bcc2 -r9f494a06e4dd1e8b3bc6a7abbf193e11c4ba2c93
--- Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 144d88de33a93734bc90e9567cc90d2e9fd3bcc2)
+++ Riskeer/ClosingStructures/src/Riskeer.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 9f494a06e4dd1e8b3bc6a7abbf193e11c4ba2c93)
@@ -267,11 +267,64 @@
}, filePath));
}
+ private static string ValidateAllDataAvailableAndGetErrorMessage(ClosingStructuresCalculationContext context)
+ {
+ return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection);
+ }
+
+ private void CalculateAll(ClosingStructuresFailureMechanismContext context)
+ {
+ ActivityProgressDialogRunner.Run(Gui.MainWindow,
+ ClosingStructuresCalculationActivityFactory.CreateCalculationActivities(context.WrappedData, context.Parent));
+ }
+
+ private void CalculateAll(CalculationGroup group, ClosingStructuresCalculationGroupContext context)
+ {
+ ActivityProgressDialogRunner.Run(Gui.MainWindow,
+ ClosingStructuresCalculationActivityFactory.CreateCalculationActivities(group,
+ context.FailureMechanism,
+ context.AssessmentSection));
+ }
+
+ private static void ValidateAll(IEnumerable> closingStructuresCalculations, IAssessmentSection assessmentSection)
+ {
+ foreach (StructuresCalculation calculation in closingStructuresCalculations)
+ {
+ ClosingStructuresCalculationService.Validate(calculation, assessmentSection);
+ }
+ }
+
+ private static void ValidateAll(ClosingStructuresFailureMechanismContext context)
+ {
+ ValidateAll(context.WrappedData.Calculations.OfType>(),
+ context.Parent);
+ }
+
+ private static void ValidateAll(ClosingStructuresCalculationGroupContext context)
+ {
+ ValidateAll(context.WrappedData.GetCalculations().OfType>(), context.AssessmentSection);
+ }
+
+ private static void ValidateAll(ClosingStructuresCalculationContext context)
+ {
+ ClosingStructuresCalculationService.Validate(context.WrappedData, context.AssessmentSection);
+ }
+
private static string ValidateAllDataAvailableAndGetErrorMessage(IAssessmentSection assessmentSection)
{
return HydraulicBoundaryDatabaseConnectionValidator.Validate(assessmentSection.HydraulicBoundaryDatabase);
}
+ private static string ValidateAllDataAvailableAndGetErrorMessage(ClosingStructuresFailureMechanismContext context)
+ {
+ return ValidateAllDataAvailableAndGetErrorMessage(context.Parent);
+ }
+
+ private static string ValidateAllDataAvailableAndGetErrorMessage(ClosingStructuresCalculationGroupContext context)
+ {
+ return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection);
+ }
+
#region ViewInfo
#region ClosingStructuresFailureMechanismView ViewInfo
@@ -445,31 +498,6 @@
.Build();
}
- private static void ValidateAll(IEnumerable> closingStructuresCalculations, IAssessmentSection assessmentSection)
- {
- foreach (StructuresCalculation calculation in closingStructuresCalculations)
- {
- ClosingStructuresCalculationService.Validate(calculation, assessmentSection);
- }
- }
-
- private static void ValidateAll(ClosingStructuresFailureMechanismContext context)
- {
- ValidateAll(context.WrappedData.Calculations.OfType>(),
- context.Parent);
- }
-
- private static string ValidateAllDataAvailableAndGetErrorMessage(ClosingStructuresFailureMechanismContext context)
- {
- return ValidateAllDataAvailableAndGetErrorMessage(context.Parent);
- }
-
- private void CalculateAll(ClosingStructuresFailureMechanismContext context)
- {
- ActivityProgressDialogRunner.Run(Gui.MainWindow,
- ClosingStructuresCalculationActivityFactory.CreateCalculationActivities(context.WrappedData, context.Parent));
- }
-
#endregion
#region ClosingStructuresCalculationGroupContext TreeNodeInfo
@@ -605,6 +633,31 @@
};
}
+ private StrictContextMenuItem CreateUpdateStructureItem(ClosingStructuresCalculationContext context)
+ {
+ var contextMenuEnabled = true;
+ string toolTipMessage = RiskeerCommonFormsResources.Update_Calculation_with_Structure_ToolTip;
+ if (context.WrappedData.InputParameters.Structure == null)
+ {
+ contextMenuEnabled = false;
+ toolTipMessage = RiskeerCommonFormsResources.Structure_must_be_selected_ToolTip;
+ }
+ else if (context.WrappedData.InputParameters.IsStructureInputSynchronized)
+ {
+ contextMenuEnabled = false;
+ toolTipMessage = RiskeerCommonFormsResources.CalculationItem_No_changes_to_update_ToolTip;
+ }
+
+ return new StrictContextMenuItem(
+ RiskeerCommonFormsResources.Update_Structure_data,
+ toolTipMessage,
+ RiskeerCommonFormsResources.UpdateItemIcon,
+ (o, args) => UpdateStructureDependentDataOfCalculation(context.WrappedData))
+ {
+ Enabled = contextMenuEnabled
+ };
+ }
+
private void UpdateStructureDependentDataOfCalculations(IEnumerable> calculations)
{
string message = RiskeerCommonFormsResources.VerifyUpdate_Confirm_calculation_outputs_cleared;
@@ -669,24 +722,6 @@
ClosingStructuresHelper.UpdateCalculationToSectionResultAssignments(failureMechanism);
}
- private static void ValidateAll(ClosingStructuresCalculationGroupContext context)
- {
- ValidateAll(context.WrappedData.GetCalculations().OfType>(), context.AssessmentSection);
- }
-
- private static string ValidateAllDataAvailableAndGetErrorMessage(ClosingStructuresCalculationGroupContext context)
- {
- return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection);
- }
-
- private void CalculateAll(CalculationGroup group, ClosingStructuresCalculationGroupContext context)
- {
- ActivityProgressDialogRunner.Run(Gui.MainWindow,
- ClosingStructuresCalculationActivityFactory.CreateCalculationActivities(group,
- context.FailureMechanism,
- context.AssessmentSection));
- }
-
private static void AddCalculation(ClosingStructuresCalculationGroupContext context)
{
var calculation = new StructuresCalculation
@@ -777,16 +812,6 @@
context.AssessmentSection));
}
- private static void ValidateAll(ClosingStructuresCalculationContext context)
- {
- ClosingStructuresCalculationService.Validate(context.WrappedData, context.AssessmentSection);
- }
-
- private static string ValidateAllDataAvailableAndGetErrorMessage(ClosingStructuresCalculationContext context)
- {
- return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection);
- }
-
private static void CalculationContextOnNodeRemoved(ClosingStructuresCalculationContext context, object parentData)
{
var calculationGroupContext = parentData as ClosingStructuresCalculationGroupContext;
@@ -798,31 +823,6 @@
}
}
- private StrictContextMenuItem CreateUpdateStructureItem(ClosingStructuresCalculationContext context)
- {
- var contextMenuEnabled = true;
- string toolTipMessage = RiskeerCommonFormsResources.Update_Calculation_with_Structure_ToolTip;
- if (context.WrappedData.InputParameters.Structure == null)
- {
- contextMenuEnabled = false;
- toolTipMessage = RiskeerCommonFormsResources.Structure_must_be_selected_ToolTip;
- }
- else if (context.WrappedData.InputParameters.IsStructureInputSynchronized)
- {
- contextMenuEnabled = false;
- toolTipMessage = RiskeerCommonFormsResources.CalculationItem_No_changes_to_update_ToolTip;
- }
-
- return new StrictContextMenuItem(
- RiskeerCommonFormsResources.Update_Structure_data,
- toolTipMessage,
- RiskeerCommonFormsResources.UpdateItemIcon,
- (o, args) => UpdateStructureDependentDataOfCalculation(context.WrappedData))
- {
- Enabled = contextMenuEnabled
- };
- }
-
private void UpdateStructureDependentDataOfCalculation(StructuresCalculation calculation)
{
string message = RiskeerCommonFormsResources.VerifyUpdate_Confirm_calculation_output_cleared;