Skip to main content

getDefaultsForHarvestParameters

@svenvw/fdm-source


@svenvw/fdm-source / fdm-core/src / getDefaultsForHarvestParameters

Function: getDefaultsForHarvestParameters()

getDefaultsForHarvestParameters(b_lu_catalogue, cultivationsCatalogue): HarvestParametersDefault

Defined in: fdm-core/src/harvest.ts:977

Generates default harvest parameter values for a given cultivation.

This function retrieves the required harvest parameters for a specific cultivation's harvest category and calculates default values for each. The calculations are performed using decimal.js to ensure precision. The default values are derived from the cultivation's catalogue data.

Parameters

b_lu_catalogue

any

The identifier for the cultivation in the catalogue.

cultivationsCatalogue

any[]

An array of cultivation catalogue items.

Returns

HarvestParametersDefault

An object containing the default harvest parameters.

Throws

If the cultivation catalogue item is not found.

Example

const defaults = getDefaultsForHarvestParameters("crop-001", catalogue);
console.log(defaults);
// Output might be: { b_lu_yield: 10000, b_lu_dm: 850 }