-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOWM.Classes.pas
138 lines (124 loc) · 3.35 KB
/
OWM.Classes.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
unit OWM.Classes;
interface
type
TOWMSys = class
private
FCountry: string;
FId: Integer;
FSunrise: TDateTime;
FSunset: TDateTime;
FType: Integer;
public
property Country: string read FCountry write FCountry;
property Id: Integer read FId write FId;
property Sunrise: TDateTime read FSunrise write FSunrise;
property Sunset: TDateTime read FSunset write FSunset;
property &Type: Integer read FType write FType;
end;
TOWMClouds = class
private
FAll: Integer;
public
property All: Integer read FAll write FAll;
end;
TOWMWind = class
private
FDeg: Integer;
FGust: Double;
FSpeed: Double;
public
property Deg: Integer read FDeg write FDeg;
property Gust: Double read FGust write FGust;
property Speed: Double read FSpeed write FSpeed;
end;
TOWMMain = class
private
FFeels_Like: Double;
FHumidity: Integer;
FPressure: Integer;
FTemp: Double;
FTemp_Max: Double;
FTemp_Min: Double;
public
property FeelsLike: Double read FFeels_Like write FFeels_Like;
property Humidity: Integer read FHumidity write FHumidity;
property Pressure: Integer read FPressure write FPressure;
property Temp: Double read FTemp write FTemp;
property TempMax: Double read FTemp_Max write FTemp_Max;
property TempMin: Double read FTemp_Min write FTemp_Min;
end;
TOWMWeather = class
private
FDescription: string;
FIcon: string;
FId: Integer;
FMain: string;
public
property Description: string read FDescription write FDescription;
property Icon: string read FIcon write FIcon;
property Id: Integer read FId write FId;
property Main: string read FMain write FMain;
end;
TOWMCoord = class
private
FLat: Double;
FLon: Double;
public
property Lat: Double read FLat write FLat;
property Lon: Double read FLon write FLon;
end;
TOWMCurrent = class
private
FBase: string;
FClouds: TOWMClouds;
FCod: Integer;
FCoord: TOWMCoord;
FDt: TDateTime;
FId: Integer;
FMain: TOWMMain;
FName: string;
FSys: TOWMSys;
FTimezone: Integer;
FVisibility: Integer;
FWeather: TArray<TOWMWeather>;
FWind: TOWMWind;
public
property Base: string read FBase write FBase;
property Clouds: TOWMClouds read FClouds write FClouds;
property Cod: Integer read FCod write FCod;
property Coord: TOWMCoord read FCoord write FCoord;
property DateTime: TDateTime read FDt write FDt;
property Id: Integer read FId write FId;
property Main: TOWMMain read FMain write FMain;
property Name: string read FName write FName;
property Sys: TOWMSys read FSys write FSys;
property Timezone: Integer read FTimezone write FTimezone;
property Visibility: Integer read FVisibility write FVisibility;
property Weather: TArray<TOWMWeather> read FWeather write FWeather;
property Wind: TOWMWind read FWind write FWind;
public
constructor Create;
destructor Destroy; override;
end;
implementation
{ TOWMCurrent }
constructor TOWMCurrent.Create;
begin
FCoord := TOWMCoord.Create;
FMain := TOWMMain.Create;
FWind := TOWMWind.Create;
FClouds := TOWMClouds.Create;
FSys := TOWMSys.Create;
end;
destructor TOWMCurrent.Destroy;
begin
FCoord.Free;
FMain.Free;
FWind.Free;
FClouds.Free;
FSys.Free;
for var Item in FWeather do
Item.Free;
inherited;
end;
end.