From 51dee60e764c4507dd0d29e8740853b42d64ea80 Mon Sep 17 00:00:00 2001 From: Francisco Salas Date: Thu, 19 Oct 2023 11:33:33 +0200 Subject: [PATCH 1/6] aw5600: added fields to interface --- CarbonCalculation.cs | 12 +++++++----- CarbonLib.csproj | 2 +- Models/CarbonRequest.cs | 4 +++- Models/FarmMapsCarbonRequest.cs | 1 + 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CarbonCalculation.cs b/CarbonCalculation.cs index ce84d9f..94e88d2 100644 --- a/CarbonCalculation.cs +++ b/CarbonCalculation.cs @@ -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; diff --git a/CarbonLib.csproj b/CarbonLib.csproj index e9c8846..1d8fcba 100644 --- a/CarbonLib.csproj +++ b/CarbonLib.csproj @@ -8,7 +8,7 @@ false false false - 2.2.0 + 2.3.0 diff --git a/Models/CarbonRequest.cs b/Models/CarbonRequest.cs index 5ab21ad..7b4b5ec 100644 --- a/Models/CarbonRequest.cs +++ b/Models/CarbonRequest.cs @@ -30,7 +30,7 @@ namespace CarbonService.Models public SoilProperty SoilProperty { get; set; } [Required] public List HistoricalCropData { get; set; } - public List GreenManures { get; set; } + public List GreenManures { get; set; } } public class SoilProperty @@ -38,6 +38,7 @@ namespace CarbonService.Models public double? OM_Const { get; set; } public double? Clay_Content { get; set; } public bool? Depth10 { get; set; } + public int? Depth { get; set; } } public class OrgManureApplied @@ -49,6 +50,7 @@ namespace CarbonService.Models public List OrganicManures { get; set; } public double? CropYield { get { return (int?)yield; } set { yield = value; } } public bool CropRes { get; set; } + public string Irrigation { get; set; } } public class OrganicManureType diff --git a/Models/FarmMapsCarbonRequest.cs b/Models/FarmMapsCarbonRequest.cs index 59cd896..4cd8578 100644 --- a/Models/FarmMapsCarbonRequest.cs +++ b/Models/FarmMapsCarbonRequest.cs @@ -44,6 +44,7 @@ namespace FarmMapsAPI.Carbon.Models public List Crops { get; set; } public List GreenManures { get; set; } public bool Rotation { get; set; } + public string Irrigations { get; set; } public HistoricalCropDataFarmMaps DeepCopy() { From 4f21c4d0d889d39bbd053fdc29b01cf1d1fbc384 Mon Sep 17 00:00:00 2001 From: jenkins Date: Thu, 19 Oct 2023 09:34:31 +0000 Subject: [PATCH 2/6] [ci skip] Changed by Jenkins: 61 --- CarbonLib.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CarbonLib.csproj b/CarbonLib.csproj index 1d8fcba..7eb7be2 100644 --- a/CarbonLib.csproj +++ b/CarbonLib.csproj @@ -8,7 +8,7 @@ false false false - 2.3.0 + 4.0.0 From 7f5f676fffc1e21f60457cd0cbb4fbf447f11778 Mon Sep 17 00:00:00 2001 From: Francisco Salas Date: Thu, 19 Oct 2023 16:12:02 +0200 Subject: [PATCH 3/6] aw5600: added fields to interface --- CarbonCalculation.cs | 2 +- Models/CarbonRequest.cs | 1 + Models/FarmMapsCarbonRequest.cs | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CarbonCalculation.cs b/CarbonCalculation.cs index 94e88d2..37aa240 100644 --- a/CarbonCalculation.cs +++ b/CarbonCalculation.cs @@ -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 }, + 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 }, GreenManures = greenManures }); foreach (var crops in cropField.HistoricalCropData) diff --git a/Models/CarbonRequest.cs b/Models/CarbonRequest.cs index 7b4b5ec..e721e6c 100644 --- a/Models/CarbonRequest.cs +++ b/Models/CarbonRequest.cs @@ -36,6 +36,7 @@ namespace CarbonService.Models public class SoilProperty { public double? OM_Const { get; set; } + public string OM_Type { get; set; } public double? Clay_Content { get; set; } public bool? Depth10 { get; set; } public int? Depth { get; set; } diff --git a/Models/FarmMapsCarbonRequest.cs b/Models/FarmMapsCarbonRequest.cs index 4cd8578..1eaa5d9 100644 --- a/Models/FarmMapsCarbonRequest.cs +++ b/Models/FarmMapsCarbonRequest.cs @@ -76,8 +76,10 @@ namespace FarmMapsAPI.Carbon.Models public class SoilPropertyFarmMaps { public double? OM_Const { get; set; } + public string OM_Type { get; set; } public double? Clay_Content { get; set; } public bool Depth10 { get; set; } + public int? Depth { get; set; } } public class GreenManureTypeFarmMaps From 1aa440072106ba90a9d90b6278e1cb9d5a2d61c2 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Fri, 20 Oct 2023 12:00:17 +0000 Subject: [PATCH 4/6] Update Jenkinsfile.develop --- Jenkinsfile.develop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.develop b/Jenkinsfile.develop index cc02489..c1766dd 100644 --- a/Jenkinsfile.develop +++ b/Jenkinsfile.develop @@ -4,7 +4,7 @@ pipeline { agent any; options { copyArtifactPermission projectNames: env.allProjectsArtifactPermission; - disableConcurrentBuilds abortPrevious: true; + disableConcurrentBuilds(); } triggers { upstream( From f745d4e66092cfc6b9c9370bc29a3fcc387ab911 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Fri, 20 Oct 2023 12:00:28 +0000 Subject: [PATCH 5/6] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0893400..8334a1b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { agent any; options { copyArtifactPermission projectNames: env.allProjectsArtifactPermission; - disableConcurrentBuilds abortPrevious: true; + disableConcurrentBuilds(); } triggers { upstream( From b18c7f73a98fa36f0679b9957cdc8a14d7f5c5b3 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 23 Oct 2023 08:11:30 +0000 Subject: [PATCH 6/6] [ci skip] Changed by Jenkins: 65 --- CarbonLib.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CarbonLib.csproj b/CarbonLib.csproj index 7eb7be2..9053ddd 100644 --- a/CarbonLib.csproj +++ b/CarbonLib.csproj @@ -12,8 +12,8 @@ - - + +