- •Disclaimer
- •Contact information
- •Version information
- •Changes in version 3.00
- •Changes in version 2.20
- •Changes in version 2.10
- •Introduction
- •Typing convention
- •Terms used in this document
- •System structure
- •Creating a simple model
- •SetupProblem
- •ModelEquations
- •EndCalc
- •Compiling
- •Simulation
- •Model file format
- •Common parameters and datatypes
- •SetupProblem
- •SetupModel
- •SetupState
- •SetTimeFactor
- •SolverSettings
- •Dynamic variables
- •States
- •Static variables
- •Parameter pages
- •Initial Parameters
- •Floating point parameters
- •Integer parameters
- •Boolean parameters
- •List parameters
- •Enumerated parameters
- •Enumerated choice parameters
- •Explicit variables
- •Action buttons
- •Info Labels
- •HideSampleTime
- •Model help file
- •PreCalc
- •SetStartState
- •AddExplicitVar
- •SetSampleTime
- •ModelEquations
- •StateShift
- •OnStateChange
- •OnSolution
- •OnSample
- •EndCalc
- •OnQuit
- •OnUIValueChange
- •Running simulations from the model
- •OnSaveSettings
- •OnLoadSettings
- •Using Initial parameters
- •SetInitial
- •SetGuess
- •AddDynVar
- •AddStatVar
- •Mathematical text
- •Debugging
- •Common problems
- •Using refrigerant equations
- •WinDali Model Editor
- •Compiler Options
- •Environment Options
- •WinDali Simulation Interface
- •Menu commands
- •Online parameters
- •Varying parameters
- •Dali solver
- •Using Profiles in models
- •Generating profiles
- •Using profiles in a model
- •Using Post Process
- •Distributing models
- •References
48 6 Model file format
Heading
procedure CreatePlot(var PlotNum : TInteger; XAxisType : TInteger; XLabel : PChar; YAxisType : TInteger; YLabel : PChar);
Parameters
PlotNum Number of the plot created (this value is used in calls to AddCurveToPlot – see below)
XAxisType Type of the X-axis. If 0 then linear axis. If 1 then logarithmic. XLabel Label on X-axis.
YAxisType Type of the Y-axis. If 0 then linear axis. If 1 then logarithmic. YLabel Label on Y-axis
Example var
PlotNum : TInteger;
CreatePlot(PlotNum,0,'X-Axis',0,'Y-Axis');
Heading
procedure AddCurveToPlot(PlotNum : TInteger; CurveName : PChar; XData,YData : array of TFloat);
Parameters |
Number returned from call to CreatePlot |
PlotNum |
|
CurveName |
Name of the curve. |
XData |
Array with x-coordinates of the curve. |
YData |
Array with y-coordinates of the curve. |
Shortcut |
|
Write curve and press <Ctrl>+J.
Example var
X,Y : array[1..20] of TFloat;
AddCurveToPlot(PlotNum,'TestCurve',X,Y);
An example showing how to use the procedures is included in the demos.
6.12 OnSaveSettings
This procedure is called every time the user selects the File|Save menu in the simulation program. The name of the file the settings are saved to is passed in the parameter FileName.
If you want to save additional information together with the settings the Simulation program saves, you can do it in this procedure. You should not write directly to file with the name passed as FileName – instead you could save your custom setting in a file with the same name but with a different extension.
6.13 OnLoadSettings
OnLoadSetting is called every time the user selects the File|Open menu in the Simulation program. The name of the file the user opens is passed in the parameter FileName.
WinDali |
Morten Juel Skovrup |