Ignore:
Timestamp:
Aug 7, 2024, 12:12:42 AM (2 months ago)
Author:
chronos
Message:
  • Modified: Improved serial console handling.
Location:
branches/ByteArray/Forms
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/ByteArray/Forms/FormConsole.lfm

    r5 r10  
    11object FormConsole: TFormConsole
    2   Left = 780
     2  Left = 779
    33  Height = 689
    4   Top = 399
     4  Top = 375
    55  Width = 1002
    66  Caption = 'Console'
     
    88  ClientWidth = 1002
    99  DesignTimePPI = 144
    10   LCLVersion = '2.2.6.0'
     10  LCLVersion = '3.4.0.0'
    1111  object Memo1: TMemo
    1212    Left = 0
     
    2020    TabOrder = 0
    2121  end
     22  object Timer1: TTimer
     23    Interval = 100
     24    OnTimer = Timer1Timer
     25    Left = 314
     26    Top = 160
     27  end
    2228end
  • branches/ByteArray/Forms/FormConsole.pas

    r5 r10  
    44
    55uses
    6   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Device;
     6  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
     7  Device, Serial;
    78
    89type
     
    1213  TFormConsole = class(TFormDevice)
    1314    Memo1: TMemo;
     15    Timer1: TTimer;
     16    procedure Timer1Timer(Sender: TObject);
     17  private
     18    FSerial: TSerial;
     19    procedure SetSerial(AValue: TSerial);
    1420  public
    15     procedure ConsoleWrite(Data: Byte);
     21    property Serial: TSerial read FSerial write SetSerial;
    1622  end;
    1723
     
    2127{$R *.lfm}
    2228
    23 procedure TFormConsole.ConsoleWrite(Data: Byte);
     29procedure TFormConsole.Timer1Timer(Sender: TObject);
    2430begin
    25   Memo1.Lines.Text := Memo1.Lines.Text + Chr(Data);
     31  Memo1.Lines.Text := Memo1.Lines.Text + FSerial.ReadOutputBuffer;
     32end;
     33
     34procedure TFormConsole.SetSerial(AValue: TSerial);
     35begin
     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;
    2644end;
    2745
  • branches/ByteArray/Forms/FormMemory.lfm

    r5 r10  
    11object FormMemory: TFormMemory
    2   Left = 706
     2  Left = 705
    33  Height = 866
    4   Top = 311
     4  Top = 287
    55  Width = 1150
    66  Caption = 'Memory'
     
    88  ClientWidth = 1150
    99  DesignTimePPI = 144
     10  Menu = MainMenu1
    1011  OnShow = FormShow
    11   LCLVersion = '2.2.6.0'
     12  LCLVersion = '3.4.0.0'
    1213  object ListViewMemory: TListView
    1314    Left = 8
     
    4546    Top = 205
    4647  end
     48  object MainMenu1: TMainMenu
     49    Left = 246
     50    Top = 252
     51    object MenuItem1: TMenuItem
     52      Caption = 'Tools'
     53      object MenuItemClear: TMenuItem
     54        Caption = 'Clear'
     55        OnClick = MenuItemClearClick
     56      end
     57    end
     58  end
    4759end
  • branches/ByteArray/Forms/FormMemory.lrj

    r5 r10  
    33{"hash":128683235,"name":"tformmemory.listviewmemory.columns[0].caption","sourcebytes":[65,100,100,114,101,115,115],"value":"Address"},
    44{"hash":305313,"name":"tformmemory.listviewmemory.columns[1].caption","sourcebytes":[68,97,116,97],"value":"Data"},
    5 {"hash":4618201,"name":"tformmemory.listviewmemory.columns[2].caption","sourcebytes":[65,83,67,73,73],"value":"ASCII"}
     5{"hash":4618201,"name":"tformmemory.listviewmemory.columns[2].caption","sourcebytes":[65,83,67,73,73],"value":"ASCII"},
     6{"hash":5989939,"name":"tformmemory.menuitem1.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"},
     7{"hash":4860802,"name":"tformmemory.menuitemclear.caption","sourcebytes":[67,108,101,97,114],"value":"Clear"}
    68]}
  • branches/ByteArray/Forms/FormMemory.pas

    r5 r10  
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
    7   Memory, Common.FormEx;
     7  Menus, Memory, Common.FormEx;
    88
    99type
     
    1313  TFormMemory = class(TFormEx)
    1414    ListViewMemory: TListView;
     15    MainMenu1: TMainMenu;
     16    MenuItem1: TMenuItem;
     17    MenuItemClear: TMenuItem;
    1518    Timer1: TTimer;
    1619    procedure FormShow(Sender: TObject);
    1720    procedure ListViewMemoryData(Sender: TObject; Item: TListItem);
     21    procedure MenuItemClearClick(Sender: TObject);
    1822    procedure Timer1Timer(Sender: TObject);
    1923  public
     
    5862end;
    5963
     64procedure TFormMemory.MenuItemClearClick(Sender: TObject);
     65begin
     66  Memory.FillZero;
     67  Reload;
     68end;
     69
    6070procedure TFormMemory.FormShow(Sender: TObject);
    6171begin
  • branches/ByteArray/Forms/FormScreen.lfm

    r5 r10  
    55  Width = 931
    66  Caption = 'Screen'
    7   ClientHeight = 642
     7  ClientHeight = 676
    88  ClientWidth = 931
    99  DesignTimePPI = 144
     
    1111  OnClose = FormClose
    1212  OnShow = FormShow
    13   LCLVersion = '2.2.6.0'
     13  LCLVersion = '3.4.0.0'
    1414  object Image1: TImage
    1515    Left = 0
    16     Height = 642
     16    Height = 676
    1717    Top = 0
    1818    Width = 931
     
    3737      end
    3838    end
     39    object MenuItem2: TMenuItem
     40      Caption = 'Tools'
     41      object MenuItem10: TMenuItem
     42        Action = Core.ASettings
     43      end
     44      object Separator2: TMenuItem
     45        Caption = '-'
     46      end
     47      object MenuItem3: TMenuItem
     48        Action = Core.ASourceEditor
     49      end
     50      object MenuItem5: TMenuItem
     51        Action = Core.ADebugger
     52      end
     53      object MenuItem8: TMenuItem
     54        Action = Core.ADisassembler
     55      end
     56    end
     57    object MenuItem13: TMenuItem
     58      Caption = 'Execution'
     59      object MenuItem14: TMenuItem
     60        Action = Core.APowerOn
     61      end
     62      object MenuItem15: TMenuItem
     63        Action = Core.APowerOff
     64      end
     65      object MenuItem16: TMenuItem
     66        Action = Core.ARestart
     67      end
     68    end
    3969    object MenuItem1: TMenuItem
    4070      Caption = 'View'
     
    5585      end
    5686    end
    57     object MenuItem2: TMenuItem
    58       Caption = 'Tools'
    59       object MenuItem10: TMenuItem
    60         Action = Core.ASettings
    61       end
    62       object Separator2: TMenuItem
    63         Caption = '-'
    64       end
    65       object MenuItem3: TMenuItem
    66         Action = Core.ASourceEditor
    67       end
    68       object MenuItem5: TMenuItem
    69         Action = Core.ADebugger
    70       end
    71       object MenuItem8: TMenuItem
    72         Action = Core.ADisassembler
    73       end
    74     end
    7587    object MenuItem11: TMenuItem
    7688      Caption = 'Help'
  • branches/ByteArray/Forms/FormScreen.lrj

    r5 r10  
    22{"hash":94014398,"name":"tformscreen.caption","sourcebytes":[83,99,114,101,101,110],"value":"Screen"},
    33{"hash":315429,"name":"tformscreen.menuitem4.caption","sourcebytes":[70,105,108,101],"value":"File"},
     4{"hash":5989939,"name":"tformscreen.menuitem2.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"},
     5{"hash":195880126,"name":"tformscreen.menuitem13.caption","sourcebytes":[69,120,101,99,117,116,105,111,110],"value":"Execution"},
    46{"hash":380871,"name":"tformscreen.menuitem1.caption","sourcebytes":[86,105,101,119],"value":"View"},
    5 {"hash":5989939,"name":"tformscreen.menuitem2.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"},
    67{"hash":322608,"name":"tformscreen.menuitem11.caption","sourcebytes":[72,101,108,112],"value":"Help"}
    78]}
  • branches/ByteArray/Forms/FormScreen.pas

    r5 r10  
    1818    MenuItem11: TMenuItem;
    1919    MenuItem12: TMenuItem;
     20    MenuItem13: TMenuItem;
     21    MenuItem14: TMenuItem;
     22    MenuItem15: TMenuItem;
     23    MenuItem16: TMenuItem;
    2024    MenuItem2: TMenuItem;
    2125    MenuItem3: TMenuItem;
Note: See TracChangeset for help on using the changeset viewer.