Executing XYGrapher from a program
Before calling XYGrapher, you must have the program to create graph configuration file automatically.
-
If you use FigFileMaker.bas, which is a Visual Basic standard module and distributed with this software:
ExecuteXYGrapher [graph setting file (*.fig) to be displayed]
The full path is required, but you cannot put the extension (.fig).
e.g.: ExecuteXYGrapher(C:\Program Files\Simulation\Result)
- If you use FigFileMaker.pas, whicht is a Delphi unit and distributed with this software:
[Object name for TXYGrapher].ExecuteXYGrapher [graph setting file (*.fig) to be displayed]
The full path is required, but you cannot put the extension (.fig).
You do not have to set all of the property values. Default values are used for undefined values.
e.g.:
procedure TSimulation.MakeResultFigure;
var
ResultFigure : TXYGrapher;
begin
ResultFigure := TXYGrapher.Create;
with ResultFigure do
begin
NumDataSeries := 1;
DataSeries[1] := 'C:\Program Files\Simulation\Result of simulation.out';
ReadStart[1] := 6;
................................
SaveFigFile(C:\Program Files\Simulation\Result);
ExecuteXYGrapher(C:\Program Files\Simulation\Result);
end;
ResultFigure.Free; //Do not forget to release it.
- If you use CreateProcess function (Delphi, C++Builder, or Visual C++) or Shell function (Visual Basic) to execute this software:
Your program must get the path of XYGrapher.exe.
The path is recorded in the following registry address:
HKEY_CURRENT_USER\Software\DelphiApplication\XYGrapher\Path_of_GraphApp
In VisualBasic, obtain the path by setting the parameter of GetSetting function as follows:
GetSetting("XYGrapher", "Path","Path of GraphApp")
Then the path, e.g. "C:\PROGRAM FILES\XYGRAPHER\", will be returned.
If you pass the automatically created graph configuration file (*.fig) on the first parameter of command line, the graph is loaded and displayed on showing. For example, if you code as follows in Visual
Basic, "Result1.fig" in "C:\Program files\Simulation\Result" will be displayed.
Dim IDmemo, PathOfXYGrapher
PathOfXYGrapher = GetSetting("XYGrapher",
"Path", "Path of GraphApp")
IDmemo = Shell(PathOfXYGrapher + XYGrapher.exe
C:\Program files\Simulation\Result\Result1.fig)
If XYGrapher is executed from a program, window size is automatically determined from dimension of the graph. The window is located at the center of the screen.