Esempio n. 1
0
        private void GetValues()
        {
            for (int i = 0; i < maxRows; i++)
            {
                try
                {
                    areas[i] = Convert.ToDouble(dataGridView1[0, i].Value);
                    CCNs[i]  = Convert.ToDouble(dataGridView1[1, i].Value);
                }
                catch
                {
                    areas[i] = 0;
                    CCNs[i]  = 0;
                }
            }

            if (preflag)
            {
                c.PreCompositeCN   = XmlPropertyObject.AsString(CCNs, 2);
                c.PreCompositeArea = XmlPropertyObject.AsString(areas, 2);
            }
            else
            {
                c.PostCompositeCN   = XmlPropertyObject.AsString(CCNs, 2);
                c.PostCompositeArea = XmlPropertyObject.AsString(areas, 2);
            }
        }
Esempio n. 2
0
        private void PlotVNB(VegetatedNaturalBuffer bmp, string p = "Nitrogen")
        {
            SetupVNBChart(p);
            addXY(14, chart1.Series["1"], bmp.plotX(), bmp.plotY(0.2, p));

            addXY(14, chart1.Series["2"], bmp.plotX(), bmp.plotY(0.4, p));

            addXY(14, chart1.Series["3"], bmp.plotX(), bmp.plotY(0.6, p));

            addXY(14, chart1.Series["4"], bmp.plotX(), bmp.plotY(0.8, p));

            addXY(14, chart1.Series["5"], bmp.plotX(), bmp.plotY(1.0, p));

            SetChartArea(chart1.ChartAreas[0], bmp);

            if (p == "Nitrogen")
            {
                AddMarker(bmp.BufferW, bmp.ProvidedNTreatmentEfficiency,
                          "Nitrogen Removal Efficiency at Buffer Width: " + XmlPropertyObject.AsString(bmp.BufferW, 2));
            }
            else
            {
                AddMarker(bmp.BufferW, bmp.ProvidedPTreatmentEfficiency,
                          "Phosphorus Removal Efficiency at Buffer Width: " + XmlPropertyObject.AsString(bmp.BufferW, 2));
            }
        }
Esempio n. 3
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            GetValues();
            Calculate();
            SetValues();
            DialogResult d = MessageBox.Show(
                "Do you want to use this value as the Curve Number? CCN = " + XmlPropertyObject.AsString(CCN, 2)
                , "Use Composite Curve Number?"
                , MessageBoxButtons.YesNo
                , MessageBoxIcon.Information);

            if (d == DialogResult.Yes)
            {
                if (preflag)
                {
                    c.PreNonDCIACurveNumber = CCN;
                    ((frmWatershedCharacteristics)this.Owner).setPreCN(CCN);
                }
                else
                {
                    c.PostNonDCIACurveNumber = CCN;
                    ((frmWatershedCharacteristics)this.Owner).setPostCN(CCN);
                }
            }


            this.Close();
        }
Esempio n. 4
0
        public frmCompositeEMC(Catchment _c, bool pre = true, bool Nitrogen = true)
        {
            InitializeComponent();
            EMCs  = new double[maxRows];
            CCNs  = new double[maxRows];
            areas = new double[maxRows];
            Cs    = new double[maxRows];
            wC    = new double[maxRows];

            c            = _c;
            preflag      = pre;
            NitrogenFlag = Nitrogen;

            if (pre)
            {
                preString = "Pre-Development";
                CCNs      = XmlPropertyObject.AsDoubleArray(c.PreCompositeCN, maxRows);
                if (Nitrogen)
                {
                    EMCs    = XmlPropertyObject.AsDoubleArray(c.PreNCompositeEMC, maxRows);
                    NString = "Total Nitrogen";
                }
                else
                {
                    EMCs    = XmlPropertyObject.AsDoubleArray(c.PrePCompositeEMC, maxRows);
                    NString = "Total Phosphorus";
                }
                areas = XmlPropertyObject.AsDoubleArray(c.PreCompositeArea, maxRows);
                DCIA  = c.PreDCIAPercent;
            }
            else
            {
                preString = "Post-Development";
                CCNs      = XmlPropertyObject.AsDoubleArray(c.PostCompositeCN, maxRows);
                if (Nitrogen)
                {
                    EMCs    = XmlPropertyObject.AsDoubleArray(c.PostNCompositeEMC, maxRows);
                    NString = "Total Nitrogen";
                }
                else
                {
                    EMCs    = XmlPropertyObject.AsDoubleArray(c.PostPCompositeEMC, maxRows);
                    NString = "Total Phosphorus";
                }
                areas = XmlPropertyObject.AsDoubleArray(c.PostCompositeArea, maxRows);
                DCIA  = c.PostDCIAPercent;
            }
        }
Esempio n. 5
0
        private void SetValues()
        {
            Common.setValue(tbSurfaceArea, p.SurfaceArea);
            Common.setValue(tbStorage, p.TotalStorage, 2);

            double[] t = p.getThicknesses();
            for (int i = 0; i < t.Length; i++)
            {
                try
                {
                    dataGridView1[2, i].Value = XmlPropertyObject.AsString(t[i], 2);
                }
                catch
                {
                }
            }
        }
Esempio n. 6
0
        private void SetValues()
        {
            for (int i = 0; i < EMCs.Length; i++)
            {
                try
                {
                    dataGridView1[0, i].Value = XmlPropertyObject.AsString(areas[i], 3);
                    dataGridView1[1, i].Value = XmlPropertyObject.AsString(EMCs[i], 3);
                    dataGridView1[2, i].Value = XmlPropertyObject.AsString(CCNs[i], 0);
                    dataGridView1[3, i].Value = XmlPropertyObject.AsString(Cs[i], 3);
                    dataGridView1[4, i].Value = XmlPropertyObject.AsString(wC[i], 3);
                }
                catch
                {
                }
            }

            lblWC.Text   = XmlPropertyObject.AsString(averageWC, 3);
            lblDCIA.Text = XmlPropertyObject.AsString(DCIA, 1);
            lblCN.Text   = XmlPropertyObject.AsString(EMC, 3);
        }
Esempio n. 7
0
        public frmCompositeCN(Catchment _c, bool pre = true)
        {
            InitializeComponent();
            CCNs  = new double[maxRows];
            areas = new double[maxRows];
            Cs    = new double[maxRows];
            wC    = new double[maxRows];

            c       = _c;
            preflag = pre;
            if (pre)
            {
                CCNs  = XmlPropertyObject.AsDoubleArray(c.PreCompositeCN, maxRows);
                areas = XmlPropertyObject.AsDoubleArray(c.PreCompositeArea, maxRows);
                DCIA  = c.PreDCIAPercent;
            }
            else
            {
                CCNs  = XmlPropertyObject.AsDoubleArray(c.PostCompositeCN, maxRows);
                areas = XmlPropertyObject.AsDoubleArray(c.PostCompositeArea, maxRows);
                DCIA  = c.PostDCIAPercent;
            }
        }
Esempio n. 8
0
        private void GetValues()
        {
            for (int i = 0; i < maxRows; i++)
            {
                areas[i] = Convert.ToDouble(dataGridView1[0, i].Value);
                EMCs[i]  = Convert.ToDouble(dataGridView1[1, i].Value);
                CCNs[i]  = Convert.ToDouble(dataGridView1[2, i].Value);
            }

            if (preflag)
            {
                c.PreCompositeCN = XmlPropertyObject.AsString(CCNs, 0);
                if (NitrogenFlag)
                {
                    c.PreNCompositeEMC = XmlPropertyObject.AsString(EMCs, 3);
                }
                else
                {
                    c.PrePCompositeEMC = XmlPropertyObject.AsString(EMCs, 3);
                }
                c.PreCompositeArea = XmlPropertyObject.AsString(areas, 2);
            }
            else
            {
                c.PostCompositeCN = XmlPropertyObject.AsString(CCNs, 0);
                if (NitrogenFlag)
                {
                    c.PostNCompositeEMC = XmlPropertyObject.AsString(EMCs, 3);
                }
                else
                {
                    c.PostPCompositeEMC = XmlPropertyObject.AsString(EMCs, 3);
                }
                c.PostCompositeArea = XmlPropertyObject.AsString(areas, 2);
            }
        }
Esempio n. 9
0
        private void PlotWetDetention(WetDetention bmp, string p = "Nitrogen")
        {
            chart1.Series.Clear();
            chart1.Titles.Clear();

            chart1.Titles.Add("Title");
            chart1.Titles[0].Text = "Plot of " + p + " for Wet Detention";

            Series series1 = new Series
            {
                Name      = "1",
                Color     = System.Drawing.Color.Blue,
                ChartType = SeriesChartType.Line
            };

            chart1.Series.Add(series1);
            chart1.Series["1"].LegendText = "Wet Detention Efficiency for " + p;

            addXY(14, chart1.Series["1"], bmp.plotX(), bmp.plotY(p));

            SetChartArea(chart1.ChartAreas[0], bmp);

            if (p == "Nitrogen")
            {
                AddMarker(bmp.ResidenceTime, bmp.ProvidedNTreatmentEfficiency,
                          "Nitrogen Removal Efficiency for Residence Time (days): " + XmlPropertyObject.AsString(bmp.ResidenceTime, 1));
            }
            else
            {
                AddMarker(bmp.ResidenceTime, bmp.ProvidedPTreatmentEfficiency,
                          "Phosphorus Removal Efficiency for Residence Time (days): " + XmlPropertyObject.AsString(bmp.ResidenceTime, 1));
            }
        }
Esempio n. 10
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            GetValues();
            Calculate();
            SetValues();
            DialogResult d = MessageBox.Show(
                "Do you want to use this value as the Event Mean Concentration? EMC = " + XmlPropertyObject.AsString(EMC, 3)
                , "Use Event Mean Concentration?"
                , MessageBoxButtons.YesNo
                , MessageBoxIcon.Information);

            if (d == DialogResult.Yes)
            {
                if (preflag)
                {
                    if (NitrogenFlag)
                    {
                        c.PreNConcentration = Math.Round(EMC, 3);
                        ((frmWatershedCharacteristics)this.Owner).setPreNEMC(Math.Round(EMC, 3));
                    }
                    else
                    {
                        c.PrePConcentration = Math.Round(EMC);
                        ((frmWatershedCharacteristics)this.Owner).setPrePEMC(Math.Round(EMC, 3));
                    }
                }
                else
                {
                    if (NitrogenFlag)
                    {
                        c.PostNConcentration = Math.Round(EMC, 3);
                        ((frmWatershedCharacteristics)this.Owner).setPostNEMC(Math.Round(EMC, 3));
                    }
                    else
                    {
                        c.PostPConcentration = Math.Round(EMC, 3);
                        ((frmWatershedCharacteristics)this.Owner).setPostPEMC(Math.Round(EMC, 3));
                    }
                }
            }


            this.Close();
        }
Esempio n. 11
0
        public static void ShowRetentionPlot(BMP bmp, string plotTitle = "Retention Treatment Efficiency")
        {
            frmChart formC = new frmChart(bmp, "Storage");

            formC.Text = plotTitle;
            formC.AddMarker(bmp.RetentionDepth, bmp.HydraulicCaptureEfficiency,
                            "System Efficiency at Treatment Depth (in over watershed): " + XmlPropertyObject.AsString(bmp.RetentionDepth, 2));
            formC.ShowDialog();
        }