CalendarSettings: IMsCalendarSettings;
CalendarSettings: Prognoz.Platform.Interop.Ms.IMsCalendarSettings;
The property is read-only.
The CalendarSettings property returns the calendar level parameters for custom calculation method.
By using this property the first day of the week, the number of days off and other parameters can be modified.
This example displays custom series calculation method. To execute the example, add links to the Dimensions, Ms, Transform system assemblies.
Function RestDays(Input: ITimeSeries): ITimeSeries;
Var
TsCalc: TsCalculation;
pContext: ITsCalculationContext;
i: Integer;
pSeries: ITimeSeries;
CalendSett: ITsCalendarSettings;
Begin
TsCalc := New TsCalculation.Create;
pContext := TsCalc.Current;;
pSeries := pContext.CreateTimeSeries;
CalendSett := Input.CalendarSettings;
If CalendSett.RestDays = DayOfWeekSet.SaturdaySunday Then
For i := Input.StartIndex To Input.EndIndex Do
pSeries.Item(i) := 1 + Input.Item(i);
End For;
End If;
Return pSeries;
End Function RestDays;
The method increases input series values if the series days off are Saturday and Sunday.
This example displays custom series calculation method.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Transform;
Function RestDays(Input: ITimeSeries): ITimeSeries;
Var
TsCalc: TsCalculation;
pContext: ITsCalculationContext;
i: Integer;
pSeries: ITimeSeries;
CalendSett: ITsCalendarSettings;
Begin
TsCalc := New TsCalculation.Create();
pContext := TsCalc.Current[Null];
pSeries := pContext.CreateTimeSeries(-1 As DimCalendarLevel, Null) As ITimeSeries;
CalendSett := Input.CalendarSettings;
If CalendSett.RestDays = DayOfWeekSet.dowsSaturdaySunday Then
For i := Input.StartIndex To Input.EndIndex Do
pSeries.Item[i] := 1 + (Input.Item[i] As double);
End For;
End If;
Return pSeries;
End Function RestDays;
The method increases input series values if the series days off are Saturday and Sunday.
See also: