/// <summary>Harvest the crop.</summary> public void RemoveBiomass(string biomassRemoveType, RemovalFractions removalData = null) { summary.WriteMessage(this, string.Format("Biomass removed from crop " + Name + " by " + biomassRemoveType.TrimEnd('e') + "ing")); // Invoke specific defoliation events. if (biomassRemoveType == "Harvest" && Harvesting != null) { Harvesting.Invoke(this, new EventArgs()); } if (biomassRemoveType == "Prune" && Pruning != null) { Pruning.Invoke(this, new EventArgs()); } if (biomassRemoveType == "LeafPluck" && LeafPlucking != null) { LeafPlucking.Invoke(this, new EventArgs()); } if (biomassRemoveType == "Cut" && Cutting != null) { Cutting.Invoke(this, new EventArgs()); } if (biomassRemoveType == "Graze" && Grazing != null) { Grazing.Invoke(this, new EventArgs()); } // Set up the default BiomassRemovalData values foreach (IOrgan organ in Organs) { // Get the default removal fractions OrganBiomassRemovalType biomassRemoval = null; if (removalData != null) { biomassRemoval = removalData.GetFractionsForOrgan(organ.Name); } organ.RemoveBiomass(biomassRemoveType, biomassRemoval); } // Reset the phenology if SetPhenologyStage specified. if (removalData != null && removalData.SetPhenologyStage != 0 && Phenology is Phenology phenology) { phenology.SetToStage(removalData.SetPhenologyStage); } // Reduce plant and stem population if thinning proportion specified if (removalData != null && removalData.SetThinningProportion != 0 && structure != null) { structure.DoThin(removalData.SetThinningProportion); } // Remove nodes from the main-stem if (removalData != null && removalData.NodesToRemove > 0) { structure.DoNodeRemoval(removalData.NodesToRemove); } }
/// <summary>Cut the crop.</summary> public void Cut() { // Invoke a cutting event. if (Cutting != null) { Cutting.Invoke(this, new EventArgs()); } }
private void OnCut() { Cutting.Invoke(); }