aw5832: fix om_choice
Some checks are pending
FarmMaps/CarbonLib/pipeline/head This commit looks good
FarmMaps.Develop/CarbonLib/pipeline/head Build queued...

This commit is contained in:
2024-01-25 11:17:04 +01:00
parent c73560db61
commit f12a1c5a82
3 changed files with 7 additions and 3 deletions

View File

@@ -139,7 +139,7 @@ namespace FarmMapsAPI.Carbon
Area = cropField.Area,
HistoricalCropData = mappedCropData,
SoilType = MapSoil(cropField.SoilType),
SoilProperty = new SoilProperty { Clay_Content = cropField.SoilProperty.Clay_Content, OM_Const = cropField.SoilProperty.OM_Const, Depth10 = cropField.SoilProperty.Depth10, Depth = cropField.SoilProperty.Depth, OM_Type = cropField.SoilProperty.OM_Type },
SoilProperty = new SoilProperty { Clay_Content = cropField.SoilProperty.Clay_Content, OM_Const = cropField.SoilProperty.OM_Const, Depth10 = cropField.SoilProperty.Depth10, Depth = cropField.SoilProperty.Depth, OM_Choice = cropField.SoilProperty.OM_Choice },
GreenManures = greenManures
});
foreach (var crops in cropField.HistoricalCropData)
@@ -240,6 +240,10 @@ namespace FarmMapsAPI.Carbon
var year = GetYears(farmInputSet, farmInput);
var carbon_organicmatter_factor = 0.54;
if (farmInput.CropFields[0].SoilProperty.OM_Choice == "c")
{
carbon_organicmatter_factor = 1;
}
//////////////////////////////////////////////
// precalculations

View File

@@ -36,7 +36,7 @@ namespace CarbonService.Models
public class SoilProperty
{
public double? OM_Const { get; set; }
public string OM_Type { get; set; }
public string OM_Choice { get; set; }
public double? Clay_Content { get; set; }
public bool? Depth10 { get; set; }
public int? Depth { get; set; }

View File

@@ -76,7 +76,7 @@ namespace FarmMapsAPI.Carbon.Models
public class SoilPropertyFarmMaps
{
public double? OM_Const { get; set; }
public string OM_Type { get; set; }
public string OM_Choice { get; set; }
public double? Clay_Content { get; set; }
public bool Depth10 { get; set; }
public int? Depth { get; set; }