diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-01-02 19:25:43 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-01-02 19:25:43 +0100 |
commit | e6e9f836fd23dbf913984b6e3bc7f2d809580149 (patch) | |
tree | f9cf0469980b85b589713f21547cef8e155c490f | |
parent | fdfe24a338e834fbf80bd60697b083c218ec4cf9 (diff) |
Added partial support for zoom settings (saved by ZoomSto)
-rwxr-xr-x | bin/tibtoa | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -643,6 +643,8 @@ sub header_type($) { when(0x03) { return('equation') } when(0x04) { return('string') } when(0x05) { return('program') } + when(0x10) { return('zoom') } + when(0x0f) { return('window') } default { return(sprintf('0x%02x', $_)) } } } @@ -777,9 +779,10 @@ if ($header{type} eq 'program' or $header{type} eq 'equation') { } } print "$cache\n"; -} elsif ($header{type} eq 'matrix' or $header{type} eq 'list' or $header{type} eq 'var') { +} elsif ($header{type} =~ /^(matrix|list|var|zoom|window)$/) { my ($exp, $digit); my $i = 0; + my @values; if ($header{type} eq 'var') { # Variables have a shorter header @@ -800,14 +803,29 @@ if ($header{type} eq 'program' or $header{type} eq 'equation') { $digit .= $char & 0x0f; } substr($digit, 1 + ($digit <= 0), 0, '.'); - printf('%-8s', $digit * (10 ** $exp)); + $digit *= 10 ** $exp; + unless ($header{type} eq 'zoom') { + printf('%-8s', $digit); + } else { + push(@values, $digit); + } if ($header{type} eq 'matrix' and $i == $header{size}->{cols} or $header{type} eq 'var') { print "\n"; $i = 0; } elsif ($header{type} eq 'matrix') { print ' | '; + } elsif ($header{type} ne 'zoom') { + print ' '; } } + if ($header{type} eq 'zoom') { + print "Xmin = $values[0]\n"; + print "Xmax = $values[1]\n"; + print "Xscl = $values[2]\n"; + print "Ymin = $values[3]\n"; + print "Ymax = $values[4]\n"; + print "Yscl = $values[5]\n"; + } } elsif ($header{type} eq 'string') { while($offset < $length) { print substr($program, $offset++, 1); |