Ejemplo n.º 1
0
        protected virtual void setCols()
        {
            try
            {//figure out config dates and get comp columns
                HeightConfigCollection configcollection = new HeightConfigCollection(_collection);
                List <IConfig>         configs          = configcollection.GetConfigs();

                Console.WriteLine(" doing " + _summarytype);

                if (configs.Count > 1)
                {
                    Console.WriteLine("configs found " + configs.Count);
                    foreach (IConfig c in configs)
                    {
                        Console.WriteLine("start date " + c.StartDate);
                    }
                    throw new ApplicationException("Can not process grid. System not yet set up to handle multpile configurations");
                }
                _configstart = configs[0].StartDate;
                Console.WriteLine("start date in summary grid " + _configstart);
                //wscomps
                //SortedDictionary<double, ISessionColumn> wscomps
                //    = _collection.GetColumnsByType(SessionColumnType.WSAvg, _configstart, true);

                _lowerwscompcol = _collection[_collection.LowerWSComp(_configstart)];
                _upperwscompcol = _collection[_collection.UpperWSComp(_configstart)];
                _lowerwsht      = _lowerwscompcol.getConfigAtDate(_configstart).Height;
                _upperwsht      = _upperwscompcol.getConfigAtDate(_configstart).Height;

                //Console.WriteLine("Summary grid found " + wscomps.Values.Count + " ws comps");
                //wdcomp
                List <ISessionColumn> wdcomp =
                    _collection.GetColumnsByType(SessionColumnType.WDAvg);
                var compcol = from c in wdcomp.AsEnumerable()
                              where c.IsComposite
                              select c;

                _wdcompcol = compcol.ToList()[0];

                Console.WriteLine("Summary grid found " + compcol.ToList().Count + " wd comps");

                //shear

                _shearwscol = _collection.GetColumnsByType(_sheartype)[0];
                _shearht    = _shearwscol.getConfigAtDate(_configstart).Height;
                Console.WriteLine("Summary grid found " + _collection.GetColumnsByType(_sheartype).Count + " shear");
            }
            catch
            {
                throw;
            }
        }
        public WindSpeedFrequencyWDWSWorkSheet(
            ISessionColumnCollection collection,
            DataView data,
            double wdbinwidth,
            double wsbinwidth,
            ExcelFile ef,
            SessionColumnType sheartype)
        {
            DateTime start = (DateTime)data[0][collection.DateIndex];

            _WDgrid = new SummaryGrid(collection, data.Table, sheartype,
                                      new WindDirectionAxis(wdbinwidth), SummaryType.WD);
            _WSgrid = new SummaryGrid(collection, data.Table, sheartype,
                                      new WindSpeedAxis(wsbinwidth, data, collection.UpperWSComp(start)), SummaryType.WS);
            _excelfile = ef;
        }