using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using LeafWeb.Core.Utility; namespace LeafWeb.Core.Entities { /// /// Descriptive information about the investigator, /// contact information, the site,the sample leaf and its general environmental condition /// public class LeafInputData { [ForeignKey("LeafOutputFile")] public int Id { get; set; } public virtual LeafInputDataSite Site { get; set; } public virtual LeafInputDataPhotosynthetic Photosynthetic { get; set; } public virtual ICollection Data { get; set; } /// /// Leaf Input set this data belongs to /// public virtual LeafInput LeafInput { get; set; } /// /// Output file this data was parsed from - the cleaned input from Piscal /// public virtual LeafOutputFile LeafOutputFile { get; set; } [ParseInfo(1, exampleValue: "First and last name")] public string InvestigatorName { get; set; } [ParseInfo(2, exampleValue: "Your email / mail addresses")] public string ContactInformation { get; set; } [ParseInfo(3, alternateTitle: "Site name in full", exampleValue: "Your site's identifier / name")] public string SiteName { get; set; } [ParseInfo(4, exampleValue: "Mixed forest / grasslands / croplands/ etc")] public string VegetationType { get; set; } [ParseInfo(5, exampleValue: "Soil type at your site")] public string SoilType { get; set; } [ParseInfo(6, exampleValue: "List of major species at the site")] public string MajorSpecies { get; set; } [ParseInfo(7, alternateTitle: "Sample leaf light environment", exampleValue: "The general light environment in which the leaf is in (e.g. heavily shaded from above)")] public string SampleLeafLightEnv { get; set; } [ParseInfo(8, exampleValue: "Indicate whether there is water stress at the time of sampling")] public string WaterStressAssessment { get; set; } [ParseInfo(9, exampleValue: "For example - Licor-6400")] public string InstrumentUsed { get; set; } [ParseInfo(10, exampleValue: "Any extra information you feel would be helpful to put the sampled leaf in context")] public string ExtraInfo { get; set; } /// /// Utility method for calculating the range of values in the curves /// public static double? Range( ICollection curves, Func 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); } }