unit OszilloskopKanalUnit;
//ToDo-Liste
//- Farbe muss verwendet werden!
interface
uses Controls, Classes;
Type TOszilloskopKanal =
class(TCollectionItem)
private
FadyWert:
array of double;
FiXMax, FiYmax: integer;
FsName:
string;
procedure SetYWert(
Index: integer; dWert: double);
procedure SetName(sWert:
string);
function GetYWert(
Index: integer): double;
function GetName:
string;
procedure movedArray(temparray:
array of double);
public
constructor create(ACollection: TCollection; DisplayWide: integer);
reintroduce;
destructor destroy;
override;
property EingangY[
Index: integer]: double
read GetYWert
write SetYWert;
property Name:
string read GetName
write SetName;
end;
implementation
constructor TOszilloskopKanal.Create(ACollection: TCollection; DisplayWide: integer);
begin
inherited create(ACollection);
SetLength(FadyWert, DisplayWide);
FiYmax := DisplayWide -1;
FsName := '
Signal';
end;
destructor TOszilloskopKanal.Destroy;
begin
SetLength(FadyWert,0);
inherited destroy;
end;
procedure TOszilloskopKanal.movedArray(temparray:
array of double);
var i: integer;
begin
for i := 0
to Length(temparray)-2
do temparray[i] := temparray[i+1]
end;
// Es werden immer nur die letzen Werte gesetzt
procedure TOszilloskopKanal.SetYWert(
Index: integer; dWert: double);
begin
movedArray(FadyWert);
FadyWert[FiYmax] := dWert;
end;
procedure TOszilloskopKanal.SetName(sWert:
string);
begin
FsName := sWert;
end;
function TOszilloskopKanal.GetYWert(
Index: integer): double;
begin
result := FadyWert[
Index]
end;
function TOszilloskopKanal.GetName;
begin
result := FsName;
end;
end.
{--------------------------------------------------------------------------------------------------------------------------}
unit OszilloskopUnit;
interface
uses Controls, ExtCtrls, Graphics, Classes, OszilloskopKanalUnit;
Type TOszilloskop =
class(TCollection)
private
FiDisplayWide, FiDisplayHeight: integer;
FdYMax: double;
// Funktion zur Ermittlung des Darstellungsbereiches
//procedure GetDisplayArea;
protected
published
public
constructor create(AItemClass: TCollectionItemClass; DisplayWide, DisplayHeight, CountChannel: integer);
reintroduce;
destructor destroy;
override;
function Add(DisplayWide: integer): TOszilloskopKanal;
end;
implementation
constructor TOszilloskop.create(AItemClass: TCollectionItemClass; DisplayWide, DisplayHeight, CountChannel: Integer);
var i: integer;
begin
inherited create(AItemClass);
FiDisplayWide := DisplayWide;
FiDisplayHeight := DisplayHeight;
end;
destructor TOszilloskop.Destroy;
var i: integer;
begin
inherited destroy;
end;
function TOszilloskop.Add(DisplayWide: integer): TOszilloskopKanal;
begin
inherited Add
as TOszilloskopKanal;
end;
end.