line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78aca54-200e-11de-bda9-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::CelestialSphereControl; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
32
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
49
|
|
10
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
11
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
12
|
1
|
|
|
1
|
|
628
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5714
|
|
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::CelestialSphereControl - Perl extension for the Common Image |
42
|
|
|
|
|
|
|
Generator Interface - Celestial Sphere Control data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::CelestialSphereControl; |
47
|
|
|
|
|
|
|
my $sky_ctl = Rinchi::CIGIPP::CelestialSphereControl->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $sky_ctl->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $sky_ctl->packet_size(); |
51
|
|
|
|
|
|
|
$hour = $sky_ctl->hour(123); |
52
|
|
|
|
|
|
|
$minute = $sky_ctl->minute(7); |
53
|
|
|
|
|
|
|
$date_time_valid = $sky_ctl->date_time_valid(Rinchi::CIGIPP->Invalid); |
54
|
|
|
|
|
|
|
$star_field_enable = $sky_ctl->star_field_enable(Rinchi::CIGIPP->Disable); |
55
|
|
|
|
|
|
|
$moon_enable = $sky_ctl->moon_enable(Rinchi::CIGIPP->Disable); |
56
|
|
|
|
|
|
|
$sun_enable = $sky_ctl->sun_enable(Rinchi::CIGIPP->Disable); |
57
|
|
|
|
|
|
|
$ephemeris_model_enable = $sky_ctl->ephemeris_model_enable(Rinchi::CIGIPP->Enable); |
58
|
|
|
|
|
|
|
$date = $sky_ctl->date(5486); |
59
|
|
|
|
|
|
|
$star_field_intensity = $sky_ctl->star_field_intensity(29.575); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 DESCRIPTION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The Celestial Sphere Control data packet allows the Host to specify properties |
64
|
|
|
|
|
|
|
of the sky model. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
The Date attribute specifies the current date and the Hour and Minute |
67
|
|
|
|
|
|
|
attributes specify the current time of day. The IG uses these attributes to |
68
|
|
|
|
|
|
|
determine ambient light properties, sun and moon positions (and corresponding |
69
|
|
|
|
|
|
|
directional light positions), moon phase, and horizon glow. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
An IG typically uses an ephemeris model to continuously update the time of day. |
72
|
|
|
|
|
|
|
A Celestial Sphere Control packet need not be sent each minute for the sole |
73
|
|
|
|
|
|
|
purpose of updating the time of day unless the Host has disabled the ephemeris |
74
|
|
|
|
|
|
|
model with the Ephemeris Model Enable flag. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Note: If the Host freezes the simulation, it must send a Celestial Sphere |
77
|
|
|
|
|
|
|
Control packet with the Ephemeris Model Enable attribute set to Disable (0); |
78
|
|
|
|
|
|
|
otherwise, the IG will continue to update the time of day. When the Host |
79
|
|
|
|
|
|
|
resumes the simulation, it must explicitly re-enable the ephemeris model. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
The Date/Time Valid attribute specifies whether the IG should set the current |
82
|
|
|
|
|
|
|
date and time to the values specified by the Hour, Minute, and Date attributes. |
83
|
|
|
|
|
|
|
This enables the Host to change sky model properties without affecting the |
84
|
|
|
|
|
|
|
ephemeris model. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 EXPORT |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
None by default. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
#============================================================================== |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item new $sky_ctl = Rinchi::CIGIPP::CelestialSphereControl->new() |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Constructor for Rinchi::CelestialSphereControl. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub new { |
99
|
1
|
|
|
1
|
1
|
205
|
my $class = shift; |
100
|
1
|
|
33
|
|
|
7
|
$class = ref($class) || $class; |
101
|
|
|
|
|
|
|
|
102
|
1
|
|
|
|
|
18
|
my $self = { |
103
|
|
|
|
|
|
|
'_Buffer' => '', |
104
|
|
|
|
|
|
|
'_ClassIdent' => 'f78aca54-200e-11de-bda9-001c25551abc', |
105
|
|
|
|
|
|
|
'_Pack' => 'CCCCCCSIf', |
106
|
|
|
|
|
|
|
'_Swap1' => 'CCCCCCvVV', |
107
|
|
|
|
|
|
|
'_Swap2' => 'CCCCCCnNN', |
108
|
|
|
|
|
|
|
'packetType' => 9, |
109
|
|
|
|
|
|
|
'packetSize' => 16, |
110
|
|
|
|
|
|
|
'hour' => 0, |
111
|
|
|
|
|
|
|
'minute' => 0, |
112
|
|
|
|
|
|
|
'_bitfields1' => 0, # Includes bitfields unused12, dateTimeValid, starFieldEnable, moonEnable, sunEnable, and ephemerisModelEnable. |
113
|
|
|
|
|
|
|
'dateTimeValid' => 0, |
114
|
|
|
|
|
|
|
'starFieldEnable' => 0, |
115
|
|
|
|
|
|
|
'moonEnable' => 0, |
116
|
|
|
|
|
|
|
'sunEnable' => 0, |
117
|
|
|
|
|
|
|
'ephemerisModelEnable' => 0, |
118
|
|
|
|
|
|
|
'_unused13' => 0, |
119
|
|
|
|
|
|
|
'_unused14' => 0, |
120
|
|
|
|
|
|
|
'date' => 0, |
121
|
|
|
|
|
|
|
'starFieldIntensity' => 0, |
122
|
|
|
|
|
|
|
}; |
123
|
|
|
|
|
|
|
|
124
|
1
|
50
|
|
|
|
6
|
if (@_) { |
125
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
126
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
127
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
128
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
129
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
1
|
|
|
|
|
3
|
bless($self,$class); |
135
|
1
|
|
|
|
|
3
|
return $self; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
#============================================================================== |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item sub packet_type() |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
$value = $sky_ctl->packet_type(); |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Data Packet Identifier. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
This attribute identifies this data packet as the Celestial Sphere Control |
147
|
|
|
|
|
|
|
packet. The value of this attribute must be 9. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=cut |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub packet_type() { |
152
|
1
|
|
|
1
|
1
|
7
|
my ($self) = @_; |
153
|
1
|
|
|
|
|
8
|
return $self->{'packetType'}; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
#============================================================================== |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=item sub packet_size() |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
$value = $sky_ctl->packet_size(); |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
Data Packet Size. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
165
|
|
|
|
|
|
|
this attribute must be 16. |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=cut |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub packet_size() { |
170
|
1
|
|
|
1
|
1
|
6
|
my ($self) = @_; |
171
|
1
|
|
|
|
|
3
|
return $self->{'packetSize'}; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
#============================================================================== |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=item sub hour([$newValue]) |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
$value = $sky_ctl->hour($newValue); |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
Hour. |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
This attribute specifies the current hour of the day within the simulation. |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=cut |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub hour() { |
187
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
188
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
189
|
1
|
|
|
|
|
3
|
$self->{'hour'} = $nv; |
190
|
|
|
|
|
|
|
} |
191
|
1
|
|
|
|
|
4
|
return $self->{'hour'}; |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
#============================================================================== |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=item sub minute([$newValue]) |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
$value = $sky_ctl->minute($newValue); |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
Minute. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
This attribute specifies the current minute of the day within the simulation. |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=cut |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub minute() { |
207
|
1
|
|
|
1
|
1
|
12
|
my ($self,$nv) = @_; |
208
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
209
|
1
|
|
|
|
|
2
|
$self->{'minute'} = $nv; |
210
|
|
|
|
|
|
|
} |
211
|
1
|
|
|
|
|
3
|
return $self->{'minute'}; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
#============================================================================== |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=item sub date_time_valid([$newValue]) |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
$value = $sky_ctl->date_time_valid($newValue); |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
Date/Time Valid. |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
This attribute specifies whether the Hour, Minute, and Date attributes are |
223
|
|
|
|
|
|
|
valid. If Date/Time Valid is set to Valid (1), these values will override the |
224
|
|
|
|
|
|
|
IG's current date and time. |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
Invalid 0 |
227
|
|
|
|
|
|
|
Valid 1 |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=cut |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
sub date_time_valid() { |
232
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
233
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
234
|
1
|
50
|
33
|
|
|
5
|
if (($nv==0) or ($nv==1)) { |
235
|
1
|
|
|
|
|
3
|
$self->{'dateTimeValid'} = $nv; |
236
|
1
|
|
|
|
|
2
|
$self->{'starFieldEnable'} = $nv; |
237
|
1
|
|
|
|
|
3
|
$self->{'moonEnable'} = $nv; |
238
|
1
|
|
|
|
|
2
|
$self->{'sunEnable'} = $nv; |
239
|
1
|
|
|
|
|
2
|
$self->{'ephemerisModelEnable'} = $nv; |
240
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 4) &0x10; |
241
|
|
|
|
|
|
|
} else { |
242
|
0
|
|
|
|
|
0
|
carp "date_time_valid must be 0 (Invalid), or 1 (Valid)."; |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
} |
245
|
1
|
|
|
|
|
4
|
return (($self->{'_bitfields1'} & 0x10) >> 4); |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
#============================================================================== |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=item sub star_field_enable([$newValue]) |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
$value = $sky_ctl->star_field_enable($newValue); |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
Star Field Enable. |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
This attribute specifies whether the star attribute is enabled in the sky |
257
|
|
|
|
|
|
|
model. The star positions are determined by the current date and time. |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
Disable 0 |
260
|
|
|
|
|
|
|
Enable 1 |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=cut |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
sub star_field_enable() { |
265
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
266
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
267
|
1
|
50
|
33
|
|
|
5
|
if (($nv==0) or ($nv==1)) { |
268
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 3) &0x08; |
269
|
|
|
|
|
|
|
} else { |
270
|
0
|
|
|
|
|
0
|
carp "star_field_enable must be 0 (Disable), or 1 (Enable)."; |
271
|
|
|
|
|
|
|
} |
272
|
|
|
|
|
|
|
} |
273
|
1
|
|
|
|
|
4
|
return (($self->{'_bitfields1'} & 0x08) >> 3); |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
#============================================================================== |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=item sub moon_enable([$newValue]) |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
$value = $sky_ctl->moon_enable($newValue); |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
Moon Enable. |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
This attribute specifies whether the moon is enabled in the sky model. The moon |
285
|
|
|
|
|
|
|
phase is determined by the current date. |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
Disable 0 |
288
|
|
|
|
|
|
|
Enable 1 |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=cut |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub moon_enable() { |
293
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
294
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
295
|
1
|
50
|
33
|
|
|
5
|
if (($nv==0) or ($nv==1)) { |
296
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 2) &0x04; |
297
|
|
|
|
|
|
|
} else { |
298
|
0
|
|
|
|
|
0
|
carp "moon_enable must be 0 (Disable), or 1 (Enable)."; |
299
|
|
|
|
|
|
|
} |
300
|
|
|
|
|
|
|
} |
301
|
1
|
|
|
|
|
3
|
return (($self->{'_bitfields1'} & 0x04) >> 2); |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
#============================================================================== |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=item sub sun_enable([$newValue]) |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
$value = $sky_ctl->sun_enable($newValue); |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
Sun Enable. |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
This attribute specifies whether the sun is enabled in the sky model. |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
Disable 0 |
315
|
|
|
|
|
|
|
Enable 1 |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=cut |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
sub sun_enable() { |
320
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
321
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
322
|
1
|
50
|
33
|
|
|
11
|
if (($nv==0) or ($nv==1)) { |
323
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 1) &0x02; |
324
|
|
|
|
|
|
|
} else { |
325
|
0
|
|
|
|
|
0
|
carp "sun_enable must be 0 (Disable), or 1 (Enable)."; |
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
} |
328
|
1
|
|
|
|
|
4
|
return (($self->{'_bitfields1'} & 0x02) >> 1); |
329
|
|
|
|
|
|
|
} |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
#============================================================================== |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
=item sub ephemeris_model_enable([$newValue]) |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
$value = $sky_ctl->ephemeris_model_enable($newValue); |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
Ephemeris Model Enable. |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
This attribute controls whether the time of day is static or continuous. If |
340
|
|
|
|
|
|
|
this attribute is set to Enabled (1), the image generator will continuously |
341
|
|
|
|
|
|
|
update the time of day. |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
Disable 0 |
344
|
|
|
|
|
|
|
Enable 1 |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
=cut |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
sub ephemeris_model_enable() { |
349
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
350
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
351
|
1
|
50
|
33
|
|
|
7
|
if (($nv==0) or ($nv==1)) { |
352
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= $nv &0x01; |
353
|
|
|
|
|
|
|
} else { |
354
|
0
|
|
|
|
|
0
|
carp "ephemeris_model_enable must be 0 (Disable), or 1 (Enable)."; |
355
|
|
|
|
|
|
|
} |
356
|
|
|
|
|
|
|
} |
357
|
1
|
|
|
|
|
3
|
return ($self->{'_bitfields1'} & 0x01); |
358
|
|
|
|
|
|
|
} |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
#============================================================================== |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
=item sub date([$newValue]) |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
$value = $sky_ctl->date($newValue); |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
Date. |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
This attribute specifies the current date within the simulation. The date is |
369
|
|
|
|
|
|
|
represented as a seven- or eight-digit decimal integer formatted as follows: |
370
|
|
|
|
|
|
|
MMDDYYYY = (month × 1000000) + (day × 10000) + year. |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=cut |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
sub date() { |
375
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
376
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
377
|
1
|
|
|
|
|
2
|
$self->{'date'} = $nv; |
378
|
|
|
|
|
|
|
} |
379
|
1
|
|
|
|
|
3
|
return $self->{'date'}; |
380
|
|
|
|
|
|
|
} |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
#============================================================================== |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
=item sub star_field_intensity([$newValue]) |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
$value = $sky_ctl->star_field_intensity($newValue); |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
Star Field Intensity. |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
This attribute specifies the intensity of the star attribute within the sky |
391
|
|
|
|
|
|
|
model. This attribute is ignored if Star Field Enable is set to Disable (0). |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
=cut |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
sub star_field_intensity() { |
396
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
397
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
398
|
1
|
|
|
|
|
2
|
$self->{'starFieldIntensity'} = $nv; |
399
|
|
|
|
|
|
|
} |
400
|
1
|
|
|
|
|
3
|
return $self->{'starFieldIntensity'}; |
401
|
|
|
|
|
|
|
} |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
#========================================================================== |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
=item sub pack() |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
$value = $sky_ctl->pack(); |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
Returns the packed data packet. |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=cut |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
sub pack($) { |
414
|
1
|
|
|
1
|
1
|
5
|
my $self = shift ; |
415
|
|
|
|
|
|
|
|
416
|
1
|
|
|
|
|
14
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
417
|
|
|
|
|
|
|
$self->{'packetType'}, |
418
|
|
|
|
|
|
|
$self->{'packetSize'}, |
419
|
|
|
|
|
|
|
$self->{'hour'}, |
420
|
|
|
|
|
|
|
$self->{'minute'}, |
421
|
|
|
|
|
|
|
$self->{'_bitfields1'}, # Includes bitfields unused12, dateTimeValid, starFieldEnable, moonEnable, sunEnable, and ephemerisModelEnable. |
422
|
|
|
|
|
|
|
$self->{'_unused13'}, |
423
|
|
|
|
|
|
|
$self->{'_unused14'}, |
424
|
|
|
|
|
|
|
$self->{'date'}, |
425
|
|
|
|
|
|
|
$self->{'starFieldIntensity'}, |
426
|
|
|
|
|
|
|
); |
427
|
|
|
|
|
|
|
|
428
|
1
|
|
|
|
|
4
|
return $self->{'_Buffer'}; |
429
|
|
|
|
|
|
|
} |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
#========================================================================== |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=item sub unpack() |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
$value = $sky_ctl->unpack(); |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
Unpacks the packed data packet. |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
=cut |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
sub unpack($) { |
442
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
443
|
|
|
|
|
|
|
|
444
|
0
|
0
|
|
|
|
|
if (@_) { |
445
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
446
|
|
|
|
|
|
|
} |
447
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
448
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
449
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
450
|
0
|
|
|
|
|
|
$self->{'hour'} = $c; |
451
|
0
|
|
|
|
|
|
$self->{'minute'} = $d; |
452
|
0
|
|
|
|
|
|
$self->{'_bitfields1'} = $e; # Includes bitfields unused12, dateTimeValid, starFieldEnable, moonEnable, sunEnable, and ephemerisModelEnable. |
453
|
0
|
|
|
|
|
|
$self->{'_unused13'} = $f; |
454
|
0
|
|
|
|
|
|
$self->{'_unused14'} = $g; |
455
|
0
|
|
|
|
|
|
$self->{'date'} = $h; |
456
|
0
|
|
|
|
|
|
$self->{'starFieldIntensity'} = $i; |
457
|
|
|
|
|
|
|
|
458
|
0
|
|
|
|
|
|
$self->{'dateTimeValid'} = $self->date_time_valid(); |
459
|
0
|
|
|
|
|
|
$self->{'starFieldEnable'} = $self->star_field_enable(); |
460
|
0
|
|
|
|
|
|
$self->{'moonEnable'} = $self->moon_enable(); |
461
|
0
|
|
|
|
|
|
$self->{'sunEnable'} = $self->sun_enable(); |
462
|
0
|
|
|
|
|
|
$self->{'ephemerisModelEnable'} = $self->ephemeris_model_enable(); |
463
|
|
|
|
|
|
|
|
464
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
465
|
|
|
|
|
|
|
} |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
#========================================================================== |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
=item sub byte_swap() |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
=cut |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
sub byte_swap($) { |
478
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
479
|
|
|
|
|
|
|
|
480
|
0
|
0
|
|
|
|
|
if (@_) { |
481
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
482
|
|
|
|
|
|
|
} else { |
483
|
0
|
|
|
|
|
|
$self->pack(); |
484
|
|
|
|
|
|
|
} |
485
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
486
|
|
|
|
|
|
|
|
487
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$g,$h,$i); |
488
|
0
|
|
|
|
|
|
$self->unpack(); |
489
|
|
|
|
|
|
|
|
490
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
491
|
|
|
|
|
|
|
} |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
1; |
494
|
|
|
|
|
|
|
__END__ |