Exemplo n.º 1
0
        public static void SaveEvapData(int stationIndex, string stationName)
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter      = "Data files (*.dat)|*.dat|All files (*.*)|*.*";
            saveFileDialog1.FilterIndex = 1;
            saveFileDialog1.FileName    = "Evap - " + stationName + ".dat";
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                StreamWriter writer = new StreamWriter(saveFileDialog1.FileName);
                writer.WriteLine(GeoData.GetEvapData(evapSourceIndex, false));
                writer.Close();
            }
        }
        // Finds adjustments to monthly evap. rates for a choice of evap. station
        // and climate projection year.
        private static void UpdateEvapAdjustments()
        {
            // Get evap values for each scenario
            string evapID = GeoData.GetEvapStationID(SiteData.evapSourceIndex);

            double[] y = new double[12];
            string   evapTable;

            evap1.Clear();
            if (SiteData.climateYear == 2035)
            {
                evapTable = StormwaterCalculator.Properties.Resources.Pmet2035Hot;
            }
            else
            {
                evapTable = StormwaterCalculator.Properties.Resources.Pmet2060Hot;
            }
            if (GetEvapAdjustments(evapTable, evapID, ref y))
            {
                evap1.Add(null, y);
            }

            evap2.Clear();
            if (SiteData.climateYear == 2035)
            {
                evapTable = StormwaterCalculator.Properties.Resources.Pmet2035Med;
            }
            else
            {
                evapTable = StormwaterCalculator.Properties.Resources.Pmet2060Med;
            }
            if (GetEvapAdjustments(evapTable, evapID, ref y))
            {
                evap2.Add(null, y);
            }

            evap3.Clear();
            if (SiteData.climateYear == 2035)
            {
                evapTable = StormwaterCalculator.Properties.Resources.Pmet2035Wet;
            }
            else
            {
                evapTable = StormwaterCalculator.Properties.Resources.Pmet2060Wet;
            }
            if (GetEvapAdjustments(evapTable, evapID, ref y))
            {
                evap3.Add(null, y);
            }

            evap0.Clear();
            string evapData = GeoData.GetEvapData(SiteData.evapSourceIndex, false);

            string[] values = evapData.Split(default(Char[]), StringSplitOptions.RemoveEmptyEntries);
            if (values.Length >= 12)
            {
                for (int i = 0; i < 12; i++)
                {
                    y[i] = Double.Parse(values[i]);
                }
                evap0.Add(null, y);
            }
        }