/// <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 += "<div class=\"activityentry\">";
            html += "Each Adult Equivalent is able to consume ";
            if (DailyIntakeLimit > 0)
            {
                html += "<span class=\"setvalue\">";
                html += DailyIntakeLimit.ToString("#,##0.##");
            }
            else
            {
                html += "<span class=\"errorlink\">NOT SET";
            }
            html += "</span> kg per day</div>";
            if (DailyIntakeOtherSources > 0)
            {
                html += "with <span class=\"setvalue\">";
                html += DailyIntakeOtherSources.ToString("#,##0.##");
                html += "</span> provided from non-modelled sources";
            }
            html += "</div>";
            html += "<div class=\"activityentry\">";
            html += "Hired labour <span class=\"setvalue\">" + ((IncludeHiredLabour) ? "is" : "is not") + "</span> included";
            html += "</div>";
            return(html);
        }
Example #2
0
        /// <inheritdoc/>
        public override string ModelSummary()
        {
            using (StringWriter htmlWriter = new StringWriter())
            {
                htmlWriter.Write("<div class=\"activityentry\">");
                htmlWriter.Write("Each Adult Equivalent is able to consume ");
                if (DailyIntakeLimit > 0)
                {
                    htmlWriter.Write("<span class=\"setvalue\">");
                    htmlWriter.Write(DailyIntakeLimit.ToString("#,##0.##"));
                }
                else
                {
                    htmlWriter.Write("<span class=\"errorlink\">NOT SET");
                }

                htmlWriter.Write("</span> kg per day");
                if (DailyIntakeOtherSources > 0)
                {
                    htmlWriter.Write("with <span class=\"setvalue\">");
                    htmlWriter.Write(DailyIntakeOtherSources.ToString("#,##0.##"));
                    htmlWriter.Write("</span> provided from non-modelled sources");
                }
                htmlWriter.Write("</div>");
                htmlWriter.Write("<div class=\"activityentry\">");
                htmlWriter.Write("Hired labour <span class=\"setvalue\">" + ((IncludeHiredLabour) ? "is" : "is not") + "</span> included");
                htmlWriter.Write("</div>");

                // find a market place if present
                Simulation sim = FindAncestor <Simulation>();
                if (sim != null)
                {
                    Market marketPlace = sim.FindChild <Market>();
                    if (marketPlace != null)
                    {
                        htmlWriter.Write("<div class=\"activityentry\">");
                        htmlWriter.Write("Food with be bought and sold through the market <span class=\"setvalue\">" + marketPlace.Name + "</span>");
                        htmlWriter.Write("</div>");
                    }
                }
                return(htmlWriter.ToString());
            }
        }
Example #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 += "<div class=\"activityentry\">";
            html += "Each Adult Equivalent is able to consume ";
            if (DailyIntakeLimit > 0)
            {
                html += "<span class=\"setvalue\">";
                html += DailyIntakeLimit.ToString("#,##0.##");
            }
            else
            {
                html += "<span class=\"errorlink\">NOT SET";
            }
            html += "</span> kg per day";
            if (DailyIntakeOtherSources > 0)
            {
                html += "with <span class=\"setvalue\">";
                html += DailyIntakeOtherSources.ToString("#,##0.##");
                html += "</span> provided from non-modelled sources";
            }
            html += "</div>";
            html += "<div class=\"activityentry\">";
            html += "Hired labour <span class=\"setvalue\">" + ((IncludeHiredLabour) ? "is" : "is not") + "</span> included";
            html += "</div>";

            // find a market place if present
            Simulation sim = Apsim.Parent(this, typeof(Simulation)) as Simulation;

            if (sim != null)
            {
                Market marketPlace = Apsim.Child(sim, typeof(Market)) as Market;
                if (marketPlace != null)
                {
                    html += "<div class=\"activityentry\">";
                    html += "Food with be bought and sold through the market <span class=\"setvalue\">" + marketPlace.Name + "</span>";
                    html += "</div>";
                }
            }
            return(html);
        }