Changeset 119 for Comm/UCommSerialPort.pas
- Timestamp:
- Jan 5, 2011, 1:16:30 PM (14 years ago)
- Location:
- Comm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Comm
-
Property svn:ignore
set to
lib
-
Property svn:ignore
set to
-
Comm/UCommSerialPort.pas
r31 r119 11 11 TCommSerialPort = class(TSerialPort) 12 12 private 13 FTxCount: Integer; 14 FRxCount: Integer; 15 procedure Receive(Stream: TStream); 13 procedure Receive(Sender: TCommPin; Stream: TStream); 16 14 procedure ReceiveData(Stream: TMemoryStream); 17 15 public 18 DataPin: TCommPin;16 Pin: TCommPin; 19 17 destructor Destroy; override; 20 18 constructor Create; 21 property TxCount: Integer read FTxCount;22 property RxCount: Integer read FRxCount;23 19 end; 24 20 … … 31 27 procedure TCommSerialPort.ReceiveData(Stream: TMemoryStream); 32 28 begin 33 Inc(FRxCount, Stream.Size); 34 DataPin.Send(Stream); 29 Pin.Send(Stream); 35 30 end; 36 31 … … 38 33 begin 39 34 inherited; 40 DataPin := TCommPin.Create;41 DataPin.OnReceive := Receive;35 Pin := TCommPin.Create; 36 Pin.OnReceive := Receive; 42 37 OnReceiveData := ReceiveData; 43 38 end; … … 46 41 begin 47 42 OnReceiveData := nil; 48 DataPin.Destroy;43 Pin.Free; 49 44 inherited; 50 45 end; 51 46 52 procedure TCommSerialPort.Receive(S tream: TStream);47 procedure TCommSerialPort.Receive(Sender: TCommPin; Stream: TStream); 53 48 begin 54 Inc(FTxCount, Stream.Size);55 49 Stream.Position := 0; 56 50 repeat
Note:
See TracChangeset
for help on using the changeset viewer.