| Text-NASA_Ames documentation | Contained in the Text-NASA_Ames distribution. |
Text::NASA_Ames::FFI1010 - Implementation of FFI1010 NASA_Ames format
This class should normally not be called directly but through the Text::NASA_Ames class indirectly.
parses the (rest of the) header (body and comments)
$Id: FFI1010.pm,v 1.1 2004/02/18 09:25:04 heikok Exp $
Heiko Klein, <H.Klein@gmx.net>
| Text-NASA_Ames documentation | Contained in the Text-NASA_Ames distribution. |
package Text::NASA_Ames::FFI1010; use base qw(Text::NASA_Ames); use Carp; use 5.00600; use strict; our $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf " %d." . "%02d" x $#r, @r };
sub new { my ($class, $fileObj) = @_; $class = ref $class || $class; if (! (ref $fileObj && (ref($fileObj) eq 'Text::NASA_Ames'))) { return new Text::NASA_Ames($fileObj); } my $self = $fileObj; bless $self, $class; $self->_parseList('dX', $self->nIV); $self->_parseLines('xName', $self->nIV); $self->_parseVDeclaration; $self->_parseAuxDeclaration; $self->_parseTailHeader; return $self; } sub _refillBuffer { my $self = shift; my $line = $self->nextLine; return unless defined $line; my ($x, @a) = split ' ', $line; if (@a != $self->nAuxV) { $self->_carp("not enough elements for Aux, expected ". $self->nAuxV() . ", got ". scalar @a); return; } $self->_cleanAndScaleVals($self->aMiss, $self->aScal, \@a) if $self->nAuxV > 0; my @v; if ($self->nV > 0) { $line = $self->nextLine; return unless defined $line; @v = split ' ', $line; if (@v != $self->nV) { $self->_carp("not enough elements for V, expected ". $self->nV() . ", got ". scalar @v); return; } $self->_cleanAndScaleVals($self->vMiss, $self->vScal, \@v); } push @{ $self->dataBuffer }, new Text::NASA_Ames::DataEntry({X => [$x], V => \@v, A => \@a}); } 1; __END__