Class TDataSeries (unit xyData)

Inherits from

TPersistent

Constructors


constructor Create;

-------------------------------------------------------------------------- #2 Administration --------------------------------------------------------------------------


Functions

function Add(x, y: Double): longint;

-------------------------------------------------------------------------- #3 Data engine --------------------------------------------------------------------------

procedure AddPoints(p:array of TDoublepoint);


procedure AddPointSeries(x:Double; y:array of Double);


procedure Clear;


function DeleteCurrentPoint(var x, y, r: Double; var index: longint): Boolean;


function DeletePoint(index: longint): Boolean;

return next point values

function DeleteValue(x: Double): Boolean;

Let's only recalc MaxMin if necessary:

destructor Destroy;


function EliminateDuplicates: Boolean;


function GetFirstPoint(var x, y, r: Double; var index: longint): Boolean;

simple sequential access to data:

function GetNextPoint(var x, y, r: Double; var index: longint): Boolean;


function GetPoint(var index: longint; var x, y, r: Double): Boolean;


function GetValue(curr: longint; var index: longint; var x, y, r: Double): Boolean;


procedure readFromFile(fname:string);


procedure ReadFromStream(r:TxyReader);

data:

procedure refreshData;

data acqusition engine} {this procedure reads the data from an abstract table.

procedure SaveToFile(fname:string);

-------------------------------------------------------------------------- #6 Statistical analysis --------------------------------------------------------------------------} {STATISTICS} {-------------------------------------------------------------------------- #7.

procedure SaveToStream(w:TxyWriter; savedata:boolean);


procedure UpdateCurrentPoint(y: Double);

both return false if no more points

procedure ExtractZero;

call event to notify.

procedure GetMinMax;


procedure RequestPaint(TheMessage:TDSChangeType);


procedure WarnTooManyPoints;

Add

procedure clearDataChangeHooks;


procedure DoDataChangeHooks(themessage:TDSChangeType);


function getAllPoints(x: Double): pGPoint;


function getDataChangeHook(o:TObject):TDataChangeEvent;


function getPointCount(x: Double): Word;


function getPointndx(i: longint): Double;


function getpointval(x: Double): Double;

-------------------------------------------------------------------------- #4 Data property servers --------------------------------------------------------------------------

procedure SetAllowDuplicates(v: Boolean);


procedure SetAutoZero(v: Boolean);

-------------------------------------------------------------------------- #5 Other property servers --------------------------------------------------------------------------

procedure setDataChangeHook(o:TObject; v:TDataChangeEvent);


procedure setPointndx(i: longint; y: Double);


procedure setpointval(x: Double; y: Double);

this returns the last point added.

procedure SetRegControl1(v: LongInt);


procedure setRegcontrol2(v: Double);


procedure SetRegType(v: et_regressions);


procedure setZeroOffset(v: Double);


Properties

property AllowDuplicates : Boolean


property AllPoints : pGPoint

Adds a point, returns last point.

property AutoZero : Boolean


property ColWidth : word


property Data : Pgpoint

deletes current point, and performs GetNextPoint

property DataSrc : TDataSrc


property HeaderCount : word


property Hooks : TDataChangeEvent


property InternalZero : Double


property PointByIndex : Double


property PointCount : Word


property PointNumber : longint


property PointWarningLimit : longint


property RegControl1 : LongInt


property RegControl2 : Double


property RegType : et_regressions


property RowChoice : TRowChoice


property RowFinish : Double


property RowHitFreq : word


property RowStart : double


property SeriesName : string


property SrcInfo : string


property TextFileByWidth : boolean


property TextMarkers : string


property TextSeparators : string


property Tolerance : Double


property ValueAt : Double


property XDataCol : String


property XFormat : TTxtFieldtype


property XMaxVal : double


property XMinVal : double


property YDataCol : String


property YFormat : TTxtFieldtype


property YMaxVal : double


property YMinVal : double


Events

event OnTooManyPoints : TNotifyEvent

protection against unlimited memory usage: warn when number of points exceed limit

Variables

Changed : Boolean;


FAllowDuplicates : Boolean;


FAutoZero : Boolean;


FColWidth : word;


FCurrent : pGPoint;


FData : pGPoint;


FDataLast : pGPoint;


FdataSrc : TDataSrc;

data accession:

FHeaderCount : word;


FIndexCount : Longint;


FPointCount : Longint;


FRegControl1 : LongInt;


FRegControl2 : Double;


FRegType : et_regressions;


FRowChoice : TRowChoice;


FRowFinish : Double;


FRowHitFreq : word;


FRowStart : Double;


FSeriesName : string;


FSrcInfo : string;


FTextFileByWidth : boolean;


FTextMarkers : string;


FTextSeparators : string;


FTolerance : Double;


FXDataCol : string;


FXFormat : TTxtFieldType;


FYDataCol : string;


FYFormat : TTxtFieldType;


FZeroOffset : Double;


xvMax : Double;


xvMin : Double;


yvMax : Double;


yvMin : Double;


FDataChangeHooks : PDataChangeHook;


FOnTooManyPoints : TNotifyEvent;


FPointWarningLimit : longint;



Constructors


constructor Create;

-------------------------------------------------------------------------- #2 Administration --------------------------------------------------------------------------


Functions


function Add(x, y: Double): longint;

-------------------------------------------------------------------------- #3 Data engine --------------------------------------------------------------------------


procedure AddPoints(p:array of TDoublepoint);


procedure AddPointSeries(x:Double; y:array of Double);


procedure Clear;


function DeleteCurrentPoint(var x, y, r: Double; var index: longint): Boolean;


function DeletePoint(index: longint): Boolean;

return next point values


function DeleteValue(x: Double): Boolean;

Let's only recalc MaxMin if necessary:


destructor Destroy;


function EliminateDuplicates: Boolean;


function GetFirstPoint(var x, y, r: Double; var index: longint): Boolean;

simple sequential access to data:


function GetNextPoint(var x, y, r: Double; var index: longint): Boolean;


function GetPoint(var index: longint; var x, y, r: Double): Boolean;


function GetValue(curr: longint; var index: longint; var x, y, r: Double): Boolean;


procedure readFromFile(fname:string);


procedure ReadFromStream(r:TxyReader);

data:


procedure refreshData;

data acqusition engine} {this procedure reads the data from an abstract table. the methods InitDataSource, TestEndData, NextRow, GetCelly, GetCellx, and Close_DataSource supply the data


procedure SaveToFile(fname:string);

-------------------------------------------------------------------------- #6 Statistical analysis --------------------------------------------------------------------------} {STATISTICS} {-------------------------------------------------------------------------- #7. Saving to stream --------------------------------------------------------------------------


procedure SaveToStream(w:TxyWriter; savedata:boolean);


procedure UpdateCurrentPoint(y: Double);

both return false if no more points


procedure ExtractZero;

call event to notify. overridden to call a different event in xyGraph descendent


procedure GetMinMax;


procedure RequestPaint(TheMessage:TDSChangeType);


procedure WarnTooManyPoints;

Add


procedure clearDataChangeHooks;


procedure DoDataChangeHooks(themessage:TDSChangeType);


function getAllPoints(x: Double): pGPoint;


function getDataChangeHook(o:TObject):TDataChangeEvent;


function getPointCount(x: Double): Word;


function getPointndx(i: longint): Double;


function getpointval(x: Double): Double;

-------------------------------------------------------------------------- #4 Data property servers --------------------------------------------------------------------------


procedure SetAllowDuplicates(v: Boolean);


procedure SetAutoZero(v: Boolean);

-------------------------------------------------------------------------- #5 Other property servers --------------------------------------------------------------------------


procedure setDataChangeHook(o:TObject; v:TDataChangeEvent);


procedure setPointndx(i: longint; y: Double);


procedure setpointval(x: Double; y: Double);

this returns the last point added. (if allowduplicates = false, this is the only point). If there is any problems, returns 0


procedure SetRegControl1(v: LongInt);


procedure setRegcontrol2(v: Double);


procedure SetRegType(v: et_regressions);


procedure setZeroOffset(v: Double);


Properties


property AllowDuplicates : Boolean


property AllPoints : pGPoint

Adds a point, returns last point. while this is a very convenient interface, not overly powerful re mutiple points, error control, etc.


property AutoZero : Boolean


property ColWidth : word


property Data : Pgpoint

deletes current point, and performs GetNextPoint


property DataSrc : TDataSrc


property HeaderCount : word


property Hooks : TDataChangeEvent


property InternalZero : Double


property PointByIndex : Double


property PointCount : Word


property PointNumber : longint


property PointWarningLimit : longint


property RegControl1 : LongInt


property RegControl2 : Double


property RegType : et_regressions


property RowChoice : TRowChoice


property RowFinish : Double


property RowHitFreq : word


property RowStart : double


property SeriesName : string


property SrcInfo : string


property TextFileByWidth : boolean


property TextMarkers : string


property TextSeparators : string


property Tolerance : Double


property ValueAt : Double


property XDataCol : String


property XFormat : TTxtFieldtype


property XMaxVal : double


property XMinVal : double


property YDataCol : String


property YFormat : TTxtFieldtype


property YMaxVal : double


property YMinVal : double


Events


event OnTooManyPoints : TNotifyEvent

protection against unlimited memory usage: warn when number of points exceed limit


Variables


Changed : Boolean;


FAllowDuplicates : Boolean;


FAutoZero : Boolean;


FColWidth : word;


FCurrent : pGPoint;


FData : pGPoint;


FDataLast : pGPoint;


FdataSrc : TDataSrc;

data accession:


FHeaderCount : word;


FIndexCount : Longint;


FPointCount : Longint;


FRegControl1 : LongInt;


FRegControl2 : Double;


FRegType : et_regressions;


FRowChoice : TRowChoice;


FRowFinish : Double;


FRowHitFreq : word;


FRowStart : Double;


FSeriesName : string;


FSrcInfo : string;


FTextFileByWidth : boolean;


FTextMarkers : string;


FTextSeparators : string;


FTolerance : Double;


FXDataCol : string;


FXFormat : TTxtFieldType;


FYDataCol : string;


FYFormat : TTxtFieldType;


FZeroOffset : Double;


xvMax : Double;


xvMin : Double;


yvMax : Double;


yvMin : Double;


FDataChangeHooks : PDataChangeHook;


FOnTooManyPoints : TNotifyEvent;


FPointWarningLimit : longint;