-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dlgAutoBuild_Finals.pas
126 lines (114 loc) · 3.34 KB
/
dlgAutoBuild_Finals.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
unit dlgAutoBuild_Finals;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Samples.Spin,
Vcl.ExtCtrls, SCMDefines;
type
TAutoBuild_Finals = class(TForm)
Panel2: TPanel;
btnCancel: TButton;
btnOk: TButton;
Panel1: TPanel;
Label1: TLabel;
lblSeedDepth2: TLabel;
lblSeedDepth1: TLabel;
Label2: TLabel;
prefSeperateGender: TCheckBox;
prefExcludeOutsideLanes: TCheckBox;
CheckBox1: TCheckBox;
rgpSeedMethod: TRadioGroup;
spnSeedDepth: TSpinEdit;
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure ReadPreferences(AIniFileName: string);
// procedure WritePreferences(AiniFileName: string); //--
public
{ Public declarations }
TypeOfEvent: scmEventFinalsType;
end;
var
AutoBuild_Finals: TAutoBuild_Finals;
implementation
uses system.IniFiles, SCMUtility;
{$R *.dfm}
{ TAutoBuild_Finals }
procedure TAutoBuild_Finals.FormCreate(Sender: TObject);
var
iniFileName: string;
begin
// read from preference file
iniFileName := GetSCMPreferenceFileName();
if FileExists(iniFileName) then
ReadPreferences(iniFileName);
TypeOfEvent := ftFinals;
end;
procedure TAutoBuild_Finals.FormShow(Sender: TObject);
var
s: string;
begin
s := ' Auto-Build for the current selected event?';
// Setup controls based on TypeOfFinal;
case TypeOfEvent of
ftFinals:
begin
rgpSeedMethod.ItemIndex := 0;
spnSeedDepth.Value := 3;
Caption := 'Auto Build Finals.';
Label1.Caption := 'Perform a FINALS' + s;
end;
ftSemi:
begin
rgpSeedMethod.ItemIndex := 1;
spnSeedDepth.Value := 2;
Caption := 'Auto Build Semi-Finals.';
Label1.Caption := 'Perform a SEMI-FINALS' + s;
end;
ftQuarter:
begin
rgpSeedMethod.ItemIndex := 1;
spnSeedDepth.Value := 3;
Caption := 'Auto Build Quarter-Finals.';
Label1.Caption := 'Perform a QUARTER-FINALS' + s;
end;
end;
btnOk.SetFocus();
end;
procedure TAutoBuild_Finals.ReadPreferences(AIniFileName: string);
var
iFile: TIniFile;
i: integer;
begin
iFile := TIniFile.Create(AIniFileName);
i := iFile.ReadInteger('Preferences','ExcludeOutsideLanes_finals', integer(cbUnchecked));
if (i = integer(cbChecked)) then
prefExcludeOutsideLanes.Checked := true
else
prefExcludeOutsideLanes.Checked := false;
i := iFile.ReadInteger('Preferences', 'SeperateGender_finals', integer(cbUnchecked));
if (i = integer(cbChecked)) then
prefSeperateGender.Checked := true
else
prefSeperateGender.Checked := false;
// 2020-11-01 auto-build v2 seed depth for Circle Seed
spnSeedDepth.Value := (iFile.ReadInteger('Preferences', 'SeedDepth_finals', 3));
iFile.Free;
end;
{
procedure TAutoBuild_Finals.WritePreferences(AIniFileName: string);
var
iFile: TIniFile;
begin
iFile := TIniFile.Create(AIniFileName);
iFile.WriteInteger('Preferences', 'ExcludeOutsideLanes_finals',
integer(prefExcludeOutsideLanes.State));
iFile.WriteInteger('Preferences', 'SeperateGender_finals',
integer(prefSeperateGender.State));
// 2020-11-01 auto-build v2 seed depth for Circle Seed
iFile.WriteInteger('Preferences', 'SeedDepth_finals', spnSeedDepth.Value);
iFile.Free;
end;
}
end.