IDataConverter<TValue> Interface
Converts time series data to a given unit.
public interface IDataConverter<TValue> : HAKOM.TSM.Net.Api.Data.TimeSeries.IDataConverter, HAKOM.DependencyInjection.Core.Net.Api.IRequiresConfiguration where TValue : System.IComparable<TValue>, System.IEquatable<TValue>Type parameters
Section titled “Type parameters”TValue
The type of the values that will be worked with.
Implements IDataConverter, IRequiresConfiguration
Methods
Section titled “Methods”IDataConverter<TValue>.Configure(IUnitStore) Method
Section titled “IDataConverter<TValue>.Configure(IUnitStore) Method”Configures the data converter with the given unitStore, which will be used to manage unit references and fetch conversion data from the repository.
void Configure(HAKOM.TSM.Net.Api.Units.Persistence.IUnitStore unitStore);Parameters
Section titled “Parameters”unitStore IUnitStore
The IUnitStore used by the data converter.
IDataConverter<TValue>.Convert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<Result<IConstantUnitConversion>>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method
Section titled “IDataConverter<TValue>.Convert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<Result<IConstantUnitConversion>>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method”Converts the given data to the given targetUnit.
System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>> Convert(HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue> data, HAKOM.TSM.Net.Api.Units.Persistence.References.IUnitReference targetUnit, System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Units.IConstantUnitConversion>> constantUnitConversionResults, System.Nullable<HAKOM.TSM.Net.Api.Time.Periods.Period> timeDependentUnitConversionReadingPeriod, System.Nullable<HAKOM.TSM.Net.Api.Time.DateTimes.DateTimeOffsetAtOrBefore> timeDependentUnitConversionHistoricDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”data HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>
The ITimeSeriesDataCollection<TValue> containing the data, which will be converted.
targetUnit IUnitReference
The IUnitReference to which the data will be converted.
constantUnitConversionResults System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<IConstantUnitConversion>>
The necessary System.Collections.Generic.IAsyncEnumerable<> where T is a Result<TValue> to perform the conversion.
timeDependentUnitConversionReadingPeriod System.Nullable<Period>
The Period for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
timeDependentUnitConversionHistoricDateTime System.Nullable<DateTimeOffsetAtOrBefore>
The DateTimeOffsetAtOrBefore for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
cancellationToken System.Threading.CancellationToken
A System.Threading.CancellationToken to abort the procedure.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>
The given ITimeSeriesDataCollection<TValue> in the targetUnit.
IDataConverter<TValue>.Convert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<Result<IUnitConversion>>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method
Section titled “IDataConverter<TValue>.Convert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<Result<IUnitConversion>>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method”Converts the given data to the given targetUnit.
System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>> Convert(HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue> data, HAKOM.TSM.Net.Api.Units.Persistence.References.IUnitReference targetUnit, System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Units.IUnitConversion>> unitConversionResults, System.Nullable<HAKOM.TSM.Net.Api.Time.Periods.Period> timeDependentUnitConversionReadingPeriod, System.Nullable<HAKOM.TSM.Net.Api.Time.DateTimes.DateTimeOffsetAtOrBefore> timeDependentUnitConversionHistoricDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”data HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>
The ITimeSeriesDataCollection<TValue> containing the data, which will be converted.
targetUnit IUnitReference
The IUnitReference to which the data will be converted.
unitConversionResults System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<IUnitConversion>>
The necessary System.Collections.Generic.IAsyncEnumerable<> where T is a Result<TValue> to perform the conversion.
timeDependentUnitConversionReadingPeriod System.Nullable<Period>
The Period for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
timeDependentUnitConversionHistoricDateTime System.Nullable<DateTimeOffsetAtOrBefore>
The DateTimeOffsetAtOrBefore for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
cancellationToken System.Threading.CancellationToken
A System.Threading.CancellationToken to abort the procedure.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>
The given ITimeSeriesDataCollection<TValue> in the targetUnit.
IDataConverter<TValue>.Convert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<IUnitConversion>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method
Section titled “IDataConverter<TValue>.Convert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<IUnitConversion>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method”Converts the given data to the given targetUnit.
System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>> Convert(HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue> data, HAKOM.TSM.Net.Api.Units.Persistence.References.IUnitReference targetUnit, System.Collections.Generic.IAsyncEnumerable<HAKOM.TSM.Net.Api.Units.IUnitConversion> unitConversions, System.Nullable<HAKOM.TSM.Net.Api.Time.Periods.Period> timeDependentUnitConversionReadingPeriod, System.Nullable<HAKOM.TSM.Net.Api.Time.DateTimes.DateTimeOffsetAtOrBefore> timeDependentUnitConversionHistoricDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”data HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>
The ITimeSeriesDataCollection<TValue> containing the data, which will be converted.
targetUnit IUnitReference
The IUnitReference to which the data will be converted.
unitConversions System.Collections.Generic.IAsyncEnumerable<IUnitConversion>
The necessary System.Collections.Generic.IAsyncEnumerable<> to perform the conversion.
timeDependentUnitConversionReadingPeriod System.Nullable<Period>
The Period for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
timeDependentUnitConversionHistoricDateTime System.Nullable<DateTimeOffsetAtOrBefore>
The DateTimeOffsetAtOrBefore for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
cancellationToken System.Threading.CancellationToken
A System.Threading.CancellationToken to abort the procedure.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>
The given ITimeSeriesDataCollection<TValue> in the targetUnit.
IDataConverter<TValue>.TryConvert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<Result<IConstantUnitConversion>>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method
Section titled “IDataConverter<TValue>.TryConvert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<Result<IConstantUnitConversion>>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method”Converts the given data to the given targetUnit.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>> TryConvert(HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue> data, HAKOM.TSM.Net.Api.Units.Persistence.References.IUnitReference targetUnit, System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Units.IConstantUnitConversion>> constantUnitConversionResults, System.Nullable<HAKOM.TSM.Net.Api.Time.Periods.Period> timeDependentUnitConversionReadingPeriod, System.Nullable<HAKOM.TSM.Net.Api.Time.DateTimes.DateTimeOffsetAtOrBefore> timeDependentUnitConversionHistoricDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”data HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>
The ITimeSeriesDataCollection<TValue> containing the data, which will be converted.
targetUnit IUnitReference
The IUnitReference to which the data will be converted.
constantUnitConversionResults System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<IConstantUnitConversion>>
The necessary System.Collections.Generic.IAsyncEnumerable<> where T is a Result<TValue> to perform the conversion.
timeDependentUnitConversionReadingPeriod System.Nullable<Period>
The Period for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
timeDependentUnitConversionHistoricDateTime System.Nullable<DateTimeOffsetAtOrBefore>
The DateTimeOffsetAtOrBefore for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
cancellationToken System.Threading.CancellationToken
A System.Threading.CancellationToken to abort the procedure.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>>
The given Result<TValue> containing the ITimeSeriesDataCollection<TValue> in the targetUnit.
IDataConverter<TValue>.TryConvert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<Result<IUnitConversion>>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method
Section titled “IDataConverter<TValue>.TryConvert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<Result<IUnitConversion>>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method”Converts the given data to the given targetUnit.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>> TryConvert(HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue> data, HAKOM.TSM.Net.Api.Units.Persistence.References.IUnitReference targetUnit, System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Units.IUnitConversion>> unitConversionResults, System.Nullable<HAKOM.TSM.Net.Api.Time.Periods.Period> timeDependentUnitConversionReadingPeriod, System.Nullable<HAKOM.TSM.Net.Api.Time.DateTimes.DateTimeOffsetAtOrBefore> timeDependentUnitConversionHistoricDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”data HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>
The ITimeSeriesDataCollection<TValue> containing the data, which will be converted.
targetUnit IUnitReference
The IUnitReference to which the data will be converted.
unitConversionResults System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<IUnitConversion>>
The necessary System.Collections.Generic.IAsyncEnumerable<> where T is a Result<TValue> to perform the conversion.
timeDependentUnitConversionReadingPeriod System.Nullable<Period>
The Period for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
timeDependentUnitConversionHistoricDateTime System.Nullable<DateTimeOffsetAtOrBefore>
The DateTimeOffsetAtOrBefore for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
cancellationToken System.Threading.CancellationToken
A System.Threading.CancellationToken to abort the procedure.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>>
The given Result<TValue> containing the ITimeSeriesDataCollection<TValue> in the targetUnit.
IDataConverter<TValue>.TryConvert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<IUnitConversion>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method
Section titled “IDataConverter<TValue>.TryConvert(ITimeSeriesDataCollection<TValue>, IUnitReference, IAsyncEnumerable<IUnitConversion>, Nullable<Period>, Nullable<DateTimeOffsetAtOrBefore>, CancellationToken) Method”Converts the given data to the given targetUnit.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>> TryConvert(HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue> data, HAKOM.TSM.Net.Api.Units.Persistence.References.IUnitReference targetUnit, System.Collections.Generic.IAsyncEnumerable<HAKOM.TSM.Net.Api.Units.IUnitConversion> unitConversions, System.Nullable<HAKOM.TSM.Net.Api.Time.Periods.Period> timeDependentUnitConversionReadingPeriod, System.Nullable<HAKOM.TSM.Net.Api.Time.DateTimes.DateTimeOffsetAtOrBefore> timeDependentUnitConversionHistoricDateTime, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”data HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>
The ITimeSeriesDataCollection<TValue> containing the data, which will be converted.
targetUnit IUnitReference
The IUnitReference to which the data will be converted.
unitConversions System.Collections.Generic.IAsyncEnumerable<IUnitConversion>
The necessary System.Collections.Generic.IAsyncEnumerable<> to perform the conversion.
timeDependentUnitConversionReadingPeriod System.Nullable<Period>
The Period for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
timeDependentUnitConversionHistoricDateTime System.Nullable<DateTimeOffsetAtOrBefore>
The DateTimeOffsetAtOrBefore for the ITimeSeriesDataReadingOptions to read the ITimeDependentUnitConversion data. Can be null if no ITimeDependentUnitConversion is in the unit conversion path.
cancellationToken System.Threading.CancellationToken
A System.Threading.CancellationToken to abort the procedure.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>>>
The given Result<TValue> containing the ITimeSeriesDataCollection<TValue> in the targetUnit.