line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78b3354-200e-11de-bdd0-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::AerosolConcentrationResponse; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
17
|
use 5.006; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
10
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
231
|
|
11
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
12
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1155
|
|
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::AerosolConcentrationResponse - Perl extension for the Common |
42
|
|
|
|
|
|
|
Image Generator Interface - Aerosol Concentration Response data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::AerosolConcentrationResponse; |
47
|
|
|
|
|
|
|
my $ac_resp = Rinchi::CIGIPP::AerosolConcentrationResponse->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $ac_resp->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $ac_resp->packet_size(); |
51
|
|
|
|
|
|
|
$request_ident = $ac_resp->request_ident(38); |
52
|
|
|
|
|
|
|
$layer_ident = $ac_resp->layer_ident(78); |
53
|
|
|
|
|
|
|
$aerosol_concentration = $ac_resp->aerosol_concentration(59.538); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 DESCRIPTION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
The Aerosol Concentration Response packet is sent in response to an |
58
|
|
|
|
|
|
|
Environmental Conditions Request packet whose Request Type attribute specifies |
59
|
|
|
|
|
|
|
Aerosol Concentrations. The packet describes the concentration of airborne |
60
|
|
|
|
|
|
|
particles associated with a specific weather layer. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
The aerosol type is determined by the weather layer ID. If two or more global |
63
|
|
|
|
|
|
|
or regional weather layers overlap and have the same layer ID, the |
64
|
|
|
|
|
|
|
concentration of that aerosol is the average of the concentrations due to each layer. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 EXPORT |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
None by default. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
#============================================================================== |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item new $ac_resp = Rinchi::CIGIPP::AerosolConcentrationResponse->new() |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Constructor for Rinchi::AerosolConcentrationResponse. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub new { |
79
|
1
|
|
|
1
|
1
|
45
|
my $class = shift; |
80
|
1
|
|
33
|
|
|
6
|
$class = ref($class) || $class; |
81
|
|
|
|
|
|
|
|
82
|
1
|
|
|
|
|
9
|
my $self = { |
83
|
|
|
|
|
|
|
'_Buffer' => '', |
84
|
|
|
|
|
|
|
'_ClassIdent' => 'f78b3354-200e-11de-bdd0-001c25551abc', |
85
|
|
|
|
|
|
|
'_Pack' => 'CCCCf', |
86
|
|
|
|
|
|
|
'_Swap1' => 'CCCCV', |
87
|
|
|
|
|
|
|
'_Swap2' => 'CCCCN', |
88
|
|
|
|
|
|
|
'packetType' => 110, |
89
|
|
|
|
|
|
|
'packetSize' => 8, |
90
|
|
|
|
|
|
|
'requestIdent' => 0, |
91
|
|
|
|
|
|
|
'layerIdent' => 0, |
92
|
|
|
|
|
|
|
'aerosolConcentration' => 0, |
93
|
|
|
|
|
|
|
}; |
94
|
|
|
|
|
|
|
|
95
|
1
|
50
|
|
|
|
4
|
if (@_) { |
96
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
97
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
98
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
99
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
100
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
1
|
|
|
|
|
3
|
bless($self,$class); |
106
|
1
|
|
|
|
|
3
|
return $self; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
#============================================================================== |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item sub packet_type() |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
$value = $ac_resp->packet_type(); |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Data Packet Identifier. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This attribute identifies this data packet as the Aerosol Concentration |
118
|
|
|
|
|
|
|
Response packet. The value of this attribute must be 110. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub packet_type() { |
123
|
1
|
|
|
1
|
1
|
10
|
my ($self) = @_; |
124
|
1
|
|
|
|
|
7
|
return $self->{'packetType'}; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
#============================================================================== |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item sub packet_size() |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
$value = $ac_resp->packet_size(); |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Data Packet Size. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
136
|
|
|
|
|
|
|
this attribute must be 8. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=cut |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub packet_size() { |
141
|
1
|
|
|
1
|
1
|
7
|
my ($self) = @_; |
142
|
1
|
|
|
|
|
4
|
return $self->{'packetSize'}; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
#============================================================================== |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item sub request_ident([$newValue]) |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
$value = $ac_resp->request_ident($newValue); |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Request ID. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
This attribute identifies the environmental conditions request to which this |
154
|
|
|
|
|
|
|
response packet corresponds. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=cut |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub request_ident() { |
159
|
1
|
|
|
1
|
1
|
10
|
my ($self,$nv) = @_; |
160
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
161
|
1
|
|
|
|
|
2
|
$self->{'requestIdent'} = $nv; |
162
|
|
|
|
|
|
|
} |
163
|
1
|
|
|
|
|
2
|
return $self->{'requestIdent'}; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
#============================================================================== |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=item sub layer_ident([$newValue]) |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
$value = $ac_resp->layer_ident($newValue); |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Layer ID. |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
This attribute identifies the weather layer whose aerosol concentration is |
175
|
|
|
|
|
|
|
being described. Thus, this attribute indicates the aerosol type to which this |
176
|
|
|
|
|
|
|
packet corresponds. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=cut |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub layer_ident() { |
181
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
182
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
183
|
1
|
|
|
|
|
2
|
$self->{'layerIdent'} = $nv; |
184
|
|
|
|
|
|
|
} |
185
|
1
|
|
|
|
|
3
|
return $self->{'layerIdent'}; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
#============================================================================== |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=item sub aerosol_concentration([$newValue]) |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
$value = $ac_resp->aerosol_concentration($newValue); |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Aerosol Concentration. |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
This attribute identifies the concentration of airborne particlesmeasured in |
197
|
|
|
|
|
|
|
grams/cubic meter. The type of particle is identified by the Layer ID attribute. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=cut |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub aerosol_concentration() { |
202
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
203
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
204
|
1
|
|
|
|
|
2
|
$self->{'aerosolConcentration'} = $nv; |
205
|
|
|
|
|
|
|
} |
206
|
1
|
|
|
|
|
3
|
return $self->{'aerosolConcentration'}; |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
#========================================================================== |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=item sub pack() |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
$value = $ac_resp->pack(); |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
Returns the packed data packet. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=cut |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
sub pack($) { |
220
|
1
|
|
|
1
|
1
|
5
|
my $self = shift ; |
221
|
|
|
|
|
|
|
|
222
|
1
|
|
|
|
|
4
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
223
|
|
|
|
|
|
|
$self->{'packetType'}, |
224
|
|
|
|
|
|
|
$self->{'packetSize'}, |
225
|
|
|
|
|
|
|
$self->{'requestIdent'}, |
226
|
|
|
|
|
|
|
$self->{'layerIdent'}, |
227
|
|
|
|
|
|
|
$self->{'aerosolConcentration'}, |
228
|
|
|
|
|
|
|
); |
229
|
|
|
|
|
|
|
|
230
|
1
|
|
|
|
|
9
|
return $self->{'_Buffer'}; |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
#========================================================================== |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=item sub unpack() |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
$value = $ac_resp->unpack(); |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
Unpacks the packed data packet. |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=cut |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
sub unpack($) { |
244
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
245
|
|
|
|
|
|
|
|
246
|
0
|
0
|
|
|
|
|
if (@_) { |
247
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
248
|
|
|
|
|
|
|
} |
249
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
250
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
251
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
252
|
0
|
|
|
|
|
|
$self->{'requestIdent'} = $c; |
253
|
0
|
|
|
|
|
|
$self->{'layerIdent'} = $d; |
254
|
0
|
|
|
|
|
|
$self->{'aerosolConcentration'} = $e; |
255
|
|
|
|
|
|
|
|
256
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
257
|
|
|
|
|
|
|
} |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
#========================================================================== |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=item sub byte_swap() |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=cut |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
sub byte_swap($) { |
270
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
271
|
|
|
|
|
|
|
|
272
|
0
|
0
|
|
|
|
|
if (@_) { |
273
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
274
|
|
|
|
|
|
|
} else { |
275
|
0
|
|
|
|
|
|
$self->pack(); |
276
|
|
|
|
|
|
|
} |
277
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
278
|
|
|
|
|
|
|
|
279
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e); |
280
|
0
|
|
|
|
|
|
$self->unpack(); |
281
|
|
|
|
|
|
|
|
282
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
283
|
|
|
|
|
|
|
} |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
1; |
286
|
|
|
|
|
|
|
__END__ |