Search for both LeafInput and LeafInputData
This commit is contained in:
@@ -80,6 +80,11 @@ namespace LeafWeb.Core.DAL
|
||||
select s).Max(s => s.DateTime));
|
||||
}
|
||||
|
||||
public IQueryable<LeafInputData> GetLeafInputData()
|
||||
{
|
||||
return _db.LeafInputData;
|
||||
}
|
||||
|
||||
public IEnumerable<LeafInput> GetLeafInputRecentlyCompleted(int count)
|
||||
{
|
||||
return
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using LeafWeb.Core.Utility;
|
||||
|
||||
namespace LeafWeb.Core.Entities
|
||||
@@ -23,7 +25,7 @@ namespace LeafWeb.Core.Entities
|
||||
public virtual LeafInput LeafInput { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Output file this data was parsed from
|
||||
/// Output file this data was parsed from - the cleaned input from Piscal
|
||||
/// </summary>
|
||||
public virtual LeafOutputFile LeafOutputFile { get; set; }
|
||||
|
||||
@@ -58,5 +60,18 @@ namespace LeafWeb.Core.Entities
|
||||
|
||||
[ParseInfo(10, exampleValue: "Any extra information you feel would be helpful to put the sampled leaf in context")]
|
||||
public string ExtraInfo { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Utility method for calculating the range of values in the curves
|
||||
/// </summary>
|
||||
public static double? Range(
|
||||
ICollection<LeafInputDataCurve> curves,
|
||||
Func<LeafInputDataCurve, double?> param)
|
||||
=> curves.Max(param) - curves.Min(param);
|
||||
|
||||
public double? CO2S_Range => Range(Data, curve => curve.CO2S);
|
||||
public double? PARi_Range => Range(Data, curve => curve.PARi);
|
||||
public double? Tleaf_Range => Range(Data, curve => curve.Tleaf);
|
||||
public double? PhiPS2_Range => Range(Data, curve => curve.PhiPS2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user