public XbyYShearStationSummary(
            ISessionColumnCollection collection,
            DataView data,
            double wdbin,
            double wdrosebin,
            double wsbin,
            ShearCalculationGridCollection gridcollection,
            List <StationSummarySheetType> whatToRun
            )
        {
            _collection     = collection;
            _data           = data;
            _wdbin          = wdbin;
            _wdrosebin      = wdrosebin;
            _wsbin          = wsbin;
            _gridcollection = gridcollection;

            _ef            = new ExcelFile();
            _ef.LimitNear += new LimitEventHandler(_ef_LimitNear);

            foreach (StationSummarySheetType s in whatToRun)
            {
                try
                {
                    RunReports[s].Invoke();
                }
                catch
                {
                }
            }
        }
        public XbyYShearStationSummary(
            ISessionColumnCollection collection,
            DataView data,
            double wdbin,
            double wdrosebin,
            double wsbin,
            AbstractAlpha gridcollection
            )
        {
            _collection      = collection;
            _data            = data;
            _wdbin           = wdbin;
            _wdrosebin       = wdrosebin;
            _wsbin           = wsbin;
            _alphacollection = gridcollection;

            _ef            = new ExcelFile();
            _ef.LimitNear += new LimitEventHandler(_ef_LimitNear);

            //original data
            _shearWksht        = new MonthbyHourShearWorkSheet(_alphacollection, _ef);
            _monthHourWorksht  = new WindSpeedFrequencyMonthHourWorkSheet(collection, data.Table, _ef, SessionColumnType.WSAvgShear);
            _wSWDworkSht       = new WindSpeedFrequencyWDWSWorkSheet(collection, data, wdbin, wsbin, _ef, SessionColumnType.WSAvgShear);
            _wroseWksht        = new WindRoseWorkSheet(collection, data, wdrosebin, _ef, SessionColumnType.WSAvgShear);
            _dataRecoveryWksht = new DataRecoveryWorksheet(_ef, collection, data.Table);

            //built in order they will appear in work book
            _shearWksht.BuildWorkSheet();
            _monthHourWorksht.BuildWorkSheet();
            _wSWDworkSht.BuildWorkSheet();
            _wroseWksht.BuildWorkSheet();
            _dataRecoveryWksht.BuildWorkSheet();
        }
        public BulkShearStationSummary(
            ISessionColumnCollection collection,
            DataView data,
            double wdbin,
            double wdrosebin,
            double wsbin
            )
        {
            _ef            = new ExcelFile();
            _ef.LimitNear += new LimitEventHandler(_ef_LimitNear);

            //original data
            SessionColumnType sheartype = SessionColumnType.WSAvgBulkShear;

            _monthHourWorksht = new WindSpeedFrequencyMonthHourWorkSheet(collection, data.Table, _ef, sheartype);
            _wSWDworkSht      = new WindSpeedFrequencyWDWSWorkSheet(collection, data, wdbin, wsbin, _ef, sheartype);
            _wroseWksht       = new WindRoseWorkSheet(collection, data, wdrosebin, _ef, sheartype);
            //datarecovery worksheet

            //built in order they will appear in work book

            _monthHourWorksht.BuildWorkSheet();
            _wSWDworkSht.BuildWorkSheet();
            _wroseWksht.BuildWorkSheet();
        }
示例#4
0
        public BulkShear(ISessionColumnCollection collection, DataView data)
        {
            //receives dataview because could be operating on subset of the data
            _data = data;

            _collection = collection;
        }
示例#5
0
 public WDSummaryGrid(ISessionColumnCollection collection, DataTable data, SessionColumnType sheartype)
 {
     _collection = collection;
     _rowdata    = _data.AsDataView();
     setCols();
     FilterData();
 }
示例#6
0
 public WindDirectionSummaryGrid(ISessionColumnCollection collection,
                                 DataTable data, SessionColumnType sheartype, WindDirectionAxis axis)
 {
     _collection = collection;
     _rowdata    = data.AsDataView();
     setCols();
     FilterData();
 }
示例#7
0
 public WindSpeedFrequencyMonthHourWorkSheet(
     ISessionColumnCollection collection,
     DataTable data,
     ExcelFile ef,
     SessionColumnType sheartype)
 {
     _ef        = ef;
     _monthgrid = new SummaryGrid(collection, data, sheartype, new MonthAxis(), SummaryType.Month);
     _hourgrid  = new SummaryGrid(collection, data, sheartype, new HourAxis(), SummaryType.Hour);
 }
示例#8
0
 public SummaryGrid(ISessionColumnCollection collection, DataTable data, SessionColumnType sheartype
                    , IAxis axis, SummaryType summarytype)
 {
     _collection  = collection;
     _rowdata     = data.AsDataView();
     _axis        = axis;
     _sheartype   = sheartype;
     _summarytype = summarytype;
     setCols();
     FilterData();
 }
示例#9
0
 public WindRoseWorkSheet(
     ISessionColumnCollection collection,
     DataView data,
     double wdbinwidth,
     ExcelFile ef,
     SessionColumnType sheartype)
 {
     _ef        = ef;
     _wRoseGrid = new SummaryGrid(collection, data.Table, sheartype,
                                  new WindDirectionAxis(wdbinwidth), SummaryType.WDRose);
 }
示例#10
0
 public SummaryGrid(ISessionColumnCollection collection, DataTable data, SessionColumnType sheartype, int shearidx,
                    IAxis axis, SummaryType summarytype, bool CDNT)
 {
     _collection  = collection;
     _rowdata     = data.AsDataView();
     _axis        = axis;
     _sheartype   = sheartype;
     _summarytype = summarytype;
     _shearwscol  = _collection[shearidx];
     setCols();
     FilterData(CDNT);
 }
        public WindSpeedFrequencyWDWSWorkSheet(
            ISessionColumnCollection collection,
            DataView data,
            double wdbinwidth,
            double wsbinwidth,
            ExcelFile ef,
            SessionColumnType sheartype,
            int shearidx)
        {
            DateTime start = (DateTime)data[0][collection.DateIndex];

            _WDgrid    = new SummaryGrid(collection, data.Table, sheartype, shearidx, new WindDirectionAxis(wdbinwidth), SummaryType.WD, false);
            _WSgrid    = new SummaryGrid(collection, data.Table, sheartype, shearidx, new WindSpeedAxis(wsbinwidth, data, collection.UpperWSComp(start)), SummaryType.WS, false);
            _excelfile = ef;
        }
 public CreateDataRecoveryGrid(ISessionColumnCollection collection, DataView data)
 {
     _data       = data;
     _collection = (SessionColumnCollection)collection;
 }
示例#13
0
 public HeightConfigCollection(ISessionColumnCollection collection)
 {
     _collection = collection;
 }
 public SingleConfigViewModel(ISessionColumnCollection columnCollection)
 {
     ColumnCollection = columnCollection;
 }
示例#15
0
 public XbyYShear(ISessionColumnCollection collection, DataView data)
 {
     _collection = collection;
     _data       = data;
 }
示例#16
0
 //constructor
 public WindSpeedComposite(ISessionColumnCollection collection, DataTable data)
 {
     _data       = data;
     _collection = collection;
 }
 public WindDirectionComposite(ISessionColumnCollection columns, DataTable data)
 {
     _data    = data;
     _columns = columns;
 }
示例#18
0
 public abstract List <double> DeriveNewWS(ISessionColumnCollection collection, AbstractAlpha alpha, double[,] sourceWS, DataTable data, double derivedHt);
 public WindDirectionCompColumns(ISessionColumnCollection collection, DataTable data)
 {
     _collection = collection;
     _data       = data;
 }
示例#20
0
 public ExportFile(ISessionColumnCollection collection, DataView data, List <int> outputcols)
 {
     _collection = collection;
     _data       = data;
     _outputcols = outputcols;
 }
示例#21
0
 public abstract List <double> DeriveNewWS(ISessionColumnCollection collection, AbstractAlpha alpha, double[,] sourceWS, Dictionary <string, List <double> > axisSourceData, double derivedHt);
示例#22
0
        public override List <double> DeriveNewWS(ISessionColumnCollection collection, AbstractAlpha alpha,
                                                  double[,] sourceWS, DataTable data, double derivedHt)
        {
            SessionColumnCollection colclxn = (SessionColumnCollection)collection;
            int rowcount      = data.Rows.Count;
            int xAxisColIndex = default(int);
            int yAxisColIndex = default(int);

            List <double> newDerivedWS = new List <double>(rowcount);

            //dynamically create list for xAxis source data

            if (alpha.Xaxis != null && alpha.Yaxis == null)
            {
                AssignColIndex(alpha.Xaxis, (SessionColumnCollection)collection);

                Type t = Type.GetType(collection.Columns[alpha.Xaxis.SessionColIndex].ColumnType.ToString());

                MethodInfo mi          = typeof(WindART.Utils).GetMethod("ExtractDataTableColumn", new Type[] { typeof(int), typeof(DataTable) });
                MethodInfo mi1         = mi.MakeGenericMethod(new Type[] { t });
                dynamic    xAxisSource = mi1.Invoke(null, new object[] { alpha.Xaxis.SessionColIndex, data });

                //only 1 axis
                for (int i = 0; i <= rowcount; i++)
                {
                    double thisAlpha = alpha.Alpha[alpha.Xaxis.GetAxisValue(xAxisSource[i]), 0];
                    newDerivedWS[i] = sourceWS[1, i] * Math.Pow((derivedHt / sourceWS[0, i]), thisAlpha);
                }

                return(newDerivedWS);
            }
            if (alpha.Xaxis != null && alpha.Yaxis != null)
            {
                AssignColIndex(alpha.Xaxis, (SessionColumnCollection)collection);
                AssignColIndex(alpha.Yaxis, (SessionColumnCollection)collection);

                MethodInfo miX = typeof(WindART.Utils).GetMethod("ExtractDataTableColumn", new Type[] { typeof(int), typeof(DataTable) });
                //Console.WriteLine(miX.ToString());
                //x
                //Console.WriteLine(" idx passed in...");
                //Console.WriteLine(alpha.Xaxis.SessionColIndex);

                Type tX = Type.GetType(data.Columns[alpha.Xaxis.SessionColIndex].DataType.ToString());
                //Console.WriteLine(tX.ToString ());

                MethodInfo miX1 = miX.MakeGenericMethod(new Type[] { tX });
                //Console.WriteLine("just before invoke..." + miX1.ToString ());
                dynamic xAxisSource = miX1.Invoke(null, new object[] { alpha.Xaxis.SessionColIndex, data });
                //Console.WriteLine(" xsource " + xAxisSource.Count);
                //y
                Type       tY          = Type.GetType(data.Columns[alpha.Yaxis.SessionColIndex].DataType.ToString());
                MethodInfo miY1        = miX.MakeGenericMethod(new Type[] { tY });
                dynamic    yAxisSource = miY1.Invoke(null, new object[] { alpha.Yaxis.SessionColIndex, data });
                //Console.WriteLine(" ysource " + yAxisSource.Count);

                Console.WriteLine(alpha.Alpha.GetUpperBound(0) + "   " + alpha.Alpha.GetUpperBound(1));
                //2 axes
                for (int i = 0; i <= rowcount - 1; i++)
                {
                    //Console.WriteLine(xAxisSource[i]);
                    // Console.WriteLine(" wd " + alpha.Xaxis.GetAxisValue(xAxisSource[i]).ToString());
                    // Console.WriteLine("                      hour " + alpha.Yaxis.GetAxisValue(yAxisSource[i]).ToString());
                    int x; int y;
                    if (alpha.Xaxis.AxisType != AxisType.WS)
                    {
                        x = (int)alpha.Xaxis.GetAxisValue(xAxisSource[i]);
                    }
                    else
                    {
                        x = (int)alpha.Xaxis.GetAxisValue(sourceWS[1, i]);
                    }

                    if (alpha.Yaxis.AxisType != AxisType.WS)
                    {
                        y = (int)alpha.Yaxis.GetAxisValue(yAxisSource[i]);
                    }
                    else
                    {
                        y = (int)alpha.Yaxis.GetAxisValue(sourceWS[1, i]);
                    }

                    if (x < 0 || y < 0)
                    {
                        newDerivedWS.Add(-9999.99);
                    }
                    else
                    {
                        double thisAlpha = default(double);
                        try
                        {
                            thisAlpha = alpha.Alpha[x, y];
                        }
                        catch
                        {
                            //if there is no bin for the ws encountered use a bulk shear
                            thisAlpha = alpha.AllAlphaAvg;
                        }
                        if (sourceWS[1, i] < 0)
                        {
                            newDerivedWS.Add(-9999.99);
                        }
                        else
                        {
                            newDerivedWS.Add(sourceWS[1, i] * Math.Pow((derivedHt / sourceWS[0, i]), thisAlpha));
                        }
                    }
                }

                return(newDerivedWS);
            }

            return(null);
        }
示例#23
0
 public override List <double> DeriveNewWS(ISessionColumnCollection collection,
                                           AbstractAlpha alpha, double[,] sourceWS, Dictionary <string, List <double> > axisSourceData, double derivedHt)
 {
     throw new NotImplementedException();
 }
示例#24
0
 public DataRecoveryWorksheet(ExcelFile ef, ISessionColumnCollection _collection, DataTable _data)
 {
     _ef = ef;
     _dataRecoveryGrid = new Grid(new CreateDataRecoveryGrid(_collection, _data.AsDataView()));
 }
示例#25
0
 public MonthbyHourShear(ISessionColumnCollection collection, DataView data)
 {
     _collection = collection;
     _data       = data;
 }