TimeSeries.CreateEx

Синтаксис Fore

CreateEx(CalendarLevel: DimCalendarLevel; CalendarSettings: ITsCalendarSettings);

Синтаксис Fore.NET

CreateEx(
    CalendarLevel: Prognoz.Platform.Interop.Dimensions.DimCalendarLevel;
    CalendarSettings: Prognoz.Platform.Interop.Transform.TsCalendarSettings;
    Context: Prognoz.Platform.Interop.Fore.ForeRuntimeContext);

Параметры

CalendarLevel. Календарная динамика ряда;

CalendarSettings. Параметры календарного уровня;

Context. Контекст. Актуален только для Fore.NET.

Описание

Конструктор CreateEx создает ряд с заданными параметрами календарного уровня.

Комментарии

Для создания ряда без дополнительных параметров используйте конструктор по умолчанию: TimeSeries.Create.

Пример Fore

В примере приведен пользовательский векторный метод расчета. Для выполнения примера добавьте ссылки на системные сборки «Dimensions», «Ms», «Transform».

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, TrueThen
        For i := pSeries.StartIndex To pSeries.EndIndex Do
            pSeries.Item(i) := 1 + Input.Item(i);
        End For;
    End If;
    Return pSeries;
End Function TimeS;

Метод выполняет увеличение значений входного ряда, если он совместим с контекстом пользовательского метода расчета.

Пример Fore.NET

Необходимые требования и результат выполнения примера Fore.NET совпадают с примером Fore.

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, TrueThen
        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;

См. также:

TimeSeries