Changeset 31 for Comm


Ignore:
Timestamp:
Jun 24, 2010, 4:18:03 PM (14 years ago)
Author:
george
Message:
  • Opravy a rozšíření funkčností některých tříd
Location:
Comm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Comm/UCommSerialPort.pas

    r26 r31  
    4545destructor TCommSerialPort.Destroy;
    4646begin
    47   FreeAndNil(DataPin);
     47  OnReceiveData := nil;
     48  DataPin.Destroy;
    4849  inherited;
    4950end;
  • Comm/USerialPort.pas

    r26 r31  
    7777    constructor Create;
    7878    destructor Destroy; override;
     79    procedure Assign(Source: TObject);
    7980  end;
    8081
     
    175176  FReceiveThread.Destroy;
    176177  inherited Destroy;
     178end;
     179
     180procedure TSerialPort.Assign(Source:TObject);
     181begin
     182  if Source is TSerialPort then begin
     183    Name := TSerialPort(Source).Name;
     184    BaudRate := TSerialPort(Source).BaudRate;
     185    Parity := TSerialPort(Source).Parity;
     186    StopBits := TSerialPort(Source).StopBits;
     187    DataBits := TSerialPort(Source).DataBits;
     188    FlowControl := TSerialPort(Source).FlowControl;
     189    DTR := TSerialPort(Source).DTR;
     190    RTS := TSerialPort(Source).RTS;
     191  end else raise Exception.Create('Assignment error');
    177192end;
    178193
Note: See TracChangeset for help on using the changeset viewer.