source: trunk/Forms/FormCPU.pas

Last change on this file was 145, checked in by chronos, 11 months ago
  • Modified: Remove U prefix from unit names.
  • Modified: Updated Common package.
File size: 1.2 KB
Line 
1unit FormCPU;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
7 ExtCtrls;
8
9type
10
11 { TFormCPU }
12
13 TFormCPU = class(TForm)
14 Label3: TLabel;
15 Label4: TLabel;
16 Label5: TLabel;
17 Label7: TLabel;
18 LabelMemoryPointer: TLabel;
19 LabelProgramPointer: TLabel;
20 LabelStepCounter: TLabel;
21 LabelStepSpeed: TLabel;
22 procedure FormCreate(Sender: TObject);
23 public
24 LastStepCounter: Integer;
25 procedure Reload;
26 end;
27
28var
29 FormCPU: TFormCPU;
30
31
32implementation
33
34uses
35 Core, TargetInterpretter;
36
37{$R *.lfm}
38
39resourcestring
40 SStepsPerSecond = ' steps/s';
41
42{ TFormCPU }
43
44procedure TFormCPU.FormCreate(Sender: TObject);
45begin
46 Core.Core.Translator.TranslateComponentRecursive(Self);
47 Core.Core.ThemeManager.UseTheme(Self);
48end;
49
50procedure TFormCPU.Reload;
51begin
52 if Core.Core.CurrentTarget is TTargetInterpretter then
53 with TTargetInterpretter(Core.Core.CurrentTarget) do begin
54 LabelProgramPointer.Caption := IntToStr(ProgramIndex);
55 LabelMemoryPointer.Caption := IntToStr(MemoryPosition);
56 LabelStepCounter.Caption := IntToStr(StepCount);
57 LabelStepSpeed.Caption := IntToStr(StepCount - LastStepCounter) + SStepsPerSecond;
58 LastStepCounter := StepCount;
59 end;
60end;
61
62end.
63
Note: See TracBrowser for help on using the repository browser.