App-SeismicUnixGui

 view release on metacpan or  search on metacpan

lib/App/SeismicUnixGui/big_streams/iVelocityAnalysis.pl  view on Meta::CPAN

   -radio_buttons stop flow
   Must be AFTR semblance

 set the prompt value according
 to which button is pressed
 then exit the MainLoop
 destroy the main window after the prompt
 is properly set

=cut

if ( !$old_data ) {

	print("iVelocityAnalysis, no old data\n");
    $iVA->start();

    $mw = MainWindow->new;
    $mw->title("Options");
    $mw->geometry("300x50+40+0");
    $mw->title("iVA");

    $calc_rb = $mw->Radiobutton(
        -text     => 'CALC',
        -value    => 'calc',
        -variable => \$rb_value,
        -command  => [ \&set_calc ]
    )->pack( -side => 'left' );

    $next_rb = $mw->Radiobutton(
        -text     => 'NEXT',
        -value    => 'next',
        -variable => \$rb_value,
        -command  => [ \&set_next ]
    )->pack( -side => 'left' );

    $pick_rb = $mw->Radiobutton(
        -text     => 'PICK',
        -value    => 'pick',
        -variable => \$rb_value,
        -command  => [ \&set_pick ]
    )->pack( -side => 'left' );


    $exit_rb = $mw->Radiobutton(
        -text     => 'EXIT',
        -value    => 'exit',
        -variable => \$rb_value,
        -command  => [ \&set_exit ]
    )->pack( -side => 'bottom' );

    MainLoop;     # for Tk widgets

}   # for new data


=pod sub set_pick

 A callback to:
 send cdp number to $iVA
 delete output of previous semblance
 plus more callbacks following...

=cut

sub set_pick {

    my $pick = 'pick';
    $next_rb->configure( -state => 'disabled' );

    #$pick_rb->configure(-state => 'normal');
    $calc_rb->configure( -state => 'normal' );
    $iVA_Tk->{_prompt} = $pick;
    $iVA->pick();
}

=pod sub set_calc

      -PRESS the CALC button
      -Increment number of tries to make
         semblance display interact and show old picks
         (number_of_tries >1)
		-radio_buttons stop flow
           Must be AFTR semblance
           B4  iWrite_All_iva_out

=cut

sub set_calc {

    my $calc = 'calc';
    $next_rb->configure( -state => 'normal' );
    $iVA_Tk->{_prompt} = $calc;
    $iVA->calc();

}

=pod sub set_next

  In this case the $variable is empty
  1. increment cdp
     Exit if beyond last cdp 
  2. reset prompt
  3. Otherwise display the first sembance
  4 ... see following callbacks

=cut


sub set_next {
    print("Next...\n");
    $next_rb->configure( -state => 'normal' );
    $calc_rb->configure( -state => 'disabled' );
    my $next = '';
    $iVA_Tk->{_prompt} = $next;
    $iVA->next();

}

=pod  sub set_exit

  saying goodbye 
  clear old images
  kill window
  stop script

=cut

sub set_exit {
    my $exit = 'exit';
    $exit_rb->configure( -state => 'normal' );
    $iVA_Tk->{_prompt} = $exit;
    $mw->destroy() if Tk::Exists($mw);
    $iVA->exit();
}

=pod sub prompt

 return which prompt has been set

=cut

sub prompt {
    our $variable = $iVA_Tk->{_prompt};
    return ($variable);
}



( run in 0.757 second using v1.01-cache-2.11-cpan-39bf76dae61 )