From 1248a4aa1d6c62a9dce116cda3008ef7d1ba11a7 Mon Sep 17 00:00:00 2001 From: jenkins Date: Thu, 25 Jan 2024 10:17:55 +0000 Subject: [PATCH 1/5] [ci skip] Changed by Jenkins: 37 --- CarbonLib.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CarbonLib.csproj b/CarbonLib.csproj index e7be04f..2fd7200 100644 --- a/CarbonLib.csproj +++ b/CarbonLib.csproj @@ -8,7 +8,7 @@ false false false - 4.2.4 + 4.2.5 From be2efc373573634582e3d60b9af9907de073aba4 Mon Sep 17 00:00:00 2001 From: jenkins Date: Thu, 25 Jan 2024 10:19:44 +0000 Subject: [PATCH 2/5] Changed by Jenkins: 38 --- CarbonLib.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CarbonLib.csproj b/CarbonLib.csproj index 2fd7200..3c2bd97 100644 --- a/CarbonLib.csproj +++ b/CarbonLib.csproj @@ -8,12 +8,12 @@ false false false - 4.2.5 + 4.2.6 - + From 04cd57e4db95bc9ea2ca226973b4a0c9aa2c4891 Mon Sep 17 00:00:00 2001 From: jenkins Date: Thu, 25 Jan 2024 10:26:59 +0000 Subject: [PATCH 3/5] [ci skip] Changed by Jenkins: 39 --- CarbonLib.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CarbonLib.csproj b/CarbonLib.csproj index 3c2bd97..098e0fa 100644 --- a/CarbonLib.csproj +++ b/CarbonLib.csproj @@ -8,7 +8,7 @@ false false false - 4.2.6 + 4.2.7 From 4c8105ef9a099aabda6e3e962b74263b14bbf683 Mon Sep 17 00:00:00 2001 From: Francisco Salas Date: Mon, 19 Feb 2024 11:55:14 +0100 Subject: [PATCH 4/5] aw5898: fix layerdepth 10, 25, 30cm; fix nullable OM --- CarbonCalculation.cs | 12 +++++++----- Models/FarmMapsCarbonRequest.cs | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CarbonCalculation.cs b/CarbonCalculation.cs index a549e38..89f5e03 100644 --- a/CarbonCalculation.cs +++ b/CarbonCalculation.cs @@ -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 }); } } } @@ -244,7 +244,7 @@ namespace FarmMapsAPI.Carbon { carbon_organicmatter_factor = 1; } - + ////////////////////////////////////////////// // precalculations ////////////////////////////////////////////// @@ -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); diff --git a/Models/FarmMapsCarbonRequest.cs b/Models/FarmMapsCarbonRequest.cs index ce19286..fcd2e29 100644 --- a/Models/FarmMapsCarbonRequest.cs +++ b/Models/FarmMapsCarbonRequest.cs @@ -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 From 5355ff07a6203f48a0f2802e7faff007780438c8 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 19 Feb 2024 10:56:02 +0000 Subject: [PATCH 5/5] [ci skip] Changed by Jenkins: 40 --- CarbonLib.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CarbonLib.csproj b/CarbonLib.csproj index 098e0fa..e4562b6 100644 --- a/CarbonLib.csproj +++ b/CarbonLib.csproj @@ -8,7 +8,7 @@ false false false - 4.2.7 + 4.2.8