101 Commits

Author SHA1 Message Date
b149eec39c Merged develop into master
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-06-11 11:12:11 +02:00
jenkins
8823db6340 [ci skip] Updated project references #92
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-06-03 10:41:08 +00:00
jenkins
94fc762de6 [ci skip] Updated project references #62
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-05-24 00:09:24 +00:00
jenkins
c1d200f1af Updated project references #61
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-05-23 23:39:41 +00:00
jenkins
09983e5d28 [ci skip] Updated project references #60
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-05-23 23:09:56 +00:00
jenkins
b42fa7f658 Updated project references #59
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-05-23 22:44:56 +00:00
jenkins
0b7e30d301 Updated project references #56
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-05-23 11:32:48 +00:00
jenkins
253a76e061 [ci skip] Updated project references #55
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-04-23 23:24:45 +00:00
jenkins
2ddd2e4b13 Updated project references #54
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-04-23 22:59:42 +00:00
jenkins
b5e0e049a2 [ci skip] Updated project references #53
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-04-23 22:33:39 +00:00
jenkins
00cad173c6 Updated project references #52
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-04-23 22:09:42 +00:00
jenkins
15656a964a [ci skip] Updated project references #52
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-03-19 17:57:23 +00:00
jenkins
bba50c65b1 [ci skip] Updated project references #51
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-03-19 17:31:19 +00:00
jenkins
3b5afbc5a9 Updated project references #50
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-03-19 16:56:00 +00:00
jenkins
cfacd6def4 [ci skip] Updated project references #49
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-03-19 16:32:19 +00:00
jenkins
34a94d858e Updated project references #48
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-03-19 16:15:43 +00:00
jenkins
0870637575 [ci skip] Updated project references #90
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-03-02 08:21:00 +00:00
jenkins
74eafbf3a3 Updated project references #89
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-03-02 07:55:56 +00:00
jenkins
4ce165ab9d [ci skip] Updated project references #86
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-03-01 18:30:43 +00:00
jenkins
0b2209a074 Updated project references #85
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-03-01 18:13:46 +00:00
jenkins
a37dab3540 [ci skip] Updated project references #82
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-03-01 15:43:44 +00:00
jenkins
03da80f6c0 Updated project references #81
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-03-01 15:26:39 +00:00
jenkins
83d955d027 [ci skip] Changed by Jenkins: 79
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-02-23 09:53:10 +00:00
jenkins
bb4be25e43 [ci skip] Changed by Jenkins: 46
Some checks reported errors
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-02-23 09:40:32 +00:00
095fa8d572 aw5919: fix casing corn crop mix
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-02-23 10:39:45 +01:00
jenkins
0e0c9a7539 [ci skip] Changed by Jenkins: 45
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-02-22 12:29:18 +00:00
jenkins
1eca28a511 Changed by Jenkins: 44
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-02-22 12:03:01 +00:00
jenkins
681329ffa5 [ci skip] Changed by Jenkins: 43
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-02-22 11:38:29 +00:00
jenkins
e7408d3eb5 Changed by Jenkins: 42
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-02-22 11:27:25 +00:00
jenkins
43d5916aff [ci skip] Changed by Jenkins: 41
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-02-22 07:27:01 +00:00
fd0a3fa292 jenkins you foul
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-02-19 13:15:54 +01:00
1641cd83e0 merged from master
Some checks reported errors
FarmMaps.Develop/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-02-19 13:00:49 +01:00
jenkins
5355ff07a6 [ci skip] Changed by Jenkins: 40
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-02-19 10:56:02 +00:00
4c8105ef9a aw5898: fix layerdepth 10, 25, 30cm; fix nullable OM
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-02-19 11:55:14 +01:00
17ba32bda1 Aw5837 Remove redudant ref
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-02-02 13:54:31 +01:00
jenkins
e9e236ff5b [ci skip] Changed by Jenkins: 76
Some checks reported errors
FarmMaps.Develop/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-01-25 11:11:52 +00:00
jenkins
d32d334302 Changed by Jenkins: 75
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-01-25 10:48:48 +00:00
jenkins
04cd57e4db [ci skip] Changed by Jenkins: 39
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-01-25 10:26:59 +00:00
jenkins
be2efc3735 Changed by Jenkins: 38
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-01-25 10:19:44 +00:00
jenkins
1248a4aa1d [ci skip] Changed by Jenkins: 37
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-01-25 10:17:55 +00:00
f12a1c5a82 aw5832: fix om_choice
Some checks are pending
FarmMaps/CarbonLib/pipeline/head This commit looks good
FarmMaps.Develop/CarbonLib/pipeline/head Build queued...
2024-01-25 11:17:04 +01:00
jenkins
c73560db61 [ci skip] Changed by Jenkins: 36
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-01-24 15:23:53 +00:00
jenkins
45bd471bdf Changed by Jenkins: 35
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-01-24 14:56:42 +00:00
jenkins
8aceaf5fd2 [ci skip] Changed by Jenkins: 34
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-01-24 14:29:03 +00:00
jenkins
97b42c09f3 Changed by Jenkins: 33
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-01-24 14:05:58 +00:00
5c40805a3b merged from master
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-01-23 14:40:26 +01:00
jenkins
7cd8dd403b [ci skip] Changed by Jenkins: 32
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-01-23 13:01:21 +00:00
e9f35daf03 aw5820: fix prod: fill object even if C_input_CropRes is 0
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-01-23 14:00:19 +01:00
jenkins
19491f1077 [ci skip] Changed by Jenkins: 74
Some checks reported errors
FarmMaps.Develop/CarbonLib/pipeline/head Something is wrong with the build of this commit
2023-11-27 08:23:38 +00:00
8efa6558c6 aw5598, 5599, 5600, 5601: several carbon changes
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-11-27 09:22:55 +01:00
jenkins
dd993a3583 Changed by Jenkins: 69
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-11-16 17:17:59 +00:00
jenkins
3034bae61e [ci skip] Changed by Jenkins: 32
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2023-11-16 15:09:49 +00:00
jenkins
4c491bd581 [ci skip] Changed by Jenkins: 31
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2023-11-16 14:21:14 +00:00
jenkins
90787a8fba Changed by Jenkins: 30
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-11-16 13:55:25 +00:00
jenkins
aef26080ba [ci skip] Changed by Jenkins: 29
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-11-16 13:32:22 +00:00
jenkins
800632d20d Changed by Jenkins: 28
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-11-16 13:21:54 +00:00
jenkins
c209f011a0 Changed by Jenkins: 66
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-11-16 13:11:02 +00:00
Willem Dantuma
5392ab24cc Merge remote-tracking branch 'origin/develop'
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-11-08 10:05:38 +01:00
jenkins
b18c7f73a9 [ci skip] Changed by Jenkins: 65
Some checks reported errors
FarmMaps.Develop/CarbonLib/pipeline/head Something is wrong with the build of this commit
2023-10-23 08:11:30 +00:00
f745d4e660 Update Jenkinsfile
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-10-20 12:00:28 +00:00
1aa4400721 Update Jenkinsfile.develop 2023-10-20 12:00:17 +00:00
c39096ce6f Update Jenkinsfile.develop
Some checks failed
FarmMaps/CarbonLib/pipeline/head There was a failure building this commit
2023-10-20 12:00:07 +00:00
b69027edf2 Update Jenkinsfile 2023-10-20 11:59:57 +00:00
7f5f676fff aw5600: added fields to interface
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-10-19 16:12:02 +02:00
jenkins
4f21c4d0d8 [ci skip] Changed by Jenkins: 61
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-10-19 09:34:31 +00:00
51dee60e76 aw5600: added fields to interface
Some checks reported warnings
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable
2023-10-19 11:33:33 +02:00
98db16fc7e Merge branch 'develop'
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-10-11 10:44:47 +02:00
0f24014de0 Update CarbonLib.csproj
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
++version
2023-10-11 08:42:44 +00:00
bd2d025164 Update CarbonLib.csproj
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-10-11 08:42:12 +00:00
jenkins
cc4cde76cb [ci skip] Changed by Jenkins: 23
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-08-04 14:42:39 +00:00
jenkins
b6c0628682 [ci skip] Changed by Jenkins: 56
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-08-04 14:32:12 +00:00
jenkins
4b9d2e6e05 [ci skip] Changed by Jenkins: 55
Some checks reported warnings
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable
2023-08-04 14:25:42 +00:00
jenkins
e22878ccdb [ci skip] Changed by Jenkins: 53
Some checks reported warnings
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable
2023-07-31 08:38:50 +00:00
jenkins
0142c17e2a [ci skip] Changed by Jenkins: 19
Some checks reported warnings
FarmMaps/CarbonLib/pipeline/head This commit is unstable
2023-07-30 12:34:12 +00:00
jenkins
a811e8eaf7 [ci skip] Changed by Jenkins: 49
Some checks reported warnings
FarmMaps/CarbonLib/pipeline/head This commit is unstable
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable
2023-07-30 09:03:18 +00:00
62145b9569 AW-5371 Release 2023.08 libraries
Some checks reported warnings
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable
2023-07-30 10:48:46 +02:00
58c84bc13d Merge branch 'master' into develop
# Conflicts:
#	CarbonLib.csproj
2023-07-30 10:48:02 +02:00
jenkins
dd44069132 [ci skip] Changed by Jenkins: 47
Some checks reported errors
FarmMaps.Develop/CarbonLib/pipeline/head Something is wrong with the build of this commit
2023-07-30 08:06:15 +00:00
jenkins
c96d751e2e [ci skip] Changed by Jenkins: 45
Some checks reported warnings
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable
2023-07-30 07:59:26 +00:00
jenkins
a8e55457a5 [ci skip] Changed by Jenkins: 43
Some checks reported warnings
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable
2023-07-28 12:22:51 +00:00
jenkins
f0caa9e1db [ci skip] Changed by Jenkins: 41
Some checks reported warnings
FarmMaps.Develop/CarbonLib/pipeline/head This commit is unstable
2023-07-28 12:03:25 +00:00
jenkins
12923be93e [ci skip] Changed by Jenkins: 38
Some checks failed
FarmMaps.Develop/CarbonLib/pipeline/head There was a failure building this commit
2023-07-28 10:09:53 +00:00
jenkins
046d681b25 [ci skip] Changed by Jenkins: 37
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-07-28 09:32:16 +00:00
jenkins
34d0d86bd5 [ci skip] Changed by Jenkins: 12
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-07-26 14:55:54 +00:00
6e8e8db12e jenkins
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-07-26 16:55:18 +02:00
f5ec4204fe aw5277: restore previous libs
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-06-27 08:32:38 +02:00
2d5fb1a48a Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/CarbonLib into develop
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-06-26 20:54:00 +02:00
c217195605 aw5277: new weather csv 2023-06-26 20:53:25 +02:00
7aeff96eed Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/CarbonLib into develop
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-06-26 16:53:53 +02:00
96906d57cf Fix jenkins 2023-06-26 16:53:40 +02:00
jenkins
1810b0005a [ci skip] Changed by Jenkins: 33
Some checks failed
FarmMaps.Develop/CarbonLib/pipeline/head There was a failure building this commit
2023-06-26 14:49:31 +00:00
53f79ce16a Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/CarbonLib into develop
Some checks failed
FarmMaps.Develop/CarbonLib/pipeline/head There was a failure building this commit
2023-06-26 16:48:54 +02:00
e95e29a96a jenkins 2023-06-26 16:48:44 +02:00
Willem Dantuma
ea976842cd Update libs
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
FarmMaps/CarbonLib/pipeline/head This commit looks good
2023-06-12 12:15:31 +02:00
f1342b118f AW-5037 Acl migration
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-05-10 15:10:38 +02:00
aa59a17a7c aw5006: upgrade to .net6
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2023-04-26 14:17:50 +02:00
Willem Dantuma
fb2b34d7ff Update libs
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2022-08-25 15:53:48 +02:00
Willem Dantuma
a00353f464 Update libs kick version
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
FarmMaps/CarbonLib/pipeline/head This commit looks good
2022-07-27 09:53:03 +02:00
7bfe3d1e50 aw3843: fix correction
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
FarmMaps/CarbonLib/pipeline/head This commit looks good
2022-06-03 12:58:19 +02:00
e8d328d6c2 aw3843: correction on SMDMax
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2022-06-03 11:25:01 +02:00
b0ac42a957 aw3831: fix yield with decimal
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2022-05-26 10:24:43 +02:00
13 changed files with 5276 additions and 197 deletions

1
.gitignore vendored
View File

@@ -362,3 +362,4 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
upstreamProjects/

View File

@@ -139,11 +139,11 @@ 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_Choice = cropField.SoilProperty.OM_Choice },
GreenManures = greenManures
});
});
foreach (var crops in cropField.HistoricalCropData)
{
{
foreach (var cropYear in crops.Crops)
{
if (!string.IsNullOrEmpty(cropYear.MiterraCropName))
@@ -156,9 +156,10 @@ 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(),
CropYield = cropYear.CropYield } }
});
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} }
});
}
else
{
@@ -170,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 });
}
}
}
@@ -214,12 +215,6 @@ namespace FarmMapsAPI.Carbon
public double? GetCropYield(string cropCode, int year, int postalCode)
{
string provinceCode = GetProvinceCode(dataTransformationSet, postalCode);
//var cropMapping = mappingCropFarmmapsMiterraRothC.FirstOrDefault(x => x.CropCode == cropCode);
//if (cropMapping == null)
//{
// return 0;
//}
//var crpYield = cropYieldConfig.SingleOrDefault(x => x.CropName.ToLower() == cropMapping.MiterraRothCCrop.ToLower());
var crpYield = cropYieldConfig.SingleOrDefault(x => x.CropName.ToLower() == cropCode.ToLower());
var crpYieldProvince = crpYield.Yields.SingleOrDefault(x => x.ProvinceCode == provinceCode);
var cropYield = crpYieldProvince.YearData.SingleOrDefault(x => x.Year == year)?.YieldValue;
@@ -244,6 +239,12 @@ 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
//////////////////////////////////////////////
@@ -264,7 +265,6 @@ namespace FarmMapsAPI.Carbon
item.Value.OM_Corr = sumCorr;
}
//var oM_corr_SoilType = new Dictionary<string, List<ColumnValue>>();
var oM_corr_SoilType = new Dictionary<(string,string), double>();
foreach (var item in soilPropertiesField)
{
@@ -272,6 +272,13 @@ 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;
if (item.Value.Depth.HasValue && item.Value.Depth.Value == 10)
{
soilPropertyDepth10 = true;
}
// 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);
@@ -546,7 +553,7 @@ namespace FarmMapsAPI.Carbon
newValue = 0.024 * item.Value + 0.228;
valueList.Add(new ColumnValue(item.Key, newValue));
break;
case "Corn_Cob_mix":
case "Corn_cob_mix":
newValue = 0.024 * item.Value + 0.228;
valueList.Add(new ColumnValue(item.Key, newValue));
break;
@@ -647,11 +654,7 @@ namespace FarmMapsAPI.Carbon
foreach (var crop in cropArea.Value)
{
var cInputCropRes = cropPropertyConfig.SingleOrDefault(s => s.Name.ToLower() == crop.Key.ToLower())?.C_input_CropRes ?? 0.0;
if (cInputCropRes > 0)
{
carbonInputs.AddValue((cropArea.Key.Item1, cropArea.Key.Item2, crop.Key), "CarbonResidues", cInputCropRes);
}
carbonInputs.AddValue((cropArea.Key.Item1, cropArea.Key.Item2, crop.Key), "CarbonResidues", cInputCropRes);
if (cropSet.StrawCrops.Any(x => x.StrawCrop.ToLower() == crop.Key.ToLower()))
{
@@ -753,7 +756,7 @@ namespace FarmMapsAPI.Carbon
coverModFactor.Add(crpCover.CropName, valueList);
}
// SMDMax (kan buiten yearLoop)
// SMDMax
// field, crop
var smdMax = new Dictionary<string, double>();
foreach (var soil in soilPropertiesField)
@@ -762,7 +765,7 @@ namespace FarmMapsAPI.Carbon
smdMax.Add(soil.Key, result);
}
// SMDaccMonthi (kan buiten yearLoop ??)
// SMDaccMonthi
var smdAccMonthi = new Dictionary<string, List<ColumnValue>>();
foreach (var climateItem in climateVariable)
@@ -772,16 +775,63 @@ namespace FarmMapsAPI.Carbon
{
if (i == 0)
{
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration;
/* smdMax met factor maand corrigeren
SMDmax(Field,Crop,AllMonths) = ifthen(CropCoverMonths(Crop,AllMonths)=1,
SMDmax(Field,Crop,AllMonths),SMDmax(Field,Crop,AllMonths)/1.8);
*/
var crop = cropAreaField1.SingleOrDefault(x => x.Key.Item2 == loopYear).Value[0].Key;
var cover = cropCoverMonthConfig.SingleOrDefault(x => x.CropName.ToLower() == crop.ToLower())?.CoverMonths;
var hasCover = cover.Any(x => x == $"M{i + 1}");
var smdMaxValue = smdMax[climateItem.Key];
if (!hasCover)
{
smdMaxValue = smdMax[climateItem.Key] / 1.8;
}
//fsa todo: add precipitation
var irrigation = 0;
var irrigations = farmInput.CropFields[0].HistoricalCropData.SingleOrDefault(x => x.Year == loopYear).Crops[0].Irrigation;
if (!string.IsNullOrEmpty(irrigations))
{
var irrigationArray = irrigations.Split(',');
if (irrigationArray.Length > i)
{
irrigation = string.IsNullOrEmpty(irrigationArray[i]) ? 0 : Convert.ToInt16(irrigationArray[i]);
}
}
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration + irrigation;
result = result < 0 ? result : 0;
result = result < smdMax[climateItem.Key] ? smdMax[climateItem.Key] : result;
result = result < smdMaxValue ? smdMaxValue : result;
valueList.Add(new ColumnValue("M1", result));
}
else
{
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration + valueList.SingleOrDefault(x => x.Key == $"M{i}").Value;
/* smdMax met factor maand corrigeren
SMDmax(Field,Crop,AllMonths) = ifthen(CropCoverMonths(Crop,AllMonths)=1,
SMDmax(Field,Crop,AllMonths),SMDmax(Field,Crop,AllMonths)/1.8);
*/
var crop = cropAreaField1.SingleOrDefault(x => x.Key.Item2 == loopYear).Value[0].Key;
var cover = cropCoverMonthConfig.SingleOrDefault(x => x.CropName.ToLower() == crop.ToLower())?.CoverMonths;
var hasCover = cover.Any(x => x == $"M{i + 1}");
var smdMaxValue = smdMax[climateItem.Key];
if (!hasCover)
{
smdMaxValue = smdMax[climateItem.Key] / 1.8;
}
var irrigation = 0;
var irrigations = farmInput.CropFields[0].HistoricalCropData.SingleOrDefault(x => x.Year == loopYear).Crops[0].Irrigation;
if (!string.IsNullOrEmpty(irrigations))
{
var irrigationArray = irrigations.Split(',');
if (irrigationArray.Length > i)
{
irrigation = string.IsNullOrEmpty(irrigationArray[i]) ? 0 : Convert.ToInt16(irrigationArray[i]);
}
}
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration + valueList.SingleOrDefault(x => x.Key == $"M{i}").Value + irrigation;
result = result < 0 ? result : 0;
result = result < smdMax[climateItem.Key] ? smdMax[climateItem.Key] : result;
result = result < smdMaxValue ? smdMaxValue : result;
valueList.Add(new ColumnValue($"M{i + 1}", result));
}
}
@@ -796,13 +846,26 @@ namespace FarmMapsAPI.Carbon
var valueList = new List<ColumnValue>();
foreach (var smdAccMonth in fieldSmdAccMonthi.Value)
{
if (smdAccMonth.Value > 0.444 * smdMax[fieldSmdAccMonthi.Key])
/* smdMax met factor maand corrigeren
SMDmax(Field,Crop,AllMonths) = ifthen(CropCoverMonths(Crop,AllMonths)=1,
SMDmax(Field,Crop,AllMonths),SMDmax(Field,Crop,AllMonths)/1.8);
*/
var crop = cropAreaField1.SingleOrDefault(x => x.Key.Item2 == loopYear).Value[0].Key;
var cover = cropCoverMonthConfig.SingleOrDefault(x => x.CropName.ToLower() == crop.ToLower())?.CoverMonths;
var hasCover = cover.Any(x => x == smdAccMonth.Key);
var smdMaxValue = smdMax[fieldSmdAccMonthi.Key];
if (!hasCover)
{
smdMaxValue = smdMax[fieldSmdAccMonthi.Key] / 1.8;
}
if (smdAccMonth.Value > 0.444 * smdMaxValue)
{
valueList.Add(new ColumnValue(smdAccMonth.Key, 1));
}
else
{
var result = (0.2 + 0.8 * ((smdMax[fieldSmdAccMonthi.Key] - smdAccMonth.Value) / (smdMax[fieldSmdAccMonthi.Key] - 0.444 * smdMax[fieldSmdAccMonthi.Key])));
var result = (0.2 + 0.8 * ((smdMaxValue - smdAccMonth.Value) / (smdMaxValue - 0.444 * smdMaxValue)));
valueList.Add(new ColumnValue(smdAccMonth.Key, result));
}
}
@@ -841,7 +904,7 @@ namespace FarmMapsAPI.Carbon
foreach (var field in cropAreaField1.Where(x => x.Key.Item2 == loopYear))
{
var valueList = new List<ColumnValue>();
var result = parameterSet.LayerDepth * bulkDens[field.Key.Item1] * oM_Corr[field.Key.Item1] * 0.54;
var result = parameterSet.LayerDepth * bulkDens[field.Key.Item1] * oM_Corr[field.Key.Item1] * carbon_organicmatter_factor;// 0.54;
foreach (var crop in field.Value)
{
valueList.Add(new ColumnValue(crop.Key, result));
@@ -1650,7 +1713,7 @@ namespace FarmMapsAPI.Carbon
var iniValue = item.Value.SingleOrDefault(x => x.Key == "IniCcontent")?.Value ?? 0;
var balanceValue = item.Value.SingleOrDefault(x => x.Key == "Balance")?.Value ?? 0;
var resultOmIni = iniValue / 0.54;
var resultOmIni = iniValue / carbon_organicmatter_factor;// 0.54;
var resultCo2 = balanceValue * (44.0 / 12.0);
item.Value.Add(new ColumnValue("OM_ini", resultOmIni));
@@ -1669,7 +1732,7 @@ namespace FarmMapsAPI.Carbon
var greenManure = item.SOC_CarbonGreenManure;
var compost = item.SOC_CarbonCompost;
item.OM_ini = iniValue / 0.54;
item.OM_ini = iniValue / carbon_organicmatter_factor;// 0.54;
item.CO2seq = balanceValue * (44.0 / 12.0);
var emision = -1 * (manure + residues + greenManure + compost - balanceValue);
@@ -1680,11 +1743,9 @@ namespace FarmMapsAPI.Carbon
// SOC_Summary_Farm
var soc_Summary_Farm = new List<FarmYearSummary>();
//carbonSummary.FarmSummary = soc_Summary_Farm;
foreach (var item in cropAreaFarm)
{
var sum = item.Value.Sum(x => x.Value);
//soc_Summary_Farm.Add(item.Key, new List<ColumnValue> { new ColumnValue("Total_crop_area", sum) });
soc_Summary_Farm.Add(new FarmYearSummary { Year = item.Key.Item2, Total_crop_area = sum });
}
@@ -1725,7 +1786,7 @@ namespace FarmMapsAPI.Carbon
var resultBal = sumBal / farmArea.Total_crop_area;
var resultIni = sumIni / farmArea.Total_crop_area;
var resultiniCc = sumInicc / farmArea.Total_crop_area;
var resultOm_Ini = resultiniCc / 0.54;
var resultOm_Ini = resultiniCc / carbon_organicmatter_factor;// 0.54;
var resultCo2 = resultBal * (44.0 / 12.0);
var resultCo2Tot = resultCo2 * farmArea.Total_crop_area;
@@ -1772,7 +1833,7 @@ namespace FarmMapsAPI.Carbon
var soilPropertiesField = new Dictionary<string, SoilPropertyType>();
foreach (var field in farmInput.CropFields)
{
soilPropertiesField.Add(field.Name, new SoilPropertyType { OM_Cont = field.SoilProperty.OM_Const.Value, Clay_Content = field.SoilProperty.Clay_Content.Value, OM_Corr = field.SoilProperty.OM_Const.Value <= 20 ? field.SoilProperty.OM_Const.Value : 0, Depth10 = field.SoilProperty.Depth10.Value });
soilPropertiesField.Add(field.Name, new SoilPropertyType { OM_Cont = field.SoilProperty.OM_Const.Value, Clay_Content = field.SoilProperty.Clay_Content.Value, OM_Corr = field.SoilProperty.OM_Const.Value <= 20 ? field.SoilProperty.OM_Const.Value : 0, Depth10 = field.SoilProperty.Depth10.Value, Depth = field.SoilProperty.Depth });
}
return soilPropertiesField;
@@ -1882,7 +1943,7 @@ namespace FarmMapsAPI.Carbon
var monthClimateList = new List<ClimateVariable>();
foreach (var month in gisSoilSet.AllMonths)
{
var climateYear = loopYear > 2020 || loopYear < 2011 ? 2012 : loopYear;
var climateYear = loopYear > 2050 || loopYear < 2011 ? 2012 : loopYear;
var monthData = climate.Single(x => x.Key.Item1 == farmZone && x.Key.Item2 == month && x.Key.Item3 == climateYear).Value;
var newMonthData = new ClimateVariable(monthData.Temperature, monthData.Precipitation, monthData.Evapotranspiration * 1.25);
monthClimateList.Add(newMonthData);
@@ -1921,11 +1982,9 @@ namespace FarmMapsAPI.Carbon
foreach (var manure in manures.GreenManureTypes)
{
var manureQ = yieldGreenManureConfig.SingleOrDefault(x => x.ManureName.ToLower() == manure.Type.ToLower());
//double manureQuality = manure.Quality == "Goed" ? manureQ.GoodQuality : manure.Quality == "Matig" ? manureQ.AverageQuality : manure.Quality == "Slecht" ? manureQ.BadQuality : 0;
double manureQuality2 = manure.Quality == Quality.Good ? manureQ.GoodQuality : manure.Quality == Quality.Average ? manureQ.AverageQuality : manure.Quality == Quality.Bad ? manureQ.BadQuality : 0;
if (manureQuality2 > 0)
{
//var yieldGreenManureRow = yieldGreenManureSheet.Rows.SingleOrDefault(x => x.Cells[0] != null && x.Cells[0].Text.ToString() == manure.Type).Cells[qColumn].Value;
carbonInputGreenManure.Add((field.Name, manures.Year), new List<ColumnValue> { new ColumnValue(manure.Type, manureQuality2) });
}
}

View File

@@ -1,83 +1,82 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>CarbonLib</AssemblyName>
<PackageId>CarbonLib</PackageId>
<RuntimeIdentifiers>win10-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>1.1.5</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Base.Core.Common" Version="1.2.2.10" />
<PackageReference Include="Base.Core.Common.Geometry" Version="1.4.0" />
<PackageReference Include="NetTopologySuite" Version="2.0.0" />
<PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="2.0.4" />
</ItemGroup>
<ItemGroup>
<None Update="config\CropCoverMonth.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropProperties.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropSets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropYield.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropYield.json.old">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Farm_input_sets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\GIS_Soil_Sets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\KNMI_data.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\ManCcont.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Mapping\MappingCropsFarmmapsMiterraRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Mapping\MappingGreenManureFarmmapsMiterraRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\ParametersRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.cpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.dbf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.prj">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.shp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.shx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\RegionSets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\SetsForDataTransformation.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\YieldGreenManure.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6</TargetFramework>
<AssemblyName>CarbonLib</AssemblyName>
<PackageId>CarbonLib</PackageId>
<RuntimeIdentifiers>win10-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>4.7.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Base.Core.Common.Geometry" Version="4.4.11" />
<PackageReference Include="NetTopologySuite" Version="2.5.0" />
<PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<None Update="config\CropCoverMonth.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropProperties.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropSets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropYield.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropYield.json.old">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Farm_input_sets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\GIS_Soil_Sets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\KNMI_data.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\ManCcont.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Mapping\MappingCropsFarmmapsMiterraRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Mapping\MappingGreenManureFarmmapsMiterraRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\ParametersRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.cpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.dbf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.prj">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.shp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.shx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\RegionSets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\SetsForDataTransformation.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\YieldGreenManure.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

50
Jenkinsfile vendored
View File

@@ -1,42 +1,30 @@
@Library('farmmaps-shared-library') _
pipeline {
agent any
environment {
APP_VERSION_PREFIX=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/Version" -v . -n|awk -v def="1.0.0" "{print} END { if(NR==0) {print def} }"', returnStdout: true).trim()
APP_NAME=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/AssemblyName" -v . -n|awk -v def="App" "{print tolower(\\$0)} END { if(NR==0) {print def} }"', returnStdout: true).trim()
APP_VERSION="${APP_VERSION_PREFIX}"
agent any;
options {
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
disableConcurrentBuilds();
}
triggers {
upstream(
upstreamProjects: '/FarmMaps/Base.Core.Common.Geometry/master',
threshold: hudson.model.Result.SUCCESS
)
}
stages {
stage('Dotnet Restore') {
stage('BaseBuildAll') {
steps {
sh '''dotnet restore CarbonLib.csproj'''
stepBaseBuildAll();
}
}
stage('Dotnet Build') {
steps {
sh '''dotnet build CarbonLib.csproj'''
}
}
stage('Dotnet Package') {
steps {
sh '''rm -rf nuget
dotnet pack -c release -o nuget -p:PackageVersion=${APP_VERSION} CarbonLib.csproj'''
}
}
stage('Dotnet Publish') {
steps {
sh '''dotnet nuget push nuget/*.nupkg -k 0c3e3afc-935b-3db1-b023-e0d4799e674d -s https://repository.akkerweb.nl/repository/nuget-hosted/'''
}
}
}
}
post {
success {
postSuccess();
}
always {
emailext (
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${DEFAULT_REPLYTO}',
subject: '${DEFAULT_SUBJECT}',
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
)
postAlways();
}
}
}

View File

@@ -1,42 +1,30 @@
@Library('farmmaps-shared-library') _
pipeline {
agent any
environment {
APP_VERSION_PREFIX=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/Version" -v . -n|awk -v def="1.0.0" "{print} END { if(NR==0) {print def} }"', returnStdout: true).trim()
APP_NAME=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/AssemblyName" -v . -n|awk -v def="App" "{print tolower(\\$0)} END { if(NR==0) {print def} }"', returnStdout: true).trim()
APP_VERSION="${APP_VERSION_PREFIX + '-prerelease.' + env.BUILD_NUMBER}"
agent any;
options {
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
disableConcurrentBuilds();
}
triggers {
upstream(
upstreamProjects: '/FarmMaps.Develop/Base.Core.Common.Geometry/develop',
threshold: hudson.model.Result.SUCCESS
)
}
stages {
stage('Dotnet Restore') {
stage('BaseBuildAll') {
steps {
sh '''dotnet restore CarbonLib.csproj'''
stepBaseBuildAll();
}
}
stage('Dotnet Build'){
steps {
sh '''dotnet build CarbonLib.csproj'''
}
}
stage('Dotnet Package') {
steps {
sh '''rm -rf nuget
dotnet pack -c debug -o nuget -p:PackageVersion=${APP_VERSION} CarbonLib.csproj'''
}
}
stage('Dotnet Publish') {
steps {
sh '''dotnet nuget push nuget/*.nupkg -k 0c3e3afc-935b-3db1-b023-e0d4799e674d -s https://repository.akkerweb.nl/repository/nuget-hosted/'''
}
}
}
}
post {
success {
postSuccess();
}
always {
emailext (
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${DEFAULT_REPLYTO}',
subject: '${DEFAULT_SUBJECT}',
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
)
postAlways();
}
}
}

View File

@@ -16,7 +16,6 @@ namespace CarbonService.Models
[Required]
public int PostalCode { get; set; }
public List<CropField> CropFields { get; set; }
//public List<OrgManureApplied> OrgManureApplied { get; set; }
}
public class CropField
@@ -31,23 +30,28 @@ namespace CarbonService.Models
public SoilProperty SoilProperty { get; set; }
[Required]
public List<HistoricalCropData> HistoricalCropData { get; set; }
public List<GreenManure> GreenManures { get; set; }
public List<GreenManure> GreenManures { get; set; }
}
public class SoilProperty
{
public double? OM_Const { get; set; }
public string OM_Choice { get; set; }
public double? Clay_Content { get; set; }
public bool? Depth10 { get; set; }
public int? Depth { get; set; }
}
public class OrgManureApplied
{
double? yield;
[Required]
public string Crop { get; set; }
public List<OrganicManureType> OrganicManures { get; set; }
public int? CropYield { 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
@@ -62,8 +66,6 @@ namespace CarbonService.Models
{
[Required]
public int Year { get; set; }
//[Required]
//public List<string> Crops { get; set; }
[Required]
public List<OrgManureApplied> Crops { get; set; }
}
@@ -81,7 +83,6 @@ namespace CarbonService.Models
[Required]
public string Type { get; set; }
//public string Quality { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public Quality Quality { get; set; }
}

View File

@@ -9,8 +9,6 @@ namespace FarmMapsAPI.Carbon.Models
{
[JsonProperty("cropField")]
public List<CropFieldSummary> CropField { get; set; }
//[JsonProperty("farmSummary")]
//public List<FarmYearSummary> FarmSummary { get; set; }
}
public class CropFieldSummary

View File

@@ -44,6 +44,7 @@ namespace FarmMapsAPI.Carbon.Models
public List<CropData> Crops { get; set; }
public List<GreenManureTypeFarmMaps> GreenManures { get; set; }
public bool Rotation { get; set; }
public string Irrigations { get; set; }
public HistoricalCropDataFarmMaps DeepCopy()
{
@@ -54,11 +55,13 @@ namespace FarmMapsAPI.Carbon.Models
public class CropData
{
double? yield;
[Required]
public string CropCode { get; set; }
public string MiterraCropName { get; set; }
public List<OrganicManureFarmMaps> OrganicManures { get; set; }
public int? CropYield { get; set; }
public double? CropYield { get { return (int?)yield; } set { yield = value; } }
public bool CropRes { get; set; }
}
@@ -67,14 +70,16 @@ namespace FarmMapsAPI.Carbon.Models
[Required]
public string Type { get; set; }
[Required]
public double Quantity { get; set; }
public double? Quantity { get; set; }
}
public class SoilPropertyFarmMaps
{
public double? OM_Const { get; set; }
public string OM_Choice { get; set; }
public double? Clay_Content { get; set; }
public bool Depth10 { get; set; }
public int? Depth { get; set; }
}
public class GreenManureTypeFarmMaps

View File

@@ -74,7 +74,6 @@ namespace FarmMapsAPI.Carbon.Models
public List<(string, int, string)> KeysWhereCropKeyExists(int year, string crop)
{
//return TrippleKeyParam.Where(x => x.Value.Any(y => y.Key == column)).Select(s=>s.Key).ToList();
return TrippleKeyParam.Where(x => x.Key.Item2 == year && x.Key.Item3.ToLower() == crop.ToLower()).Select(s=>s.Key).ToList();
}
}

View File

@@ -10,7 +10,7 @@ namespace FarmMapsAPI.Carbon.Models
public double OM_Corr { get; set; }
public double Bulk_Density { get; set; }
public double Clay_Content { get; set; }
public double Depth { get; set; }
public int? Depth { get; set; }
public bool Depth10 { get; set; }
}

View File

@@ -1,2 +1,3 @@
# CarbonLib
#

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff