/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public bool IsHarvestDayForCrop(int id) { VegObjectController CurrentCrop = sim.VegetationController.CurrentCrop; if (CurrentCrop != null) { return(CurrentCrop.CropIndex == id && CurrentCrop.TodayIsPlantDay); } return(false); }
/// <summary> /// /// </summary> /// <returns></returns> public bool IsHarvestDay() { VegObjectController CurrentCrop = sim.VegetationController.CurrentCrop; if (CurrentCrop != null) { return(CurrentCrop.TodayIsPlantDay); } return(false); }
/// <summary> /// /// </summary> /// <param name="crop"></param> public void CheckApplicationBasedOnDAS(VegObjectController crop) { if (ApplicationIndex == 0 && crop.days_since_planting >= dataModel.TriggerDaysFirst) { ProductRateApplied = dataModel.ProductRate; ++ApplicationIndex; } else if (ApplicationIndex > 0 && crop.days_since_planting >= dataModel.TriggerDaysFirst + dataModel.TriggerDaysSubsequent * ApplicationIndex) { ProductRateApplied = dataModel.SubsequentProductRate; ++ApplicationIndex; } }
/// <summary> /// /// </summary> public void Plant() { ++sim.total_number_plantings; sim.accumulate_cov_day_before_planting += sim.total_residue_cover; VegObjectController lastcrop = sim.VegetationController.CurrentCrop; sim.VegetationController.CurrentCrop = this; LastSowingDate = sim.today; if (lastcrop != this || rotation_count == 0) { lastcrop.ResetRotationCount(); sim.VegetationController.CurrentCrop.ResetRotationCount(); } out_DaysSincePlant_days = 0; ++number_of_plantings; dry_matter = 0; out_DryMatter_kg_per_ha = 0; crop_stage = 0; out_RootDepth_mm = 0; yield = 0; soil_water_at_planting = sim.total_soil_water; CropStatus = CropStatus.csGrowing; }