line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Astro::SkyX::sky6MyFOVs; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
17
|
use 5.006001; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
36
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
279
|
|
6
|
|
|
|
|
|
|
require IO::Socket; |
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
require Astro::SkyX; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#use vars qw( $SkyXConnection $_count ); |
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
14
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
15
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
16
|
|
|
|
|
|
|
our ($AUTOLOAD); |
17
|
|
|
|
|
|
|
# This allows declaration use SkyX ':all'; |
18
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
19
|
|
|
|
|
|
|
# will save memory. |
20
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
21
|
|
|
|
|
|
|
new connect Send Get |
22
|
|
|
|
|
|
|
) ] ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our @EXPORT = qw( |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
30
|
|
|
|
|
|
|
our @PROPERTIES = qw( Property setProperty Name Fill ); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Preloaded methods go here. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
##---## |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new { |
37
|
0
|
|
|
0
|
0
|
|
my ($caller, %arg) = @_; |
38
|
0
|
|
|
|
|
|
my $caller_is_obj = ref($caller); |
39
|
0
|
|
0
|
|
|
|
my $class = $caller_is_obj || $caller; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $self = bless { |
42
|
|
|
|
|
|
|
_debug => $_[1], |
43
|
|
|
|
|
|
|
}, $class; |
44
|
|
|
|
|
|
|
# Private count increment/decrement methods |
45
|
|
|
|
|
|
|
# $self->_incr_count(); |
46
|
0
|
|
|
|
|
|
return $self; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub AUTOLOAD ($;$) { |
50
|
1
|
|
|
1
|
|
7
|
no strict "refs"; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
411
|
|
51
|
0
|
|
|
0
|
|
|
my ($self, @newval) = @_; |
52
|
0
|
|
|
|
|
|
my $newtext = ''; |
53
|
0
|
|
|
|
|
|
my $js = "/* Java Script */ \r\n"; |
54
|
0
|
0
|
|
|
|
|
if ($AUTOLOAD =~ /.*::(.*::.*)/) { |
55
|
0
|
|
|
|
|
|
my $method = $1; |
56
|
0
|
|
|
|
|
|
my $p; |
57
|
|
|
|
|
|
|
# Let's build the javascript |
58
|
0
|
0
|
|
|
|
|
$newtext = join ',', map{ /^[0-9.-]*$/ ? $_ : qq/'$_'/ }@newval; |
|
0
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
$method =~ tr/::/./s; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my ($package, $propertyName) = $AUTOLOAD =~ m/^(.+::)(.+)$/; |
62
|
0
|
0
|
0
|
|
|
|
if(haveProperty($propertyName)){ |
|
|
0
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
$js .= $method . "(" . $newtext . ");\r\n"; |
64
|
|
|
|
|
|
|
} elsif(length($propertyName) and length($newtext) ){ |
65
|
0
|
|
|
|
|
|
$js .= $method . ' = ' . $newtext . ";\r\n"; |
66
|
|
|
|
|
|
|
} else { |
67
|
0
|
|
|
|
|
|
$js .= $method . ";\r\n"; |
68
|
|
|
|
|
|
|
} |
69
|
0
|
|
|
|
|
|
Astro::SkyX::Send($self,$js); |
70
|
0
|
|
|
|
|
|
return Astro::SkyX::Get($self); |
71
|
|
|
|
|
|
|
} |
72
|
0
|
|
|
|
|
|
die "No such method: $AUTOLOAD"; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub haveProperty{ |
76
|
0
|
|
|
0
|
0
|
|
my ($value) = @_; |
77
|
0
|
|
|
|
|
|
for my $property (@PROPERTIES){ |
78
|
0
|
0
|
|
|
|
|
if($property eq $value){ |
79
|
0
|
|
|
|
|
|
return "1"; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
} |
82
|
0
|
|
|
|
|
|
return undef; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
0
|
|
|
sub DESTROY { |
86
|
|
|
|
|
|
|
# $_[0]->_decr_count(); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
90
|
|
|
|
|
|
|
__END__ |