Beispiel #1
0
        public object createForestryReport(ForestryValues values)
        {
            var Expected = values.GetExpected();
            var Actual   = values.GetActual();
            var PYield   = values.GetPYield();

            var fReport = new
            {
                scenario = values.ScenarioName,
                location = values.ParcelName,
                //Live_Trees = MakeReportObj(Expected[0].ToString(), Actual[0], PYield[0]),
                //Standing_Dead = MakeReportObj(Expected[1].ToString(), Actual[1], PYield[1]),
                //Forest_Floor = MakeReportObj(Expected[2].ToString(), Actual[2], PYield[2]),
                //Understory = MakeReportObj(Expected[3].ToString(), Actual[3], PYield[3]),
                //Downed_Dead_Wood = MakeReportObj(Expected[4].ToString(), Actual[4], PYield[4]),
                //Soil_Organic = MakeReportObj(Expected[5].ToString(), Actual[5], PYield[5]),
                //Products_In_Use = MakeReportObj(Expected[6].ToString(), Actual[6], PYield[6]),
                //In_Landfills = MakeReportObj(Expected[7].ToString(), Actual[7], PYield[7]),
                Total_Stand_Carbon = MakeReportObj(Expected[0].ToString(), Actual[0], PYield[0]),
                Harvested_Carbon   = MakeReportObj(Expected[1].ToString(), Actual[1], PYield[1]),
                Total = MakeReportObj(Expected[2].ToString(), Actual[2], PYield[2]),
            };


            return(fReport);
        }
Beispiel #2
0
        public void CreateForestryTable(HtmlTextWriter writer, ForestryValues values)
        {
            var Expected = values.GetExpected();
            var Actual   = values.GetActual();
            var PYield   = values.GetPYield();

            //Forestry Table
            writer.RenderBeginTag("table style='width:100%' border='2' border-collapse: collapse");
            CreateHeaderRow(writer, values.ScenarioName, values.ParcelName, "", "");
            CreateHeaderRow(writer, "Forestry", "Expected", "Reported", "Percent Yield");
            //CreateNormalRow(writer, "Live Trees", Expected[0].ToString(), Actual[0], PYield[0]);
            //CreateNormalRow(writer, "Standing Dead", Expected[1].ToString(), Actual[1], PYield[1]);
            //CreateNormalRow(writer, "Forest Floor", Expected[2].ToString(), Actual[2], PYield[2]);
            //CreateNormalRow(writer, "Understory", Expected[3].ToString(), Actual[3], PYield[3]);
            //CreateNormalRow(writer, "Downed Dead Wood", Expected[4].ToString(), Actual[4], PYield[4]);
            //CreateNormalRow(writer, "Soil Organic", Expected[5].ToString(), Actual[5], PYield[5]);
            //CreateNormalRow(writer, "Products In Use", Expected[6].ToString(), Actual[6], PYield[6]);
            //CreateNormalRow(writer, "In Landfills", Expected[7].ToString(), Actual[7], PYield[7]);
            //CreateNormalRow(writer, "Total", Expected[8].ToString(), Actual[8], PYield[8]);

            CreateNormalRow(writer, "Total Stand Carbon", Expected[0].ToString(), Actual[0], PYield[0]);
            CreateNormalRow(writer, "Harvested Carbon", Expected[1].ToString(), Actual[1], PYield[1]);
            CreateNormalRow(writer, "Total", Expected[2].ToString(), Actual[2], PYield[2]);
            CreateNormalRow(writer, "Site", "", "", MainWindow.getTestLoc());
            writer.RenderEndTag();
        }
Beispiel #3
0
        public void ForestryReport()
        {
            string reportValue;
            int    scenarioCount = 0;

            foreach (var scenario in xmlReport.ForestryReportScenarioList)
            {
                int parcelCount = 0;
                foreach (var report in scenario.ForestryReportList)
                {
                    var fValues = new ForestryValues();

                    fValues.SetExpected(report);

                    //Select Croplands Tab
                    gMethods.FindAndClick(By.XPath("//div[contains(@id,'reportTabs')]/div/div/div/div[*]/em/button/span[contains(.,'Forestry')]"), driver, true);

                    gMethods.AddDelay(2000);

                    // Grabs the values off the report table and compares to expected values
                    for (int i = 0; i < 2; i++)
                    {
                        //reportValue = gMethods.FindValue(By.XPath("//div[contains(@id,'forestryReportContainer')]/div/div[2]/div[1]/div/div/div[1]/div/table/tbody/tr[" + (parcelCount * 3) + "]/td/table/tbody/tr[" + (i + 2) + "]/td[" + (scenarioCount + 5) + "]/div"), driver);
                        reportValue = gMethods.FindValue(By.XPath("//div[contains(@id,'forestryReportContainer')]/div/div/div/table/tbody/tr[3]/td/table/tbody/tr[" + (i + 2) + "]/td[6]/div"), driver);
                        //reportValue = gMethods.FindValue(By.XPath("//div[contains(@id,'forestryReportContainer')]/div/div/div/table/tbody/tr[3]/td/table/tbody/tr[" + (i + 2) + "]/td[6]/div"), driver);


                        gMethods.AddDelay(300);

                        fValues.SetActual(i, reportValue);
                    }

                    //reportTabContainer
                    //reportValue = gMethods.FindValue(By.XPath("//div[contains(@id,'forestryReportContainer')]/div/div[2]/div[1]/div/div/div[1]/div/table/tbody/tr[" + (parcelCount * 3 + 1) + "]/td[" + (scenarioCount + 5) + "]/div"), driver);
                    reportValue = gMethods.FindValue(By.XPath("//div[contains(@id,'forestryReportContainer')]/div/div/div/table/tbody/tr[4]/td[6]/div"), driver);

                    fValues.SetActual(2, reportValue);

                    fValues.CalculatePYield();

                    ForestryReports.Add(fValues);

                    parcelCount++;
                }
                scenarioCount++;
                if (scenario.Name != "Baseline")
                {
                    scenarioCount++;
                }
            }
        }