App-SeismicUnixGui

 view release on metacpan or  search on metacpan

lib/App/SeismicUnixGui/misc/green_flow.pm  view on Meta::CPAN

	# should be at start of color_flow
	$color_flow_href->{_flow_type} = $flow_type->{_user_built};
	my $flow_name_in_color = $color_flow_href->{$_flow_name_in_color};

	my $flow_color = $color_flow_href->{_flow_color};

	# read in variables from the perl flow file
	$perl_flow->set_perl_file_in($flow_name_in_color);
	$perl_flow->parse();

	# clear all signs in GUI and wipe all the memory spaces
	# associated with the contents in the flow listbox that is about to
	# be occupied
	_clear_color_flow();

	my $num_prog_names = $perl_flow->get_num_prog_names();

	if ( length $num_prog_names ) {

		for ( my $prog_idx = 0 ; $prog_idx < $num_prog_names ; $prog_idx++ ) {

			# collect info. from perl file
			$perl_flow->set_prog_index($prog_idx);
			$color_flow_href->{_prog_name_sref} =
			  $perl_flow->get_prog_name_sref();
			$color_flow_href->{_names_aref} = $perl_flow->get_all_names_aref();
			$color_flow_href->{_values_aref} =
			  $perl_flow->get_all_values_aref();
			$color_flow_href->{_check_buttons_settings_aref} =
			  $perl_flow->get_check_buttons_settings_aref();

			# establish which program is active in the flow  7.10.21
			$control->set_flow_program_name_sref(
				$color_flow_href->{_prog_name_sref} );
			$control->set_flow_prog_name_index(0);

			# remove quotes upon input
			$color_flow_href->{_values_aref} =
			  $control->get_no_quotes4array( $color_flow_href->{_values_aref} );

			# add single quotes upon input only to strings
			$color_flow_href->{_values_aref} =
			  $control->get_string_or_number4aref(
				$color_flow_href->{_values_aref} );

			$perl_flow->set_prog_index($prog_idx);
			my $number_of_values = scalar @{ $color_flow_href->{_values_aref} };

			$color_flow_href->{_param_sunix_length} =
			  $perl_flow->get_param_sunix_length();

			my $values_aref = $color_flow_href->{_values_aref};

			# print("2. color_flow,_perl_flow, values = @$values_aref \n");

		  # Populate GUI with the parameter values and labels of the first item
		  # _add2flow will call _flow_select to select the last flow item loaded
		  # _flow select marks the gui history and calls
		  # flow_select which will detect any parameter changes
		  # and will store
		  # upload variables into the param_flow for each program

			_add2flow();
		}

		_flow_select_director('_perl_flow');

		# flow loading and display is complete
		# print("1. color_flow, _perl_flow, print out gui_history\n");
		# $gui_history->view();

		return ();

	}
	else {
		print("$this_color flow is missing the number of programs in a flow\n");
	}

}

=head2 sub _set_flow_color


=cut 

sub _set_flow_color {
	my ($flow_color) = @_;

	if ($flow_color) {

		$color_flow_href->{_flow_color} = $flow_color;

	}
	else {
		print("color_flow, set_flow_color, missing color\n");
	}
	return ();
}

=head2 sub _local_set_flow_listbox_color_w


=cut 

sub _local_set_flow_listbox_color_w {
	my ($flow_color) = @_;

	if ( $flow_color eq $this_color ) {

		$color_flow_href->{_flow_listbox_color_w} =
		  $color_flow_href->{$_flow_listbox_color_w};

	}
	else {
		print(
"color_flow,_local_set_flow_listbox_color_w, _local_set_flow_listbox_color_w, missing color\n"
		);
	}

	return ();
}



( run in 1.146 second using v1.01-cache-2.11-cpan-b16cb0d3907 )