ILaner.SaveChangesToModels

Syntax

SaveChangesToModels;

Description

The SaveChangesToModels method saves changes in factors data obtained from a modeling container model, to the original model.

Example

Executing the example requires a form with the Button1 and Button2 buttons, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1, that is a data source for TabSheetBox. Workbook of the time series database must be loaded to UiErAnalyzer1. Modeling container of the database must include a model with the OBJ_MODEL identifier based on database time series.

The example is executed in two steps:

  1. Clicking the Button1 button switches the data table to editing mode, time series data is loaded to the data table from the model.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

ErAn: IEaxAnalyzer;

Laner: ILaner;

Ruby: IRubricator;

ActiveMetabase: IMetabase;

Cont: IMetabaseObjectDescriptor;

Model: IMsModel;

Begin

ActiveMetabase := MetabaseClass.Active;

ErAn := UiErAnalyzer1.ErAnalyzer;

Laner := ErAn.Laner;

Ruby := Laner.RubricatorInstance.Rubricator;

Cont := Ruby.ModelSpace;

Model := ActiveMetabase.FetchItemById("OBJ_MODEL", Cont.Key).Edit As IMsModel;

Model.RestoreLaner(Laner, Null);

TabSheetBox1.Source.GetTabSheet.View.EnableEdit := True;

End Sub Button1OnClick;

After executing the example the data can be modified.

  1. Clicking the Button2 button saves modified time series data to the model.

Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);

Var

ErAn: IEaxAnalyzer;

Laner: ILaner;

Begin

ErAn := UiErAnalyzer1.ErAnalyzer;

Laner := ErAn.Laner;

Laner.SaveChangesToModels;

End Sub Button2OnClick;

After executing the example the changed factor data is saved to the model of the modeling container.

See also:

ILaner