line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78ad594-200e-11de-bdad-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::MaritimeSurfaceConditionsControl; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
28
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
51
|
|
10
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
11
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
12
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7457
|
|
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.02'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Preloaded methods go here. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Rinchi::CIGIPP::MaritimeSurfaceConditionsControl - Perl extension for the |
42
|
|
|
|
|
|
|
Common Image Generator Interface - Maritime Surface Conditions Control data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::MaritimeSurfaceConditionsControl; |
47
|
|
|
|
|
|
|
my $msc_ctl = Rinchi::CIGIPP::MaritimeSurfaceConditionsControl->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $msc_ctl->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $msc_ctl->packet_size(); |
51
|
|
|
|
|
|
|
$entity_ident = $msc_ctl->entity_ident(51957); |
52
|
|
|
|
|
|
|
$region_ident = $msc_ctl->region_ident(64233); |
53
|
|
|
|
|
|
|
$scope = $msc_ctl->scope(Rinchi::CIGIPP->GlobalScope); |
54
|
|
|
|
|
|
|
$whitecap_enable = $msc_ctl->whitecap_enable(Rinchi::CIGIPP->Disable); |
55
|
|
|
|
|
|
|
$surface_conditions_enable = $msc_ctl->surface_conditions_enable(Rinchi::CIGIPP->Disable); |
56
|
|
|
|
|
|
|
$sea_surface_height = $msc_ctl->sea_surface_height(32.113); |
57
|
|
|
|
|
|
|
$surface_water_temperature = $msc_ctl->surface_water_temperature(0.898); |
58
|
|
|
|
|
|
|
$surface_clarity = $msc_ctl->surface_clarity(56.091); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
The Maritime Surface Conditions Control packet is used to specify the surface |
63
|
|
|
|
|
|
|
behavior for seas and other bodies of water. This packet is used in conjunction |
64
|
|
|
|
|
|
|
with the Weather Control and Wave Control packets to define sea states. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Regional maritime surface conditions always take precedence over the global |
67
|
|
|
|
|
|
|
surface conditions. Once the surface conditions of a region are set, global |
68
|
|
|
|
|
|
|
changes will not affect the surface conditions within that region unless it is |
69
|
|
|
|
|
|
|
disabled. Global changes will, however, contribute to the conditions within a |
70
|
|
|
|
|
|
|
region's transition perimeter. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
If two or more regions overlap, the value of each surface condition attribute |
73
|
|
|
|
|
|
|
defining the sea state within the area of overlap should be the average of the |
74
|
|
|
|
|
|
|
values determined by overlapping the regions. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
To determine the maritime surface conditions within areas of overlap or through |
77
|
|
|
|
|
|
|
a transition perimeter, the Host can request the conditions at a specific |
78
|
|
|
|
|
|
|
latitude and longitude by issuing an Environmental Conditions Request packet. |
79
|
|
|
|
|
|
|
The Host can request the instantaneous height of the water surface at a |
80
|
|
|
|
|
|
|
specific latitude and longitude by sending a HAT/HOT Request packet. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 EXPORT |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
None by default. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
#============================================================================== |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item new $msc_ctl = Rinchi::CIGIPP::MaritimeSurfaceConditionsControl->new() |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Constructor for Rinchi::MaritimeSurfaceConditionsControl. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub new { |
95
|
1
|
|
|
1
|
1
|
247
|
my $class = shift; |
96
|
1
|
|
33
|
|
|
7
|
$class = ref($class) || $class; |
97
|
|
|
|
|
|
|
|
98
|
1
|
|
|
|
|
18
|
my $self = { |
99
|
|
|
|
|
|
|
'_Buffer' => '', |
100
|
|
|
|
|
|
|
'_ClassIdent' => 'f78ad594-200e-11de-bdad-001c25551abc', |
101
|
|
|
|
|
|
|
'_Pack' => 'CCSCCSfffI', |
102
|
|
|
|
|
|
|
'_Swap1' => 'CCvCCvVVVV', |
103
|
|
|
|
|
|
|
'_Swap2' => 'CCnCCnNNNN', |
104
|
|
|
|
|
|
|
'packetType' => 13, |
105
|
|
|
|
|
|
|
'packetSize' => 24, |
106
|
|
|
|
|
|
|
'region_entityIdent' => 0, |
107
|
|
|
|
|
|
|
'_bitfields1' => 0, # Includes bitfields unused22, scope, whitecapEnable, and surfaceConditionsEnable. |
108
|
|
|
|
|
|
|
'scope' => 0, |
109
|
|
|
|
|
|
|
'whitecapEnable' => 0, |
110
|
|
|
|
|
|
|
'surfaceConditionsEnable' => 0, |
111
|
|
|
|
|
|
|
'_unused23' => 0, |
112
|
|
|
|
|
|
|
'_unused24' => 0, |
113
|
|
|
|
|
|
|
'seaSurfaceHeight' => 0, |
114
|
|
|
|
|
|
|
'surfaceWaterTemperature' => 0, |
115
|
|
|
|
|
|
|
'surfaceClarity' => 0, |
116
|
|
|
|
|
|
|
'_unused25' => 0, |
117
|
|
|
|
|
|
|
}; |
118
|
|
|
|
|
|
|
|
119
|
1
|
50
|
|
|
|
4
|
if (@_) { |
120
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
121
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
122
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
123
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
124
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
1
|
|
|
|
|
3
|
bless($self,$class); |
130
|
1
|
|
|
|
|
3
|
return $self; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
#============================================================================== |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item sub packet_type() |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
$value = $msc_ctl->packet_type(); |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Data Packet Identifier. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
This attribute identifies this data packet as the Maritime Surface Conditions |
142
|
|
|
|
|
|
|
Control packet. The value of this attribute must be 13. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=cut |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub packet_type() { |
147
|
1
|
|
|
1
|
1
|
7
|
my ($self) = @_; |
148
|
1
|
|
|
|
|
9
|
return $self->{'packetType'}; |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
#============================================================================== |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item sub packet_size() |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
$value = $msc_ctl->packet_size(); |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
Data Packet Size. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
160
|
|
|
|
|
|
|
this attribute must be 24. |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=cut |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
sub packet_size() { |
165
|
1
|
|
|
1
|
1
|
5
|
my ($self) = @_; |
166
|
1
|
|
|
|
|
4
|
return $self->{'packetSize'}; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
#============================================================================== |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=item sub entity_ident([$newValue]) |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
$value = $msc_ctl->entity_ident($newValue); |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Entity ID. (Entity-based Surface Conditions) |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
This attribute specifies the entity to which the surface attributes in this |
178
|
|
|
|
|
|
|
packet are applied. |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=cut |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub entity_ident() { |
183
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
184
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
185
|
1
|
|
|
|
|
3
|
$self->{'region_entityIdent'} = $nv; |
186
|
|
|
|
|
|
|
} |
187
|
1
|
|
|
|
|
3
|
return $self->{'region_entityIdent'}; |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
#============================================================================== |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=item sub region_ident([$newValue]) |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
$value = $msc_ctl->region_ident($newValue); |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
Region ID. (Regional Surface Conditions) |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
This attribute specifies the region to which the surface attributes are |
199
|
|
|
|
|
|
|
confined. |
200
|
|
|
|
|
|
|
Note: Entity ID/Region ID is ignored if Scope is set to Global (0). |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=cut |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub region_ident() { |
205
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
206
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
207
|
1
|
|
|
|
|
2
|
$self->{'region_entityIdent'} = $nv; |
208
|
|
|
|
|
|
|
} |
209
|
1
|
|
|
|
|
3
|
return $self->{'region_entityIdent'}; |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
#============================================================================== |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=item sub scope([$newValue]) |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
$value = $msc_ctl->scope($newValue); |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Scope. |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
This attribute specifies whether this packet is applied globally, applied to a |
221
|
|
|
|
|
|
|
region, or assigned to an entity. If this value is set to Regional (1), the |
222
|
|
|
|
|
|
|
surface condition properties are applied only within the region specified by |
223
|
|
|
|
|
|
|
Region ID. If this value is set to Entity (2), the properties are applied to |
224
|
|
|
|
|
|
|
the area defined by the moving model specified by Entity ID. |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
GlobalScope 0 |
227
|
|
|
|
|
|
|
RegionalScope 1 |
228
|
|
|
|
|
|
|
EntityScope 2 |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=cut |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
sub scope() { |
233
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
234
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
235
|
1
|
50
|
33
|
|
|
7
|
if (($nv==0) or ($nv==1) or ($nv==2)) { |
|
|
|
33
|
|
|
|
|
236
|
1
|
|
|
|
|
2
|
$self->{'scope'} = $nv; |
237
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 2) &0x0C; |
238
|
|
|
|
|
|
|
} else { |
239
|
0
|
|
|
|
|
0
|
carp "scope must be 0 (GlobalScope), 1 (RegionalScope), or 2 (EntityScope)."; |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
} |
242
|
1
|
|
|
|
|
4
|
return (($self->{'_bitfields1'} & 0x0C) >> 2); |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
#============================================================================== |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=item sub whitecap_enable([$newValue]) |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
$value = $msc_ctl->whitecap_enable($newValue); |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
Whitecap Enable. |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
This attribute determines whether whitecaps are enabled. |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
Disable 0 |
256
|
|
|
|
|
|
|
Enable 1 |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=cut |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
sub whitecap_enable() { |
261
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
262
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
263
|
1
|
50
|
33
|
|
|
7
|
if (($nv==0) or ($nv==1)) { |
264
|
1
|
|
|
|
|
2
|
$self->{'whitecapEnable'} = $nv; |
265
|
1
|
|
|
|
|
2
|
$self->{'_bitfields1'} |= ($nv << 1) &0x02; |
266
|
|
|
|
|
|
|
} else { |
267
|
0
|
|
|
|
|
0
|
carp "whitecap_enable must be 0 (Disable), or 1 (Enable)."; |
268
|
|
|
|
|
|
|
} |
269
|
|
|
|
|
|
|
} |
270
|
1
|
|
|
|
|
3
|
return (($self->{'_bitfields1'} & 0x02) >> 1); |
271
|
|
|
|
|
|
|
} |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
#============================================================================== |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=item sub surface_conditions_enable([$newValue]) |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
$value = $msc_ctl->surface_conditions_enable($newValue); |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
Surface Conditions Enable. |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
This attribute determines the state of the specified surface conditions. If |
282
|
|
|
|
|
|
|
this attribute is set to Disable (0), the surface conditions within the region |
283
|
|
|
|
|
|
|
or entity are the same as the global maritime surface conditions. If the |
284
|
|
|
|
|
|
|
attribute is set to Enable (1), the surface conditions are defined by this |
285
|
|
|
|
|
|
|
packet. |
286
|
|
|
|
|
|
|
This attribute is ignored if Scope is set to Global (0). |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
Disable 0 |
289
|
|
|
|
|
|
|
Enable 1 |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
=cut |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
sub surface_conditions_enable() { |
294
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
295
|
1
|
50
|
|
|
|
13
|
if (defined($nv)) { |
296
|
1
|
50
|
33
|
|
|
5
|
if (($nv==0) or ($nv==1)) { |
297
|
1
|
|
|
|
|
4
|
$self->{'surfaceConditionsEnable'} = $nv; |
298
|
1
|
|
|
|
|
2
|
$self->{'_bitfields1'} |= $nv &0x01; |
299
|
|
|
|
|
|
|
} else { |
300
|
0
|
|
|
|
|
0
|
carp "surface_conditions_enable must be 0 (Disable), or 1 (Enable)."; |
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
} |
303
|
1
|
|
|
|
|
3
|
return ($self->{'_bitfields1'} & 0x01); |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
#============================================================================== |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=item sub sea_surface_height([$newValue]) |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
$value = $msc_ctl->sea_surface_height($newValue); |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
Sea Surface Height. |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
This attribute specifies the height of the water above MSL at equilibrium. This |
315
|
|
|
|
|
|
|
attribute can also be used to specify the tide level within the surf zone. |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=cut |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
sub sea_surface_height() { |
320
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
321
|
1
|
50
|
|
|
|
29
|
if (defined($nv)) { |
322
|
1
|
|
|
|
|
3
|
$self->{'seaSurfaceHeight'} = $nv; |
323
|
|
|
|
|
|
|
} |
324
|
1
|
|
|
|
|
4
|
return $self->{'seaSurfaceHeight'}; |
325
|
|
|
|
|
|
|
} |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
#============================================================================== |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
=item sub surface_water_temperature([$newValue]) |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
$value = $msc_ctl->surface_water_temperature($newValue); |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
Surface Water Temperature. |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
This attribute specifies in degrees Celsius the water temperature at the surface. |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
=cut |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
sub surface_water_temperature() { |
340
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
341
|
1
|
50
|
|
|
|
3
|
if (defined($nv)) { |
342
|
1
|
|
|
|
|
3
|
$self->{'surfaceWaterTemperature'} = $nv; |
343
|
|
|
|
|
|
|
} |
344
|
1
|
|
|
|
|
2
|
return $self->{'surfaceWaterTemperature'}; |
345
|
|
|
|
|
|
|
} |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
#============================================================================== |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
=item sub surface_clarity([$newValue]) |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
$value = $msc_ctl->surface_clarity($newValue); |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
Surface Clarity. |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
This attribute specifies the clarity of the water at its surface. This is used |
356
|
|
|
|
|
|
|
to control the visual effect of the water's turbidity and sediment type. A |
357
|
|
|
|
|
|
|
value of 100% indicates pristine water. A value of 0% indicates extremely |
358
|
|
|
|
|
|
|
turbid water. |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
=cut |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
sub surface_clarity() { |
363
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
364
|
1
|
50
|
|
|
|
116
|
if (defined($nv)) { |
365
|
1
|
|
|
|
|
2
|
$self->{'surfaceClarity'} = $nv; |
366
|
|
|
|
|
|
|
} |
367
|
1
|
|
|
|
|
4
|
return $self->{'surfaceClarity'}; |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
#========================================================================== |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=item sub pack() |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
$value = $msc_ctl->pack(); |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
Returns the packed data packet. |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=cut |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
sub pack($) { |
381
|
1
|
|
|
1
|
1
|
5
|
my $self = shift ; |
382
|
|
|
|
|
|
|
|
383
|
1
|
|
|
|
|
10
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
384
|
|
|
|
|
|
|
$self->{'packetType'}, |
385
|
|
|
|
|
|
|
$self->{'packetSize'}, |
386
|
|
|
|
|
|
|
$self->{'region_entityIdent'}, |
387
|
|
|
|
|
|
|
$self->{'_bitfields1'}, # Includes bitfields unused22, scope, whitecapEnable, and surfaceConditionsEnable. |
388
|
|
|
|
|
|
|
$self->{'_unused23'}, |
389
|
|
|
|
|
|
|
$self->{'_unused24'}, |
390
|
|
|
|
|
|
|
$self->{'seaSurfaceHeight'}, |
391
|
|
|
|
|
|
|
$self->{'surfaceWaterTemperature'}, |
392
|
|
|
|
|
|
|
$self->{'surfaceClarity'}, |
393
|
|
|
|
|
|
|
$self->{'_unused25'}, |
394
|
|
|
|
|
|
|
); |
395
|
|
|
|
|
|
|
|
396
|
1
|
|
|
|
|
18
|
return $self->{'_Buffer'}; |
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
#========================================================================== |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=item sub unpack() |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
$value = $msc_ctl->unpack(); |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
Unpacks the packed data packet. |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=cut |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
sub unpack($) { |
410
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
411
|
|
|
|
|
|
|
|
412
|
0
|
0
|
|
|
|
|
if (@_) { |
413
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
414
|
|
|
|
|
|
|
} |
415
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
416
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
417
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
418
|
0
|
|
|
|
|
|
$self->{'region_entityIdent'} = $c; |
419
|
0
|
|
|
|
|
|
$self->{'_bitfields1'} = $d; # Includes bitfields unused22, scope, whitecapEnable, and surfaceConditionsEnable. |
420
|
0
|
|
|
|
|
|
$self->{'_unused23'} = $e; |
421
|
0
|
|
|
|
|
|
$self->{'_unused24'} = $f; |
422
|
0
|
|
|
|
|
|
$self->{'seaSurfaceHeight'} = $g; |
423
|
0
|
|
|
|
|
|
$self->{'surfaceWaterTemperature'} = $h; |
424
|
0
|
|
|
|
|
|
$self->{'surfaceClarity'} = $i; |
425
|
0
|
|
|
|
|
|
$self->{'_unused25'} = $j; |
426
|
|
|
|
|
|
|
|
427
|
0
|
|
|
|
|
|
$self->{'scope'} = $self->scope(); |
428
|
0
|
|
|
|
|
|
$self->{'whitecapEnable'} = $self->whitecap_enable(); |
429
|
0
|
|
|
|
|
|
$self->{'surfaceConditionsEnable'} = $self->surface_conditions_enable(); |
430
|
|
|
|
|
|
|
|
431
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
432
|
|
|
|
|
|
|
} |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
#========================================================================== |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
=item sub byte_swap() |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
=cut |
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
sub byte_swap($) { |
445
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
446
|
|
|
|
|
|
|
|
447
|
0
|
0
|
|
|
|
|
if (@_) { |
448
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
449
|
|
|
|
|
|
|
} else { |
450
|
0
|
|
|
|
|
|
$self->pack(); |
451
|
|
|
|
|
|
|
} |
452
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
453
|
|
|
|
|
|
|
|
454
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$g,$h,$i,$j); |
455
|
0
|
|
|
|
|
|
$self->unpack(); |
456
|
|
|
|
|
|
|
|
457
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
458
|
|
|
|
|
|
|
} |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
1; |
461
|
|
|
|
|
|
|
__END__ |