Skip to content

Commit

Permalink
Assembly name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
holos-aafc committed Apr 18, 2024
1 parent 5555288 commit c40952e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion H.Content/H.Content.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>H.Content</RootNamespace>
<AssemblyName>AAFC.Holos.Content</AssemblyName>
<AssemblyName>H.Content</AssemblyName>
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
Expand Down
8 changes: 7 additions & 1 deletion H.Core/Calculators/Carbon/ICBMSoilCarbonCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public CropViewItem SetCarbonInputs(
CropViewItem nextYearViewItem,
Farm farm)
{
var isNonSwathingGrazingScenario = currentYearViewItem.TotalCarbonLossesByGrazingAnimals > 0 &&
farm.CropHasGrazingAnimals(currentYearViewItem) &&
farm.YieldAssignmentMethod != YieldAssignmentMethod.Custom &&
currentYearViewItem.HarvestMethod != HarvestMethods.StubbleGrazing &&
currentYearViewItem.HarvestMethod != HarvestMethods.Swathing;

currentYearViewItem.PlantCarbonInAgriculturalProduct = this.CalculatePlantCarbonInAgriculturalProduct(
previousYearViewItem: previousYearViewItem,
currentYearViewItem: currentYearViewItem,
Expand All @@ -75,7 +81,7 @@ public CropViewItem SetCarbonInputs(
nextYearViewItem: nextYearViewItem,
farm: farm);

if (currentYearViewItem.TotalCarbonLossesByGrazingAnimals > 0 && farm.CropHasGrazingAnimals(currentYearViewItem) && farm.YieldAssignmentMethod != YieldAssignmentMethod.Custom && currentYearViewItem.HarvestMethod != HarvestMethods.StubbleGrazing)
if (isNonSwathingGrazingScenario)
{
// Total C losses from grazing animals is calculated in Equation 11.3.2-4

Expand Down
6 changes: 6 additions & 0 deletions H.Core/Calculators/Carbon/IPCCTier2SoilCarbonCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ public void CalculateInputs(CropViewItem viewItem, Farm farm)
intercept: intercept,
moistureContentAsPercentage: viewItem.MoistureContentOfCropPercentage);


if (viewItem.HarvestMethod == HarvestMethods.Swathing && farm.CropHasGrazingAnimals(viewItem))
{
viewItem.PercentageOfProductYieldReturnedToSoil = (100 - viewItem.GetAverageUtilizationFromGrazingAnimals());
}

viewItem.AboveGroundResidueDryMatter = this.CalculateAboveGroundResidueDryMatter(harvestIndex: harvestIndex, viewItem: viewItem);

viewItem.AboveGroundResidueDryMatterExported = this.CalculateAboveGroundResidueDryMatterExported(
Expand Down
2 changes: 1 addition & 1 deletion H.Core/H.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>H.Core</RootNamespace>
<AssemblyName>AAFC.Holos.Core</AssemblyName>
<AssemblyName>H.Core</AssemblyName>
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
Expand Down
17 changes: 17 additions & 0 deletions H.Core/Models/LandManagement/Fields/CropViewItem.Grazing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using System.Linq;

namespace H.Core.Models.LandManagement.Fields
{
Expand Down Expand Up @@ -42,5 +43,21 @@ public double TotalCarbonLossesByGrazingAnimals
public double TotalCarbonUptakeByAnimals { get; set; }

#endregion

#region Public Methods

public double GetAverageUtilizationFromGrazingAnimals()
{
if (this.HasGrazingViewItems)
{
return this.GrazingViewItems.Average(x => x.Utilization);
}
else
{
return 0;
}
}

#endregion
}
}
2 changes: 1 addition & 1 deletion H.Infrastructure/H.Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>H.Infrastructure</RootNamespace>
<AssemblyName>AAFC.Holos.Infrastructure</AssemblyName>
<AssemblyName>H.Infrastructure</AssemblyName>
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
Expand Down

0 comments on commit c40952e

Please sign in to comment.