IFormulaTransformModel.RestoreFromFormulaData

Syntax

RestoreFromFormulaData(FormulaData: IRubricatorFormulaData);

Parameters

FormulaData. The formula that should be restored.

Description

The RestoreFromFormulaData method restores the calculated series by the specified data of the formula.

Example

Executing the example requires a form, a button named Button1 on the form, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1 that is a data source for TabSheetBox. A working area of the time series database must be loaded to UiErAnalyzer1. This database must contain a formula with the 1 key.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Laner: ILaner;
    RubInst: IRubricatorInstance;
    FormulaData: IRubricatorFormulaData;
    Serie: ILanerCalculateSerie;
    Transform: IFormulaTransformModel;
Begin
    Laner := UiErAnalyzer1.ErAnalyzer.Laner;
    RubInst := Laner.RubricatorInstance;
    Laner.BeginUpdate;
    FormulaData := RubInst.GetFormulaData(1);
    Serie := Laner.Series.AddCalculateSerie("Series restored from formula");
    Transform := Serie.Transform;
    Transform.RestoreFromFormulaData(FormulaData);
    Laner.EndUpdate;
End Sub Button1OnClick;

After executing the example a new calculated series restored from the formula with the 1 key is added.

See also:

IFormulaTransformModel