57 lines
2.1 KiB
C#
57 lines
2.1 KiB
C#
using AutoMapper;
|
|
using LeafWeb.Core.Entities;
|
|
|
|
namespace LeafWeb.WebCms.Models
|
|
{
|
|
public class LeafInputDataCurveViewModel
|
|
{
|
|
/// <summary>Sample CO2 concentration</summary>
|
|
public double? CO2S { get; set; }
|
|
|
|
/// <summary> PAR measured by the in-chamber quantum sensor</summary>
|
|
public double? PARi { get; set; }
|
|
|
|
/// <summary>temperature of leaf thermocouple</summary>
|
|
public double? Tleaf { get; set; }
|
|
|
|
/// <summary>DeltaF/Fm, the fraction of absorbed PSII photons that are used in photochemistry</summary>
|
|
public double? PhiPS2 { get; set; }
|
|
public LeafInputDataCurveViewModel() {}
|
|
|
|
static LeafInputDataCurveViewModel()
|
|
{
|
|
Mapper.CreateMap<LeafInputData, LeafInputDataCurveViewModel>()
|
|
.ForMember(m => m.CO2S,
|
|
conf =>
|
|
conf.MapFrom(d =>
|
|
LeafInputData.Range(d.Data, c => c.CO2S)))
|
|
.ForMember(m => m.PARi,
|
|
conf =>
|
|
conf.MapFrom(d =>
|
|
LeafInputData.Range(d.Data, c => c.PARi)))
|
|
.ForMember(m => m.Tleaf,
|
|
conf =>
|
|
conf.MapFrom(d =>
|
|
LeafInputData.Range(d.Data, c => c.Tleaf)))
|
|
.ForMember(m => m.PhiPS2,
|
|
conf =>
|
|
conf.MapFrom(d =>
|
|
LeafInputData.Range(d.Data, c => c.PhiPS2)))
|
|
;
|
|
}
|
|
|
|
public LeafInputDataCurveViewModel(LeafInputDataCurve leafInputDataCurve)
|
|
{
|
|
Mapper.Map(leafInputDataCurve, this);
|
|
}
|
|
|
|
public LeafInputDataCurveViewModel(LeafInputData leafInputData)
|
|
{
|
|
Mapper.Map(leafInputData, this);
|
|
//CO2S = LeafInputData.Range(dataCurves, c => c.CO2S);
|
|
//PARi = LeafInputData.Range(dataCurves, c => c.PARi);
|
|
//Tleaf = LeafInputData.Range(dataCurves, c => c.Tleaf);
|
|
//PhiPS2 = LeafInputData.Range(dataCurves, c => c.PhiPS2);
|
|
}
|
|
}
|
|
} |