Changeset 10 for branches/ByteArray/Forms/FormConsole.pas
- Timestamp:
- Aug 7, 2024, 12:12:42 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ByteArray/Forms/FormConsole.pas
r5 r10 4 4 5 5 uses 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Device; 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, 7 Device, Serial; 7 8 8 9 type … … 12 13 TFormConsole = class(TFormDevice) 13 14 Memo1: TMemo; 15 Timer1: TTimer; 16 procedure Timer1Timer(Sender: TObject); 17 private 18 FSerial: TSerial; 19 procedure SetSerial(AValue: TSerial); 14 20 public 15 pro cedure ConsoleWrite(Data: Byte);21 property Serial: TSerial read FSerial write SetSerial; 16 22 end; 17 23 … … 21 27 {$R *.lfm} 22 28 23 procedure TFormConsole. ConsoleWrite(Data: Byte);29 procedure TFormConsole.Timer1Timer(Sender: TObject); 24 30 begin 25 Memo1.Lines.Text := Memo1.Lines.Text + Chr(Data); 31 Memo1.Lines.Text := Memo1.Lines.Text + FSerial.ReadOutputBuffer; 32 end; 33 34 procedure TFormConsole.SetSerial(AValue: TSerial); 35 begin 36 if FSerial = AValue then Exit; 37 if Assigned(FSerial) then begin 38 FSerial.OnOutput := nil; 39 end; 40 FSerial := AValue; 41 if Assigned(FSerial) then begin 42 Memo1.Lines.Text := FSerial.ReadOutputBuffer; 43 end; 26 44 end; 27 45
Note:
See TracChangeset
for help on using the changeset viewer.