private void UpdateCanopy() { // PUBLISH New_Canopy event double cover_green = 0; double cover_sen = 0; foreach (Organ1 Organ in Organ1s) { cover_green += Organ.CoverGreen; cover_sen += Organ.CoverSen; } double cover_tot = (1.0 - (1.0 - cover_green) * (1.0 - cover_sen)); NewCanopyType NewCanopy = new NewCanopyType(); NewCanopy.height = (float)Stem.Height; NewCanopy.depth = (float)Stem.Height; NewCanopy.lai = (float)Leaf.LAI; NewCanopy.lai_tot = (float)(Leaf.LAI + Leaf.SLAI); NewCanopy.cover = (float)cover_green; NewCanopy.cover_tot = (float)cover_tot; NewCanopy.sender = Name; New_Canopy.Invoke(NewCanopy); Util.Debug("NewCanopy.height=%f", NewCanopy.height); Util.Debug("NewCanopy.depth=%f", NewCanopy.depth); Util.Debug("NewCanopy.lai=%f", NewCanopy.lai); Util.Debug("NewCanopy.lai_tot=%f", NewCanopy.lai_tot); Util.Debug("NewCanopy.cover=%f", NewCanopy.cover); Util.Debug("NewCanopy.cover_tot=%f", NewCanopy.cover_tot); }
protected virtual void PublishNewCanopyEvent() { if (New_Canopy != null) { NewCanopyType Canopy = new NewCanopyType(); Canopy.sender = Plant.Name; Canopy.lai = (float)LAI; Canopy.lai_tot = (float)(LAI + LAIDead); Canopy.height = (float)Structure.Height; Canopy.depth = (float)Structure.Height; Canopy.cover = (float)CoverGreen; Canopy.cover_tot = (float)CoverTot; New_Canopy.Invoke(Canopy); } }