|
@@ -84,9 +84,11 @@ type
|
|
TCompilerStatusDialog = object(TCenterDialog)
|
|
TCompilerStatusDialog = object(TCenterDialog)
|
|
ST : PAdvancedStaticText;
|
|
ST : PAdvancedStaticText;
|
|
KeyST : PColorStaticText;
|
|
KeyST : PColorStaticText;
|
|
|
|
+ starttime : real;
|
|
constructor Init;
|
|
constructor Init;
|
|
destructor Done;virtual;
|
|
destructor Done;virtual;
|
|
procedure Update;
|
|
procedure Update;
|
|
|
|
+ procedure SetStartTime(r : real);
|
|
end;
|
|
end;
|
|
|
|
|
|
TFPInputFile = class(tinputfile)
|
|
TFPInputFile = class(tinputfile)
|
|
@@ -551,12 +553,30 @@ end;
|
|
CompilerStatusDialog
|
|
CompilerStatusDialog
|
|
****************************************************************************}
|
|
****************************************************************************}
|
|
|
|
|
|
|
|
+function getrealtime : real;
|
|
|
|
+var
|
|
|
|
+{$IFDEF USE_SYSUTILS}
|
|
|
|
+ h,m,s,s1000 : word;
|
|
|
|
+{$ELSE USE_SYSUTILS}
|
|
|
|
+ h,m,s,s100 : word;
|
|
|
|
+{$ENDIF USE_SYSUTILS}
|
|
|
|
+begin
|
|
|
|
+{$IFDEF USE_SYSUTILS}
|
|
|
|
+ DecodeTime(Time,h,m,s,s1000);
|
|
|
|
+ getrealtime:=h*3600.0+m*60.0+s+s1000/1000.0;
|
|
|
|
+{$ELSE USE_SYSUTILS}
|
|
|
|
+ gettime(h,m,s,s100);
|
|
|
|
+ getrealtime:=h*3600.0+m*60.0+s+s100/100.0;
|
|
|
|
+{$ENDIF USE_SYSUTILS}
|
|
|
|
+end;
|
|
|
|
+
|
|
constructor TCompilerStatusDialog.Init;
|
|
constructor TCompilerStatusDialog.Init;
|
|
var R: TRect;
|
|
var R: TRect;
|
|
begin
|
|
begin
|
|
R.Assign(0,0,56,11);
|
|
R.Assign(0,0,56,11);
|
|
ClearFormatParams; AddFormatParamStr(KillTilde(SwitchesModeName[SwitchesMode]));
|
|
ClearFormatParams; AddFormatParamStr(KillTilde(SwitchesModeName[SwitchesMode]));
|
|
inherited Init(R, FormatStrF(dialog_compilingwithmode, FormatParams));
|
|
inherited Init(R, FormatStrF(dialog_compilingwithmode, FormatParams));
|
|
|
|
+ starttime:=getrealtime;
|
|
GetExtent(R); R.B.Y:=11;
|
|
GetExtent(R); R.B.Y:=11;
|
|
R.Grow(-3,-2);
|
|
R.Grow(-3,-2);
|
|
New(ST, Init(R, ''));
|
|
New(ST, Init(R, ''));
|
|
@@ -576,10 +596,16 @@ begin
|
|
Inherited Done;
|
|
Inherited Done;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TCompilerStatusDialog.SetStartTime(r : real);
|
|
|
|
+ begin
|
|
|
|
+ starttime:=r;
|
|
|
|
+ end;
|
|
|
|
+
|
|
procedure TCompilerStatusDialog.Update;
|
|
procedure TCompilerStatusDialog.Update;
|
|
var
|
|
var
|
|
StatusS,KeyS: string;
|
|
StatusS,KeyS: string;
|
|
hstatus : TFPCHeapStatus;
|
|
hstatus : TFPCHeapStatus;
|
|
|
|
+ r : real;
|
|
const
|
|
const
|
|
MaxFileNameSize = 46;
|
|
MaxFileNameSize = 46;
|
|
begin
|
|
begin
|
|
@@ -642,6 +668,9 @@ begin
|
|
AddFormatParamInt(hstatus.CurrHeapUsed div 1024);
|
|
AddFormatParamInt(hstatus.CurrHeapUsed div 1024);
|
|
AddFormatParamInt(hstatus.CurrHeapSize div 1024);
|
|
AddFormatParamInt(hstatus.CurrHeapSize div 1024);
|
|
AddFormatParamInt(Status.ErrorCount);
|
|
AddFormatParamInt(Status.ErrorCount);
|
|
|
|
+ r:=getrealtime;
|
|
|
|
+ AddFormatParamInt(trunc(r-starttime));
|
|
|
|
+ AddFormatParamInt(trunc(frac(r-starttime)*10));
|
|
ST^.SetText(
|
|
ST^.SetText(
|
|
FormatStrF(
|
|
FormatStrF(
|
|
'Main file: %s'#13+
|
|
'Main file: %s'#13+
|
|
@@ -649,7 +678,7 @@ begin
|
|
'Target: %s'#13+
|
|
'Target: %s'#13+
|
|
'Line number: %6d '+'Total lines: %6d'+#13+
|
|
'Line number: %6d '+'Total lines: %6d'+#13+
|
|
'Used memory: %6dK '+'Allocated memory: %6dK'#13+
|
|
'Used memory: %6dK '+'Allocated memory: %6dK'#13+
|
|
- 'Total errors: %5d',
|
|
|
|
|
|
+ 'Total errors:%6d '+'Compile time: %8d.%1ds',
|
|
FormatParams)
|
|
FormatParams)
|
|
);
|
|
);
|
|
KeyST^.SetText(^C+KeyS);
|
|
KeyST^.SetText(^C+KeyS);
|
|
@@ -660,23 +689,6 @@ end;
|
|
Compiler Hooks
|
|
Compiler Hooks
|
|
****************************************************************************}
|
|
****************************************************************************}
|
|
|
|
|
|
-function getrealtime : real;
|
|
|
|
-var
|
|
|
|
-{$IFDEF USE_SYSUTILS}
|
|
|
|
- h,m,s,s1000 : word;
|
|
|
|
-{$ELSE USE_SYSUTILS}
|
|
|
|
- h,m,s,s100 : word;
|
|
|
|
-{$ENDIF USE_SYSUTILS}
|
|
|
|
-begin
|
|
|
|
-{$IFDEF USE_SYSUTILS}
|
|
|
|
- DecodeTime(Time,h,m,s,s1000);
|
|
|
|
- getrealtime:=h*3600.0+m*60.0+s+s1000/1000.0;
|
|
|
|
-{$ELSE USE_SYSUTILS}
|
|
|
|
- gettime(h,m,s,s100);
|
|
|
|
- getrealtime:=h*3600.0+m*60.0+s+s100/100.0;
|
|
|
|
-{$ENDIF USE_SYSUTILS}
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
const
|
|
const
|
|
lasttime : real = 0;
|
|
lasttime : real = 0;
|
|
|
|
|
|
@@ -911,6 +923,7 @@ begin
|
|
if not assigned(CompilingHiddenFile) then
|
|
if not assigned(CompilingHiddenFile) then
|
|
begin
|
|
begin
|
|
New(CompilerStatusDialog, Init);
|
|
New(CompilerStatusDialog, Init);
|
|
|
|
+ CompilerStatusDialog^.SetStartTime(getrealtime);
|
|
CompilerStatusDialog^.SetState(sfModal,true);
|
|
CompilerStatusDialog^.SetState(sfModal,true);
|
|
{ disable window closing }
|
|
{ disable window closing }
|
|
CompilerStatusDialog^.Flags:=CompilerStatusDialog^.Flags and not wfclose;
|
|
CompilerStatusDialog^.Flags:=CompilerStatusDialog^.Flags and not wfclose;
|