Пример #1
0
            /// <summary>
            /// Compute values using a RatingTableDataTable
            /// for example compute flows based on gage height input series
            /// </summary>
            /// <param name="s"></param>
            /// <param name="fileName">rating table filename</param>
            /// <returns></returns>
            public static Series ComputeSeries(Series s, string fileName)
            {
                var rval = new Series();
                var fn   = fileName;

                Logger.WriteLine("ComputeSeries(" + s.Table.TableName + "," + fileName);
                if (!File.Exists(fn))
                {
                    fn = Path.Combine(Path.Combine(Globals.LocalConfigurationDataPath, "rating_tables"), fileName);
                }

                if (!File.Exists(fn))
                {
                    string msg = "Error: File not found " + fn;
                    Console.WriteLine(msg);
                    Logger.WriteLine(msg);
                    rval.TimeInterval = s.TimeInterval;
                    return(rval);
                }

                var rt = new RatingTableDataTable();

                rt.ReadTable(fn);
                rval = rt.Lookup(s);
                rval.TimeInterval = s.TimeInterval;
                return(rval);
            }
Пример #2
0
            /// <summary>
            /// Compute values using a RatingTableDataTable
            /// for example compute flows based on gage height input series
            /// </summary>
            /// <param name="s"></param>
            /// <param name="fileName">rating table filename</param>
            /// <returns></returns>
            public static Series ComputeSeries(Series s, string fileName,
                                               InterpolationMethod method = InterpolationMethod.None)
            {
                var rval = new Series();

                Logger.WriteLine("RatingTableDataTable.ComputeSeries(" + s.Table.TableName + "," + fileName + ")");

                var fn = RatingTableUtility.GetRatingTableAsLocalFile(fileName);

                if (!File.Exists(fn))
                {
                    string msg = "Error: File not found " + fn;
                    Console.WriteLine(msg);
                    Logger.WriteLine(msg);
                    rval.TimeInterval = s.TimeInterval;
                    return(rval);
                }

                var rt = new RatingTableDataTable();

                rt.ReadFile(fn);

                rval = rt.Lookup(s, method);

                rval.TimeInterval = s.TimeInterval;
                return(rval);
            }
            /// <summary>
            /// Compute values using a RatingTableDataTable
            /// for example compute flows based on gage height input series
            /// </summary>
            /// <param name="s"></param>
            /// <param name="fileName">rating table filename</param>
            /// <returns></returns>
            public static Series ComputeSeries(Series s, string fileName)
            {
                var rval = new Series();
                var fn = fileName;

                Logger.WriteLine("ComputeSeries(" + s.Table.TableName + "," + fileName);
                if(!File.Exists(fn))
                   fn = Path.Combine(Path.Combine(Globals.LocalConfigurationDataPath, "rating_tables"), fileName);

                if (!File.Exists(fn))
                {
                    string msg = "Error: File not found " + fn;
                    Console.WriteLine(msg);
                    Logger.WriteLine(msg);
                    rval.TimeInterval = s.TimeInterval;
                    return rval;
                }

                var rt = new RatingTableDataTable();
                rt.ReadFile(fn);
                rval = rt.Lookup(s);
                rval.TimeInterval = s.TimeInterval;
                return rval;
            }