line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78b30ac-200e-11de-bdcf-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::WeatherConditionsResponse; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
27
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
47
|
|
10
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
11
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
12
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1858
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
require Exporter; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
19
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
20
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# This allows declaration use Rinchi::CIGI::AtmosphereControl ':all'; |
23
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
24
|
|
|
|
|
|
|
# will save memory. |
25
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
) ] ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our @EXPORT = qw( |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Preloaded methods go here. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Rinchi::CIGIPP::WeatherConditionsResponse - Perl extension for the Common Image |
42
|
|
|
|
|
|
|
Generator Interface - Weather Conditions Response data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::WeatherConditionsResponse; |
47
|
|
|
|
|
|
|
my $wthr_resp = Rinchi::CIGIPP::WeatherConditionsResponse->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $wthr_resp->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $wthr_resp->packet_size(); |
51
|
|
|
|
|
|
|
$request_ident = $wthr_resp->request_ident(41); |
52
|
|
|
|
|
|
|
$humidity = $wthr_resp->humidity(45); |
53
|
|
|
|
|
|
|
$air_temperature = $wthr_resp->air_temperature(76.992); |
54
|
|
|
|
|
|
|
$visibility_range = $wthr_resp->visibility_range(36.303); |
55
|
|
|
|
|
|
|
$horizontal_wind_speed = $wthr_resp->horizontal_wind_speed(47.571); |
56
|
|
|
|
|
|
|
$vertical_wind_speed = $wthr_resp->vertical_wind_speed(45.084); |
57
|
|
|
|
|
|
|
$wind_direction = $wthr_resp->wind_direction(0.137); |
58
|
|
|
|
|
|
|
$barometric_pressure = $wthr_resp->barometric_pressure(89.194); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
The Weather Conditions Response packet is sent in response to an Environmental |
63
|
|
|
|
|
|
|
Conditions Request packet whose Request Type attribute specifies Weather |
64
|
|
|
|
|
|
|
Conditions. The packet describes atmosphere properties at the requested |
65
|
|
|
|
|
|
|
geodetic position. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 EXPORT |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
None by default. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#============================================================================== |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item new $wthr_resp = Rinchi::CIGIPP::WeatherConditionsResponse->new() |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Constructor for Rinchi::WeatherConditionsResponse. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub new { |
80
|
1
|
|
|
1
|
1
|
51
|
my $class = shift; |
81
|
1
|
|
33
|
|
|
7
|
$class = ref($class) || $class; |
82
|
|
|
|
|
|
|
|
83
|
1
|
|
|
|
|
20
|
my $self = { |
84
|
|
|
|
|
|
|
'_Buffer' => '', |
85
|
|
|
|
|
|
|
'_ClassIdent' => 'f78b30ac-200e-11de-bdcf-001c25551abc', |
86
|
|
|
|
|
|
|
'_Pack' => 'CCCCffffffI', |
87
|
|
|
|
|
|
|
'_Swap1' => 'CCCCVVVVVVV', |
88
|
|
|
|
|
|
|
'_Swap2' => 'CCCCNNNNNNN', |
89
|
|
|
|
|
|
|
'packetType' => 109, |
90
|
|
|
|
|
|
|
'packetSize' => 32, |
91
|
|
|
|
|
|
|
'requestIdent' => 0, |
92
|
|
|
|
|
|
|
'humidity' => 0, |
93
|
|
|
|
|
|
|
'airTemperature' => 0, |
94
|
|
|
|
|
|
|
'visibilityRange' => 0, |
95
|
|
|
|
|
|
|
'horizontalWindSpeed' => 0, |
96
|
|
|
|
|
|
|
'verticalWindSpeed' => 0, |
97
|
|
|
|
|
|
|
'windDirection' => 0, |
98
|
|
|
|
|
|
|
'barometricPressure' => 0, |
99
|
|
|
|
|
|
|
'_unused80' => 0, |
100
|
|
|
|
|
|
|
}; |
101
|
|
|
|
|
|
|
|
102
|
1
|
50
|
|
|
|
4
|
if (@_) { |
103
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
104
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
105
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
106
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
107
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
1
|
|
|
|
|
3
|
bless($self,$class); |
113
|
1
|
|
|
|
|
3
|
return $self; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
#============================================================================== |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item sub packet_type() |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
$value = $wthr_resp->packet_type(); |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Data Packet Identifier. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
This attribute identifies this data packet as the Weather Conditions Response |
125
|
|
|
|
|
|
|
packet. The value of this attribute must be 109. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub packet_type() { |
130
|
1
|
|
|
1
|
1
|
6
|
my ($self) = @_; |
131
|
1
|
|
|
|
|
7
|
return $self->{'packetType'}; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
#============================================================================== |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item sub packet_size() |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
$value = $wthr_resp->packet_size(); |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Data Packet Size. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
143
|
|
|
|
|
|
|
this attribute must be 32. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub packet_size() { |
148
|
1
|
|
|
1
|
1
|
4
|
my ($self) = @_; |
149
|
1
|
|
|
|
|
3
|
return $self->{'packetSize'}; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
#============================================================================== |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=item sub request_ident([$newValue]) |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
$value = $wthr_resp->request_ident($newValue); |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Request ID. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
This attribute identifies the environmental conditions request to which this |
161
|
|
|
|
|
|
|
response packet corresponds. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=cut |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub request_ident() { |
166
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
167
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
168
|
1
|
|
|
|
|
1
|
$self->{'requestIdent'} = $nv; |
169
|
|
|
|
|
|
|
} |
170
|
1
|
|
|
|
|
3
|
return $self->{'requestIdent'}; |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
#============================================================================== |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item sub humidity([$newValue]) |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
$value = $wthr_resp->humidity($newValue); |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
Humidity. |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
This attribute indicates the humidity at the requested location. |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=cut |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
sub humidity() { |
186
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
187
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
188
|
1
|
50
|
33
|
|
|
10
|
if ($nv>=0 and $nv<=100 and int($nv)==$nv) { |
|
|
|
33
|
|
|
|
|
189
|
1
|
|
|
|
|
2
|
$self->{'humidity'} = $nv; |
190
|
|
|
|
|
|
|
} else { |
191
|
0
|
|
|
|
|
0
|
carp "humidity must be an integer 0-100 (percent)."; |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
} |
194
|
1
|
|
|
|
|
3
|
return $self->{'humidity'}; |
195
|
|
|
|
|
|
|
} |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
#============================================================================== |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=item sub air_temperature([$newValue]) |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
$value = $wthr_resp->air_temperature($newValue); |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
Air Temperature. |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
This attribute indicates the air temperature, measured in degrees Celcius, at |
206
|
|
|
|
|
|
|
the requested location. |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=cut |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub air_temperature() { |
211
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
212
|
1
|
50
|
|
|
|
2
|
if (defined($nv)) { |
213
|
1
|
|
|
|
|
3
|
$self->{'airTemperature'} = $nv; |
214
|
|
|
|
|
|
|
} |
215
|
1
|
|
|
|
|
3
|
return $self->{'airTemperature'}; |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
#============================================================================== |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=item sub visibility_range([$newValue]) |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
$value = $wthr_resp->visibility_range($newValue); |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
Visibility Range. |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
This attribute indicates the visibility range, measured in meters, at the |
227
|
|
|
|
|
|
|
requested location. |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=cut |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
sub visibility_range() { |
232
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
233
|
1
|
50
|
|
|
|
2
|
if (defined($nv)) { |
234
|
1
|
|
|
|
|
2
|
$self->{'visibilityRange'} = $nv; |
235
|
|
|
|
|
|
|
} |
236
|
1
|
|
|
|
|
9
|
return $self->{'visibilityRange'}; |
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
#============================================================================== |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=item sub horizontal_wind_speed([$newValue]) |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
$value = $wthr_resp->horizontal_wind_speed($newValue); |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
Horizontal Wind Speed. |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
This attribute indicates the local wind speed, measured in meters/second, |
248
|
|
|
|
|
|
|
parallel to the ellipsoid-tangential reference plane. |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=cut |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
sub horizontal_wind_speed() { |
253
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
254
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
255
|
1
|
|
|
|
|
7
|
$self->{'horizontalWindSpeed'} = $nv; |
256
|
|
|
|
|
|
|
} |
257
|
1
|
|
|
|
|
3
|
return $self->{'horizontalWindSpeed'}; |
258
|
|
|
|
|
|
|
} |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
#============================================================================== |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=item sub vertical_wind_speed([$newValue]) |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
$value = $wthr_resp->vertical_wind_speed($newValue); |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
Vertical Wind Speed. |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
This attribute indicates the local vertical wind speed, measured in |
269
|
|
|
|
|
|
|
meters/second. |
270
|
|
|
|
|
|
|
Note: A positive value indicates an updraft, while a negative value indicates a downdraft. |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=cut |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
sub vertical_wind_speed() { |
275
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
276
|
1
|
50
|
|
|
|
3
|
if (defined($nv)) { |
277
|
1
|
|
|
|
|
2
|
$self->{'verticalWindSpeed'} = $nv; |
278
|
|
|
|
|
|
|
} |
279
|
1
|
|
|
|
|
3
|
return $self->{'verticalWindSpeed'}; |
280
|
|
|
|
|
|
|
} |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
#============================================================================== |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=item sub wind_direction([$newValue]) |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
$value = $wthr_resp->wind_direction($newValue); |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
Wind Direction. |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
This attribute indicates the local wind direction. |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
Note: This is the direction from which the wind is blowing. |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
Datum: True North |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
=cut |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
sub wind_direction() { |
299
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
300
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
301
|
1
|
|
|
|
|
2
|
$self->{'windDirection'} = $nv; |
302
|
|
|
|
|
|
|
} |
303
|
1
|
|
|
|
|
2
|
return $self->{'windDirection'}; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
#============================================================================== |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=item sub barometric_pressure([$newValue]) |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
$value = $wthr_resp->barometric_pressure($newValue); |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
Barometric Pressure. |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
This attribute indicates the atmospheric pressure at the requested location. |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=cut |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
sub barometric_pressure() { |
319
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
320
|
1
|
50
|
|
|
|
2
|
if (defined($nv)) { |
321
|
1
|
|
|
|
|
2
|
$self->{'barometricPressure'} = $nv; |
322
|
|
|
|
|
|
|
} |
323
|
1
|
|
|
|
|
3
|
return $self->{'barometricPressure'}; |
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
#========================================================================== |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=item sub pack() |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
$value = $wthr_resp->pack(); |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
Returns the packed data packet. |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=cut |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
sub pack($) { |
337
|
1
|
|
|
1
|
1
|
4
|
my $self = shift ; |
338
|
|
|
|
|
|
|
|
339
|
1
|
|
|
|
|
7
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
340
|
|
|
|
|
|
|
$self->{'packetType'}, |
341
|
|
|
|
|
|
|
$self->{'packetSize'}, |
342
|
|
|
|
|
|
|
$self->{'requestIdent'}, |
343
|
|
|
|
|
|
|
$self->{'humidity'}, |
344
|
|
|
|
|
|
|
$self->{'airTemperature'}, |
345
|
|
|
|
|
|
|
$self->{'visibilityRange'}, |
346
|
|
|
|
|
|
|
$self->{'horizontalWindSpeed'}, |
347
|
|
|
|
|
|
|
$self->{'verticalWindSpeed'}, |
348
|
|
|
|
|
|
|
$self->{'windDirection'}, |
349
|
|
|
|
|
|
|
$self->{'barometricPressure'}, |
350
|
|
|
|
|
|
|
$self->{'_unused80'}, |
351
|
|
|
|
|
|
|
); |
352
|
|
|
|
|
|
|
|
353
|
1
|
|
|
|
|
3
|
return $self->{'_Buffer'}; |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
#========================================================================== |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=item sub unpack() |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
$value = $wthr_resp->unpack(); |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
Unpacks the packed data packet. |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
=cut |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
sub unpack($) { |
367
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
368
|
|
|
|
|
|
|
|
369
|
0
|
0
|
|
|
|
|
if (@_) { |
370
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
371
|
|
|
|
|
|
|
} |
372
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
373
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
374
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
375
|
0
|
|
|
|
|
|
$self->{'requestIdent'} = $c; |
376
|
0
|
|
|
|
|
|
$self->{'humidity'} = $d; |
377
|
0
|
|
|
|
|
|
$self->{'airTemperature'} = $e; |
378
|
0
|
|
|
|
|
|
$self->{'visibilityRange'} = $f; |
379
|
0
|
|
|
|
|
|
$self->{'horizontalWindSpeed'} = $g; |
380
|
0
|
|
|
|
|
|
$self->{'verticalWindSpeed'} = $h; |
381
|
0
|
|
|
|
|
|
$self->{'windDirection'} = $i; |
382
|
0
|
|
|
|
|
|
$self->{'barometricPressure'} = $j; |
383
|
0
|
|
|
|
|
|
$self->{'_unused80'} = $k; |
384
|
|
|
|
|
|
|
|
385
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
#========================================================================== |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
=item sub byte_swap() |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
=cut |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
sub byte_swap($) { |
399
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
400
|
|
|
|
|
|
|
|
401
|
0
|
0
|
|
|
|
|
if (@_) { |
402
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
403
|
|
|
|
|
|
|
} else { |
404
|
0
|
|
|
|
|
|
$self->unpack(); |
405
|
|
|
|
|
|
|
} |
406
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
407
|
|
|
|
|
|
|
|
408
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k); |
409
|
0
|
|
|
|
|
|
$self->unpack(); |
410
|
|
|
|
|
|
|
|
411
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
412
|
|
|
|
|
|
|
} |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
1; |
415
|
|
|
|
|
|
|
__END__ |