35 Commits

Author SHA1 Message Date
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
10 changed files with 5215 additions and 172 deletions

1
.gitignore vendored
View File

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

View File

@@ -214,12 +214,6 @@ namespace FarmMapsAPI.Carbon
public double? GetCropYield(string cropCode, int year, int postalCode) public double? GetCropYield(string cropCode, int year, int postalCode)
{ {
string provinceCode = GetProvinceCode(dataTransformationSet, 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 crpYield = cropYieldConfig.SingleOrDefault(x => x.CropName.ToLower() == cropCode.ToLower());
var crpYieldProvince = crpYield.Yields.SingleOrDefault(x => x.ProvinceCode == provinceCode); var crpYieldProvince = crpYield.Yields.SingleOrDefault(x => x.ProvinceCode == provinceCode);
var cropYield = crpYieldProvince.YearData.SingleOrDefault(x => x.Year == year)?.YieldValue; var cropYield = crpYieldProvince.YearData.SingleOrDefault(x => x.Year == year)?.YieldValue;
@@ -264,7 +258,6 @@ namespace FarmMapsAPI.Carbon
item.Value.OM_Corr = sumCorr; item.Value.OM_Corr = sumCorr;
} }
//var oM_corr_SoilType = new Dictionary<string, List<ColumnValue>>();
var oM_corr_SoilType = new Dictionary<(string,string), double>(); var oM_corr_SoilType = new Dictionary<(string,string), double>();
foreach (var item in soilPropertiesField) foreach (var item in soilPropertiesField)
{ {
@@ -753,7 +746,7 @@ namespace FarmMapsAPI.Carbon
coverModFactor.Add(crpCover.CropName, valueList); coverModFactor.Add(crpCover.CropName, valueList);
} }
// SMDMax (kan buiten yearLoop) // SMDMax
// field, crop // field, crop
var smdMax = new Dictionary<string, double>(); var smdMax = new Dictionary<string, double>();
foreach (var soil in soilPropertiesField) foreach (var soil in soilPropertiesField)
@@ -762,7 +755,7 @@ namespace FarmMapsAPI.Carbon
smdMax.Add(soil.Key, result); smdMax.Add(soil.Key, result);
} }
// SMDaccMonthi (kan buiten yearLoop ??) // SMDaccMonthi
var smdAccMonthi = new Dictionary<string, List<ColumnValue>>(); var smdAccMonthi = new Dictionary<string, List<ColumnValue>>();
foreach (var climateItem in climateVariable) foreach (var climateItem in climateVariable)
@@ -772,16 +765,43 @@ namespace FarmMapsAPI.Carbon
{ {
if (i == 0) if (i == 0)
{ {
/* 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 result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration; var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration;
result = result < 0 ? result : 0; 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)); valueList.Add(new ColumnValue("M1", result));
} }
else else
{ {
/* 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 result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration + valueList.SingleOrDefault(x => x.Key == $"M{i}").Value; var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration + valueList.SingleOrDefault(x => x.Key == $"M{i}").Value;
result = result < 0 ? result : 0; 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)); valueList.Add(new ColumnValue($"M{i + 1}", result));
} }
} }
@@ -796,13 +816,26 @@ namespace FarmMapsAPI.Carbon
var valueList = new List<ColumnValue>(); var valueList = new List<ColumnValue>();
foreach (var smdAccMonth in fieldSmdAccMonthi.Value) 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)); valueList.Add(new ColumnValue(smdAccMonth.Key, 1));
} }
else 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)); valueList.Add(new ColumnValue(smdAccMonth.Key, result));
} }
} }
@@ -1680,11 +1713,9 @@ namespace FarmMapsAPI.Carbon
// SOC_Summary_Farm // SOC_Summary_Farm
var soc_Summary_Farm = new List<FarmYearSummary>(); var soc_Summary_Farm = new List<FarmYearSummary>();
//carbonSummary.FarmSummary = soc_Summary_Farm;
foreach (var item in cropAreaFarm) foreach (var item in cropAreaFarm)
{ {
var sum = item.Value.Sum(x => x.Value); 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 }); soc_Summary_Farm.Add(new FarmYearSummary { Year = item.Key.Item2, Total_crop_area = sum });
} }
@@ -1882,7 +1913,7 @@ namespace FarmMapsAPI.Carbon
var monthClimateList = new List<ClimateVariable>(); var monthClimateList = new List<ClimateVariable>();
foreach (var month in gisSoilSet.AllMonths) 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 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); var newMonthData = new ClimateVariable(monthData.Temperature, monthData.Precipitation, monthData.Evapotranspiration * 1.25);
monthClimateList.Add(newMonthData); monthClimateList.Add(newMonthData);
@@ -1921,11 +1952,9 @@ namespace FarmMapsAPI.Carbon
foreach (var manure in manures.GreenManureTypes) foreach (var manure in manures.GreenManureTypes)
{ {
var manureQ = yieldGreenManureConfig.SingleOrDefault(x => x.ManureName.ToLower() == manure.Type.ToLower()); 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; double manureQuality2 = manure.Quality == Quality.Good ? manureQ.GoodQuality : manure.Quality == Quality.Average ? manureQ.AverageQuality : manure.Quality == Quality.Bad ? manureQ.BadQuality : 0;
if (manureQuality2 > 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) }); carbonInputGreenManure.Add((field.Name, manures.Year), new List<ColumnValue> { new ColumnValue(manure.Type, manureQuality2) });
} }
} }

View File

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

50
Jenkinsfile vendored
View File

@@ -1,42 +1,30 @@
@Library('farmmaps-shared-library') _
pipeline { pipeline {
agent any agent any;
environment { options {
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() copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
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() disableConcurrentBuilds abortPrevious: true;
APP_VERSION="${APP_VERSION_PREFIX}" }
triggers {
upstream(
upstreamProjects: '/FarmMaps/Base.Core.Common.Geometry/master',
threshold: hudson.model.Result.SUCCESS
)
} }
stages { stages {
stage('Dotnet Restore') { stage('BaseBuildAll') {
steps { 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 { post {
success {
postSuccess();
}
always { always {
emailext ( postAlways();
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${DEFAULT_REPLYTO}',
subject: '${DEFAULT_SUBJECT}',
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
)
} }
} }
} }

View File

@@ -1,42 +1,30 @@
@Library('farmmaps-shared-library') _
pipeline { pipeline {
agent any agent any;
environment { options {
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() copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
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() disableConcurrentBuilds abortPrevious: true;
APP_VERSION="${APP_VERSION_PREFIX + '-prerelease.' + env.BUILD_NUMBER}" }
triggers {
upstream(
upstreamProjects: '/FarmMaps.Develop/Base.Core.Common.Geometry/develop',
threshold: hudson.model.Result.SUCCESS
)
} }
stages { stages {
stage('Dotnet Restore') { stage('BaseBuildAll') {
steps { 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 { post {
success {
postSuccess();
}
always { always {
emailext ( postAlways();
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${DEFAULT_REPLYTO}',
subject: '${DEFAULT_SUBJECT}',
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
)
} }
} }
} }

View File

@@ -16,7 +16,6 @@ namespace CarbonService.Models
[Required] [Required]
public int PostalCode { get; set; } public int PostalCode { get; set; }
public List<CropField> CropFields { get; set; } public List<CropField> CropFields { get; set; }
//public List<OrgManureApplied> OrgManureApplied { get; set; }
} }
public class CropField public class CropField
@@ -43,10 +42,12 @@ namespace CarbonService.Models
public class OrgManureApplied public class OrgManureApplied
{ {
double? yield;
[Required] [Required]
public string Crop { get; set; } public string Crop { get; set; }
public List<OrganicManureType> OrganicManures { 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 bool CropRes { get; set; }
} }
@@ -62,8 +63,6 @@ namespace CarbonService.Models
{ {
[Required] [Required]
public int Year { get; set; } public int Year { get; set; }
//[Required]
//public List<string> Crops { get; set; }
[Required] [Required]
public List<OrgManureApplied> Crops { get; set; } public List<OrgManureApplied> Crops { get; set; }
} }
@@ -81,7 +80,6 @@ namespace CarbonService.Models
[Required] [Required]
public string Type { get; set; } public string Type { get; set; }
//public string Quality { get; set; }
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
public Quality Quality { get; set; } public Quality Quality { get; set; }
} }

View File

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

View File

@@ -54,11 +54,13 @@ namespace FarmMapsAPI.Carbon.Models
public class CropData public class CropData
{ {
double? yield;
[Required] [Required]
public string CropCode { get; set; } public string CropCode { get; set; }
public string MiterraCropName { get; set; } public string MiterraCropName { get; set; }
public List<OrganicManureFarmMaps> OrganicManures { 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; } public bool CropRes { get; set; }
} }

View File

@@ -74,7 +74,6 @@ namespace FarmMapsAPI.Carbon.Models
public List<(string, int, string)> KeysWhereCropKeyExists(int year, string crop) 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(); return TrippleKeyParam.Where(x => x.Key.Item2 == year && x.Key.Item3.ToLower() == crop.ToLower()).Select(s=>s.Key).ToList();
} }
} }

File diff suppressed because it is too large Load Diff