Changeset 416 for PinConnection
- Timestamp:
- Aug 20, 2012, 2:45:39 PM (12 years ago)
- Location:
- PinConnection
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
PinConnection/PinConnection.lpk
r413 r416 22 22 <License Value="GNU/GPL"/> 23 23 <Version Minor="4"/> 24 <Files Count="1 5">24 <Files Count="16"> 25 25 <Item1> 26 26 <Filename Value="USerialPort.pas"/> … … 80 80 </Item14> 81 81 <Item15> 82 <Filename Value="UCommConnector.pas"/> 83 <UnitName Value="UCommConnector"/> 84 </Item15> 85 <Item16> 82 86 <Filename Value="UPinConnection.pas"/> 83 87 <HasRegisterProc Value="True"/> 84 88 <UnitName Value="UPinConnection"/> 85 </Item1 5>89 </Item16> 86 90 </Files> 87 91 <i18n> -
PinConnection/PinConnection.pas
r413 r416 10 10 USerialPort, UPacketBurst, UCommFrame, UCommHub, UCommPin, UCommSerialPort, 11 11 UCommThread, UCommConcentrator, UCommDelay, UCommTCPClient, UCommTCPServer, 12 UCommTelnet, UCommTelnetComPortOption, UCommMark, U PinConnection,13 LazarusPackageIntf;12 UCommTelnet, UCommTelnetComPortOption, UCommMark, UCommConnector, 13 UPinConnection, LazarusPackageIntf; 14 14 15 15 implementation -
PinConnection/UCommConcentrator.pas
r414 r416 115 115 FPins.Concentrator := Self; 116 116 FMain := TCommPin.Create; 117 FMain.Node := Self; 117 118 FMain.OnSetSatus := MainSetStatus; 118 119 FMain.OnReceive := MainReceive; -
PinConnection/UCommSerialPort.pas
r414 r416 20 20 protected 21 21 procedure SetActive(const AValue: Boolean); override; 22 procedure AssignTo(Dest: TPersistent); override; 22 23 public 23 24 SerialPort: TSerialPort; … … 43 44 inherited; 44 45 SerialPort.Active := AValue; 46 end; 47 48 procedure TCommSerialPort.AssignTo(Dest: TPersistent); 49 begin 50 if Dest is TCommSerialPort then begin 51 TCommSerialPort(Dest).SerialPort.Assign(SerialPort); 52 end else inherited; 45 53 end; 46 54 -
PinConnection/UCommTCPClient.pas
r413 r416 35 35 procedure ReceiveData(Sender: TCommPin; Stream: TListByte); 36 36 procedure SetActive(const AValue: Boolean); 37 protected 38 procedure AssignTo(Dest: TPersistent); override; 37 39 public 38 40 Socket: TTCPBlockSocket; … … 91 93 FreeAndNil(FReceiveThread); 92 94 end; 95 end; 96 97 procedure TCommTCPClient.AssignTo(Dest: TPersistent); 98 begin 99 if Dest is TCommTCPClient then begin 100 TCommTCPClient(Dest).Address := Address; 101 TCommTCPClient(Dest).Port := Port; 102 end 103 else inherited; 93 104 end; 94 105 -
PinConnection/UCommTelnet.pas
r414 r416 57 57 ServerChecked: Boolean; 58 58 SupportedByServer: Boolean; 59 procedure Assign(Source: TTelnetOption); virtual; 59 60 function CheckOption: Boolean; 60 61 procedure SendCommand(Request, Response: TListByte); … … 78 79 procedure ReadResponse(Response: TListByte); 79 80 function ResponseCount: Integer; 81 protected 82 procedure AssignTo(Dest: TPersistent); override; 80 83 public 81 84 Options: TListObject; … … 92 95 procedure SendSubCommand(OptionCode: TTelnetCommand; Request, Response: TListByte); 93 96 procedure SendCommand(Code: TTelnetCode; Request, Response: TListByte); 97 procedure Purge; 94 98 constructor Create(AOwner: TComponent); override; 95 99 destructor Destroy; override; … … 114 118 if FActive = AValue then Exit; 115 119 FActive := AValue; 120 end; 121 122 procedure TTelnetOption.Assign(Source: TTelnetOption); 123 begin 124 SupportedByServer := Source.SupportedByServer; 125 ServerChecked := Source.ServerChecked; 126 Code := Source.Code; 127 FOnRequest := Source.FOnRequest; 128 Active := Source.FActive; 116 129 end; 117 130 … … 306 319 end; 307 320 321 procedure TCommTelnet.AssignTo(Dest: TPersistent); 322 var 323 I: Integer; 324 begin 325 if Dest is TCommTelnet then begin 326 TCommTelnet(Dest).Timeout := Timeout; 327 TCommTelnet(Dest).PortType := PortType; 328 TCommTelnet(Dest).ErrorCount := ErrorCount; 329 TCommTelnet(Dest).OptionsNegotationEnable := OptionsNegotationEnable; 330 for I := 0 to Options.Count - 1 do begin 331 TTelnetOption(TCommTelnet(Dest).Options[I]).Assign(TTelnetOption(Options[I])); 332 TTelnetOption(TCommTelnet(Dest).Options[I]).Telnet := TCommTelnet(Dest); 333 end; 334 end else inherited; 335 end; 336 308 337 procedure TCommTelnet.Register(Option: TTelnetOption); 309 338 begin … … 399 428 end; 400 429 430 procedure TCommTelnet.Purge; 431 begin 432 FState := tsNormal; 433 FResponses.Clear; 434 end; 435 401 436 constructor TCommTelnet.Create(AOwner: TComponent); 402 437 begin -
PinConnection/UCommTelnetComPortOption.pas
r412 r416 41 41 constructor Create; 42 42 destructor Destroy; override; 43 procedure Assign(Source: TTelnetOption); override; 43 44 property FlowControl: TFlowControl read GetFlowControl write SetFlowControl; 44 45 property DataBits: TDataBits read GetDataBits write SetDataBits; … … 224 225 end; 225 226 227 procedure TTelnetOptionComPort.Assign(Source: TTelnetOption); 228 begin 229 FBaudRate := TTelnetOptionComPort(Source).FBaudRate; 230 FDTR := TTelnetOptionComPort(Source).FDTR; 231 FRTS := TTelnetOptionComPort(Source).FRTS; 232 inherited Assign(Source); 233 end; 234 226 235 end. 227 236
Note:
See TracChangeset
for help on using the changeset viewer.