public override double?CalculateScore(TreatmentBMPObservation treatmentBMPObservation) { var observationValue = GetObservationValueFromObservationData(treatmentBMPObservation.ObservationData); var benchmarkValue = treatmentBMPObservation.TreatmentBMPAssessmentObservationType.GetBenchmarkValue(treatmentBMPObservation.TreatmentBMPAssessment.TreatmentBMP); var thresholdValue = treatmentBMPObservation.TreatmentBMPAssessmentObservationType.GetThresholdValue(treatmentBMPObservation.TreatmentBMPAssessment.TreatmentBMP); var useUpperValue = treatmentBMPObservation.TreatmentBMPAssessmentObservationType.UseUpperValueForThreshold(benchmarkValue, observationValue); var thresholdValueInBenchmarkUnits = treatmentBMPObservation.TreatmentBMPAssessmentObservationType.GetThresholdValueInBenchmarkUnits(benchmarkValue, thresholdValue, useUpperValue); if (observationValue == null || benchmarkValue == null || thresholdValueInBenchmarkUnits == null) { return(null); } return(TreatmentBMPAssessmentObservationTypeHelper.LinearInterpolation(observationValue.Value, benchmarkValue.Value, thresholdValueInBenchmarkUnits.Value)); }
public static void DeleteTreatmentBMPObservation(this IQueryable <TreatmentBMPObservation> treatmentBMPObservations, TreatmentBMPObservation treatmentBMPObservationToDelete) { DeleteTreatmentBMPObservation(treatmentBMPObservations, new List <TreatmentBMPObservation> { treatmentBMPObservationToDelete }); }
public abstract double?CalculateScore(TreatmentBMPObservation treatmentBMPObservation);
public override double?CalculateScore(TreatmentBMPObservation treatmentBMPObservation) { var observationValue = GetObservationValueFromObservationData(treatmentBMPObservation.ObservationData); return(observationValue); }