verride;
procedure AddElement (Element: TElement);
procedure GetOrder;
procedure DelElement (Element: TElement);
property SysTime: TCustTime read FSysTime;
property SysPeriod: TCustTime read FSysPeriod write FSysPeriod;
property StepPeriod: TCustTime read FStepPeriod write FStepPeriod;
property Counts [Index: integer]: integer read GetCounts;
property BornParcelCount: integer index 0 read GetCounts;
property StoreParcelCount: integer index 1 read GetCounts;
property WorkParcelCount: integer index 2 read GetCounts;
property PassedParcelCount: integer index 3 read GetCounts;
property RefusedParcelCount: integer index 4 read GetCounts;
property ParcelCount: integer read GetParcelCount;
property StepCount: integer read FStepCount write FStepCount;
property ParcelsClass: TParcelsClass read FParcelsClass write FParcelsClass;
published
property Diagram: TPaintBox read FDiagram write FDiagram;
property ElementCount: integer read GetElementCount;
property Elements [Index: integer]: TElement read GetElement;
end;
implementation
uses MainFrm;
constructor TQSheme.Create;
begin
FElements: = TList.Create;
FParcelsClass: = TParcel;
FParcels: = TList.Create;
FEventQueue: = TList.Create;
end;
destructor TQSheme.Destroy;
begin
FElements.Free;
ClearEventQueue;
FEventQueue.Free;
ClearParcelList;
FParcels.Free;
inherited;
end;
function TQSheme.GetElement (Index: integer): TElement;
begin
Result: = FElements [Index];
end;
function TQSheme.GetElementCount: integer;
begin
Result: = FElements.Count
end;
procedure TQSheme.AddElement (Element: TElement);
begin
if Assigned (Element) then begin
FElements.Add (Element);
Element.Sheme: = Self;
end;
end;
procedure TQSheme.DelElement (Element: TElement);
var i, j: integer;
begin
if Assigned (Element) then begin
for i: = 0 to ElementCount - 1 do
for j: = Elements [i]. SourceCount-1 downto 0 do
if Elements [i]. Sources [j] = Element then
Elements [i]. DelSource (Element);
FElements.Remove (Element);
end;
end;
function TQSheme.IsFinishElement (Element: TElement): Boolean;
var j, s: integer;
begin
Result: = False;
for j: = 0 to ElementCount-1 do begin
for s: = 0 to Elements [j]. SourceCount-1 do begin
if Element = Elements [j]. Sources [s] then Exit;
end;
end;
Result: = True;
end;
procedure TQSheme.Find...