aw7152: open source, moved lib to sub folder, added console app
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
This commit is contained in:
100
CarbonLib/Models/CarbonRequest.cs
Normal file
100
CarbonLib/Models/CarbonRequest.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using NetTopologySuite.Geometries;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarbonService.Models
|
||||
{
|
||||
public class CarbonRequest
|
||||
{
|
||||
public Geometry geometry { get; set; }
|
||||
[Required]
|
||||
public int PostalCode { get; set; }
|
||||
public List<CropField> CropFields { get; set; }
|
||||
}
|
||||
|
||||
public class CropField
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public double Area { get; set; }
|
||||
[Required]
|
||||
public string SoilType { get; set; }
|
||||
[Required]
|
||||
public SoilProperty SoilProperty { get; set; }
|
||||
[Required]
|
||||
public List<HistoricalCropData> HistoricalCropData { get; set; }
|
||||
public List<GreenManure> GreenManures { get; set; }
|
||||
}
|
||||
|
||||
public class SoilProperty
|
||||
{
|
||||
public double? OM_Const { get; set; }
|
||||
public double? C_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 double? CropYield { get { return (int?)yield; } set { yield = value; } }
|
||||
public bool CropRes { get; set; }
|
||||
public string Irrigation { get; set; }
|
||||
}
|
||||
|
||||
public class OrganicManureType
|
||||
{
|
||||
[Required]
|
||||
public string Type { get; set; }
|
||||
[Required]
|
||||
public double Quantity { get; set; }
|
||||
}
|
||||
|
||||
public class HistoricalCropData
|
||||
{
|
||||
[Required]
|
||||
public int Year { get; set; }
|
||||
[Required]
|
||||
public List<OrgManureApplied> Crops { get; set; }
|
||||
}
|
||||
|
||||
public class GreenManure
|
||||
{
|
||||
[Required]
|
||||
public int Year { get; set; }
|
||||
[Required]
|
||||
public List<GreenManureType> GreenManureTypes { get; set; }
|
||||
}
|
||||
|
||||
public class GreenManureType
|
||||
{
|
||||
[Required]
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public Quality Quality { get; set; }
|
||||
}
|
||||
|
||||
public enum Quality
|
||||
{
|
||||
[EnumMember(Value = "Goed")]
|
||||
Good,
|
||||
[EnumMember(Value = "Matig")]
|
||||
Average,
|
||||
[EnumMember(Value = "Slecht")]
|
||||
Bad
|
||||
}
|
||||
}
|
||||
134
CarbonLib/Models/CarbonSummary.cs
Normal file
134
CarbonLib/Models/CarbonSummary.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class CarbonSummary
|
||||
{
|
||||
[JsonProperty("cropField")]
|
||||
public List<CropFieldSummary> CropField { get; set; }
|
||||
}
|
||||
|
||||
public class CarbonSummaryList
|
||||
{
|
||||
[JsonProperty("cropFieldClimate")]
|
||||
public List<CropFieldSummaryList> CropFieldClimate { get; set; }
|
||||
[JsonProperty("cropField")]
|
||||
public CarbonSummary CarbonSummary { get; set; }
|
||||
}
|
||||
|
||||
public class CropFieldSummary
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("summary")]
|
||||
public List<YearSummary> Summary { get; set; }
|
||||
}
|
||||
|
||||
public class CropFieldSummaryList
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("summary")]
|
||||
public List<YearSummaryClimate> SummaryList { get; set; }
|
||||
}
|
||||
|
||||
public class YearSummary
|
||||
{
|
||||
[JsonProperty("crop")]
|
||||
public string Crop { get; set; }
|
||||
[JsonProperty("year")]
|
||||
public int Year { get; set; }
|
||||
[JsonProperty("bulk_Density")]
|
||||
public double Bulk_Density { get; set; }
|
||||
[JsonProperty("total_crop_area")]
|
||||
public double Total_crop_area { get; set; }
|
||||
[JsonProperty("balance")]
|
||||
public double Balance { get; set; }
|
||||
[JsonProperty("initial")]
|
||||
public double Initial { get; set; }
|
||||
[JsonProperty("iniCcontent")]
|
||||
public double IniCcontent { get; set; }
|
||||
[JsonProperty("oM_ini")]
|
||||
public double OM_ini { get; set; }
|
||||
[JsonProperty("oM_ini_Climate")]
|
||||
public List<double> OM_ini_Climate { get; set; }
|
||||
[JsonProperty("cO2seq")]
|
||||
public double CO2seq { get; set; }
|
||||
[JsonProperty("soC_CarbonCompost")]
|
||||
public double SOC_CarbonCompost { get; set; }
|
||||
[JsonProperty("soC_CarbonGreenManure")]
|
||||
public double SOC_CarbonGreenManure { get; set; }
|
||||
[JsonProperty("soC_CarbonResidues")]
|
||||
public double SOC_CarbonResidues { get; set; }
|
||||
[JsonProperty("soC_CarbonManure")]
|
||||
public double SOC_CarbonManure { get; set; }
|
||||
[JsonProperty("emision")]
|
||||
public double Emision { get; set; }
|
||||
}
|
||||
|
||||
public class YearSummaryClimate
|
||||
{
|
||||
[JsonProperty("crop")]
|
||||
public string Crop { get; set; }
|
||||
[JsonProperty("year")]
|
||||
public int Year { get; set; }
|
||||
[JsonProperty("bulk_Density")]
|
||||
public List<double> Bulk_Density { get; set; }
|
||||
[JsonProperty("total_crop_area")]
|
||||
public double Total_crop_area { get; set; }
|
||||
[JsonProperty("balance")]
|
||||
public List<double> Balance { get; set; }
|
||||
[JsonProperty("initial")]
|
||||
public List<double> Initial { get; set; }
|
||||
[JsonProperty("iniCcontent")]
|
||||
public List<double> IniCcontent { get; set; }
|
||||
[JsonProperty("oM_ini")]
|
||||
public List<double> OM_ini { get; set; }
|
||||
[JsonProperty("cO2seq")]
|
||||
public List<double> CO2seq { get; set; }
|
||||
[JsonProperty("soC_CarbonCompost")]
|
||||
public List<double> SOC_CarbonCompost { get; set; }
|
||||
[JsonProperty("soC_CarbonGreenManure")]
|
||||
public List<double> SOC_CarbonGreenManure { get; set; }
|
||||
[JsonProperty("soC_CarbonResidues")]
|
||||
public List<double> SOC_CarbonResidues { get; set; }
|
||||
[JsonProperty("soC_CarbonManure")]
|
||||
public List<double> SOC_CarbonManure { get; set; }
|
||||
[JsonProperty("emision")]
|
||||
public List<double> Emision { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class FarmYearSummary
|
||||
{
|
||||
[JsonProperty("year")]
|
||||
public int Year { get; set; }
|
||||
[JsonProperty("total_crop_area")]
|
||||
public double Total_crop_area { get; set; }
|
||||
[JsonProperty("balance")]
|
||||
public double Balance { get; set; }
|
||||
[JsonProperty("initial")]
|
||||
public double Initial { get; set; }
|
||||
[JsonProperty("iniCcontent")]
|
||||
public double IniCcontent { get; set; }
|
||||
[JsonProperty("oM_ini")]
|
||||
public double OM_ini { get; set; }
|
||||
[JsonProperty("cO2seq")]
|
||||
public double CO2seq { get; set; }
|
||||
[JsonProperty("cO2seq_total")]
|
||||
public double CO2seq_total { get; set; }
|
||||
[JsonProperty("soC_CarbonCompost")]
|
||||
public double SOC_CarbonCompost { get; set; }
|
||||
[JsonProperty("soC_CarbonGreenManure")]
|
||||
public double SOC_CarbonGreenManure { get; set; }
|
||||
[JsonProperty("soC_CarbonResidues")]
|
||||
public double SOC_CarbonResidues { get; set; }
|
||||
[JsonProperty("soC_CarbonManure")]
|
||||
public double SOC_CarbonManure { get; set; }
|
||||
[JsonProperty("emision")]
|
||||
public double Emision { get; set; }
|
||||
}
|
||||
}
|
||||
20
CarbonLib/Models/ClimateVariable.cs
Normal file
20
CarbonLib/Models/ClimateVariable.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class ClimateVariable
|
||||
{
|
||||
public double Temperature { get; set; }
|
||||
public double Precipitation { get; set; }
|
||||
public double Evapotranspiration { get; set; }
|
||||
|
||||
public ClimateVariable(double temperature, double precipitation, double evapoTranspiration)
|
||||
{
|
||||
Temperature = temperature;
|
||||
Precipitation = precipitation;
|
||||
Evapotranspiration = evapoTranspiration;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
CarbonLib/Models/ColumnValue.cs
Normal file
30
CarbonLib/Models/ColumnValue.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class ColumnValue
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public double Value { get; set; }
|
||||
|
||||
public ColumnValue(string key, double value)
|
||||
{
|
||||
Key = key;
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public class YearColumnValue
|
||||
{
|
||||
public int Key { get; set; }
|
||||
public double Value { get; set; }
|
||||
|
||||
public YearColumnValue(int key, double value)
|
||||
{
|
||||
Key = key;
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
CarbonLib/Models/CropCoverMonthsModel.cs
Normal file
12
CarbonLib/Models/CropCoverMonthsModel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class CropCoverMonthsModel
|
||||
{
|
||||
public string CropName { get; set; }
|
||||
public List<string> CoverMonths { get; set; }
|
||||
}
|
||||
}
|
||||
16
CarbonLib/Models/CropPropertyModel.cs
Normal file
16
CarbonLib/Models/CropPropertyModel.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class CropPropertyModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public double DM_content { get; set; }
|
||||
public double FracR { get; set; }
|
||||
public double C_input_CropRes { get; set; }
|
||||
public double HarvestIndex { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
20
CarbonLib/Models/CropSets.cs
Normal file
20
CarbonLib/Models/CropSets.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class StrawCrp
|
||||
{
|
||||
public string StrawCrop { get; set; }
|
||||
public double DM_Content { get; set; }
|
||||
}
|
||||
|
||||
public class CropSets
|
||||
{
|
||||
public List<StrawCrp> StrawCrops { get; set; }
|
||||
public List<string> GreenManureType { get; set; }
|
||||
public List<string> Perennial { get; set; }
|
||||
public List<string> Grass_nat { get; set; }
|
||||
}
|
||||
}
|
||||
24
CarbonLib/Models/CropYieldModel.cs
Normal file
24
CarbonLib/Models/CropYieldModel.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class YearData
|
||||
{
|
||||
public int Year { get; set; }
|
||||
public double YieldValue { get; set; }
|
||||
}
|
||||
|
||||
public class Yield
|
||||
{
|
||||
public string ProvinceCode { get; set; }
|
||||
public List<YearData> YearData { get; set; }
|
||||
}
|
||||
|
||||
public class CropYieldModel
|
||||
{
|
||||
public string CropName { get; set; }
|
||||
public List<Yield> Yields { get; set; }
|
||||
}
|
||||
}
|
||||
25
CarbonLib/Models/FarmInputsetsModel.cs
Normal file
25
CarbonLib/Models/FarmInputsetsModel.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class ManureSourcesLiv
|
||||
{
|
||||
public string ManureSource_liv { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
|
||||
public class Compost
|
||||
{
|
||||
public string compost { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
|
||||
public class FarmInputsetsModel
|
||||
{
|
||||
public List<ManureSourcesLiv> ManureSources_liv { get; set; }
|
||||
public List<Compost> composts { get; set; }
|
||||
public List<string> CarbonSource { get; set; }
|
||||
}
|
||||
}
|
||||
117
CarbonLib/Models/FarmMapsCarbonRequest.cs
Normal file
117
CarbonLib/Models/FarmMapsCarbonRequest.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
//using CarbonService.Models;
|
||||
using NetTopologySuite.Geometries;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class FarmMapsCarbonRequest
|
||||
{
|
||||
public string ModelYear { get; set; }
|
||||
public string ScenarioName { get; set; }
|
||||
public int PostalCode { get; set; }
|
||||
|
||||
public List<CropFieldFarmMaps> CropFields { get; set; }
|
||||
|
||||
//added
|
||||
public int CalculateUntil { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public int CalculateFrom { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class CropFieldFarmMaps
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public double Area { get; set; }
|
||||
[Required]
|
||||
public string SoilType { get; set; }
|
||||
public string SoilTypeDefault { get; set; }
|
||||
[Required]
|
||||
public SoilPropertyFarmMaps SoilProperty { get; set; }
|
||||
[Required]
|
||||
public List<HistoricalCropDataFarmMaps> HistoricalCropData { get; set; }
|
||||
}
|
||||
|
||||
public class HistoricalCropDataFarmMaps
|
||||
{
|
||||
[Required]
|
||||
public int Year { get; set; }
|
||||
[Required]
|
||||
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()
|
||||
{
|
||||
HistoricalCropDataFarmMaps other = (HistoricalCropDataFarmMaps)this.MemberwiseClone();
|
||||
return other;
|
||||
}
|
||||
}
|
||||
|
||||
public class CropData
|
||||
{
|
||||
double? yield;
|
||||
|
||||
[Required]
|
||||
public string CropCode { get; set; }
|
||||
public string MiterraCropName { get; set; }
|
||||
public List<OrganicManureFarmMaps> OrganicManures { get; set; }
|
||||
public double? CropYield { get { return (int?)yield; } set { yield = value; } }
|
||||
public bool CropRes { get; set; }
|
||||
}
|
||||
|
||||
public class OrganicManureFarmMaps
|
||||
{
|
||||
[Required]
|
||||
public string Type { get; set; }
|
||||
[Required]
|
||||
public double? Quantity { get; set; }
|
||||
}
|
||||
|
||||
public class SoilPropertyFarmMaps
|
||||
{
|
||||
public double? OM_Const { get; set; }
|
||||
public double? C_Const { get; set; }
|
||||
public double? OM_ConstDefault { get; set; }
|
||||
public string OM_Choice { get; set; }
|
||||
public double? Clay_Content { get; set; }
|
||||
public double? Clay_ContentDefault { get; set; }
|
||||
public bool Depth10 { get; set; }
|
||||
public int? Depth { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<OrganicMatterFarmMaps> OrganicMatters { get; set; }
|
||||
}
|
||||
|
||||
public class OrganicMatterFarmMaps
|
||||
{
|
||||
public int Year { get; set; }
|
||||
public double OrganicMatter { get; set; }
|
||||
}
|
||||
|
||||
public class GreenManureTypeFarmMaps
|
||||
{
|
||||
public string CropCode { get; set; }
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public QualityFarmMaps? Quality { get; set; }
|
||||
}
|
||||
|
||||
public enum QualityFarmMaps
|
||||
{
|
||||
[EnumMember(Value = "Goed")]
|
||||
Good = 1,
|
||||
[EnumMember(Value = "Matig")]
|
||||
Average = 2,
|
||||
[EnumMember(Value = "Slecht")]
|
||||
Bad = 3
|
||||
}
|
||||
}
|
||||
15
CarbonLib/Models/GIS_Soils_Sets.cs
Normal file
15
CarbonLib/Models/GIS_Soils_Sets.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class GIS_Soils_Sets
|
||||
{
|
||||
public List<string> SoilType { get; set; }
|
||||
public List<string> MineralSoils { get; set; }
|
||||
public List<string> Months { get; set; }
|
||||
public List<string> AllMonths { get; set; }
|
||||
public List<string> ClimateVar { get; set; }
|
||||
}
|
||||
}
|
||||
80
CarbonLib/Models/GamsParameter.cs
Normal file
80
CarbonLib/Models/GamsParameter.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class GamsThreeKeyParameter
|
||||
{
|
||||
//field, year, crop
|
||||
public Dictionary<(string,int,string), List<ColumnValue>> TrippleKeyParam { get; set; }
|
||||
|
||||
public GamsThreeKeyParameter()
|
||||
{
|
||||
TrippleKeyParam = new Dictionary<(string, int, string), List<ColumnValue>>();
|
||||
}
|
||||
|
||||
public void AddValue((string, int, string)key, string column, double value)
|
||||
{
|
||||
if (TrippleKeyParam.ContainsKey(key))
|
||||
{
|
||||
if (TrippleKeyParam[key].Any(x => x.Key == column))
|
||||
{
|
||||
throw new Exception("key allready exists");
|
||||
}
|
||||
else
|
||||
{
|
||||
TrippleKeyParam[key].Add(new ColumnValue(column, value));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TrippleKeyParam.Add(key, new List<ColumnValue> { new ColumnValue(column, value) });
|
||||
}
|
||||
}
|
||||
|
||||
public void AddOrUpdateValue((string, int, string) key, string column, double value)
|
||||
{
|
||||
if (TrippleKeyParam.ContainsKey(key))
|
||||
{
|
||||
if (TrippleKeyParam[key].Any(x => x.Key == column))
|
||||
{
|
||||
TrippleKeyParam[key].Single(x => x.Key == column).Value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
TrippleKeyParam[key].Add(new ColumnValue(column, value));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TrippleKeyParam.Add(key, new List<ColumnValue> { new ColumnValue(column, value) });
|
||||
}
|
||||
}
|
||||
|
||||
public void AddValueSkipIfColumnExists((string, int, string) key, string column, double value)
|
||||
{
|
||||
if (TrippleKeyParam.ContainsKey(key))
|
||||
{
|
||||
if (TrippleKeyParam[key].Any(x => x.Key == column))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
TrippleKeyParam[key].Add(new ColumnValue(column, value));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TrippleKeyParam.Add(key, new List<ColumnValue> { new ColumnValue(column, value) });
|
||||
}
|
||||
}
|
||||
|
||||
public List<(string, int, string)> KeysWhereCropKeyExists(int year, string crop)
|
||||
{
|
||||
return TrippleKeyParam.Where(x => x.Key.Item2 == year && x.Key.Item3.ToLower() == crop.ToLower()).Select(s=>s.Key).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
CarbonLib/Models/ManCcontModel.cs
Normal file
12
CarbonLib/Models/ManCcontModel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class ManCcontModel
|
||||
{
|
||||
public string ManCcont { get; set; }
|
||||
public double Value { get; set; }
|
||||
}
|
||||
}
|
||||
16
CarbonLib/Models/MappingCropFarmmapsMiterraRothC.cs
Normal file
16
CarbonLib/Models/MappingCropFarmmapsMiterraRothC.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class MappingCropFarmmapsMiterraRothC
|
||||
{
|
||||
public string CropCode { get; set; }
|
||||
public string CropName { get; set; }
|
||||
public string PurposeCode { get; set; }
|
||||
public string PurposeName { get; set; }
|
||||
public string MiterraRothCCrop { get; set; }
|
||||
}
|
||||
}
|
||||
16
CarbonLib/Models/MappingGreenManureFarmmapsMiterraRothC.cs
Normal file
16
CarbonLib/Models/MappingGreenManureFarmmapsMiterraRothC.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class MappingGreenManureFarmmapsMiterraRothC
|
||||
{
|
||||
public string CropCode { get; set; }
|
||||
public string CropName { get; set; }
|
||||
public string PurposeCode { get; set; }
|
||||
public string PurposeName { get; set; }
|
||||
public string MiterraRothCCrop { get; set; }
|
||||
}
|
||||
}
|
||||
18
CarbonLib/Models/ParameterSet.cs
Normal file
18
CarbonLib/Models/ParameterSet.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class ParameterSet
|
||||
{
|
||||
public double LayerDepth { get; set; }
|
||||
public double kDPM { get; set; }
|
||||
public double kRPM { get; set; }
|
||||
public double kBIO { get; set; }
|
||||
public double kHUM { get; set; }
|
||||
public double StubbleFraction { get; set; }
|
||||
public double CarbonBiomass { get; set; }
|
||||
public double FracBelowGroundCinput { get; set; }
|
||||
}
|
||||
}
|
||||
24
CarbonLib/Models/SetsForDataTransformation.cs
Normal file
24
CarbonLib/Models/SetsForDataTransformation.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class KNMIZoneReg
|
||||
{
|
||||
public string KNMI_zone { get; set; }
|
||||
public List<int> Reg { get; set; }
|
||||
}
|
||||
|
||||
public class NUTS0NUTSII
|
||||
{
|
||||
public string prov { get; set; }
|
||||
public List<int> reg { get; set; }
|
||||
}
|
||||
|
||||
public class SetsForDataTransformation
|
||||
{
|
||||
public List<KNMIZoneReg> KNMI_zone_Reg { get; set; }
|
||||
public List<NUTS0NUTSII> NUTS0NUTSII { get; set; }
|
||||
}
|
||||
}
|
||||
12
CarbonLib/Models/SoilBulkDensityType.cs
Normal file
12
CarbonLib/Models/SoilBulkDensityType.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class SoilBulkDensityType
|
||||
{
|
||||
public double Clay { get; set; }
|
||||
public double Sand { get; set; }
|
||||
}
|
||||
}
|
||||
42
CarbonLib/Models/SoilPropertyType.cs
Normal file
42
CarbonLib/Models/SoilPropertyType.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class SoilPropertyType
|
||||
{
|
||||
public double OM_Cont { get; set; }
|
||||
public double OM_Corr { get; set; }
|
||||
public double C_Cont { get; set; }
|
||||
public double C_Corr { get; set; }
|
||||
public double Bulk_Density { get; set; }
|
||||
public double Clay_Content { get; set; }
|
||||
public int? Depth { get; set; }
|
||||
public bool Depth10 { get; set; }
|
||||
}
|
||||
|
||||
struct SoilTypePropertyKey
|
||||
{
|
||||
public string SoilType { get; set; }
|
||||
public string SoilProperty{ get; set; }
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return SoilType.GetHashCode() ^ SoilProperty.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is SoilTypePropertyKey)
|
||||
{
|
||||
SoilTypePropertyKey compositeKey = (SoilTypePropertyKey)obj;
|
||||
|
||||
return ((this.SoilType == compositeKey.SoilType) &&
|
||||
(this.SoilProperty == compositeKey.SoilProperty));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
CarbonLib/Models/YieldGreenManureModel.cs
Normal file
14
CarbonLib/Models/YieldGreenManureModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
{
|
||||
public class YieldGreenManureModel
|
||||
{
|
||||
public string ManureName { get; set; }
|
||||
public double GoodQuality { get; set; }
|
||||
public double AverageQuality { get; set; }
|
||||
public double BadQuality { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user