Ejemplo n.º 1
0
        /// <inheritdoc/>
        public override string ModelSummary()
        {
            using (StringWriter htmlWriter = new StringWriter())
            {
                htmlWriter.Write("\r\n<div class=\"activityentry\">");
                htmlWriter.Write(CLEMModel.DisplaySummaryValueSnippet(FeedTypeName, "Pasture not set", HTMLSummaryStyle.Resource));
                htmlWriter.Write(" occupies ");
                Land parentLand = null;
                if (LandTypeNameToUse != null && LandTypeNameToUse != "")
                {
                    parentLand = this.FindInScope(LandTypeNameToUse.Split('.')[0]) as Land;
                }

                if (UseAreaAvailable)
                {
                    htmlWriter.Write("the unallocated portion of ");
                }
                else
                {
                    if (parentLand == null)
                    {
                        htmlWriter.Write("<span class=\"setvalue\">" + AreaRequested.ToString("#,##0.###") + "</span> <span class=\"errorlink\">[UNITS NOT SET]</span> of ");
                    }
                    else
                    {
                        htmlWriter.Write("<span class=\"setvalue\">" + AreaRequested.ToString("#,##0.###") + "</span> " + parentLand.UnitsOfArea + " of ");
                    }
                }
                htmlWriter.Write(CLEMModel.DisplaySummaryValueSnippet(LandTypeNameToUse, "Land not set", HTMLSummaryStyle.Resource));
                htmlWriter.Write("</div>");

                return(htmlWriter.ToString());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Provides the description of the model settings for summary (GetFullSummary)
        /// </summary>
        /// <param name="formatForParentControl">Use full verbose description</param>
        /// <returns></returns>
        public override string ModelSummary(bool formatForParentControl)
        {
            string html = "";

            html += "\n<div class=\"activityentry\">";
            if (FeedTypeName == null || FeedTypeName == "")
            {
                html += "<span class=\"errorlink\">[PASTURE TYPE NOT SET]</span>";
            }
            else
            {
                html += "<span class=\"resourcelink\">" + FeedTypeName + "</span>";
            }
            html += " occupies ";
            Land parentLand = null;

            if (LandTypeNameToUse != null && LandTypeNameToUse != "")
            {
                parentLand = Apsim.Find(this, LandTypeNameToUse.Split('.')[0]) as Land;
            }

            if (UseAreaAvailable)
            {
                html += "the unallocated portion of ";
            }
            else
            {
                if (parentLand == null)
                {
                    html += "<span class=\"setvalue\">" + AreaRequested.ToString("#,##0.###") + "</span> <span class=\"errorlink\">[UNITS NOT SET]</span> of ";
                }
                else
                {
                    html += "<span class=\"setvalue\">" + AreaRequested.ToString("#,##0.###") + "</span> " + parentLand.UnitsOfArea + " of ";
                }
            }
            if (LandTypeNameToUse == null || LandTypeNameToUse == "")
            {
                html += "<span class=\"errorlink\">[LAND NOT SET]</span>";
            }
            else
            {
                html += "<span class=\"resourcelink\">" + LandTypeNameToUse + "</span>";
            }
            html += "</div>";

            html += "\n<div class=\"activityentry\">";
            html += "The simulation starts with <span class=\"setvalue\">" + StartingAmount.ToString("#,##0.##") + "</span> kg/ha";
            html += "</div>";

            return(html);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Provides the description of the model settings for summary (GetFullSummary)
        /// </summary>
        /// <param name="formatForParentControl">Use full verbose description</param>
        /// <returns></returns>
        public override string ModelSummary(bool formatForParentControl)
        {
            string html = "";

            html += "\n<div class=\"activityentry\">This crop uses ";

            Land   parentLand = null;
            IModel clemParent = FindAncestor <ZoneCLEM>();

            if (LandItemNameToUse != null && LandItemNameToUse != "")
            {
                if (clemParent != null && clemParent.Enabled)
                {
                    parentLand = clemParent.FindInScope(LandItemNameToUse.Split('.')[0]) as Land;
                }
            }

            if (UseAreaAvailable)
            {
                html += "the unallocated portion of ";
            }
            else
            {
                if (parentLand == null)
                {
                    html += "<span class=\"setvalue\">" + AreaRequested.ToString("0.###") + "</span> <span class=\"errorlink\">[UNITS NOT SET]</span> of ";
                }
                else
                {
                    html += "<span class=\"setvalue\">" + AreaRequested.ToString("0.###") + "</span> " + parentLand.UnitsOfArea + " of ";
                }
            }
            if (LandItemNameToUse == null || LandItemNameToUse == "")
            {
                html += "<span class=\"errorlink\">[LAND NOT SET]</span>";
            }
            else
            {
                html += "<span class=\"resourcelink\">" + LandItemNameToUse + "</span>";
            }
            html += "</div>";
            return(html);
        }