Esempio n. 1
0
        private void Init(int waterYear)
        {
            //    qu = new HydrometDailySeries("HEII", "QU",HydrometHost.PNLinux);
            //    var t1 = new DateTime(waterYear-1, 10, 1);
            //    var t2 = new DateTime(waterYear, 8, 1);
            //    if (t2 > DateTime.Now && t2.Year != 7100)
            //    {
            //        t2 = DateTime.Now.AddDays(-1);
            //    }
            //    qu.Read(t1, t2);
            //    // find date where (if)  20,000 cfs occurs at heii.

            //    for (int i = 0; i < qu.Count; i++)
            //    {
            //        Point pt = qu[i];
            //        if( !pt.IsMissing  && pt.Value >=20000)
            //        {
            //            quDate20000 = pt.DateTime;
            //            break;
            //        }
            //    }

            solid  = FcPlotDataSet.GetPeriodicSeries("Heii.Solid");
            dashed = FcPlotDataSet.GetPeriodicSeries("Heii.Dashed");
        }
Esempio n. 2
0
        private void Init(string text, string lookupColumnName)
        {
            DataTable tbl = FcPlotDataSet.ControlPointTableFromName(text, lookupColumnName);

            if (tbl.Rows.Count != 1)
            {
                throw new ArgumentException("Error: site not found '" + Name + "'");
            }

            Name           = tbl.Rows[0]["Name"].ToString();
            StationQU      = tbl.Rows[0]["StationQU"].ToString();
            StationQD      = tbl.Rows[0]["StationQD"].ToString();
            DailyStationQU = tbl.Rows[0]["DailyStationQU"].ToString();
            StationFC      = tbl.Rows[0]["StationFC"].ToString();
            EspNode        = tbl.Rows[0]["EspNode"].ToString();

            if (tbl.Rows[0]["FlagLegend"] != DBNull.Value)
            {
                FlagLegend = tbl.Rows[0]["FlagLegend"].ToString();
            }

            PercentSpace = Convert.ToDouble(tbl.Rows[0]["PercentSpace"]);

            string s = tbl.Rows[0]["UpstreamReservoirs"].ToString().Trim();

            UpstreamReservoirs = s.Split(',');

            ReservoirLags = new int[UpstreamReservoirs.Length];


            if (tbl.Rows[0]["ReservoirLags"] != DBNull.Value)
            {
                s = tbl.Rows[0]["ReservoirLags"].ToString().Trim();
                if (s != "")
                {
                    var        tokens  = s.Split(',');
                    List <int> lagList = new List <int>();
                    for (int i = 0; i < tokens.Length; i++)
                    {
                        lagList.Add(Convert.ToInt32(tokens[i]));
                    }
                    if (lagList.Count != UpstreamReservoirs.Length)
                    {
                        throw new ArgumentException("The number of lags, does not match the number of upstream stations");
                    }

                    ReservoirLags = lagList.ToArray();
                }
            }

            TotalUpstreamActiveSpace = Convert.ToDouble(tbl.Rows[0]["TotalUpstreamActiveSpace"]);

            VariableRuleCurve = Convert.ToBoolean(tbl.Rows[0]["VariableRuleCurve"]);

            RequiredLegend = tbl.Rows[0]["RequiredLegend"].ToString();

            ForecastMonthStart = Convert.ToInt32(tbl.Rows[0]["ForecastMonthStart"].ToString());
            ForecastMonthEnd   = Convert.ToInt32(tbl.Rows[0]["ForecastMonthEnd"].ToString());
        }
Esempio n. 3
0
        public WodiRuleCurve(string cbtt, int waterYear, FillType fType)
            : base("wodi.space", fType)
        {
            this.waterYear = waterYear;
            qu             = new HydrometDailySeries("wodi", "qu");
            var t1 = new DateTime(waterYear - 1, 10, 1);
            var t2 = new DateTime(waterYear, 9, 30);

            qu.Read(t1, t2);
            tblQu          = FcPlotDataSet.GetTable("wodi.inflow");
            tblfc          = FcPlotDataSet.GetTable("wodi.forecast");
            fc             = new HydrometMonthlySeries("wodi", "fc");
            fc.TimePostion = TimePostion.EndOfMonth;
            fc.Read(t1, t2);

            ReadQUAverage();
        }
Esempio n. 4
0
        public SeriesList CalculateVariableRuleCurves(DateTime t1, DateTime t2, double totalSpace, double percent)
        {
            var rval = new SeriesList();

            if (m_fillType == FillType.Fixed)
            {
                return(rval);
            }


            var levels = FcPlotDataSet.GetVariableForecastLevels(curveName);

            for (int i = 0; i < levels.Length; i++)
            {
                Series s = CreateRuleLine(levels[i], t1, t2) * percent;
                s = -s + totalSpace;

                s = Max(s, 0);
                rval.Add(s);
            }

            return(rval);
        }