line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78b38a4-200e-11de-bdd2-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::TerrestrialSurfaceConditionsResponse; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
18
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
40
|
|
10
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
64
|
|
11
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
12
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1276
|
|
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::TerrestrialSurfaceConditionsResponse - Perl extension for the |
42
|
|
|
|
|
|
|
Common Image Generator Interface - Terrestrial Surface Conditions Response data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::TerrestrialSurfaceConditionsResponse; |
47
|
|
|
|
|
|
|
my $tsc_resp = Rinchi::CIGIPP::TerrestrialSurfaceConditionsResponse->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $tsc_resp->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $tsc_resp->packet_size(); |
51
|
|
|
|
|
|
|
$request_ident = $tsc_resp->request_ident(208); |
52
|
|
|
|
|
|
|
$surface_condition_ident = $tsc_resp->surface_condition_ident(53038); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 DESCRIPTION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
The Terrestrial Surface Conditions Response packet is sent in response to an |
57
|
|
|
|
|
|
|
Environmental Conditions Request packet whose Request Type attribute specifies |
58
|
|
|
|
|
|
|
Terrestrial Surface Conditions. The packet describes the terrain surface |
59
|
|
|
|
|
|
|
conditions at the requested geodetic latitude and longitude. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 EXPORT |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
None by default. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
#============================================================================== |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item new $tsc_resp = Rinchi::CIGIPP::TerrestrialSurfaceConditionsResponse->new() |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Constructor for Rinchi::TerrestrialSurfaceConditionsResponse. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub new { |
74
|
1
|
|
|
1
|
1
|
47
|
my $class = shift; |
75
|
1
|
|
33
|
|
|
6
|
$class = ref($class) || $class; |
76
|
|
|
|
|
|
|
|
77
|
1
|
|
|
|
|
9
|
my $self = { |
78
|
|
|
|
|
|
|
'_Buffer' => '', |
79
|
|
|
|
|
|
|
'_ClassIdent' => 'f78b38a4-200e-11de-bdd2-001c25551abc', |
80
|
|
|
|
|
|
|
'_Pack' => 'CCCCI', |
81
|
|
|
|
|
|
|
'_Swap1' => 'CCCCV', |
82
|
|
|
|
|
|
|
'_Swap2' => 'CCCCN', |
83
|
|
|
|
|
|
|
'packetType' => 112, |
84
|
|
|
|
|
|
|
'packetSize' => 8, |
85
|
|
|
|
|
|
|
'requestIdent' => 0, |
86
|
|
|
|
|
|
|
'_unused82' => 0, |
87
|
|
|
|
|
|
|
'surfaceConditionIdent' => 0, |
88
|
|
|
|
|
|
|
}; |
89
|
|
|
|
|
|
|
|
90
|
1
|
50
|
|
|
|
9
|
if (@_) { |
91
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
92
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
93
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
94
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
95
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
1
|
|
|
|
|
3
|
bless($self,$class); |
101
|
1
|
|
|
|
|
2
|
return $self; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
#============================================================================== |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item sub packet_type() |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
$value = $tsc_resp->packet_type(); |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Data Packet Identifier. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
This attribute identifies this data packet as the Terrestrial Surface |
113
|
|
|
|
|
|
|
Conditions Response packet. The value of this attribute must be 112. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub packet_type() { |
118
|
1
|
|
|
1
|
1
|
7
|
my ($self) = @_; |
119
|
1
|
|
|
|
|
6
|
return $self->{'packetType'}; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
#============================================================================== |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item sub packet_size() |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
$value = $tsc_resp->packet_size(); |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Data Packet Size. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
131
|
|
|
|
|
|
|
this attribute must be 8. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub packet_size() { |
136
|
1
|
|
|
1
|
1
|
5
|
my ($self) = @_; |
137
|
1
|
|
|
|
|
3
|
return $self->{'packetSize'}; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
#============================================================================== |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=item sub request_ident([$newValue]) |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
$value = $tsc_resp->request_ident($newValue); |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Request ID. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
This attribute identifies the environmental conditions request to which this |
149
|
|
|
|
|
|
|
response packet corresponds. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=cut |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
sub request_ident() { |
154
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
155
|
1
|
50
|
|
|
|
3
|
if (defined($nv)) { |
156
|
1
|
|
|
|
|
2
|
$self->{'requestIdent'} = $nv; |
157
|
|
|
|
|
|
|
} |
158
|
1
|
|
|
|
|
3
|
return $self->{'requestIdent'}; |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
#============================================================================== |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item sub surface_condition_ident([$newValue]) |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
$value = $tsc_resp->surface_condition_ident($newValue); |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
Surface Condition ID. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
This attribute indicates the presence of a specific surface condition or |
170
|
|
|
|
|
|
|
contaminant at the test point. Surface condition codes are IG-dependent. |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=cut |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub surface_condition_ident() { |
175
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
176
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
177
|
1
|
|
|
|
|
2
|
$self->{'surfaceConditionIdent'} = $nv; |
178
|
|
|
|
|
|
|
} |
179
|
1
|
|
|
|
|
3
|
return $self->{'surfaceConditionIdent'}; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
#========================================================================== |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item sub pack() |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
$value = $tsc_resp->pack(); |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Returns the packed data packet. |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=cut |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
sub pack($) { |
193
|
1
|
|
|
1
|
1
|
4
|
my $self = shift ; |
194
|
|
|
|
|
|
|
|
195
|
1
|
|
|
|
|
5
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
196
|
|
|
|
|
|
|
$self->{'packetType'}, |
197
|
|
|
|
|
|
|
$self->{'packetSize'}, |
198
|
|
|
|
|
|
|
$self->{'requestIdent'}, |
199
|
|
|
|
|
|
|
$self->{'_unused82'}, |
200
|
|
|
|
|
|
|
$self->{'surfaceConditionIdent'}, |
201
|
|
|
|
|
|
|
); |
202
|
|
|
|
|
|
|
|
203
|
1
|
|
|
|
|
8
|
return $self->{'_Buffer'}; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
#========================================================================== |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=item sub unpack() |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
$value = $tsc_resp->unpack(); |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
Unpacks the packed data packet. |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=cut |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
sub unpack($) { |
217
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
218
|
|
|
|
|
|
|
|
219
|
0
|
0
|
|
|
|
|
if (@_) { |
220
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
221
|
|
|
|
|
|
|
} |
222
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
223
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
224
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
225
|
0
|
|
|
|
|
|
$self->{'requestIdent'} = $c; |
226
|
0
|
|
|
|
|
|
$self->{'_unused82'} = $d; |
227
|
0
|
|
|
|
|
|
$self->{'surfaceConditionIdent'} = $e; |
228
|
|
|
|
|
|
|
|
229
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
#========================================================================== |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=item sub byte_swap() |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=cut |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
sub byte_swap($) { |
243
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
244
|
|
|
|
|
|
|
|
245
|
0
|
0
|
|
|
|
|
if (@_) { |
246
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
247
|
|
|
|
|
|
|
} else { |
248
|
0
|
|
|
|
|
|
$self->unpack(); |
249
|
|
|
|
|
|
|
} |
250
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
251
|
|
|
|
|
|
|
|
252
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e); |
253
|
0
|
|
|
|
|
|
$self->unpack(); |
254
|
|
|
|
|
|
|
|
255
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
256
|
|
|
|
|
|
|
} |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
1; |
259
|
|
|
|
|
|
|
__END__ |