aw5600: added fields to interface
Some checks reported warnings
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable

This commit is contained in:
2023-10-19 11:33:33 +02:00
parent 98db16fc7e
commit 51dee60e76
4 changed files with 12 additions and 7 deletions

View File

@@ -141,9 +141,9 @@ namespace FarmMapsAPI.Carbon
SoilType = MapSoil(cropField.SoilType),
SoilProperty = new SoilProperty { Clay_Content = cropField.SoilProperty.Clay_Content, OM_Const = cropField.SoilProperty.OM_Const, Depth10 = cropField.SoilProperty.Depth10 },
GreenManures = greenManures
});
});
foreach (var crops in cropField.HistoricalCropData)
{
{
foreach (var cropYear in crops.Crops)
{
if (!string.IsNullOrEmpty(cropYear.MiterraCropName))
@@ -157,8 +157,9 @@ namespace FarmMapsAPI.Carbon
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(),
CropYield = cropYear.CropYield } }
});
CropYield = cropYear.CropYield,
Irrigation = crops.Irrigations} }
});
}
else
{
@@ -265,6 +266,7 @@ namespace FarmMapsAPI.Carbon
var initialSoilKey = historicalCropdata.Keys.FirstOrDefault(x => x.Item1 == item.Key && x.Item2 == year.First());
var initialSoil = historicalCropdata[initialSoilKey].FirstOrDefault();
var soilPropertyDepth10 = item.Value.Depth10;
//FSA todo: different corrections for depth10 (10, 25, 30 cm)
if (initialSoil == "Temp_gras" && soilPropertyDepth10)
{
oM_corr_SoilType.Add((item.Key, soilOfItem), item.Value.OM_Cont * 0.97);
@@ -778,7 +780,7 @@ namespace FarmMapsAPI.Carbon
{
smdMaxValue = smdMax[climateItem.Key] / 1.8;
}
//fsa todo: add precipitation
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration;
result = result < 0 ? result : 0;
result = result < smdMaxValue ? smdMaxValue : result;