示例#1
0
 /// <summary>
 /// Get TimeRange covery by Energiemenge
 /// </summary>
 /// <param name="menge">Energiemenge</param>
 /// <returns>TimeRange ranging from the earliest <see cref="Verbrauch.Startdatum"/> to the latest <see cref="Verbrauch.Enddatum"/></returns>
 /// <returns></returns>
 public static TimeRange GetTimeRange(this BO4E.BO.Energiemenge menge)
 {
     using (MiniProfiler.Current.Step(nameof(GetTimeRange)))
     {
         return(new TimeRange(menge.GetMinDate().UtcDateTime, menge.GetMaxDate().UtcDateTime));
     }
 }
示例#2
0
 /// <summary>
 /// Same as <see cref="GetTotalConsumption(BO.Energiemenge, Wertermittlungsverfahren, string, Mengeneinheit)"/> but without autodetected parameters.
 /// By default a the full length of the Energiemenge is taken into account.
 /// </summary>
 /// <param name="em">Energiemenge</param>
 /// <returns>Tuple of consumption value and unit of measurement</returns>
 public static Tuple <decimal, Mengeneinheit> GetTotalConsumption(this BO4E.BO.Energiemenge em)
 {
     return(GetConsumption(em, new TimeRange(em.GetMinDate().UtcDateTime, em.GetMaxDate().UtcDateTime)));
 }
示例#3
0
 /// <summary>
 /// Test, if the Energiemenge is continuous within its own min/max range.
 /// <see cref="IsContinuous(BO.Energiemenge, TimeRange)"/>
 /// </summary>
 /// <param name="em">Energiemenge</param>
 /// <returns>true iff Energiemenge has defined value for every point in time t in
 /// min(energieverbrauch.startdatum) &lt;= t &lt; max(energieverbrauch.enddatum);
 /// false otherwise
 /// </returns>
 public static bool IsContinuous(this BO4E.BO.Energiemenge em)
 {
     return(IsContinuous(em, new TimeRange(em.GetMinDate().UtcDateTime, em.GetMaxDate().UtcDateTime)));
 }