using System.ComponentModel;
using Deltares.Standard;
using Deltares.Standard.Attributes;
namespace Deltares.AssessmentMechanism
{
///
/// Results of a assessment calculation
/// ToDo: indication failure to calculate
///
public class AssessmentCalculationResult : IVisibleEnabled
{
///
/// Passed the assesment if true
///
[PropertyOrder(2, 1)]
public bool Approved { get; set; }
///
/// Safety factor, where a value of 1 or higher means a good result.
/// A value below 1 expresses failure.
///
[Format("F3")]
[ReadOnly(true)]
[Clearable]
[PropertyOrder(2, 2)]
public double FactorOfSafety { get; set; }
///
/// Gets or sets a value indicating whether this is calculated.
///
public bool Calculated { get; set; }
///
/// Indication of failure
///
[Format("F3", true)]
[ReadOnly(true)]
public double ZValue { get; set; }
///
/// Additional intermediate result of the calculation
///
[Format("F3", true)]
[ReadOnly(true)]
public double SubResult1 { get; set; }
///
/// Second additional intermediate result of the calculation
///
[Format("F3", true)]
[ReadOnly(true)]
public double SubResult2 { get; set; }
public bool IsVisible(string property)
{
switch (property)
{
case "Approved":
return Calculated;
case "FactorOfSafety":
return Calculated;
case "ZValue":
return Calculated;
default:
return true;
}
}
public bool IsEnabled(string property)
{
return false;
}
}
}