/// <summary>Gets all canopies in simulation</summary> private void GetAllCanopies() { foreach (ICanopy canopy in Apsim.FindAll(this.Parent, typeof(ICanopy))) { ComponentDataStruct componentData = ComponentData.Find(c => c.Name == canopy.CanopyType); if (componentData == null) { componentData = CreateNewComonentData(canopy.CanopyType); Clear(componentData); } componentData.Name = canopy.CanopyType; componentData.Type = canopy.CanopyType; componentData.Canopy = canopy; componentData.LAI = canopy.LAI; componentData.LAItot = canopy.LAITotal; componentData.CoverGreen = canopy.CoverGreen; componentData.CoverTot = canopy.CoverTotal; componentData.Height = Math.Round(canopy.Height, 5) / 1000.0; // Round off a bit and convert mm to m componentData.Depth = Math.Round(canopy.Depth, 5) / 1000.0; // Round off a bit and convert mm to m componentData.Canopy = canopy; } }