Science Daily: Uranus
- NASA's Hubble, New Horizons team up for a simultaneous look at Uranus October 11, 2024
- Key to rapid planet formation August 1, 2024
This is the easy part. If you have never written a Perl module, you can find some tutorials elsewhere [need reference]. Our Perl module will be called Astro::INDI and we can produce a skeleton quite simply. I’m going to be bit picky here and insert POD (plain-old documentation) as I do this. It’s a habit well-worth cultivating.
package Astro::INDI;
=head1 NAME - Astro::INDI
=head1 SYNOPSIS
use Astro::INDI;
my $client = new Astro::INDI('host' => 'localhost', 'port' => 7624);
=head1 DESCRIPTION
Implements the INDI client protocol to facilitate writing INDI clients in Perl.
=head1 EXAMPLES
=cut
use strict;
use Socket;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
require Exporter;
@ISA = qw(Exporter AutoLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
# @EXPORT = qw( );
@EXPORT_OK = qw( );
%EXPORT_TAGS = ( ALL => \@EXPORT_OK );
$VERSION = '0.1';
# Preloaded methods go here.
sub new {
my ($class, %initializer) = @_;
my $self = { 'host' => 'localhost',
'port' => 7624 };
bless $self, ref $class || $class;
foreach my $key (keys %initializer) {
$self->{$key} = $initializer{$key};
}
return $self;
}
=head1 ACKNOWLEDGEMENTS
Elwood C. Downey is the creator of INDI. He wrote the original white-paper, formalized the XML protocol, and
wrote a significant portion of the initial INDI library including the standalone client tools getINDI, setINDI, and
evalINDI.
Jasem Mutlaq wrote a significant portion of the INDI library and oversees the SourceForge project.
Many others have been involved in making INDI a viable project. This includes everyone who has written, helped
write or debug a device driver. Thanks are also due those manufacturers who have provided communications
specifications or source code to control their devices.
=head1 AUTHOR
Roland Roberts (roland AT astrofoto DOT org)
1;
__END__
The only thing we have defined here is a method to create a new object. It’s not a very useful object without some more methods, but those come later. I’ve also added, somewhat presciently at this point, the “use Socket” line. Since the stock INDI server talks via TCP/IP, we’re going to need that.
On to the more interesting parts….
Written by Roland Roberts
Search
.Archives
- October 2024 (1)
- May 2024 (2)
- April 2024 (3)
- September 2022 (5)
- April 2022 (1)
- January 2022 (3)
- December 2021 (4)
- September 2021 (3)
- July 2021 (1)
- January 2021 (1)
- November 2020 (2)
- October 2020 (2)
- September 2020 (2)
- August 2020 (5)
- July 2020 (1)
- November 2019 (2)
- September 2019 (1)
- August 2019 (2)
- September 2017 (1)
- August 2017 (1)
- September 2015 (3)
- August 2015 (2)
- June 2015 (5)
- May 2015 (3)
- May 2013 (2)
- January 2013 (1)
- December 2012 (2)
- September 2012 (1)
- June 2012 (1)
- May 2012 (1)
- October 2011 (2)
- September 2011 (2)
- April 2011 (2)
- March 2011 (10)
- January 2011 (8)
- November 2010 (2)
- October 2010 (1)
- September 2010 (3)
- August 2010 (2)
- July 2010 (1)
- June 2010 (1)
- April 2010 (3)
- February 2010 (3)
- January 2010 (3)
- December 2009 (6)
- November 2009 (3)
- October 2009 (7)
- September 2009 (8)
- August 2009 (4)
- July 2009 (1)
- June 2009 (2)
- May 2009 (2)
- April 2009 (7)
- March 2009 (1)
- February 2009 (6)
- January 2009 (4)
- December 2008 (4)
- November 2008 (3)
- October 2008 (11)
- September 2008 (4)
- August 2008 (5)
- July 2008 (5)
- June 2008 (2)
- April 2008 (4)
- March 2008 (18)
- February 2008 (9)
- November 2007 (1)
- October 2007 (3)
- July 2007 (3)
- April 2007 (1)
- March 2007 (6)
- February 2007 (3)
- December 2006 (3)
- October 2006 (4)
- September 2006 (1)
- July 2006 (5)
- May 2006 (10)
- April 2006 (9)