This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfsrep.pas
74 lines (56 loc) · 1.45 KB
/
fsrep.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
unit fsrep;
interface
uses
Classes;
type
TFSReporter = class(TObject)
protected
FStatus : string;
FCurVal,FCurMax : integer;
FOverVal,FOverMax : integer;
procedure setStatus(status:string);virtual;
procedure setVal(newval:integer);virtual;
procedure setMax(newmax:integer);virtual;
procedure setOverVal(newval:integer);virtual;
procedure setOverMax(newmax:integer);virtual;
public
CancelNotifier : boolean;
procedure setProgress(current,total:integer);
property Status:string read FStatus write setStatus;
property Value:integer read FCurVal write setVal;
property Max:integer read FCurMax write setMax;
property OverValue:integer read FOverVal write setOverVal;
property OverMax:integer read FOverMax write setOverMax;
end;
implementation
uses
SysUtils, procs;
{ TFSReporter }
procedure TFSReporter.setProgress(current, total: integer);
begin
Max := total;
Value := current;
debug('reporter','progress: '+IntToStr(((value*100) div max)));
end;
procedure TFSReporter.setStatus(status: string);
begin
FStatus := status;
debug('reporter',status);
end;
procedure TFSReporter.setVal(newval: integer);
begin
FCurval := newval;
end;
procedure TFSReporter.setMax(newmax: integer);
begin
FCurMax := newmax;
end;
procedure TFSReporter.setOverVal(newval: integer);
begin
FOverVal:= newval;
end;
procedure TFSReporter.setOverMax(newmax: integer);
begin
FOverMax := newmax;
end;
end.