DOCUMENTATION

SYNOPSIS

PERL PERL PROGRAM NAME: conditions4big_streams.pm
AUTHOR: 	Juan Lorenzo
DATE: 		May 16 2018 

DESCRIPTION 
		makes gui aware 
		of what method is active
		
		Makes GUI disable and reenable certain widgets depending on which
		method is called
		
		Based on method used, hash values are reset internally
		one of few packages that changes state of variables outside main
		for this reason we copy all hash to private variables and reassign
		them on potential exit so that nothing is lost or mislabeled
		
		only conditions are reset. All other parameters travel through safely
		
		Be careful to blank as many imported values as possible and only allow
		the essential to be  used (_reset and reset methods are available)
		
		I sometimes reset some values internally (_reset)and only allow 
		one or a few to survive for manipulation internally. But, because
		all variables that enter are sheltered in private variables those that are not
		changed can safely be handed back to the namespace of the module that is calling 
		conditions4big_streams.
		
		get_flow_index_last_touched needs to be exported so do not reset it
		
		For safety we try to encapsulate this module
		For safety we work internally sometimes with single scalars instead of imported hash and variables
		For safety, input hash keys are assigned to new variables with short private names
		New variables with short names are exported from a private hash
		
BASED ON:

previous version the main L_SU.pl (V 0.3)
 

USE

NOTES

Examples

SEISMIC UNIX NOTES

CHANGES and their DATES refactoring of 2017 version of L_SU.pl

Notes from bash

106 of convenient private abbreviated-variable names
These are defiend in every subroutine so that get_hash_ref can export them

private hash

106 off

sub _get_add2flow

sub _get_add2flow_button

sub _get_flow_color

sub _get_flow_listbox_color_w

sub _reset

26 off
do not reset important values:
location within GUI

sub _reset_is_flow_listbox_color_w

sub _set_flow_color

sub _set_flow_listbox_color_w

sub _set_flow_listbox_last_touched_txt

keep track of whcih listbox was last chosen

sub _set_flow_listbox_last_touched_w

sub _set_gui_widgets

 spread important widget addresses
 privately for convenience using abbreviated names,
 i.e. in scalar instead of hash notaion
 print("1 conditions4big_streams,_set_gui_widgets, delete_from_flow_button: $delete_from_flow_button\n");
 print("conditions4big_streams,_set_gui_widgets,flow_listbox_grey_w : $flow_listbox_grey_w \n");

25 off

sub get_flow_color

return flow color if it exists

sub get_hash_ref

return ALL values of the private hash, supposedly
improtant external widgets have not been reset.. only conditions
are reset
TODO: perhaps it is better to have a specific method
	to return one specific widget address at a time?
}

 

25 off  only reset the conditional parameters, not the widgets and other information

sub set_flow_color

sub set_gui_widgets

bring it important widget addresses

29 and 29

sub set_hash_ref

bring in important (1) last flow index, (1) prog name and (22) conditions
does not include widgets
widgets are boruught in with set_gui_widgets

sub set4FileDialog_SaveAs_end

sub set4FileDialog_open_end

sub set4FileDialog_open_perl_file_end

sub set4FileDialog_open_start

sub set4FileDialog_open_perl_file_start

sub set4_end_of_SaveAs_button

sub set4_start_of_SaveAs_button

sub set4end_of_flow_item_up_arrow_button

when the arrow that moves flow items up a list is clicked

location within GUI

foreach my $key (sort keys %$conditions4big_streams) {
  print ("conditions4big_streams user,set4end_of_flow_select,key is $key, value is $conditions4big_streams->{$key}\n");
}

if an item within a user-built list of programs is selected then 
the following options are set to be true--they can now be activated from the GUI
Also the color of the flow is maintained

sub set4end_of_run_button

location within GUI

sets 
conditions4big_streams

sub set4end_of_run_superflow

location within GUI

sets 
conditions4big_streams

sub set4run_button

is used by both pre-built sueprflows and user-built flows look at set4start_of_run_button and set4end_of_run_button

legacy?

sub set4run_button_end

location within GUI

sets 
	$conditions4big_streams
	
	legacy?
	look at set4start_of_run_button and set4end_of_run_button

location within GUI on first clicking delete button

when the arrow that moves flow items up a list is clicked

take focus of the first Entry button/Value for all listboxes returns only a few parameters All others have been reset to false

WARNING, _reset may make color disappear

legacy look at set4start_of_run_button and set4end_of_run_button

sub set4end_of_add2flow

sets 
	$conditions4big_streams
	$add2flow_button_grey
	$flow_listbox_grey_w
	
calls
	_reset();

sees a
	listbox
	my $color 						= _get_flow_color();

sub set4end_of_add2flow_button

sets 
	$conditions4big_streams
	$add2flow_button_color
	$flow_listbox_color_w
	
calls
	_reset();

sees a
	listbox
	my $color 						= _get_flow_color();

sub set4end_of_superflow_Save

sub set4end_of_superflow_select

sub set4start_of_add2flow

find out correct color

find out correct color

sub set4start_of_sunix_select

sub set4start_of_superflow_Save

sub set4start_of_superflow_select

sub set4superflow_close_data_file_end

sub set4superflow_close_path_end

sub set4superflow_open_data_file_end

sub set4superflow_open_data_file_start

sub set4superflow_open_path_end

sub set4superflow_open_path_start

sub set4superflow_Save

sub set_flow_index_last_touched