-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAnalytics.pas
175 lines (159 loc) · 4.12 KB
/
Analytics.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{ The Weather Project - SETTINGS UNIT
(C) 2022 Connor Bell - ALL RIGHTS RESERVED
}
unit Analytics;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin, Vcl.Grids,
Vcl.ValEdit;
type
TfrmAnalytics = class(TForm)
clbrMain: TCoolBar;
tlbrMain: TToolBar;
pgcMain: TPageControl;
tbsWeather: TTabSheet;
tbsAQI: TTabSheet;
pgcWeather: TPageControl;
tbsParameters: TTabSheet;
tbsAPI: TTabSheet;
strWP: TStringGrid;
strWAPI: TStringGrid;
pgcAQI: TPageControl;
tbsParamAQI: TTabSheet;
tbsAQIAPI: TTabSheet;
strAQIA: TStringGrid;
tlbtnClose: TToolButton;
strAQIP: TStringGrid;
procedure FormActivate(Sender: TObject);
procedure tlbtnCloseClick(Sender: TObject);
procedure tlbtnPrintClick(Sender: TObject);
procedure tlbtnSaveClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
// User Def Proc
procedure LoadParams;
end;
var
frmAnalytics: TfrmAnalytics;
implementation
uses
Main;
{$R *.dfm}
procedure TfrmAnalytics.FormActivate(Sender: TObject);
begin
// ON ACTIVATE
LoadParams;
end;
procedure TfrmAnalytics.LoadParams;
begin
// LOAD PARAMS
// Weather Params
with strWP do
begin
Cells[0, 0] := 'Parameter';
Cells[1, 0] := 'Value';
Cells[0, 1] := frmMain.rrqMain.Params[0].Name;
Cells[1, 1] := frmMain.rrqMain.Params[0].Value;
Cells[0, 2] := frmMain.rrqMain.Params[2].Name;
Cells[1, 2] := frmMain.rrqMain.Params[2].Value;
end;
// Weather API
with strWAPI do
begin
Cells[0, 0] := 'Status Code';
Cells[1, 0] := frmMain.rrsMain.StatusCode.ToString;
Cells[0, 1] := 'Status Message';
Cells[1, 1] := frmMain.rrsMain.StatusText;
Cells[0, 2] := 'Server';
Cells[1, 2] := frmMain.rrsConditions.Server;
end;
// AQI Params
with strAQIP do
begin
Cells[0, 0] := 'Parameter';
Cells[1, 0] := 'Value';
Cells[0, 1] := frmMain.rrqAQI.Params[0].Name;
Cells[1, 1] := frmMain.rrqAQI.Params[0].Value;
end;
// AQI API
with strAQIA do
begin
Cells[0, 0] := 'Status Code';
Cells[1, 0] := frmMain.rrsAQI.StatusCode.ToString;
Cells[0, 1] := 'Status Message';
Cells[1, 1] := frmMain.rrsAQI.StatusText;
Cells[0, 2] := 'Server';
Cells[1, 2] := frmMain.rrsAQI.Server;
end;
end;
procedure TfrmAnalytics.tlbtnCloseClick(Sender: TObject);
begin
// CLOSE ANALYTICS
frmAnalytics.Close;
end;
procedure TfrmAnalytics.tlbtnPrintClick(Sender: TObject);
begin
// PRINT ANALYTICS
if tbsWeather.Showing = True then
begin
// Print Weather Tabsheet contents
if tbsAPI.Showing = True then
begin
// Print API Stats
end
else
if tbsParameters.Showing = True then
begin
// Print the Parameter Stats
end;
end
else
if tbsAQI.Showing = True then
begin
// Print AQI Tabsheet contents
if tbsAQIAPI.Showing = True then
begin
// Print AQI API Stats
end
else
if tbsParamAQI.Showing = True then
begin
// Print the AQI Parameter Stats
end;
end;
end;
procedure TfrmAnalytics.tlbtnSaveClick(Sender: TObject);
begin
// SAVE ANALYTICS
if tbsWeather.Showing = True then
begin
// Save Weather Tabsheet contents
if tbsAPI.Showing = True then
begin
// Save API Stats
end
else
if tbsParameters.Showing = True then
begin
// Save the Parameter Stats
end;
end
else
if tbsAQI.Showing = True then
begin
// Save AQI Tabsheet contents
if tbsAQIAPI.Showing = True then
begin
// Save AQI API Stats
end
else
if tbsParamAQI.Showing = True then
begin
// Save the AQI Parameter Stats
end;
end;
end;
end.