Search for both LeafInput and LeafInputData

This commit is contained in:
2023-02-02 09:35:22 -05:00
parent 8e16510ad9
commit 680f139aa5
24 changed files with 808 additions and 281 deletions
+5
View File
@@ -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
+18 -3
View File
@@ -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);
}
}