CreateEx(CalendarLevel: DimCalendarLevel; CalendarSettings: ITsCalendarSettings);
CreateEx(
CalendarLevel: Prognoz.Platform.Interop.Dimensions.DimCalendarLevel;
CalendarSettings: Prognoz.Platform.Interop.Transform.TsCalendarSettings;
Context: Prognoz.Platform.Interop.Fore.ForeRuntimeContext);
CalendarLevel. Series calendar frequency.
CalendarSettings. Calendar level parameters.
Context. Context. It is relevant only for Fore.NET.
The CreateEx constructor creates a series with the specified calendar level parameters.
Use the TimeSeries.Create default constructor to create a series without additional parameters.
A custom series calculation method is given in the example. To execute the example, add links to the Dimensions, Ms, Transform system assemblies.
Function TimeS(Input: ITimeSeries): ITimeSeries;
Var
pContext: ITsCalculationContext;
i: Integer;
CalendSett: ITsCalendarSettings;
pSeries: ITimeSeries;
Begin
pContext := TsCalculation.Current;
CalendSett := New MsCalendarSettings.Create;
CalendSett.RestDays := DayOfWeekSet.SaturdaySunday;
CalendSett.FirstDay := DayOfWeekSet.Monday;
pSeries := New TimeSeries.CreateEx(DimCalendarLevel.Day, CalendSett);
If pSeries.CheckCompatible(Input, True) Then
For i := pSeries.StartIndex To pSeries.EndIndex Do
pSeries.Item(i) := 1 + Input.Item(i);
End For;
End If;
Return pSeries;
End Function TimeS;
The method increases input series values if it is compatible with the user calculation method context.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Transform;
Public Function TimeS(Input: TimeSeries): ITimeSeries;
Var
CClass: TsCalculationClass;
pContext: ITsCalculationContext;
i: Integer;
CalendSett: TsCalendarSettings;
pSeries: ITimeSeries;
Begin
CClass := New TsCalculationClass.Create();
pContext := CClass.Current[Null];
CalendSett := New TsCalendarSettings.Create();
CalendSett.RestDays := DayOfWeekSet.dowsSaturdaySunday;
CalendSett.FirstDay := DayOfWeekSet.dowsMonday;
pSeries := New TimeSeriesClass.Create();
pSeries.CreateEx(DimCalendarLevel.dclDay, CalendSett, Null);
If pSeries.CheckCompatible(Input, True) Then
For i := pSeries.StartIndex To pSeries.EndIndex Do
pSeries.Item[i] := 1 + (Input.Item[i] As double);
End For;
End If;
Return pSeries;
End Function TimeS;
See also: