-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUnit10.pas
87 lines (72 loc) · 1.74 KB
/
Unit10.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
unit Unit10;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Spin, AdvGlassButton, ExtCtrls;
type
TForm10 = class(TForm)
Label1: TLabel;
Shape2: TShape;
Shape1: TShape;
Label3: TLabel;
AdvGlassButton12: TAdvGlassButton;
AdvGlassButton1: TAdvGlassButton;
SpinEdit1: TSpinEdit;
Label2: TLabel;
SpinEdit2: TSpinEdit;
CheckBox1: TCheckBox;
procedure AdvGlassButton12Click(Sender: TObject);
procedure AdvGlassButton1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
private
send_cmd:bool;
public
{ Public declarations }
end;
var
Form10: TForm10;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm10.AdvGlassButton12Click(Sender: TObject);
begin
settings_mask:=$FF;
if settempmode then begin //set temperature
settings_data :=Form10.SpinEdit2.Value;
send_cmd:=true;
Form10.Close;
send_new_settings_temperature(Form10.SpinEdit2.Value, CheckBox1.Checked);
end
else begin //set noolite timeout
if (settings_mode=18) then begin
settings_data :=round(Form10.SpinEdit1.Value/10);
send_cmd:=true;
Form10.Close;
send_new_settings(18);
end;
if (settings_mode=19) then begin
settings_data :=round(Form10.SpinEdit1.Value/10);
send_cmd:=true;
Form10.Close;
send_new_settings(19);
end;
end;
end;
procedure TForm10.AdvGlassButton1Click(Sender: TObject);
begin
send_cmd:=false;
settings_set := 0;
settempmode:=false;
Form10.Close;
end;
procedure TForm10.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if send_cmd=false then
Form1.AdvGlassButton12.Click;
end;
procedure TForm10.FormShow(Sender: TObject);
begin
send_cmd:=false;
end;
end.