Ignore:
Timestamp:
Jan 5, 2011, 1:16:30 PM (14 years ago)
Author:
george
Message:
  • Created: New Lazarus package as container for few classes with bidirectional pin interconnection system .
Location:
Comm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Comm

    • Property svn:ignore set to
      lib
  • Comm/UCommSerialPort.pas

    r31 r119  
    1111  TCommSerialPort = class(TSerialPort)
    1212  private
    13     FTxCount: Integer;
    14     FRxCount: Integer;
    15     procedure Receive(Stream: TStream);
     13    procedure Receive(Sender: TCommPin; Stream: TStream);
    1614    procedure ReceiveData(Stream: TMemoryStream);
    1715  public
    18     DataPin: TCommPin;
     16    Pin: TCommPin;
    1917    destructor Destroy; override;
    2018    constructor Create;
    21     property TxCount: Integer read FTxCount;
    22     property RxCount: Integer read FRxCount;
    2319  end;
    2420
     
    3127procedure TCommSerialPort.ReceiveData(Stream: TMemoryStream);
    3228begin
    33   Inc(FRxCount, Stream.Size);
    34   DataPin.Send(Stream);
     29  Pin.Send(Stream);
    3530end;
    3631
     
    3833begin
    3934  inherited;
    40   DataPin := TCommPin.Create;
    41   DataPin.OnReceive := Receive;
     35  Pin := TCommPin.Create;
     36  Pin.OnReceive := Receive;
    4237  OnReceiveData := ReceiveData;
    4338end;
     
    4641begin
    4742  OnReceiveData := nil;
    48   DataPin.Destroy;
     43  Pin.Free;
    4944  inherited;
    5045end;
    5146
    52 procedure TCommSerialPort.Receive(Stream: TStream);
     47procedure TCommSerialPort.Receive(Sender: TCommPin; Stream: TStream);
    5348begin
    54   Inc(FTxCount, Stream.Size);
    5549  Stream.Position := 0;
    5650  repeat
Note: See TracChangeset for help on using the changeset viewer.