line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78b35f2-200e-11de-bdd1-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::MaritimeSurfaceConditionsResponse; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
21
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
48
|
|
10
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
11
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
12
|
1
|
|
|
1
|
|
16
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1362
|
|
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::MaritimeSurfaceConditionsResponse - Perl extension for the |
42
|
|
|
|
|
|
|
Common Image Generator Interface - Maritime Surface Conditions Response data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::MaritimeSurfaceConditionsResponse; |
47
|
|
|
|
|
|
|
my $msc_resp = Rinchi::CIGIPP::MaritimeSurfaceConditionsResponse->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $msc_resp->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $msc_resp->packet_size(); |
51
|
|
|
|
|
|
|
$request_ident = $msc_resp->request_ident(122); |
52
|
|
|
|
|
|
|
$sea_surface_height = $msc_resp->sea_surface_height(9.874); |
53
|
|
|
|
|
|
|
$surface_water_temperature = $msc_resp->surface_water_temperature(82.083); |
54
|
|
|
|
|
|
|
$surface_clarity = $msc_resp->surface_clarity(8.774); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 DESCRIPTION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
The Maritime Surface Conditions Response packet is sent in response to an |
59
|
|
|
|
|
|
|
Environmental Conditions Request packet whose Request Type attribute specifies |
60
|
|
|
|
|
|
|
Maritime Surface Conditions. The packet describes the sea surface state at the |
61
|
|
|
|
|
|
|
requested geodetic latitude and longitude. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 EXPORT |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
None by default. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
#============================================================================== |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item new $msc_resp = Rinchi::CIGIPP::MaritimeSurfaceConditionsResponse->new() |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Constructor for Rinchi::MaritimeSurfaceConditionsResponse. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub new { |
76
|
1
|
|
|
1
|
1
|
44
|
my $class = shift; |
77
|
1
|
|
33
|
|
|
6
|
$class = ref($class) || $class; |
78
|
|
|
|
|
|
|
|
79
|
1
|
|
|
|
|
16
|
my $self = { |
80
|
|
|
|
|
|
|
'_Buffer' => '', |
81
|
|
|
|
|
|
|
'_ClassIdent' => 'f78b35f2-200e-11de-bdd1-001c25551abc', |
82
|
|
|
|
|
|
|
'_Pack' => 'CCCCfff', |
83
|
|
|
|
|
|
|
'_Swap1' => 'CCCCVVV', |
84
|
|
|
|
|
|
|
'_Swap2' => 'CCCCNNN', |
85
|
|
|
|
|
|
|
'packetType' => 111, |
86
|
|
|
|
|
|
|
'packetSize' => 16, |
87
|
|
|
|
|
|
|
'requestIdent' => 0, |
88
|
|
|
|
|
|
|
'_unused81' => 0, |
89
|
|
|
|
|
|
|
'seaSurfaceHeight' => 0, |
90
|
|
|
|
|
|
|
'surfaceWaterTemperature' => 0, |
91
|
|
|
|
|
|
|
'surfaceClarity' => 0, |
92
|
|
|
|
|
|
|
}; |
93
|
|
|
|
|
|
|
|
94
|
1
|
50
|
|
|
|
3
|
if (@_) { |
95
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
96
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
97
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
98
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
99
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
1
|
|
|
|
|
3
|
bless($self,$class); |
105
|
1
|
|
|
|
|
3
|
return $self; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
#============================================================================== |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item sub packet_type() |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
$value = $msc_resp->packet_type(); |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Data Packet Identifier. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This attribute identifies this data packet as the Maritime Surface Conditions |
117
|
|
|
|
|
|
|
Response packet. The value of this attribute must be 111. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub packet_type() { |
122
|
1
|
|
|
1
|
1
|
5
|
my ($self) = @_; |
123
|
1
|
|
|
|
|
44
|
return $self->{'packetType'}; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
#============================================================================== |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item sub packet_size() |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
$value = $msc_resp->packet_size(); |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Data Packet Size. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
135
|
|
|
|
|
|
|
this attribute must be 16. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=cut |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub packet_size() { |
140
|
1
|
|
|
1
|
1
|
5
|
my ($self) = @_; |
141
|
1
|
|
|
|
|
3
|
return $self->{'packetSize'}; |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
#============================================================================== |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item sub request_ident([$newValue]) |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
$value = $msc_resp->request_ident($newValue); |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
Request ID. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
This attribute identifies the environmental conditions request to which this |
153
|
|
|
|
|
|
|
response packet corresponds. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=cut |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub request_ident() { |
158
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
159
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
160
|
1
|
|
|
|
|
2
|
$self->{'requestIdent'} = $nv; |
161
|
|
|
|
|
|
|
} |
162
|
1
|
|
|
|
|
2
|
return $self->{'requestIdent'}; |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
#============================================================================== |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=item sub sea_surface_height([$newValue]) |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
$value = $msc_resp->sea_surface_height($newValue); |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Sea Surface Height. |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
This attribute indicates the height of the sea surface at equilibrium (i.e., |
174
|
|
|
|
|
|
|
without waves). |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
Note that the instantaneous elevation of the water including wave displacement |
177
|
|
|
|
|
|
|
may be determined from a Height Of Terrain request. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=cut |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub sea_surface_height() { |
182
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
183
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
184
|
1
|
|
|
|
|
3
|
$self->{'seaSurfaceHeight'} = $nv; |
185
|
|
|
|
|
|
|
} |
186
|
1
|
|
|
|
|
3
|
return $self->{'seaSurfaceHeight'}; |
187
|
|
|
|
|
|
|
} |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
#============================================================================== |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item sub surface_water_temperature([$newValue]) |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
$value = $msc_resp->surface_water_temperature($newValue); |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
Surface Water Temperature |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
This attribute indicates the water temperature at the sea surface. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=cut |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub surface_water_temperature() { |
202
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
203
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
204
|
1
|
|
|
|
|
1
|
$self->{'surfaceWaterTemperature'} = $nv; |
205
|
|
|
|
|
|
|
} |
206
|
1
|
|
|
|
|
3
|
return $self->{'surfaceWaterTemperature'}; |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
#============================================================================== |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=item sub surface_clarity([$newValue]) |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
$value = $msc_resp->surface_clarity($newValue); |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
Surface Clarity. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
This attribute indicates the clarity of the water at its surface. A value of |
218
|
|
|
|
|
|
|
100% indicates pristine water, while a value of 0% indicates extremely turbid water. |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=cut |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
sub surface_clarity() { |
223
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
224
|
1
|
50
|
|
|
|
3
|
if (defined($nv)) { |
225
|
1
|
|
|
|
|
2
|
$self->{'surfaceClarity'} = $nv; |
226
|
|
|
|
|
|
|
} |
227
|
1
|
|
|
|
|
3
|
return $self->{'surfaceClarity'}; |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
#========================================================================== |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=item sub pack() |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
$value = $msc_resp->pack(); |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
Returns the packed data packet. |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=cut |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
sub pack($) { |
241
|
1
|
|
|
1
|
1
|
4
|
my $self = shift ; |
242
|
|
|
|
|
|
|
|
243
|
1
|
|
|
|
|
5
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
244
|
|
|
|
|
|
|
$self->{'packetType'}, |
245
|
|
|
|
|
|
|
$self->{'packetSize'}, |
246
|
|
|
|
|
|
|
$self->{'requestIdent'}, |
247
|
|
|
|
|
|
|
$self->{'_unused81'}, |
248
|
|
|
|
|
|
|
$self->{'seaSurfaceHeight'}, |
249
|
|
|
|
|
|
|
$self->{'surfaceWaterTemperature'}, |
250
|
|
|
|
|
|
|
$self->{'surfaceClarity'}, |
251
|
|
|
|
|
|
|
); |
252
|
|
|
|
|
|
|
|
253
|
1
|
|
|
|
|
3
|
return $self->{'_Buffer'}; |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
#========================================================================== |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=item sub unpack() |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
$value = $msc_resp->unpack(); |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
Unpacks the packed data packet. |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=cut |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
sub unpack($) { |
267
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
268
|
|
|
|
|
|
|
|
269
|
0
|
0
|
|
|
|
|
if (@_) { |
270
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
271
|
|
|
|
|
|
|
} |
272
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
273
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
274
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
275
|
0
|
|
|
|
|
|
$self->{'requestIdent'} = $c; |
276
|
0
|
|
|
|
|
|
$self->{'_unused81'} = $d; |
277
|
0
|
|
|
|
|
|
$self->{'seaSurfaceHeight'} = $e; |
278
|
0
|
|
|
|
|
|
$self->{'surfaceWaterTemperature'} = $f; |
279
|
0
|
|
|
|
|
|
$self->{'surfaceClarity'} = $g; |
280
|
|
|
|
|
|
|
|
281
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
#========================================================================== |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=item sub byte_swap() |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=cut |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
sub byte_swap($) { |
295
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
296
|
|
|
|
|
|
|
|
297
|
0
|
0
|
|
|
|
|
if (@_) { |
298
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
299
|
|
|
|
|
|
|
} else { |
300
|
0
|
|
|
|
|
|
$self->pack(); |
301
|
|
|
|
|
|
|
} |
302
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
303
|
|
|
|
|
|
|
|
304
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$g); |
305
|
0
|
|
|
|
|
|
$self->unpack(); |
306
|
|
|
|
|
|
|
|
307
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
1; |
311
|
|
|
|
|
|
|
__END__ |