OnWarning(Message: String);
The OnWarning method implements the event for displaying a warning on modeling problem calculation.
For correct use, the method must be redetermined in the user class that is the event handler. Also, this handler must be set in the parameters that are used for modeling problem calculation.
The example displays the description of the user class that is the event handler.
Add links to the Cubes, Matrix, Metabase, Ms system assemblies.
Public Class MCallback: ProblemCalculationCallback
Public Sub OnError(Message: String);
Begin
Debug.WriteLine("Error: " + Message);
End Sub OnError;
Public Sub OnFinish;
Begin
Debug.WriteLine("Problem calculation is complete");
End Sub OnFinish;
Public Sub OnMessage(Message: String);
Begin
Debug.WriteLine("Message: " + Message);
End Sub OnMessage;
Public Sub OnModelCalculation(Model: IMsModel);
Begin
Debug.WriteLine("Model calculation: " + (Model As IMetabaseObject).Id);
End Sub OnModelCalculation;
Public Sub OnStep;
Begin
Debug.WriteLine("Calculation step is executed");
End Sub OnStep;
Public Sub OnBreak(Breakpoint: IMsBreakpoint);
Begin
Debug.WriteLine(Breakpoint.Name);
End Sub OnBreak;
Public Sub OnWarning(Message: string);
Begin
Debug.WriteLine("Warning: " + Message);
End Sub OnWarning;
Public Sub OnStageStart(Stage: MsProblemCalculationStage; Data: Variant);
Begin
Debug.Write("Stage start ");
Select Case Stage
Case MsProblemCalculationStage.Init: Debug.WriteLine("'Initialization'");
Case MsProblemCalculationStage.DetermIdent: Debug.WriteLine("'Identification of determinate equations'");
Case MsProblemCalculationStage.Vector: Debug.WriteLine("'Identification of vector equations'");
Case MsProblemCalculationStage.Ident: Debug.WriteLine("'Identification of stochastic methods'");
Case MsProblemCalculationStage.Calc: Debug.WriteLine("'Calculate models'");
Case MsProblemCalculationStage.Save: Debug.WriteLine("'Save data'");
Case MsProblemCalculationStage.Finish: Debug.WriteLine("'Calculation end'");
Case MsProblemCalculationStage.Load: Debug.WriteLine("'Load data'");
End Select;
End Sub OnStageStart;
Public Sub OnStageFinish(Stage: MsProblemCalculationStage; Duration: Integer; Data: Variant);
Begin
Debug.WriteLine("Stage is complete. Time spent in milliseconds: " + Duration.ToString);
Debug.WriteLine("");
End Sub OnStageFinish;
Public Sub OnBeforeSaveData(Stub: IVariableStub; Matrix: IMatrix; var ValueFlag: Integer; Var Cancel: Boolean);
Begin
End Sub OnBeforeSaveData;
Public Sub OnSaveData(Stub: IVariableStub; Matrix: IMatrix; ValueFlag: Integer; AuditRecordKey: Variant);
Begin
End Sub OnSaveData;
Public Function OnGetActiveEvents: MsProblemCalculationCallbackEvents;
Begin
Return MsProblemCalculationCallbackEvents.All
End Function OnGetActiveEvents;
End Class MCallback;
The use of this class for event handling is given in the example for IMsProblemCalculationSettings.BreakOnError.
See also: