IFormulaParser Interface
Parses formulas of type System.String to IParsedFormula.
public interface IFormulaParserMethods
Section titled “Methods”IFormulaParser.ParseFormula<TValue>(string, string, Period, ICalculationOptions, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method
Section titled “IFormulaParser.ParseFormula<TValue>(string, string, Period, ICalculationOptions, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method”Gets a formula of type System.String and converts it to a IParsedFormula so it can be called as a script: * Replaces the time series references of format “[repositoryName.TimeSeriesName, unit, aggregation]” with TimeSeriesDataCalculationWrapper<TValue> * Replaces vale, flag pairs “{value|flag}” with TimeSeriesDataCalculationWrapper<TValue> * adds a Func call at the beginning so it can be called with the current calculation time and time series referenced values.
System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Calculation.Formulas.IParsedFormula> ParseFormula<TValue>(string formula, string defaultRepositoryName, HAKOM.TSM.Net.Api.Time.Periods.Period readingPeriod, HAKOM.TSM.Net.Api.Calculation.ICalculationOptions calculationOptions, System.Nullable<HAKOM.TSM.Net.Api.Time.DateTimes.DateTimeOffsetAtOrBefore> historicDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TValue
The value type of the time series data.
Parameters
Section titled “Parameters”formula System.String
The formula as System.String loaded from the time series or given as ad-hoc formula.
defaultRepositoryName System.String
The default repository name for the time series references without given repository name.
readingPeriod Period
The Period in which the time series data should be read.
calculationOptions ICalculationOptions
Holds default settings for reading in the data used in the calculation of the IFormula object.
historicDateTime System.Nullable<DateTimeOffsetAtOrBefore>
The historic date and time, which will be used to fetch ITimeSeries and related data.
cancellationToken System.Threading.CancellationToken
A token that may be used to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<IParsedFormula>
a System.Threading.Tasks.Task<> containing information of the formula for the calculation.
IFormulaParser.TryParseFormula<TValue>(string, string, Period, ICalculationOptions, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method
Section titled “IFormulaParser.TryParseFormula<TValue>(string, string, Period, ICalculationOptions, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method”Gets a formula of type System.String and tries to convert it to a IParsedFormula so it can be called as a script.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Calculation.Formulas.IParsedFormula>> TryParseFormula<TValue>(string formula, string defaultRepositoryName, HAKOM.TSM.Net.Api.Time.Periods.Period readingPeriod, HAKOM.TSM.Net.Api.Calculation.ICalculationOptions calculationOptions, System.Nullable<HAKOM.TSM.Net.Api.Time.DateTimes.DateTimeOffsetAtOrBefore> historicDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TValue
The value type of the time series data.
Parameters
Section titled “Parameters”formula System.String
The formula as System.String loaded from the time series or given as ad-hoc formula.
defaultRepositoryName System.String
The default repository name for the time series references without given repository name.
readingPeriod Period
The Period in which the time series data should be read.
calculationOptions ICalculationOptions
Unspecified settings for reading in the data used in the calculation of the IFormula object.
historicDateTime System.Nullable<DateTimeOffsetAtOrBefore>
The historic date and time, which will be used to fetch ITimeSeries and related data.
cancellationToken System.Threading.CancellationToken
A token that may be used to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<IParsedFormula>>
A System.Threading.Tasks.Task<> of IParsedFormula containing information of the formula for the calculation.
Remarks
Section titled “Remarks”The Result will provide additional information about success or failure.