line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78afdd0-200e-11de-bdbc-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::EnvironmentalConditionsRequest; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
22
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
48
|
|
10
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
11
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
12
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2456
|
|
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::EnvironmentalConditionsRequest - Perl extension for the Common |
42
|
|
|
|
|
|
|
Image Generator Interface - Environmental Conditions Request data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::EnvironmentalConditionsRequest; |
47
|
|
|
|
|
|
|
my $ec_rqst = Rinchi::CIGIPP::EnvironmentalConditionsRequest->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $ec_rqst->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $ec_rqst->packet_size(); |
51
|
|
|
|
|
|
|
$request_type_ac = $ec_rqst->request_type_ac(0); |
52
|
|
|
|
|
|
|
$request_type_wc = $ec_rqst->request_type_wc(1); |
53
|
|
|
|
|
|
|
$request_type_tsc = $ec_rqst->request_type_tsc(0); |
54
|
|
|
|
|
|
|
$request_type_msc = $ec_rqst->request_type_msc(0); |
55
|
|
|
|
|
|
|
$request_ident = $ec_rqst->request_ident(167); |
56
|
|
|
|
|
|
|
$latitude = $ec_rqst->latitude(28.347); |
57
|
|
|
|
|
|
|
$longitude = $ec_rqst->longitude(82.085); |
58
|
|
|
|
|
|
|
$altitude = $ec_rqst->altitude(38.01); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
At any given location, it may be impossible for the Host to determine exactly |
63
|
|
|
|
|
|
|
the visibility range, air temperature, or other atmospheric or surface |
64
|
|
|
|
|
|
|
conditions. One factor is that various IG implementations may differ in how |
65
|
|
|
|
|
|
|
they calculate values across transition bands and within overlapping regions. |
66
|
|
|
|
|
|
|
Random phenomena such as winds aloft, scud, and wave activity may also make |
67
|
|
|
|
|
|
|
determining instantaneous conditions at a specific point impossible. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
The Environmental Conditions Request packet is used by the Host to request the |
70
|
|
|
|
|
|
|
state of the environment at a specific location. The Request Type attribute |
71
|
|
|
|
|
|
|
determines what data are returned by the IG. Each request type is represented |
72
|
|
|
|
|
|
|
by a power of two (i.e., a unique bit), so request types may be combined by |
73
|
|
|
|
|
|
|
adding or bit-wise ORing the values together. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
For a given test point, the IG may respond with no more than one of each of the |
76
|
|
|
|
|
|
|
Maritime Surface Conditions Response and Weather Conditions Response packets. |
77
|
|
|
|
|
|
|
For terrestrial surface conditions requests, the IG should respond with one |
78
|
|
|
|
|
|
|
Terrestrial Surface Conditions Response packet for each surface condition type |
79
|
|
|
|
|
|
|
or attribute present at the test point. If the Request Type attribute specifies |
80
|
|
|
|
|
|
|
that aerosol concentrations should be returned, the IG must send a Weather |
81
|
|
|
|
|
|
|
Conditions Aerosol Response packet for each weather layer that encompasses the |
82
|
|
|
|
|
|
|
test point. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 EXPORT |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
None by default. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
#============================================================================== |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item new $ec_rqst = Rinchi::CIGIPP::EnvironmentalConditionsRequest->new() |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Constructor for Rinchi::EnvironmentalConditionsRequest. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub new { |
97
|
1
|
|
|
1
|
1
|
65
|
my $class = shift; |
98
|
1
|
|
33
|
|
|
7
|
$class = ref($class) || $class; |
99
|
|
|
|
|
|
|
|
100
|
1
|
|
|
|
|
14
|
my $self = { |
101
|
|
|
|
|
|
|
'_Buffer' => '', |
102
|
|
|
|
|
|
|
'_ClassIdent' => 'f78afdd0-200e-11de-bdbc-001c25551abc', |
103
|
|
|
|
|
|
|
'_Pack' => 'CCCCIddd', |
104
|
|
|
|
|
|
|
'_Swap1' => 'CCCCVVVVVVV', |
105
|
|
|
|
|
|
|
'_Swap2' => 'CCCCNNNNNNN', |
106
|
|
|
|
|
|
|
'packetType' => 28, |
107
|
|
|
|
|
|
|
'packetSize' => 32, |
108
|
|
|
|
|
|
|
'_bitfields1' => 0, # Includes bitfields unused49, requestTypeAC, requestTypeWC, requestTypeTSC, and requestTypeMSC. |
109
|
|
|
|
|
|
|
'requestTypeAC' => 0, |
110
|
|
|
|
|
|
|
'requestTypeWC' => 0, |
111
|
|
|
|
|
|
|
'requestTypeTSC' => 0, |
112
|
|
|
|
|
|
|
'requestTypeMSC' => 0, |
113
|
|
|
|
|
|
|
'requestIdent' => 0, |
114
|
|
|
|
|
|
|
'_unused50' => 0, |
115
|
|
|
|
|
|
|
'latitude' => 0, |
116
|
|
|
|
|
|
|
'longitude' => 0, |
117
|
|
|
|
|
|
|
'altitude' => 0, |
118
|
|
|
|
|
|
|
}; |
119
|
|
|
|
|
|
|
|
120
|
1
|
50
|
|
|
|
5
|
if (@_) { |
121
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
122
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
123
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
124
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
125
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
1
|
|
|
|
|
3
|
bless($self,$class); |
131
|
1
|
|
|
|
|
3
|
return $self; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
#============================================================================== |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item sub packet_type() |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
$value = $ec_rqst->packet_type(); |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Data Packet Identifier. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
This attribute identifies this data packet as the Environmental Conditions |
143
|
|
|
|
|
|
|
Request packet. The value of this attribute must be 28. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub packet_type() { |
148
|
1
|
|
|
1
|
1
|
8
|
my ($self) = @_; |
149
|
1
|
|
|
|
|
8
|
return $self->{'packetType'}; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
#============================================================================== |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=item sub packet_size() |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
$value = $ec_rqst->packet_size(); |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Data Packet Size. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
161
|
|
|
|
|
|
|
this attribute must be 32. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=cut |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub packet_size() { |
166
|
1
|
|
|
1
|
1
|
6
|
my ($self) = @_; |
167
|
1
|
|
|
|
|
3
|
return $self->{'packetSize'}; |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
#============================================================================== |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=item sub request_type_ac([$newValue]) |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
$value = $ec_rqst->request_type_ac($newValue); |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
Request Type. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
This attribute specifies the desired response type for the request. The |
179
|
|
|
|
|
|
|
numerical values listed at left may be combined by addition or bit-wise OR. The |
180
|
|
|
|
|
|
|
resulting value may be any combination of the following: |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Aerosol Concentrations – The IG will send exactly one Aerosol Concentration |
183
|
|
|
|
|
|
|
Response packet for each weather layer (regardless of scope) that encompasses |
184
|
|
|
|
|
|
|
that location. |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=cut |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub request_type_ac() { |
189
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
190
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
191
|
1
|
50
|
33
|
|
|
5
|
if (($nv==0) or ($nv==1)) { |
192
|
1
|
|
|
|
|
2
|
$self->{'requestTypeAC'} = $nv; |
193
|
1
|
|
|
|
|
4
|
$self->{'_bitfields1'} |= ($nv << 3) &0x08; |
194
|
|
|
|
|
|
|
} else { |
195
|
0
|
|
|
|
|
0
|
carp "request_type_ac must be 0 or 1."; |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
} |
198
|
1
|
|
|
|
|
3
|
return (($self->{'_bitfields1'} & 0x08) >> 3); |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
#============================================================================== |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=item sub request_type_wc([$newValue]) |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
$value = $ec_rqst->request_type_wc($newValue); |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
Request Type. |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
This attribute specifies the desired response type for the request. The |
210
|
|
|
|
|
|
|
numerical values listed at left may be combined by addition or bit-wise OR. The |
211
|
|
|
|
|
|
|
resulting value may be any combination of the following: |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
Weather Conditions – The IG will respond with a Weather Conditions Response packet. |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=cut |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub request_type_wc() { |
218
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
219
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
220
|
1
|
50
|
33
|
|
|
30
|
if (($nv==0) or ($nv==1)) { |
221
|
1
|
|
|
|
|
3
|
$self->{'requestTypeWC'} = $nv; |
222
|
1
|
|
|
|
|
10
|
$self->{'_bitfields1'} |= ($nv << 2) &0x04; |
223
|
|
|
|
|
|
|
} else { |
224
|
0
|
|
|
|
|
0
|
carp "request_type_wc must be 0 or 1."; |
225
|
|
|
|
|
|
|
} |
226
|
|
|
|
|
|
|
} |
227
|
1
|
|
|
|
|
3
|
return (($self->{'_bitfields1'} & 0x04) >> 2); |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
#============================================================================== |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=item sub request_type_tsc([$newValue]) |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
$value = $ec_rqst->request_type_tsc($newValue); |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
Request Type. |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
This attribute specifies the desired response type for the request. The |
239
|
|
|
|
|
|
|
numerical values listed at left may be combined by addition or bit-wise OR. The |
240
|
|
|
|
|
|
|
resulting value may be any combination of the following: |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
Terrestrial Surface Conditions – The IG will respond with a Terrestrial Surface |
243
|
|
|
|
|
|
|
Conditions Response packet. |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
=cut |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
sub request_type_tsc() { |
248
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
249
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
250
|
1
|
50
|
33
|
|
|
5
|
if (($nv==0) or ($nv==1)) { |
251
|
1
|
|
|
|
|
3
|
$self->{'requestTypeTSC'} = $nv; |
252
|
1
|
|
|
|
|
8
|
$self->{'_bitfields1'} |= ($nv << 1) &0x02; |
253
|
|
|
|
|
|
|
} else { |
254
|
0
|
|
|
|
|
0
|
carp "request_type_tsc must be 0 or 1."; |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
} |
257
|
1
|
|
|
|
|
9
|
return (($self->{'_bitfields1'} & 0x02) >> 1); |
258
|
|
|
|
|
|
|
} |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
#============================================================================== |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=item sub request_type_msc([$newValue]) |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
$value = $ec_rqst->request_type_msc($newValue); |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
Request Type. |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
This attribute specifies the desired response type for the request. The |
269
|
|
|
|
|
|
|
numerical values listed at left may be combined by addition or bit-wise OR. The |
270
|
|
|
|
|
|
|
resulting value may be any combination of the following: |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
Maritime Surface Conditions – The IG will respond with a Maritime Surface |
273
|
|
|
|
|
|
|
Conditions Response packet. |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=cut |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
sub request_type_msc() { |
278
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
279
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
280
|
1
|
50
|
33
|
|
|
5
|
if (($nv==0) or ($nv==1)) { |
281
|
1
|
|
|
|
|
3
|
$self->{'requestTypeMSC'} = $nv; |
282
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= $nv &0x01; |
283
|
|
|
|
|
|
|
} else { |
284
|
0
|
|
|
|
|
0
|
carp "request_type_msc must be 0 or 1."; |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
} |
287
|
1
|
|
|
|
|
5
|
return ($self->{'_bitfields1'} & 0x01); |
288
|
|
|
|
|
|
|
} |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
#============================================================================== |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=item sub request_ident([$newValue]) |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
$value = $ec_rqst->request_ident($newValue); |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
Request ID. |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
This attribute identifies the environmental conditions request. When the IG |
299
|
|
|
|
|
|
|
returns a responds to the request, each response packet(s) will contain this |
300
|
|
|
|
|
|
|
value in its Request ID attribute. |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
=cut |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
sub request_ident() { |
305
|
1
|
|
|
1
|
1
|
7
|
my ($self,$nv) = @_; |
306
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
307
|
1
|
|
|
|
|
3
|
$self->{'requestIdent'} = $nv; |
308
|
|
|
|
|
|
|
} |
309
|
1
|
|
|
|
|
14
|
return $self->{'requestIdent'}; |
310
|
|
|
|
|
|
|
} |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
#============================================================================== |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
=item sub latitude([$newValue]) |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
$value = $ec_rqst->latitude($newValue); |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
Latitude. |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
This attribute specifies the geodetic latitude at which the environmental state |
321
|
|
|
|
|
|
|
is requested. |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
=cut |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
sub latitude() { |
326
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
327
|
1
|
50
|
|
|
|
11
|
if (defined($nv)) { |
328
|
1
|
|
|
|
|
3
|
$self->{'latitude'} = $nv; |
329
|
|
|
|
|
|
|
} |
330
|
1
|
|
|
|
|
4
|
return $self->{'latitude'}; |
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
#============================================================================== |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
=item sub longitude([$newValue]) |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
$value = $ec_rqst->longitude($newValue); |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
Longitude. |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
This attribute specifies the geodetic longitude at which the environmental |
342
|
|
|
|
|
|
|
state is requested. |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
=cut |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
sub longitude() { |
347
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
348
|
1
|
50
|
|
|
|
3
|
if (defined($nv)) { |
349
|
1
|
|
|
|
|
3
|
$self->{'longitude'} = $nv; |
350
|
|
|
|
|
|
|
} |
351
|
1
|
|
|
|
|
3
|
return $self->{'longitude'}; |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
#============================================================================== |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
=item sub altitude([$newValue]) |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
$value = $ec_rqst->altitude($newValue); |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
Altitude. |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
This attribute specifies the geodetic altitude in meters above mean sea level |
363
|
|
|
|
|
|
|
at which the environmental state is requested. |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
This attribute is used only for weather conditions and aerosol concentrations requests. |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=cut |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
sub altitude() { |
370
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
371
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
372
|
1
|
|
|
|
|
3
|
$self->{'altitude'} = $nv; |
373
|
|
|
|
|
|
|
} |
374
|
1
|
|
|
|
|
3
|
return $self->{'altitude'}; |
375
|
|
|
|
|
|
|
} |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
#========================================================================== |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
=item sub pack() |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
$value = $ec_rqst->pack(); |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
Returns the packed data packet. |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
=cut |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
sub pack($) { |
388
|
1
|
|
|
1
|
1
|
6
|
my $self = shift ; |
389
|
|
|
|
|
|
|
|
390
|
1
|
|
|
|
|
7
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
391
|
|
|
|
|
|
|
$self->{'packetType'}, |
392
|
|
|
|
|
|
|
$self->{'packetSize'}, |
393
|
|
|
|
|
|
|
$self->{'_bitfields1'}, # Includes bitfields unused49, requestTypeAC, requestTypeWC, requestTypeTSC, and requestTypeMSC. |
394
|
|
|
|
|
|
|
$self->{'requestIdent'}, |
395
|
|
|
|
|
|
|
$self->{'_unused50'}, |
396
|
|
|
|
|
|
|
$self->{'latitude'}, |
397
|
|
|
|
|
|
|
$self->{'longitude'}, |
398
|
|
|
|
|
|
|
$self->{'altitude'}, |
399
|
|
|
|
|
|
|
); |
400
|
|
|
|
|
|
|
|
401
|
1
|
|
|
|
|
3
|
return $self->{'_Buffer'}; |
402
|
|
|
|
|
|
|
} |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
#========================================================================== |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
=item sub unpack() |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
$value = $ec_rqst->unpack(); |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
Unpacks the packed data packet. |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
=cut |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
sub unpack($) { |
415
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
416
|
|
|
|
|
|
|
|
417
|
0
|
0
|
|
|
|
|
if (@_) { |
418
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
419
|
|
|
|
|
|
|
} |
420
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
421
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
422
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
423
|
0
|
|
|
|
|
|
$self->{'_bitfields1'} = $c; # Includes bitfields unused49, requestTypeAC, requestTypeWC, requestTypeTSC, and requestTypeMSC. |
424
|
0
|
|
|
|
|
|
$self->{'requestIdent'} = $d; |
425
|
0
|
|
|
|
|
|
$self->{'_unused50'} = $e; |
426
|
0
|
|
|
|
|
|
$self->{'latitude'} = $f; |
427
|
0
|
|
|
|
|
|
$self->{'longitude'} = $g; |
428
|
0
|
|
|
|
|
|
$self->{'altitude'} = $h; |
429
|
|
|
|
|
|
|
|
430
|
0
|
|
|
|
|
|
$self->{'requestTypeAC'} = $self->request_type_ac(); |
431
|
0
|
|
|
|
|
|
$self->{'requestTypeWC'} = $self->request_type_wc(); |
432
|
0
|
|
|
|
|
|
$self->{'requestTypeTSC'} = $self->request_type_tsc(); |
433
|
0
|
|
|
|
|
|
$self->{'requestTypeMSC'} = $self->request_type_msc(); |
434
|
|
|
|
|
|
|
|
435
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
#========================================================================== |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
=item sub byte_swap() |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
=cut |
447
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
sub byte_swap($) { |
449
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
450
|
|
|
|
|
|
|
|
451
|
0
|
0
|
|
|
|
|
if (@_) { |
452
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
453
|
|
|
|
|
|
|
} else { |
454
|
0
|
|
|
|
|
|
$self->pack(); |
455
|
|
|
|
|
|
|
} |
456
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
457
|
|
|
|
|
|
|
|
458
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$g,$f,$i,$h,$k,$j); |
459
|
0
|
|
|
|
|
|
$self->unpack(); |
460
|
|
|
|
|
|
|
|
461
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
462
|
|
|
|
|
|
|
} |
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
1; |
465
|
|
|
|
|
|
|
__END__ |