Model: IMsModel;
The Model property returns a model, string view of which is generated.
Executing the example requires a form, a button on this form with the Button1 identifier, the LanerBox component and the UiErAnalyzer component named UiErAnalyzer1, which is a data source for LanerBox. Workbook of the time series database must be loaded to UiErAnalyzer1. The first series of the workbook must be calculated.
Add links to the Ms, Metabase system assemblies. The example is handler of the OnClick event for button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Laner: ILaner;
Series: ILanerSeries;
CalcSerie: ILanerCalculateSerie;
ModelDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
StringGenerator: IMsModelStringGenerator;
Period: IMsModelPeriod;
s: String;
Begin
Laner := UiErAnalyzer1.ErAnalyzer.Laner;
Series := Laner.Series;
CalcSerie := Series.Item(0) As ILanerCalculateSerie;
ModelDescr := CalcSerie.SaveModel;
Model := ModelDescr.Edit As IMsModel;
StringGenerator := Model.CreateStringGenerator;
s := StringGenerator.Execute;
Period := StringGenerator.Model.Period;
s := s + " (" + Period.ForecastStartDate.ToString + ")";
(Model As IMetabaseObject).Name := s;
(Model As IMetabaseObject).Save;
End Sub Button1OnClick;
After executing the example the first series of workspace is saved as a model. The model name is generated and added by start date of forecasting period.
See also: