home *** CD-ROM | disk | FTP | other *** search
- unit NewTags;
-
- interface
-
- uses Tags, Crt;
-
- type
-
- PFunc = function : real;
- pPFunc = ^PFunc;
-
- NewPump = object(DOutput)
- MaxPressure : real;
- ScalingFactor : real;
- GetPressureDemon : PFunc;
- procedure Init( ATag : String12; AStatus : boolean;
- MaxP, Scale : real;
- PressFunction : pPFunc );
- function Flow : real;
- end;
-
- implementation
-
- procedure NewPump.Init( ATag : String12; AStatus : boolean;
- MaxP, Scale : real;
- PressFunction: pPFunc );
- begin
- Digital.Init( ATag,AStatus);
- MaxPressure := maxP;
- Scalingfactor := Scale;
- @GetPressureDemon := PressFunction;
- end;
-
- function NewPump.Flow : real;
- begin
- if Status = true then
- Flow := Sqrt( (MaxPressure - GetPressureDemon)/ScalingFactor )
- else
- Flow := 0;
- end;
-
- { Initialization code }
- begin
- { None. }
- end.