forked from P33a/SimTwo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuPSI_user_charts.pas
99 lines (80 loc) · 3.52 KB
/
uPSI_user_charts.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
unit uPSI_user_charts;
{
This file has been generated by UnitParser v0.7, written by M. Knight
and updated by NP. v/d Spek and George Birbilis.
Source Code from Carlo Kok has been used to implement various sections of
UnitParser. Components of ROPS are used in the construction of UnitParser,
code implementing the class wrapper is taken from Carlo Kok's conv utility
}
interface
uses
SysUtils
,Classes
,uPSComponent
,uPSRuntime
,uPSCompiler
;
type
(*----------------------------------------------------------------------------*)
TPSImport_user_charts = class(TPSPlugin)
protected
procedure CompileImport1(CompExec: TPSScript); override;
procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
end;
{ compile-time registration functions }
procedure SIRegister_user_charts(CL: TPSPascalCompiler);
{ run-time registration functions }
procedure RIRegister_user_charts_Routines(S: TPSExec);
procedure Register;
implementation
uses
Graphics
,TAGraph
,TASeries
,FastChart
,user_charts
;
procedure Register;
begin
RegisterComponents('Pascal Script', [TPSImport_user_charts]);
end;
(* === compile-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure SIRegister_user_charts(CL: TPSPascalCompiler);
begin
CL.AddDelphiFunction('Procedure ChartSeriesAddXY( ChartIndex, SeriesIndex : integer; X, Y : double)');
CL.AddDelphiFunction('Procedure ChartSeriesClear( ChartIndex, SeriesIndex : integer)');
CL.AddDelphiFunction('Procedure ChartSetAxisMinMax( ChartIndex : integer; Xmin, Xmax, Ymin, Ymax : double)');
CL.AddDelphiFunction('Procedure ChartSeriesSetColor( ChartIndex, SeriesIndex : integer; newColor : TColor)');
CL.AddDelphiFunction('Function ChartSeriesGetCount( ChartIndex : integer) : integer');
CL.AddDelphiFunction('Procedure ChartSeriesSetCount( ChartIndex, SeriesCount : integer)');
CL.AddDelphiFunction('Function ChartSeriesCreate( ChartIndex : integer) : integer');
CL.AddDelphiFunction('Procedure ChartSeriesDeleteAll( ChartIndex : integer)');
end;
(* === run-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure RIRegister_user_charts_Routines(S: TPSExec);
begin
S.RegisterDelphiFunction(@ChartSeriesAddXY, 'ChartSeriesAddXY', cdRegister);
S.RegisterDelphiFunction(@ChartSeriesClear, 'ChartSeriesClear', cdRegister);
S.RegisterDelphiFunction(@ChartSetAxisMinMax, 'ChartSetAxisMinMax', cdRegister);
S.RegisterDelphiFunction(@ChartSeriesSetColor, 'ChartSeriesSetColor', cdRegister);
S.RegisterDelphiFunction(@ChartSeriesGetCount, 'ChartSeriesGetCount', cdRegister);
S.RegisterDelphiFunction(@ChartSeriesSetCount, 'ChartSeriesSetCount', cdRegister);
S.RegisterDelphiFunction(@ChartSeriesCreate, 'ChartSeriesCreate', cdRegister);
S.RegisterDelphiFunction(@ChartSeriesDeleteAll, 'ChartSeriesDeleteAll', cdRegister);
end;
{ TPSImport_user_charts }
(*----------------------------------------------------------------------------*)
procedure TPSImport_user_charts.CompileImport1(CompExec: TPSScript);
begin
SIRegister_user_charts(CompExec.Comp);
end;
(*----------------------------------------------------------------------------*)
procedure TPSImport_user_charts.ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter);
begin
//RIRegister_user_charts(ri);
RIRegister_user_charts_Routines(CompExec.Exec); // comment it if no routines
end;
(*----------------------------------------------------------------------------*)
end.