Calculation
The primary calculations of the app are executed via the seeding rate calculator SDK, and we have developed multiple functions in /src/shared/utils/calculator.js
to utilize these calculations.
convertToPercent
: Utility function to convert a float number to a percentage value with 1 digit decimal.
twoDigit
: Utility function to convert a value to a 2 digit decimal number.
createUserInput
: Utility function to create a custom input for the calculator object.
createCalculator
: Call sdk to initialize a new SeedRateCalculator
object.
initialOptions
: Initial parameters for a seed for calculation, this options is used in the app for adjusting parameters for the calculator.
adjustProportions
: Calculations in Mix Ratios
page for MCCC. The calculation includes 4 steps which is listed in the page. Additionally, the calculations log each step on the console for debugging purposes.
adjustProportionsNECCC
: The calculations for NECCC. It contains 3 steps which is differ from MCCC.
reviewMix
: Calculations in Review MIx
page for MCCC. It contains 5 steps and also logs the steps to the console for debugging.
reviewMixNECCC
: Calculations for NECCC.
confirmPlan
: Calculations for Confirm Plan
page.
checkNRCS
: Calculations for NRCS check in MCCC. This function contains 5 child functions, each of them is runs a single check on the selected seeds, all of them will print the checking result to the console for debugging.
getPlantingDate
: Utility function to get the Reliable Establishment
planting date from a seed.
calculatePieChartData
: Utility function to calculate data for pie charts in the app.
calculatePlantsandSeedsPerAcre
: Utility function for calculating default and adjusted(seed in mix) Plant and Seed Per Acre
for the seed data in Mix Ratios
and Review Mix
.