IMsTimeMatrix.CalendarSettings

Fore Syntax

CalendarSettings: IMsCalendarSettings;

Fore.NET Syntax

CalendarSettings: Prognoz.Platform.Interop.Ms.MsCalendarSettings;

Description

The CalendarSettings property returns the calendar level parameters for custom calculation method.

Comments

The property is read-only. By using this property the first day of the week, the number of days off and other parameters can be modified.

Fore Example

This example describes custom method.

To execute the example, add links to the Ms, Dimensions, Transform system assemblies.

Public Function Remove(param: IMsTimeMatrix; Index: Integer): Variant;
Var
    TsCalc: TsCalculation;
    Context: ITsCalculationContext;
    Serie: IMsTimeMatrix;
    CalendSett: ITsCalendarSettings;
    i, j: Integer;
    s: String;
Begin
    TsCalc := New TsCalculation.Create;
    Context := TsCalc.Current;
    Serie := Context.CreateTimeSeries;
    CalendSett := param.CalendarSettings;   
    Index := param.CurrentIndex;
    If CalendSett.RestDays = DayOfWeekSet.SaturdaySunday Then
        param.DeleteSerie(Index);
        param.MoveSerie(0,5);
        For i := 0 To param.Count - 1 Do
            s := "";
            For j := param.StartIndex To param.EndIndex Do
                s := s + (param.Item(i).Item(j) As double).ToString + " ";
            End For;
            Debug.WriteLine("Lag index: " + param.LagIndex(0,1).ToString);
            Debug.WriteLine("Series: " + i.ToString + " - " + s);
        End For;
    End If
    Return Null;
End Function Remove;

The method removes and moves matrix series if series days off are Saturday and Sunday. After that the console window displays lag index and resulting matrix series.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Transform;
Imports Prognoz.Platform.Interop.Dimensions;

Public Function Remove(param: IMsTimeMatrix; Index: Integer): object;
Var
    TsCalc: TsCalculation;
    Context: ITsCalculationContext;
    Serie: IMsTimeMatrix;
    CalendSett: ITsCalendarSettings;
    i, j: Integer;
    s: String;
Begin
    TsCalc := New TsCalculation.Create();
    Context := TsCalc.Current[Null];
    Serie := Context.CreateTimeSeries(-1 As DimCalendarLevel, NullAs IMsTimeMatrix;
    CalendSett := param.CalendarSettings;   
    Index := param.CurrentIndex;
    If CalendSett.RestDays = DayOfWeekSet.dowsSaturdaySunday Then
        param.DeleteSerie(Index);
        param.MoveSerie(0,5);
        For i := 0 To param.Count - 1 Do
            s := "";
            For j := param.StartIndex To param.EndIndex Do
                s := s + (param.Item[i].Item[j] As double).ToString() + " ";
            End For;
            System.Diagnostics.Debug.WriteLine("Lag index: " + param.LagIndex[0,1].ToString());
            System.Diagnostics.Debug.WriteLine("Series: " + i.ToString() + " - " + s);
        End For;
    End If
    Return Null;
End Function Remove;

See also:

IMsTimeMatrix