PASSBaseObj 1.4 |
![]() |
![]() |
megabax | |||||||||||||||||||||||
06.12.2010 . | |||||||||||||||||||||||
() www.easyprog.ru PASSBaseObj 1.4
: TPASSAbstractDataSource . TPASSDataSource . TPASSBufferedDataSource . TPASSStreamBufferedDataSource , . TPASSStreamTimedBufferedDataSource , , , , . TPASSPriceSource .
.
TPASSAbstractDataSource. TPASSAbstractDataSource=Class(TObject) GetFieldNum , . Fields . , . TPASSDataSource TPASSDataSource=Class(TPASSAbstractDataSource) Active , . . CurrentItemIndex - . CountLoadedBars - . . NextItem, PrevItem, First, Last . GetDataByFieldName, GetDataByFieldNum, GetDataByFieldNameAndIndex, GetDataByFieldNumAndIndex - . GetDataByFieldName, GetDataByFieldNum - , GetDataByFieldNameAndIndex, GetDataByFieldNumAndIndex - . TPASSBufferedDataSource
TPASSBufferedDataSource=Class(TPASSDataSource) private FBuffer:PBufferArray; FPointerSize:LongInt; procedure SetCurrentItemIndex(ACurrentItemIndex:LongInt); override; public Property PointerSize:LongInt Read FPointerSize Write FPointerSize; Function NextItem:boolean; override; Function PrevItem:boolean; override; Function Add:Boolean; virtual; Procedure First; override; Procedure Last; override; Procedure FillGrid(AGrid: TStringGrid; AFields:TStringList); end;
PointerSize . Add CurrentItemIndex . FillGrid TStringGrid (, , ).
TPASSStreamBufferedDataSource
TPASSStreamBufferedDataSource=class(TPASSBufferedDataSource) private procedure SaveHeader(AStream:TStream); virtual; procedure LoadHeader(AStream:TStream); virtual; end;
TPASSStreamTimedBufferedDataSource
TPASSStreamTimedBufferedDataSource=class(TPASSStreamBufferedDataSource) public function SearchIndexAsDate(ADateTime:TDateTime):integer; end;
SearchIndexAsDate . , CurrentItemIndex 1. , , , -1 . , 0. .
TPASSPriceSource
. TPASSPriceSource=Class(TPASSBufferedDataSource) private FFilePath:string; FTiker:string; FPeriod:string; FStream:TStream; FHaveHeader, FHaveTicker, FHavePer:boolean; FName:string; procedure SetActive(AActive:boolean); virtual; procedure SetFilePath(AFilePath:string); function GetSignature:Str3; function GetVersion:real; procedure ShiftBufferRight(index,count:LongInt); public property Name:string read FName write FName; property Active:Boolean Read FActive Write SetActive; constructor Create(AFilePath:string;AActive:boolean); property FilePath:string Read FFilePath Write SetFilePath; property Tiker:string read FTiker write FTiker; property Period:string read FPeriod; property Stream:TStream read FStream; destructor Destroy; override; procedure SetBarData(ABarData:TBarStructure); virtual; function GetBarData:TBarStructure; virtual; function GetBarDataByIndex(Index:LongInt):TBarStructure; virtual; function GetDataByFieldName(AFieldName:String):Double; virtual; function GetDataByFieldNum(AFieldNum:integer) :Double; virtual; function GetDataByFieldNameAndIndex(AFieldName:String;Index:LongInt):Double; virtual; function GetDataByFieldNumAndIndex(AFieldNum:integer;Index:LongInt):Double; virtual; function SearchIndexAsDate(ADateTime:TDateTime):integer; procedure LoadDataFromTextFile(AFilePath:string); procedure LoadBarFromTextFile(var AStruct:TBarStructure; var VF:TextFile); procedure LoadDataFromStream(AStream:TStream); procedure LoadBarFromStream(var AStruct:TBarStructure; AStream:TStream); procedure SaveDataToStream(AStream:TStream); procedure SaveBarToStream(AStruct:TBarStructure; AStream:TStream); procedure SaveBarToTextFile(var VF:TextFile; AStruct:tBarStructure); procedure SaveDataToTextFile(AFilePath:string); procedure SaveAllData; function InsertBarData(ABarData:TBarStructure):boolean; virtual; function InsertEmptyBarBefore(index:LongInt):boolean; virtual; procedure Delete(index:LongInt); end;
Name , . Create ( ) . FilePath ( ). Tiker . EESR. . , Tiker, Tiker . Period . , . . :
. PerPrToStr StrToPerPr. Stream . TFileStream. . SetBarData . GetBarData . GetBarDataByIndex - . NextItem, PrevItem, First, Last . GetDataByFieldName, GetDataByFieldNum, GetDataByFieldNameAndIndex, GetDataByFieldNumAndIndex - . GetDataByFieldName, GetDataByFieldNum - , GetDataByFieldNameAndIndex, GetDataByFieldNumAndIndex - . LoadDataFromTextFile . . LoadBarFromTextFile AStruct. LoadDataFromStream . . LoadBarFromStream AStruct. SaveDataToStream . SaveBarToStream . SaveBarToTextFile . SaveDataToTextFile . SaveAllData , FilePath. InsertBarData . , . . InsertEmptyBarBefore , . Delete .
|
|||||||||||||||||||||||
( 06.12.2010 . ) |
. » |
---|