Ejemplo n.º 1
0
        public static void AddDataForNovanaPejl(IEnumerable <JupiterIntake> Intakes, DateTime start, DateTime end)
        {
            ShapeOutputTables.PejlingerDataTable DT1 = new ShapeOutputTables.PejlingerDataTable();
            ShapeOutputTables.PejlingerRow       CurrentRow;

            ShapeOutputTables.IntakeCommonDataTable DT2 = new ShapeOutputTables.IntakeCommonDataTable();

            foreach (JupiterIntake CurrentIntake in Intakes)
            {
                CurrentIntake.Data = DT2.NewIntakeCommonRow();
                AddCommonDataForNovana(CurrentIntake);
                DT2.Rows.Add(CurrentIntake.Data);
                CurrentRow          = DT1.NewPejlingerRow();
                CurrentRow.NOVANAID = CurrentIntake.Data["NOVANAID"].ToString();

                DT1.Rows.Add(CurrentRow);

                var selectedobs = CurrentIntake.HeadObservations.ItemsInPeriod(start, end);

                //Create statistics on water levels
                CurrentRow.ANTPEJ = selectedobs.Count();
                if (CurrentRow.ANTPEJ > 0)
                {
                    CurrentRow.REFPOINT = CurrentIntake.RefPoint;
                    CurrentRow.MINDATO  = selectedobs.First().Time;
                    CurrentRow.MAXDATO  = selectedobs.Last().Time;
                    CurrentRow.AKTAAR   = CurrentRow.MAXDATO.Year - CurrentRow.MINDATO.Year + 1;
                    CurrentRow.AKTDAGE  = CurrentRow.MAXDATO.Subtract(CurrentRow.MINDATO).Days + 1;
                    CurrentRow.PEJPRAAR = CurrentRow.ANTPEJ / CurrentRow.AKTAAR;
                    CurrentRow.MAXPEJ   = selectedobs.Max(num => num.Value);
                    CurrentRow.MINPEJ   = selectedobs.Min(num => num.Value);
                    CurrentRow.MEANPEJ  = selectedobs.Average(num => num.Value);
                }
            }
            //Add a blank string to ensure length of column
            DT2.Rows[0]["COMMENT"] = "                                                   ";

            DT2.Merge(DT1);
        }
    public static void AddDataForNovanaPejl(IEnumerable<JupiterIntake> Intakes, DateTime start, DateTime end)
    {
      ShapeOutputTables.PejlingerDataTable DT1 = new ShapeOutputTables.PejlingerDataTable();
      ShapeOutputTables.PejlingerRow CurrentRow;

      ShapeOutputTables.IntakeCommonDataTable DT2 = new ShapeOutputTables.IntakeCommonDataTable();

      foreach (JupiterIntake CurrentIntake in Intakes)
      {
        CurrentIntake.Data = DT2.NewIntakeCommonRow();
        AddCommonDataForNovana(CurrentIntake);
        DT2.Rows.Add(CurrentIntake.Data);
        CurrentRow = DT1.NewPejlingerRow();
        CurrentRow.NOVANAID = CurrentIntake.Data["NOVANAID"].ToString();

        DT1.Rows.Add(CurrentRow);

        var selectedobs = CurrentIntake.HeadObservations.ItemsInPeriod(start, end);

        //Create statistics on water levels
        CurrentRow.ANTPEJ = selectedobs.Count();
        if (CurrentRow.ANTPEJ > 0)
        {
          CurrentRow.REFPOINT = CurrentIntake.RefPoint;
          CurrentRow.MINDATO = selectedobs.First().Time;
          CurrentRow.MAXDATO = selectedobs.Last().Time;
          CurrentRow.AKTAAR = CurrentRow.MAXDATO.Year - CurrentRow.MINDATO.Year + 1;
          CurrentRow.AKTDAGE = CurrentRow.MAXDATO.Subtract(CurrentRow.MINDATO).Days + 1;
          CurrentRow.PEJPRAAR = CurrentRow.ANTPEJ / CurrentRow.AKTAAR;
          CurrentRow.MAXPEJ = selectedobs.Max(num => num.Value);
          CurrentRow.MINPEJ = selectedobs.Min(num => num.Value);
          CurrentRow.MEANPEJ = selectedobs.Average(num => num.Value);
        }
      }
      //Add a blank string to ensure length of column
      DT2.Rows[0]["COMMENT"] = "                                                   ";

      DT2.Merge(DT1);
    }