-
Notifications
You must be signed in to change notification settings - Fork 33
/
OptOptions.pas
117 lines (102 loc) · 3.62 KB
/
OptOptions.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
unit OptOptions;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
// Delphi Form for the Huge Optimal Solver
TOptOptionForm = class(TForm)
Button1: TButton;
CheckUseHuge: TCheckBox;
Panel1: TPanel;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure CheckUseHugeClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
//
var
OptOptionForm: TOptOptionForm;
implementation
uses CordCube, CubeDefs, RubikMain;
{$R *.DFM}
// Click OK on Form
procedure TOptOptionForm.Button1Click(Sender: TObject);
begin
if (CheckUseHuge.Checked=true) and
{$IF UHUGE}
(Length(PruningUBigP[0])<28181682) then
{$ELSE}
(Length(PruningBigP)<705886618) then
{$IFEND}
begin
OptOptionForm.Hide;
Form1.HugeSolver.Enabled:=false;
makesTables:=true;//for TForm1.OnCloseQuery
Form1.File1.Enabled:=false;
Form1.RunPatButton.Enabled:=false;
Form1.BRunSym.Enabled:=false;
Form1.ButtonAddSolve.Enabled:=false;
Form1.ButtonAddGen.Enabled:=false;
Form1.ProgressLabel.Visible:=true;
Form1.Progressbar.Visible:=true;
{$IF NOT UHUGE}
CreateFlipConjugateTable;
{$IFEND}
{$IF UHUGE}
CreateUltraBigPruningTable;
// CreateCenTwistUDSliceSortedPruningTable;
{$ELSE}
CreateBigPruningTable;
// CreateCenTwistUDSliceSortedPruningTable;
{$IFEND}
Form1.ProgressLabel.Visible:=false;
Form1.Progressbar.Visible:=false;
Form1.ButtonAddSolve.Enabled:=true;
Form1.ButtonAddGen.Enabled:=true;
Form1.RunPatButton.Enabled:=true;
Form1.BRunSym.Enabled:=true;
makesTables:=false;
Form1.HugeSolver.Enabled:=true;
Form1.File1.Enabled:=true;
Exit;
end;
if CheckUseHuge.Checked=false then USES_BIG:=false else USES_BIG:=true;
OptOptionForm.Hide;
end;
//
//
procedure TOptOptionForm.FormCreate(Sender: TObject);
begin
Label1.Caption:=
{$IF UHUGE}
#13 'To use the Huge Optimal Solver you need:' #13 #13
'-> 3 GB of free RAM and 2GB disk space.' #13
'-> An empty Main Window.' #13 #13
'If extensive file swapping occurs, you should run' #13
'Cube Explorer with a fresh (rebooted) system.' #13#13
'Unless you solve cubes with twisted centers the' #13
'solving speed will increase considerably.'
{$ELSE}
#13 'To use the Huge Optimal Solver you need:' #13 #13
'-> 1 GB of free RAM and 700 MB disk space.' #13
'-> An empty Main Window.' #13 #13
'If extensive file swapping occurs, you should run' #13
'Cube Explorer with a fresh (rebooted) system.' #13 #13
'Unless you solve cubes with twisted centers the' #13
'solving speed will increase considerably.'
{$IFEND}
end;
//
// Click CheckBox on Form
procedure TOptOptionForm.CheckUseHugeClick(Sender: TObject);
begin
If CheckUseHuge.Checked=true then USES_BIG:=true
else USES_BIG:=false
end;
//
end.