App-PLab

 view release on metacpan or  search on metacpan

lib/App/PLab/ImageApp.pm  view on Meta::CPAN

{
   my $w = $_[0];
   my @rc = $w-> rect;
   return (
      path         => '.',
      WindowRect   => "@rc",
      MaxState     => 0,
      SerType      => 'Short',
      extSaveDir   => '',
      silentExtDir => 0,
      dirTimeout   => 120,
      statusDelay  => 5,
      showHint     => 1,
   );
}

sub win_extname
{
   my ($w, $extname) = @_;
   my $ext = $w-> {dataExt};
   $extname =~ /([^\\\/]*)$/;

lib/App/PLab/ImageApp.pm  view on Meta::CPAN


sub win_getseriesrange
{
   my $w = $_[0];

   return (0,0) unless defined $w->{fileNum};
   my $path = $w-> {ini}-> {path};
   my @d;

   if ( exists $w-> {cachedDir} && ( $w-> {cachedDir} eq $path) &&
      (( time - $w-> {cachedDirTime}) < $w-> {ini}-> {dirTimeout})) {
      @d = @{$w-> {cachedDirContent}};
   } else {
      warn("Cannot read directory $path:$!"), return (0,0) unless opendir DIR, $path;
      @d = readdir DIR;
      closedir DIR;
      $w-> {cachedDir}        = $path;
      $w-> {cachedDirTime}    = time;
      $w-> {cachedDirContent} = \@d;
   }



( run in 0.426 second using v1.01-cache-2.11-cpan-4d50c553e7e )