aw5898: fix layerdepth 10, 25, 30cm; fix nullable OM
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
This commit is contained in:
@@ -156,7 +156,7 @@ namespace FarmMapsAPI.Carbon
|
||||
Crop = cropYear.MiterraCropName,
|
||||
CropRes = cropYear.CropRes,
|
||||
OrganicManures =
|
||||
cropYear.OrganicManures.Where(y=>y.Quantity > 0 && !string.IsNullOrEmpty(y.Type)).Select(x => new OrganicManureType { Type = x.Type, Quantity = x.Quantity }).ToList(),
|
||||
cropYear.OrganicManures.Where(y=>y.Quantity > 0 && !string.IsNullOrEmpty(y.Type)).Select(x => new OrganicManureType { Type = x.Type, Quantity = x.Quantity.HasValue? x.Quantity.Value : 0 }).ToList(),
|
||||
CropYield = cropYear.CropYield,
|
||||
Irrigation = crops.Irrigations} }
|
||||
});
|
||||
@@ -171,9 +171,9 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
foreach (var manure in cropYear.OrganicManures)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(manure.Type) && manure.Quantity > 0)
|
||||
if (!string.IsNullOrEmpty(manure.Type) && manure.Quantity.HasValue && manure.Quantity > 0)
|
||||
{
|
||||
orgManure.Add(new OrganicManureType { Type = manure.Type, Quantity = manure.Quantity });
|
||||
orgManure.Add(new OrganicManureType { Type = manure.Type, Quantity = manure.Quantity.HasValue ? manure.Quantity.Value : 0 });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,9 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
soilPropertyDepth10 = true;
|
||||
}
|
||||
//FSA todo: different corrections for depth10 (10, 25, 30 cm)
|
||||
// Different corrections for depth (10, 25, 30 cm)
|
||||
// depth of 10cm has same result as previous checkbox (sample taken at 10cm)
|
||||
parameterSet.LayerDepth = item.Value.Depth.HasValue? item.Value.Depth.Value : parameterSet.LayerDepth;
|
||||
if (initialSoil == "Temp_gras" && soilPropertyDepth10)
|
||||
{
|
||||
oM_corr_SoilType.Add((item.Key, soilOfItem), item.Value.OM_Cont * 0.97);
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
[Required]
|
||||
public string Type { get; set; }
|
||||
[Required]
|
||||
public double Quantity { get; set; }
|
||||
public double? Quantity { get; set; }
|
||||
}
|
||||
|
||||
public class SoilPropertyFarmMaps
|
||||
|
||||
Reference in New Issue
Block a user