-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix[AGRI-NMP-721]: Fertigation Calculation Fixes #722
Conversation
…changed * tank vol to * ammount to dissolve as per Ahmed
@@ -269,7 +269,7 @@ | |||
"Id": 6, | |||
"FertilizerId": 6, | |||
"SolubilityUnitId": 3, | |||
"Value": 15.86, | |||
"Value": 19.02, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to the solubility of Ammonium nitrate to 19.02 as per Ahmed's correction in the fert ppt
if (amountToDissolve <= tankVolume * solInWater/1000){ | ||
//convert tankVolume from imp gal to litres | ||
//convert amountToDissolve from lbs to kgs | ||
if ((amountToDissolve * 0.45359237m) <= ((tankVolume * 4.54609m) * solInWater / 1000 * 0.65m)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per Ahmed fert ppt changed solubility assessment to "Multilply by 0.65 ("amountToDissolve <= tankVolume * solInWater/1000 * 0.65") to give room to error in solubility such as using colder water etc."
@@ -817,5 +817,12 @@ | |||
"Text": "Enter the volume of fertilizer mixture to be applied; do not enter the fertigation system's total output volume.", | |||
"UserPromptPage": "Calculate", | |||
"UserJourney": "Mixed" | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tooltip for solubilty
@@ -308,6 +309,9 @@ public IActionResult FertigationDetails(string fldName, int? id, string? groupID | |||
fgvm.nutrientConcentrationN = nf.nutrientConcentrationN.ToString("#.##"); | |||
fgvm.nutrientConcentrationP205 = nf.nutrientConcentrationP205.ToString("#.##"); | |||
fgvm.nutrientConcentrationK2O = nf.nutrientConcentrationK2O.ToString("#.##"); | |||
fgvm.kglNutrientConcentrationN = (nf.nutrientConcentrationN * 0.119826m).ToString("#.##"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kg/l nutrient concentration in stock to be displayed
</div> | ||
<div class="form-group col-sm-4" style="display:flex; align-items: center;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New nutrient concentration in stock table in kg/l
fgvm.calcN = Convert.ToString(Math.Round(Convert.ToDecimal(fgvm.nutrientConcentrationN) * tankVolume / fertArea, 2)); | ||
fgvm.calcK2o = Convert.ToString(Math.Round(Convert.ToDecimal(fgvm.nutrientConcentrationK2O) * tankVolume / fertArea, 2)); | ||
fgvm.calcP2o5 = Convert.ToString(Math.Round(Convert.ToDecimal(fgvm.nutrientConcentrationP205) * tankVolume / fertArea, 2)); | ||
// dont show nutrient concentration calculations if need to reduce amount to dissolve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes to 0 if user needs to reduce amount to dissolve.
fgvm.dryAction = "Soluble"; | ||
} | ||
else{ | ||
//Need in lb/us gallon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if soluble then calculate nutrient concentration in stock in imperial and metric
fgvm.calcTotalN = Convert.ToString(Convert.ToInt32(fertilizerNutrients.fertilizer_N) * Convert.ToInt32(fgvm.eventsPerSeason)); | ||
fgvm.calcTotalK2o = Convert.ToString(Convert.ToInt32(fertilizerNutrients.fertilizer_P2O5) * Convert.ToInt32(fgvm.eventsPerSeason)); | ||
fgvm.calcTotalP2o5 = Convert.ToString(Convert.ToInt32(fertilizerNutrients.fertilizer_K2O) * Convert.ToInt32(fgvm.eventsPerSeason)); | ||
fgvm.calcTotalN = Convert.ToString(Convert.ToInt32(fertilizerNutrients.fertilizer_N)/100 * Convert.ToInt32(fgvm.eventsPerSeason)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction to Applied Nutrients calculation, was N * tank vol / fert area now N/100 * amount to dissolve / fert area
decimal convertedProductRate = Convert.ToDecimal(fgvm.productRate) * _fU.ConversionToImperialGallonsPerAcre; | ||
|
||
// Method to get conversion factor based on user's selected unit for product rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change total product units and conversion factor based on users application rate units
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull Request Standards
HOTFIX
,FEATURE
,etc
][NMP-###]
README
,functions
,team documents
]Description
This PR includes the following proposed change(s):
Corrected unit conversions on solubility assessment

- ("amountToDissolve <= tankVolume * solInWater/1000 * 0.65") Josh to get back to us on coefficient for marginal error like cold vs warm water.
Change to the solubility of Ammonium nitrate to 19.02 as per Ahmed's correction
Correction to Applied Nutrients calculation, was N * tank vol / fert area now N/100 * amount to dissolve / fert area
Corrected total product volume calculations to match user's selected application rate unit, added conversion factor (these now match the fert calculation values expected)


Added a second Nutrient Concentration In Stock Solution calculation in kg/L, for Dry Fertilizer and Dry Fertilizer Custom.

Added solubility tooltip for Dry Fertilizer and Dry Fertilizer Custom. (Tooltips are still being wacky not always showing when clicked, previously Ariel and I tried to fix but couldn't figure out why. In the ppt Josh mentions it's happened before and fixed when goes to prod?)
