Changeset 288 for PinConnection/UCommSerialPort.pas
- Timestamp:
- Oct 24, 2011, 9:01:08 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PinConnection/UCommSerialPort.pas
r272 r288 10 10 11 11 type 12 13 { TCommSerialPort } 14 12 15 TCommSerialPort = class(TSerialPort) 13 16 private 14 17 procedure Receive(Sender: TCommPin; Stream: TStream); 18 procedure SetStatus(Sender: TCommPin; AValue: Integer); 15 19 procedure ReceiveData(Stream: TMemoryStream); 16 20 public … … 32 36 end; 33 37 38 procedure TCommSerialPort.SetStatus(Sender: TCommPin; AValue: Integer); 39 begin 40 try 41 Lock.Acquire; 42 if (AValue and 1) = 1 then Parity := paMark else Parity := paSpace; 43 finally 44 Lock.Release; 45 end; 46 end; 47 34 48 constructor TCommSerialPort.Create; 35 49 begin … … 38 52 Pin := TCommPin.Create; 39 53 Pin.OnReceive := Receive; 54 Pin.OnSetSatus := SetStatus; 40 55 OnReceiveData := ReceiveData; 41 56 end;
Note:
See TracChangeset
for help on using the changeset viewer.