lib/App/SeismicUnixGui/misc/L_SU.pm untested

filter: Statementstmt 0.0% 0 / 502 Branchbran 0.0% 0 / 124 Conditioncond 0.0% 0 / 120 MC/DCmcdc 0.0% 0 / 61 Subroutinesub 0.0% 0 / 47 Podpod 0.0% 0 / 22 totaltotal 0.0% 0 / 876 CC 63 SCAR 51.1
CC
63
Cov
0%
_FileDialog_button_Open
552.0
user_built_flows
272.0
set_run_button
56.0
CRAP 165.0
1 package App::SeismicUnixGui::misc::L_SU;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PERL PROGRAM NAME: L_SU.pm
8 AUTHOR: Juan Lorenzo
9 DATE: May 14 2018
10  
11 DESCRIPTION
12
13 BASED ON:
14 previous versions of the main L_SU.pl
15
16 =cut
17  
18 =head2 USE
19  
20 =head3 NOTES
21  
22 =head4 Examples
23  
24 =head3 SEISMIC UNIX NOTES
25  
26 =head2 CHANGES and their DATES
27 V 0.1.0 refactoring of 2017 version of L_SU.pl
28
29 V 0.1.1 May 16 2018
30 moving FileDialog_button, FileDialog, FileDialog_close
31 to file_dialog.pm
32
33 making save_button redundant
34 refactor superflow selection
35
36 V0.1.2 refactoring superflows and user-built flows
37
38 V0.1.3 introduce multi-color flows ( 4 off)
39
40 V0.1.5 includes gui_history 9-13-19
41
42 V0.1.6 move methods into color_listbox class 2.10.2021
43
44 V0.1.7 May 2021
45 permit my_dialogs to interact with user and change flow
46
47 V0.1.8 January 2023 Includes Delete a file through the
48 FileDialog
49
50 =cut
51  
52 use Moose;
53 our $VERSION = '0.1.8';
54  
55 my $path;
56 my $SeismicUnixGui;
57 use Carp;
58  
59 extends 'App::SeismicUnixGui::misc::gui_history' => { -version => 0.0.2 };
60 use aliased 'App::SeismicUnixGui::misc::gui_history';
61 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
62 use aliased 'App::SeismicUnixGui::misc::color_listbox';
63 use App::SeismicUnixGui::misc::decisions '1.0.0';
64 use aliased 'App::SeismicUnixGui::misc::decisions';
65 use aliased 'App::SeismicUnixGui::misc::flow_widgets';
66 use aliased 'App::SeismicUnixGui::messages::message_director';
67 use aliased 'App::SeismicUnixGui::misc::file_dialog';
68 use aliased 'App::SeismicUnixGui::misc::help';
69 use aliased 'App::SeismicUnixGui::misc::save_button';
70 use aliased 'App::SeismicUnixGui::misc::param_widgets';
71 use aliased 'App::SeismicUnixGui::misc::run_button';
72 use aliased 'App::SeismicUnixGui::big_streams::pre_built_big_stream';
73 use App::SeismicUnixGui::misc::grey_flow '0.0.4';
74 use aliased 'App::SeismicUnixGui::misc::grey_flow';
75 use App::SeismicUnixGui::misc::blue_flow '0.0.4';
76 use aliased 'App::SeismicUnixGui::misc::blue_flow';
77 use App::SeismicUnixGui::misc::pink_flow '0.0.4';
78 use aliased 'App::SeismicUnixGui::misc::pink_flow';
79 use App::SeismicUnixGui::misc::green_flow '0.0.4';
80 use aliased 'App::SeismicUnixGui::misc::green_flow';
81 use App::SeismicUnixGui::misc::neutral_flow '0.0.4';
82 use aliased 'App::SeismicUnixGui::misc::neutral_flow';
83  
84 my $color_listbox = color_listbox->new();
85 my $gui_history = gui_history->new();
86 my $file_dialog = file_dialog->new();
87 my $flow_widgets = flow_widgets->new();
88 my $get = L_SU_global_constants->new();
89  
90 my $pre_built_big_stream = pre_built_big_stream->new();
91 my $L_SU_href = $gui_history->get_defaults();
92  
93 my $flow_type = $get->flow_type_href();
94 my $save_button = save_button->new();
95 my $run_button = run_button->new();
96 my $message_director = message_director->new();
97  
98 =head2
99 ------------------------------------------------------------
100 Instantiate flow objects for each color and store them in a hash
101 Keys are color names; values are object instances of their modules
102 ------------------------------------------------------------
103 =cut
104  
105 my $color_flow_h = {
106 'grey' => grey_flow->new(), # user-built "pink" flow
107 'pink' => pink_flow->new(), # user-built "pink" flow
108 'green' => green_flow->new(), # user-built "green" flow
109 'blue' => blue_flow->new(), # user-built "blue" flow
110 'neutral' => neutral_flow->new(), # "neutral" flow, used for system tasks
111 };
112  
113 my ( $mw);
114 my ( $parameter_values_button_frame);
115 my ( $parameter_names_frame, $parameter_values_frame );
116 my (
117 $flow_listbox_grey_w, $flow_listbox_pink_w,
118 $flow_listbox_green_w, $flow_listbox_blue_w
119 );
120 my (
121 $flow_name_grey_w, $flow_name_pink_w,
122 $flow_name_green_w, $flow_name_blue_w
123 );
124 my ($flowNsuperflow_name_w);
125 my $gui_history_aref;
126  
127 my $is_pre_built_superflow;
128 my $is_user_built_flow;
129  
130 my ( $set_run_button_w, $save_button_w, $message_w );
131 my ($sunix_listbox);
132 my (
133 $add2flow_button_grey, $add2flow_button_pink,
134 $add2flow_button_green, $add2flow_button_blue
135 );
136  
137 my $var = $get->var();
138 my $alias_superflow_names_h = $get->alias_superflow_names_h();
139 my $alias_help_menubutton_label_h = $get->alias_help_menubutton_label_h();
140 my $false = $var->{_false};
141 my $neutral = $var->{_neutral};
142 my $no = $var->{_no};
143 my $on = $var->{_on};
144 my $superflow_names = $get->superflow_names_h();
145 my $true = $var->{_true};
146 my $yes = $var->{_yes};
147  
148 =head2 defaults
149  
150 =cut
151  
152 my $my_dialogs_ans4ok_default = $yes;
153 my $my_dialogs_ans4cancel_default = $no;
154  
155 =head2 declare private variables
156  
157 =cut
158  
159 =head2 private hash
160 to manage listbox occupation
161  
162 =cut
163  
164 my $L_SU_gui = {
165  
166 _occupied_listbox_aref => $color_listbox->get_flow_listbox_occupancy_aref(),
167 _vacant_listbox_aref => $color_listbox->get_flow_listbox_vacancy_aref(),
168 _my_dialogs_ans4cancel => $my_dialogs_ans4cancel_default,
169 _my_dialogs_ans4ok => $my_dialogs_ans4ok_default,
170 };
171  
172 =head2
173  
174 Opening a file of folder for a superflow
175 Only superflow bindings use this private (' _') subroutine.
176 Superflows that are opening Data files from GUI are directed here
177
178 FileDialog_button is mainly used for user-built flows
179 and directs superflows
180 to _FileDialog_button
181
182 For safety, place set_hash_ref first
183 $$dialog_type_sref can be Data, Save or SaveAs
184  
185 =cut
186  
187 sub _FileDialog_button {
188 my ( $self, $dialog_type_sref ) = @_;
189  
190 if ( length $dialog_type_sref ) {
191 $L_SU_href->{_dialog_type} = $$dialog_type_sref;
192 $file_dialog->set_hash_ref($L_SU_href);
193 $file_dialog->FileDialog_director();
194 $L_SU_href = $file_dialog->get_hash_ref();
195 }
196 else {
197 print(
198 "L_SU, for superflows only, _FileDialog_button (binding),option type missing "
199 );
200 }
201 return ();
202 }
203  
204 =head2 sub _get_flow_color
205  
206 =cut
207  
208 sub _get_flow_color {
209 my ($self) = @_;
210 my $color;
211 if ( $L_SU_href->{_flow_color} ) {
212 $color = $L_SU_href->{_flow_color};
213 return ($color);
214 }
215 else {
216 $color = '';
217 return ($color);
218 }
219 }
220  
221 =head2 sub _set_flow_color
222  
223 set the flow color even if it is blank (=no color))
224  
225 =cut
226  
227 sub _set_flow_color {
228 my ($color) = @_;
229  
230 if ( $color or $color eq '' ) {
231 $L_SU_href->{_flow_color} = $color;
232 }
233 else {
234 print("L_SU,_set_flow_color, missing color \n");
235 }
236 return ();
237 }
238  
239  
240 =head2 sub _set_flow_listbox_color_w
241  
242 =cut
243  
244 sub _set_flow_listbox_color_w {
245 my ($color) = @_;
246  
247 my %color_key_map = (
248 grey => '_is_flow_listbox_grey_w',
249 pink => '_is_flow_listbox_pink_w',
250 green => '_is_flow_listbox_green_w',
251 blue => '_is_flow_listbox_blue_w',
252 );
253  
254 if ( exists $color_key_map{$color} ) {
255 my $key = $color_key_map{$color};
256 $L_SU_href->{$key} = $true;
257 # print("L_SU,_set_flow_listbox, color:$color\n");
258 }
259 else {
260 print("L_SU,_set_flow_listbox, missing or invalid color: $color\n");
261 }
262  
263 # TBD
264 # if ( $color eq 'grey' ) {
265  
266 # $L_SU_href->{_is_flow_listbox_grey_w} = $true;
267  
268 # # print("1. L_SU,_set_flow_listbox, color:$color \n");
269  
270 # }
271 # elsif ( $color eq 'pink' ) {
272  
273 # $L_SU_href->{_is_flow_listbox_pink_w} = $true;
274  
275 # # print("L_SU,_set_flow_listbox, color:$color\n");
276  
277 # }
278 # elsif ( $color eq 'green' ) {
279  
280 # # print("L_SU,_set_flow_listbox, color:$color\n");
281 # $L_SU_href->{_is_flow_listbox_green_w} = $true;
282  
283 # }
284 # elsif ( $color eq 'blue' ) {
285  
286 # # print("L_SU,_set_flow_listbox, color:$color\n");
287 # $L_SU_href->{_is_flow_listbox_blue_w} = $true;
288  
289 # }
290 # else {
291 # print("L_SU,_set_flow_listbox, missing color \n");
292 # }
293 return ();
294 }
295  
296 =head2 sub _unset_pre_built_userflow_type
297  
298 =cut
299  
300 sub _unset_pre_built_superflow_type {
301  
302 my ($self) = @_;
303  
304 $L_SU_href->{_is_pre_built_superflow} = $false;
305  
306 return ();
307 }
308  
309 =head2 sub _set_user_built_flow_type
310  
311 =cut
312  
313 sub _set_user_built_flow_type {
314  
315 my ($self) = @_;
316  
317 $L_SU_href->{_flow_type} = $flow_type->{_user_built};
318 $L_SU_href->{_is_user_built_flow} = $true;
319  
320 return ();
321 }
322  
323 =head2 sub _FileDialog_button_Delete
324  
325 is color-listbox-neutral
326
327 =cut
328  
329 sub _FileDialog_button_Delete {
330  
331 my ( $self, $dialog_type_sref ) = @_;
332  
333 # opens file and populates GUI
334 my $color = 'neutral';
335 $L_SU_href->{_flow_color} = $color_flow_h->{$color}->get_flow_color();
336 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
337 $color_flow_h->{$color}->FileDialog_button($dialog_type_sref);
338  
339 # $L_SU_href->{_flow_color} = $grey_flow->get_flow_color();
340  
341 return ();
342  
343 }
344  
345 =head2 sub _FileDialog_button_Open
346
347 =cut
348  
349 sub _FileDialog_button_Open {
350  
351 my ($dialog_type_sref) = @_;
352  
353 my $color;
354  
355 # print("L_SU,FileDialog_button, CASE 1 print gui_history.txt\n");
356 # $gui_history->view();
357  
358 # print("CASE 1 in prep for CASE 4; dialog_type=$$dialog_type_sref\n");
359  
360 # after just working with a pre-built superflow
361 # but before opening a user-built flow
362  
363 if ( $$dialog_type_sref eq 'Open'
364 && $L_SU_href->{_flow_type} eq 'pre_built_superflow'
365 && !( $L_SU_href->{_is_flow_listbox_grey_w} )
366 && !( $L_SU_href->{_is_flow_listbox_pink_w} )
367 && !( $L_SU_href->{_is_flow_listbox_green_w} )
368 && !( $L_SU_href->{_is_flow_listbox_blue_w} ) )
369 {
370  
371 ## print("CASE 1 L_SU,FileDialog_button, _flow_type: $L_SU_href->{_flow_type}\n");
372 # print("CASE 1 L_SU, FileDialog_button, color is $color\n");
373  
374 # Default selected flow box color is 'grey'for now,
375 # but the default can be changed in L_SU_global_constants
376 my $which_color = $var->{_color_default};
377 _set_flow_color($which_color);
378 _set_flow_listbox_color_w($which_color);
379 _unset_pre_built_superflow_type();
380 _set_user_built_flow_type();
381 $color = $which_color;
382  
383 }
384 elsif ( $$dialog_type_sref eq 'Open' ) {
385  
386 # print("CASE 2 in prep for CASE 4\n");
387 # After selecting a sunix program and before
388 # flow selection:
389 # select the color of the flow to fill automatically
390 # either picked by user immediately before or, if not,
391 # pick grey as the default.
392 # But, if grey is occupied, send a warning message to the user
393 # to say that the current grey will be overwritten
394 # and that the prior flow will not be saved automatically
395 # Color was either
396 # (1) selected prevsiously, or is
397 # (2) not yet occupied
398 ## my $next_available_color = $color_listbox->get_next_available_flow_listbox_color();
399 ## $color_listbox->set_next_available_flow_listbox_color($next_available_color);
400  
401 $color_listbox->set_flow_listbox_next_available_occupancyNvacancy_aref(
402 $L_SU_gui->{_occupied_listbox_aref} );
403 my $next_available_color =
404 $color_listbox->get_flow_listbox_vacancy_color();
405 my $vacancy = $color_listbox->is_vacant_listbox($next_available_color);
406  
407 if ( $vacancy eq $true ) {
408  
409 _set_flow_color($next_available_color);
410 _set_flow_listbox_color_w($next_available_color);
411 _unset_pre_built_superflow_type();
412 _set_user_built_flow_type();
413 $color = $next_available_color;
414  
415 # print(
416 #"CASE 2 I.L_SU,FileDialog_button, $next_available_color will be occupied\n"
417 # );
418  
419 }
420 elsif ( $vacancy eq $false ) {
421  
422 $color_listbox
423 ->set_flow_listbox_next_available_occupancyNvacancy_aref(
424 $L_SU_gui->{_occupied_listbox_aref} );
425 my $which_color = $color_listbox->get_flow_listbox_vacancy_color();
426  
427 # print(
428 # "CASE 2 II.L_SU,FileDialog_button, $which_color is available\n"
429 # );
430 $color_listbox->set_flow_listbox_color2check($next_available_color);
431 my $ans = $color_listbox->is_flow_listbox_color_available();
432  
433 # print("CASE 2 III.L_SU,FileDialog_button, ans=$ans\n");
434  
435 if ( $ans == $true ) {
436  
437 # CASE of an unoccupied color listbox
438 # print("CASE 2A L_SU,FileDialog_button, ans=$ans\n");
439 _set_flow_color($which_color);
440 _set_flow_listbox_color_w($which_color);
441 _unset_pre_built_superflow_type();
442 _set_user_built_flow_type();
443 $color = $which_color;
444  
445 }
446 elsif ( $ans == $false ) {
447  
448 # CASE 2B of a selected colored box that is ALREADY occupied
449 $color_listbox->my_dialogs( 'color_listbox', 0 );
450 $L_SU_gui->{_my_dialogs_ans4cancel} =
451 $color_listbox->get_my_dialog_cancel_click();
452 $L_SU_gui->{_my_dialogs_ans4ok} =
453 $color_listbox->get_my_dialog_ok_click();
454  
455 # print(
456 # "L_SU, FileDialog,CASE 2B L_SU_gui->{_my_dialogs_ans4cancel}= $L_SU_gui->{_my_dialogs_ans4cancel}\n"
457 # );
458 # print("L_SU, FileDialog,CASE 2B L_SU_gui->{_my_dialogs_ans4ok}=$L_SU_gui->{_my_dialogs_ans4ok}\n");
459  
460 # reset clicks after using my_dialogs
461 $color_listbox->set_my_dialog_ok_click($no);
462 $color_listbox->set_my_dialog_cancel_click($no);
463 $color_listbox->set_my_dialog_box_click($no);
464  
465 if ( length $L_SU_gui->{_my_dialogs_ans4cancel}
466 && length $L_SU_gui->{_my_dialogs_ans4ok} )
467 {
468  
469 if ( $L_SU_gui->{_my_dialogs_ans4ok} eq $yes ) {
470  
471 # CASE 2B.1; now becomes same as CASE 2A
472 # overwrite visible flow
473 # print("L_SU, FileDialog,CASE 2B.1\n");
474 _set_flow_color($which_color);
475 _set_flow_listbox_color_w($which_color);
476 _unset_pre_built_superflow_type();
477 _set_user_built_flow_type();
478 $color = $which_color;
479  
480 }
481 elsif ( $L_SU_gui->{_my_dialogs_ans4cancel} eq $yes ) {
482  
483 # CASE 2B.2
484 # User has another go
485 # print("L_SU, FileDialog,CASE 2B.2, Cancel selected NADA \n");
486  
487 }
488 else {
489 print("L_SU, FileDialog,CASE 2B.2, unexpected \n");
490 }
491  
492 }
493 else {
494 print("L_SU, FileDialog, dialogs exist\n");
495 }
496  
497 }
498 else {
499 print("L_SU, FileDialog_button, unexpected answer\n");
500 } # end of whether answers exists
501  
502 }
503 else {
504 print(
505 "CASE 0 L_SU, FileDialog_button, color to occupy (if vacant already) = $color \n"
506 );
507 }
508  
509 }
510 else {
511 # print("L_SU,FileDialog_button, end of Open\n");
512 } # end all CASES 1 through 2.X
513  
514 if ( not $color ) {
515  
516 $color = _get_flow_color();
517  
518 }
519 else {
520 # print("L_SU, FileDialog_button, Good, color already chosen: $color \n");
521 # NADA
522 }
523  
524 if (
525 ( $L_SU_gui->{_my_dialogs_ans4cancel} eq $no )
526  
527 && ( $L_SU_gui->{_my_dialogs_ans4ok} eq $yes )
528 && $color
529 && ( $L_SU_href->{_is_flow_listbox_grey_w}
530 || $L_SU_href->{_is_flow_listbox_pink_w}
531 || $L_SU_href->{_is_flow_listbox_green_w}
532 || $L_SU_href->{_is_flow_listbox_blue_w}
533 || ( $L_SU_href->{_flow_type} eq 'user_built' && $color ) )
534 )
535 {
536  
537 # CASES 3A-3D
538 # General case of user-built flows in grey, pink, green or blue.
539 #
540 # = 'neutral', when flow listbox is not a color and sunix_select is selected
541 # but add2flow_button has not been activated
542 #
543 # = nothing, if chosen before a colored flow exists,
544 # when coming from a user-built flow
545 #
546 # = neutral, when superflow Data is chosen
547 #
548 if ( $L_SU_href->{_is_flow_listbox_grey_w}
549 && $color eq 'grey' )
550 { # for added certainty
551  
552 # CASE 3A
553 # mark the neutral-colored flow as unused
554 # helps bind flow parameters to the opening files
555  
556 $color_listbox->set_next_available_flow_listbox_color($color);
557 my $which_color =
558 $color_listbox->get_next_available_flow_listbox_color();
559  
560 # print(
561 # "CASE 3A L_SU, FileDialog_button, the next available listbox color is set as: $color\n"
562 # );
563  
564 # print("1. L_SU,FileDialog_button, color is $L_SU_href->{_flow_color}\n");
565 # print("CASE 3A 1.L_SU, FileDialogS_button, $which_color will be occupied\n");
566  
567 # opens file and populates GUI
568 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
569 $color_flow_h->{$color}->FileDialog_button($dialog_type_sref);
570 $L_SU_href->{_flow_color} = $color_flow_h->{$color}->get_flow_color();
571 my $Flow_file_exists = $color_flow_h->{$color}->get_Flow_file_exists();
572 my $perl_flow_errors = $color_flow_h->{$color}->get_perl_flow_errors();
573  
574 if ( $Flow_file_exists
575 && $perl_flow_errors eq $false )
576 {
577  
578 # only confirm occupation/vacancy AFTER file is read into GUI
579 # update any newly added listboxes for all case 3A
580 $color_listbox->set_flow_listbox_color($color);
581 $L_SU_gui->{_occupied_listbox_aref} =
582 $color_listbox->get_flow_listbox_occupancy_aref();
583 $L_SU_gui->{_vacant_listbox_aref} =
584 $color_listbox->get_flow_listbox_vacancy_aref();
585  
586 # print(
587 # "Successful read Case 3A L_SU,FileDialog_button, L_SU_gui->{_occupied_listbox_aref},@{$L_SU_gui->{_occupied_listbox_aref}}\n"
588 # );
589 # print(
590 # "Successful read Case 3A L_SU,FileDialog_button, L_SU_gui->{_vacant_listbox_aref},@{$L_SU_gui->{_vacant_listbox_aref}}\n"
591 # );
592 #
593 }
594 else {
595 # if flow is not successful, occupied and vacant listbox need not be set
596 $color_listbox->set_prior_available_flow_listbox_color($color);
597  
598 # print(
599 # "Non-successful read Case 3A L_SU,FileDialog_button, L_SU_gui->{_occupied_listbox_aref},@{$L_SU_gui->{_occupied_listbox_aref}}\n"
600 # );
601 # print(
602 # "Non-successful read Case 3A L_SU,FileDialog_button, L_SU_gui->{_vacant_listbox_aref},@{$L_SU_gui->{_vacant_listbox_aref}}\n"
603 # );
604  
605 }
606  
607 }
608 elsif ($L_SU_href->{_is_flow_listbox_pink_w}
609 && $color eq 'pink' )
610 { # for added certainty
611 # CASE 3B - pink flow box
612 # mark the neutral-colored flow as unused
613 # helps bind flow parameters to the opening files
614  
615 $color_listbox->set_next_available_flow_listbox_color($color);
616 my $which_color =
617 $color_listbox->get_next_available_flow_listbox_color();
618  
619 # print("CASE 3B _SU, FileDialog_button, the next available listbox color is set as: $color\n");
620 # print("1. L_SU,FileDialog_button, color is $L_SU_href->{_flow_color}\n");
621 # print("CASE 3B 1.L_SU,FileDialog_button, $which_color will be occupied\n");
622  
623 # opens file and populates GUI
624 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
625 $color_flow_h->{$color}->FileDialog_button($dialog_type_sref);
626 $L_SU_href->{_flow_color} = $color_flow_h->{$color}->get_flow_color();
627 my $Flow_file_exists = $color_flow_h->{$color}->get_Flow_file_exists();
628 my $perl_flow_errors = $color_flow_h->{$color}->get_perl_flow_errors();
629  
630 if ( $Flow_file_exists
631 && $perl_flow_errors eq $false )
632 {
633 #
634 # only confirm occupation/vacancy AFTER file is read into GUI
635 # update any newly added listboxes for all case 3B
636 $color_listbox->set_flow_listbox_color($color);
637  
638 $L_SU_gui->{_occupied_listbox_aref} =
639 $color_listbox->get_flow_listbox_occupancy_aref();
640 $L_SU_gui->{_vacant_listbox_aref} =
641 $color_listbox->get_flow_listbox_vacancy_aref();
642  
643 # print(
644 # "Successful read Case 3B L_SU,FileDialog_button, L_SU_gui->{_occupied_listbox_aref},@{$L_SU_gui->{_occupied_listbox_aref}}\n"
645 # );
646 # print(
647 # "Successful read Case 3B L_SU,FileDialog_button, L_SU_gui->{_vacant_listbox_aref},@{$L_SU_gui->{_vacant_listbox_aref}}\n"
648 # );
649  
650 }
651 else {
652 # if flow is not successful, occupied and vacant listbox need not be set
653 $color_listbox->set_prior_available_flow_listbox_color(
654 _get_flow_color() );
655  
656 # print(
657 # "Non-successful read Case 3B L_SU,FileDialog_button, L_SU_gui->{_occupied_listbox_aref},@{$L_SU_gui->{_occupied_listbox_aref}}\n"
658 # );
659 # print(
660 # "Non-successful read Case 3B L_SU,FileDialog_button, L_SU_gui->{_vacant_listbox_aref},@{$L_SU_gui->{_vacant_listbox_aref}}\n"
661 # );
662  
663 }
664  
665 }
666 elsif ($L_SU_href->{_is_flow_listbox_green_w}
667 && $color eq 'green' )
668 { # more certainty
669 # CASE 3C - green flow box
670 # mark the neutral-colored flow as unused
671 # helps bind flow parameters to the opening files
672  
673 $color_listbox->set_next_available_flow_listbox_color($color);
674 my $which_color =
675 $color_listbox->get_next_available_flow_listbox_color();
676  
677 # print("CASE 3C L_SU, _SU, FileDialog_button, the next available listbox color is set as: $color\n");;
678 # print("1. L_SU,FileDialog_button, color is $L_SU_href->{_flow_color}\n");
679 # print("CASE 3C 1.L_SU,FileDialog_button, $which_color will be occupied\n");
680 #
681 # opens file and populates GUI
682 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
683 $color_flow_h->{$color}->FileDialog_button($dialog_type_sref);
684 $L_SU_href->{_flow_color} = $color_flow_h->{$color}->get_flow_color();
685 my $Flow_file_exists = $color_flow_h->{$color}->get_Flow_file_exists();
686 my $perl_flow_errors = $color_flow_h->{$color}->get_perl_flow_errors();
687  
688 if ( $Flow_file_exists
689 && $perl_flow_errors eq $false )
690 {
691  
692 # only confirm occupation/vacancy AFTER file is read into GUI
693 # update any newly added listboxes for all case 3C
694 $color_listbox->set_flow_listbox_color($color);
695  
696 $L_SU_gui->{_occupied_listbox_aref} =
697 $color_listbox->get_flow_listbox_occupancy_aref();
698 $L_SU_gui->{_vacant_listbox_aref} =
699 $color_listbox->get_flow_listbox_vacancy_aref();
700  
701 # print(
702 # "Successful read Case 3C L_SU,FileDialog_button, L_SU_gui->{_occupied_listbox_aref},@{$L_SU_gui->{_occupied_listbox_aref}}\n"
703 # );
704 # print(
705 # "Successful read Case 3C L_SU,FileDialog_button, L_SU_gui->{_vacant_listbox_aref},@{$L_SU_gui->{_vacant_listbox_aref}}\n"
706 # );
707  
708 }
709 else {
710 # if flow is not successful, occupied and vacant listbox need not be set
711 $color_listbox->set_prior_available_flow_listbox_color(
712 _get_flow_color() );
713  
714 # print(
715 # "Non-Successful read Case 3C L_SU,FileDialog_button, L_SU_gui->{_occupied_listbox_aref},@{$L_SU_gui->{_occupied_listbox_aref}}\n"
716 # );
717 # print(
718 # "Non-Successful read Case 3C L_SU,FileDialog_button, L_SU_gui->{_vacant_listbox_aref},@{$L_SU_gui->{_vacant_listbox_aref}}\n"
719 # );
720 }
721  
722 }
723 elsif ($L_SU_href->{_is_flow_listbox_blue_w}
724 && $color eq 'blue' )
725 { # more certainty
726 # CASE 3D - blue flow box
727 # mark the neutral-colored flow as unused
728 # helps bind flow parameters to the opening files
729  
730 $color_listbox->set_next_available_flow_listbox_color($color);
731 my $which_color =
732 $color_listbox->get_next_available_flow_listbox_color();
733  
734 # print("CASE 3D L_SU, FileDialog_button, the next available listbox color is set as: $color\n");
735 # print("1. L_SU,FileDialog_button, color is $L_SU_href->{_flow_color}\n");
736 # print("CASE 3D 1.L_SU,FileDialog_button, $which_color will be occupied\n");
737  
738 # opens file and populates GUI
739 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
740 $color_flow_h->{$color}->FileDialog_button($dialog_type_sref);
741 $L_SU_href->{_flow_color} = $color_flow_h->{$color}->get_flow_color();
742 my $Flow_file_exists = $color_flow_h->{$color}->get_Flow_file_exists();
743 my $perl_flow_errors = $color_flow_h->{$color}->get_perl_flow_errors();
744  
745 if ( $Flow_file_exists
746 && $perl_flow_errors eq $false )
747 {
748  
749 # only confirm occupation / vacancy AFTER file is read into GUI update any newly added listboxes
750 # for all case 3 D
751 $color_listbox->set_flow_listbox_color($color);
752 $L_SU_gui->{_occupied_listbox_aref} =
753 $color_listbox->get_flow_listbox_occupancy_aref();
754 $L_SU_gui->{_vacant_listbox_aref} =
755 $color_listbox->get_flow_listbox_vacancy_aref();
756  
757 # print(
758 # "Successful read Case 3D L_SU,FileDialog_button, L_SU_gui->{_occupied_listbox_aref},@{$L_SU_gui->{_occupied_listbox_aref}}\n"
759 # );
760 # print(
761 # "Successful read Case 3D L_SU,FileDialog_button, L_SU_gui->{_vacant_listbox_aref},@{$L_SU_gui->{_vacant_listbox_aref}}\n"
762 # );
763  
764 }
765 else {
766 # if flow is not successful, occupied and vacant listbox need not be set
767 $color_listbox->set_prior_available_flow_listbox_color(
768 _get_flow_color() );
769  
770 # print(
771 # "Non-Successful read Case 3D L_SU,FileDialog_button, L_SU_gui->{_occupied_listbox_aref},@{$L_SU_gui->{_occupied_listbox_aref}}\n"
772 # );
773 # print(
774 # "Non-Successful read Case 3D L_SU,FileDialog_button, L_SU_gui->{_vacant_listbox_aref},@{$L_SU_gui->{_vacant_listbox_aref}}\n"
775 # );
776 }
777  
778 }
779 else {
780 print("L_SU, FileDialog_button, unexpected missing settings \n");
781 }
782  
783 }
784 elsif ( $L_SU_href->{_flow_type} eq 'pre_built_superflow' ) {
785  
786 # CASE 4
787 # when GUI opens Data for a superflow
788 # deprecated 1.19.23
789 print(
790 "CASE 4, L_SU,FileDialog_button,dialog type= $$dialog_type_sref");
791  
792 $L_SU_href->{_dialog_type} = $$dialog_type_sref;
793 $file_dialog->set_hash_ref($L_SU_href);
794 $file_dialog->FileDialog_director();
795 $L_SU_href = $file_dialog->get_hash_ref();
796  
797 }
798 elsif (( $L_SU_gui->{_my_dialogs_ans4cancel} eq $yes )
799 && ( $L_SU_gui->{_my_dialogs_ans4ok} eq $no ) )
800 {
801  
802 # print("CASE 5, where user skips opening a perl file and overwriting an existant flow\n");
803 # NADA
804  
805 }
806 elsif (
807 not $color
808 && ( $L_SU_href->{_flow_type} eq 'user_built_flow' )
809 && ( $L_SU_gui->{_my_dialogs_ans4cancel} eq
810 $my_dialogs_ans4cancel_default )
811 && ( $L_SU_gui->{_my_dialogs_ans4ok} eq $my_dialogs_ans4ok_default )
812 )
813 {
814  
815 # print("L_SU,FileDialog_button, Case 6\n");
816  
817 # CASE 6
818 # Flow when program opens a (pre-existing) user-built perl flow
819 # and user flows are already in progress
820 # but no color or colored listbox is active,
821  
822 $color_listbox->set_flow_listbox_color( _get_flow_color() );
823 $L_SU_gui->{_occupied_listbox_aref} =
824 $color_listbox->get_flow_listbox_occupancy_aref();
825 $L_SU_gui->{_vacant_listbox_aref} =
826 $color_listbox->get_flow_listbox_vacancy_aref();
827 my $which_color = $color_listbox->get_flow_listbox_vacancy_color();
828  
829 _set_flow_color($which_color);
830 _set_flow_listbox_color_w($which_color);
831 _unset_pre_built_superflow_type();
832  
833 _set_user_built_flow_type();
834  
835 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
836 $color_flow_h->{$color}->FileDialog_button($dialog_type_sref);
837 $L_SU_href->{_flow_color} = $color_flow_h->{$color}->get_flow_color();
838  
839 }
840 else {
841 # print("6. L_SU, FileDialog_button, not a color: $color \n");
842 # print("6. L_SU, FileDialog_button, missing color, and flow types \n");
843 } # end user-built flow (2 types) or superflow (or user) 1 type)
844  
845 return ();
846  
847 } # end sub _FileDialog_button
848  
849 =head2 sub FileDialog_button
850  
851 (1) For user-built flows.
852 (2) Interactively choose a file name
853 that will then be entered into the
854 values of the parameter frame and
855 stored away via param_flow
856 for colored flows: grey, pink, blue, green
857  
858 (3) Set conditions for the use of a FileDialog_button
859 i.e., find out which prior widget invoked the FileDialog_button
860 e.g., was it a user-built flow or a superflow?
861  
862 print("L_SU,FileDialog_button parameter_values_frame: $L_SU_href->{_parameter_values_frame}\n");
863 print("L_SU,FileDialog_button parameter_values_frame: $parameter_values_frame\n");
864
865 (4) dialog_type is one of 3 topics: 'Data ', (open a)
866 Open (open a user-built perl flow) or'SaveAs 'a user-built perl flow)
867 or 'Delete' any file
868
869 (5) The Save (main) option goes straight to the L_SU,save_button for both'
870 user_built'and 'pre_built_superflow'
871  
872 (6) flow_type can be 'user_built'or 'pre_built_superflow '
873 (7) for safety, place set_hash_ref first
874
875 (8) Each colored flow will be directed to a different program
876  
877 foreach my $key (sort keys %$L_SU_href) {
878 print (" L_SU,FileDialog_button, key is $key, value is $L_SU_href->{$key}\n");
879 }
880
881 (9) The number of values and names = what is read from the configuration file
882 After FileDialog is run, the number of values and names = max default value,
883 because param_widgets are chosen inside file_dialog
884 This action is justified because I chose to determine independently # variables
885 from the param_widget which is defaulted to a large number
886 (so that we know in advance how many value are occupied without reading SeismicUnixPltTk_global_cosntants.pm
887 The "large number" can be changed within L_SU_global_constants.
888  
889 =cut
890  
891 sub FileDialog_button {
892  
893 my ( $self, $dialog_type_sref ) = @_;
894  
895 my $dialog_type = $$dialog_type_sref;
896  
897 my $private_module = '_FileDialog_button_' . $dialog_type;
898  
899 if ( $dialog_type eq 'Open'
900 or $dialog_type eq 'SaveAs' )
901 {
902  
903 _FileDialog_button_Open($dialog_type_sref);
904  
905 # a file has just been opened
906 # print("1. L_SU,FileDialog_button_Open, print out gui_history\n");
907 # $gui_history->view();
908  
909 }
910 else {
911 # such as case for 'Delete'
912 $self->$private_module($dialog_type_sref);
913 }
914  
915 return ();
916 }
917  
918 =head2 sub get_help
919  
920 Callback sequence following MB3 click
921 activation of a sunix (Listbox) item.
922 Program name is a scalar reference
923
924 Allow this subroutine help decide whether it is a superflow
925 or a user-created flow
926
927 Show a window with the perldoc to the user
928
929 =cut
930  
931 sub get_help {
932  
933 my ($self) = @_;
934  
935 my $decisions = decisions->new();
936 my $pre_req_ok;
937 $L_SU_href->{_is_pre_built_superflow} = $true; # helps decisions
938  
939 $decisions->set4help($L_SU_href);
940 $pre_req_ok = $decisions->get4help();
941  
942 if (
943 $pre_req_ok
944 and length $L_SU_href->{_prog_name_sref}
945 and length $L_SU_href->{_current_program_name}
946 and ( $L_SU_href->{_current_program_name} eq
947 ${ $L_SU_href->{_prog_name_sref} } )
948 )
949 {
950  
951 my $help = help->new();
952  
953 my $prog_name = ${ $L_SU_href->{_prog_name_sref} };
954 my $alias = $alias_superflow_names_h->{$prog_name};
955 my $SeismicUnixGui = $get->get_path4SeismicUnixGui();
956 my $PATH = $SeismicUnixGui . '/big_streams';
957  
958 # print("L_SU,help,alias: $PATH/$alias $var->{_suffix_pl}\n");
959  
960 my $inbound = $PATH . '/' . $alias . $var->{_suffix_pl};
961 $help->set_name( \$inbound );
962 $help->tkpod();
963  
964 }
965 else {
966 print("L_SU, can not provide help\n");
967 print("L_SU, prog_name=$L_SU_href->{_prog_name_sref}\n");
968 }
969  
970 return ();
971 }
972  
973 =head2 sub help_menubutton
974  
975 Callback sequence following MB1 (regular)
976 click activation of a help_menubutton item.
977 Program name is a scalar reference
978
979 Allow this subroutine help_menubutton
980 to select action e.g., open
981 a perldoc file for information
982
983 =cut
984  
985 sub help_menubutton {
986  
987 my ( $self, $install_option_ref ) = @_;
988  
989 my $help_menubutton_type = $get->help_menubutton_type_href();
990  
991 if ( length $install_option_ref ) {
992  
993 if ( $$install_option_ref eq $help_menubutton_type->{_About} )
994 {
995  
996 my $item = $alias_help_menubutton_label_h->{_About};
997 my $message = $message_director->help_button($item);
998  
999 }
1000 elsif ( $$install_option_ref eq
1001 $help_menubutton_type->{_InstallationGuide} )
1002 {
1003  
1004 my $item = $alias_help_menubutton_label_h->{_InstallationGuide};
1005 my $message = $message_director->help_button_pdf($item);
1006  
1007 }
1008 elsif ( $$install_option_ref eq $help_menubutton_type->{_Tutorial} )
1009 {
1010  
1011 my $item = $alias_help_menubutton_label_h->{_Tutorial};
1012 my $message = $message_director->help_button_pdf($item);
1013  
1014 }
1015 else {
1016 carp("L_SU, can not provide help\n");
1017 print("Help button option = $$install_option_ref\n");
1018 }
1019  
1020 }
1021 else {
1022 carp("L_SU, help_menubutton\n");
1023 print("missing value\n");
1024 }
1025  
1026 return ();
1027 }
1028  
1029  
1030 =head2 sub initialize my dialogs
1031  
1032 Create widgets that show messages
1033 Show warnings or errors in a message box
1034 Message box is defined in main where it is
1035 also made invisible (withdraw)
1036 Here we turn on the message box (deiconify, raise)
1037 The message does not release the program
1038 until OK or cancels clicked and wait variable changes
1039 from no/yes to yes/no.
1040  
1041 =cut
1042  
1043 sub initialize_my_dialogs {
1044 my ( $self, $ok_button, $label, $cancel_button, $top_level ) = @_;
1045  
1046 if ( length $ok_button
1047 && length $label
1048 && $cancel_button
1049 && $top_level )
1050 {
1051  
1052 # $color_listbox->set_hash_ref($L_SU_href);
1053 $color_listbox->initialize_my_dialogs( $ok_button, $label,
1054 $cancel_button, $top_level );
1055  
1056 }
1057 else {
1058 print("L_SU,initialize_my_dialogs, missing widgets\n");
1059 }
1060 return ();
1061 }
1062  
1063 =head2 sub initialize messages
1064  
1065 Create widgets that show messages
1066 Show warnings or errors in a message box
1067 Message box is defined in main where it is
1068 also made invisible (withdraw)
1069 Here we turn on the message box (deiconify, raise)
1070 The message does not release the program
1071 until OK is clicked and wait variable changes from yes
1072 to no.
1073  
1074 =cut
1075  
1076 sub initialize_messages {
1077 my ($self) = @_;
1078  
1079 $color_listbox->set_hash_ref($L_SU_href);
1080 $color_listbox->initialize_messages();
1081  
1082 return ();
1083 }
1084  
1085 =head2 sub pre_built_superflows
1086
1087 scalar reference:
1088 print("LSU_Tk,superflow_select,prog_name: ${$L_SU_href->{_prog_name_sref}}\n");
1089 array reference:
1090 print("LSU_Tk,superflow_select: _names_aref @{$L_SU_href->{_names_aref}}\n");
1091 sets flow type = pre-built superflow
1092
1093 # print complete hash
1094 while (my ( $key,$value ) = each %{$L_SU_href} ){
1095 print ("$key \t\t=> $value\n");
1096 }
1097  
1098 binding needs:
1099 $pre_built_big_stream ->select();
1100 $pre_built_big_stream ->set_sub_ref
1101 $pre_built_big_stream ->set_flowNsuperflow_name_w displays superflow name at top of gui
1102
1103 );
1104  
1105 foreach my $key (sort keys %$L_SU_href) {
1106 print (" file_dialog,key is $key, value is $L_SU_href->{$key}\n");
1107
1108 =cut
1109  
1110 sub pre_built_superflows {
1111 my ( $self, $superflow_name_sref ) = @_;
1112  
1113 # print("1113. L_SU,pre_built_superflows ,superflow_name_sref=$$superflow_name_sref\n");
1114  
1115 if ($superflow_name_sref) {
1116  
1117 $L_SU_href->{_prog_name_sref} = $superflow_name_sref;
1118 $gui_history->set_hash_ref($L_SU_href);
1119 $gui_history->set4superflow_open_data_file_start();
1120 $L_SU_href = $gui_history->get_hash_ref();
1121 $pre_built_big_stream->set_hash_ref($L_SU_href);
1122  
1123 # displays superflow name at top of gui
1124 $pre_built_big_stream->set_flowNsuperflow_name_w(
1125 $flowNsuperflow_name_w);
1126  
1127 # for binding to file dialog options
1128 my $sub_ref = \&_FileDialog_button;
1129 $pre_built_big_stream->set_sub_ref($sub_ref);
1130  
1131 # print("1162 L_SU,pre_built_superflows, gui_history.txt\n");
1132 # $gui_history->view();
1133  
1134 # display parameters values and names
1135 # of a chosen superflow
1136 # but do not write them to a file
1137 $pre_built_big_stream->select();
1138  
1139 # print("41 L_SU,pre_built_superflows, parameter_values_frame: $L_SU_href->{_parameter_values_frame}\n");
1140 # print("41 L_SU,pre_built_superflows, parameter_values_frame: $parameter_values_frame\n");
1141  
1142 # return changes to $L_SU_href without altering other original values
1143 $L_SU_href = $pre_built_big_stream->get_hash_ref();
1144  
1145 # print("41 L_SU,pre_built_superflows, values_aref: @{$L_SU_href->{_values_aref}}\n");
1146  
1147 }
1148 else {
1149 print("L_SU,pre_built_superflow, missing name \n");
1150 }
1151 return ();
1152 }
1153  
1154 =head2 sub set_run_button
1155  
1156 comes from MAIN and is used by superflow
1157
1158 uses flow or pre_built superflow names
1159
1160 original L_SU plus changes is returned
1161
1162 for safety, place set_hash_ref first
1163
1164 foreach my $key (sort keys %$L_SU_href) {
1165 print (" L_SU,set_run_button, key is $key, value is $L_SU_href->{$key}\n");
1166 }
1167
1168
1169 =cut
1170  
1171 sub set_run_button {
1172 my ( $self, $value_ref ) = @_;
1173  
1174 # print("L_SU,set_run_button, value: ${$value_ref} \n");
1175  
1176 if ( $$value_ref eq 'Run' ) { # i.e., 'Run'... double check
1177  
1178 # e.g., user-built or pre-built superflow
1179 if ( $L_SU_href->{_flow_type} ) {
1180 my $flow_type = $L_SU_href->{_flow_type};
1181  
1182 if ( $flow_type eq 'user_built' ) {
1183  
1184 my $flow_color = $L_SU_href->{_flow_color};
1185  
1186 # print("1. L_SU,set_run_button, flow_color: $L_SU_href->{_flow_color} \n");
1187 my $color_flow = $flow_color . '_flow';
1188  
1189 if ($flow_color) { # e.g. grey, pink, green or blue flows
1190  
1191 my $this_color = $flow_color;
1192 my $_flow_name_out_color = '_flow_name_out_' . $this_color;
1193  
1194 # my $temp_hash;
1195 # if ( $flow_color eq 'grey' ) {
1196  
1197 my $temp_hash = $color_flow_h->{$flow_color}->get_hash_ref();
1198  
1199 # }
1200 # elsif ( $flow_color eq 'pink' ) {
1201  
1202 # $temp_hash = $pink_flow->get_hash_ref();
1203  
1204 # }
1205 # elsif ( $flow_color eq 'green' ) {
1206  
1207 # $temp_hash = $green_flow->get_hash_ref();
1208  
1209 # }
1210 # elsif ( $flow_color eq 'blue' ) {
1211  
1212 # $temp_hash = $blue_flow->get_hash_ref();
1213  
1214 # }
1215 # else {
1216 # print("L_SU, unexpected flow color\n");
1217 # }
1218  
1219 # TODO do we need a temp_hash or is this legacy code from before gui_history existed? 7.14.21
1220 $L_SU_href->{_has_used_SaveAs_button} =
1221 $temp_hash->{_has_used_SaveAs_button};
1222 $L_SU_href->{_has_used_open_perl_file_button} =
1223 $temp_hash->{_has_used_open_perl_file_button};
1224 $L_SU_href->{_has_used_Save_button} =
1225 $temp_hash->{_has_used_Save_button};
1226 $L_SU_href->{$_flow_name_out_color} =
1227 $temp_hash->{$_flow_name_out_color};
1228 my $flow_name_out_color =
1229 $L_SU_href->{$_flow_name_out_color};
1230  
1231 # print("1 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1232  
1233 if ( $L_SU_href->{_has_used_SaveAs_button}
1234 || $L_SU_href->{_has_used_Save_button}
1235 || $L_SU_href->{_flow_name_out}
1236 || $L_SU_href->{_has_used_open_perl_file_button} )
1237 {
1238  
1239 # print("1 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1240 $gui_history->set_hash_ref($L_SU_href);
1241  
1242 # $gui_history->set_gui_widgets($L_SU_href);
1243 $gui_history->set4start_of_run_button();
1244  
1245 # print("2 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1246 # print("2 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1247  
1248 $run_button->set_hash_ref($L_SU_href);
1249  
1250 # print("3 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1251 $run_button->set_flow_type( $L_SU_href->{_flow_type} );
1252  
1253 # print("4 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1254 $run_button->set_flow_name_out($flow_name_out_color);
1255  
1256 # print("5 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1257 # $set_run_button->set_gui_widgets($L_SU_href);
1258 # print("6 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1259 $run_button->director();
1260  
1261 # print("7 L_SU,set_run_button,_is_last_parameter_index_touched_color: $L_SU_href->{_is_last_parameter_index_touched_color} \n");
1262 $gui_history->set4end_of_run_button(); # sets 2
1263  
1264 $L_SU_href = $gui_history->get_hash_ref();
1265  
1266 # print("\n8. L_SU,$set_run_button,_last_flow_index_touched is: $L_SU_href->{_last_flow_index_touched}\n");
1267  
1268 }
1269 else {
1270 print("L_SU,set_run_button, missing conditions\n");
1271 my $message = $message_director->run_button(1);
1272  
1273 # a blank message
1274 $message_w->delete( "1.0", 'end' );
1275 $message_w->insert( 'end', $message );
1276  
1277 }
1278 }
1279 else {
1280 print("L_SU, set_run_button, missing color\n");
1281 }
1282  
1283 }
1284 elsif ( $flow_type eq 'pre_built_superflow' ) {
1285  
1286 # print("L_SU,set_run_button, (a pre_built_superflow, has_used_Save_superflow: $L_SU_href->{_has_used_Save_superflow}: \n");
1287 # print("L_SU,set_run_button, (a pre_built_superflow, has_used_SaveAs_button: $L_SU_href->{_has_used_SaveAs_button}: \n");
1288  
1289 $run_button->set_hash_ref($L_SU_href); # used 36 / 115 in
1290 $run_button->set_flow_type( $L_SU_href->{_flow_type} );
1291 $run_button->set_prog_name_sref(
1292 $L_SU_href->{_prog_name_sref} );
1293  
1294 # $run_button->set_gui_widgets($L_SU_href); # used 23 / 115 in
1295 $run_button->director();
1296  
1297 }
1298 else {
1299 print("L_SU,set_run_button, wrong flow type\n");
1300 }
1301 }
1302 else {
1303 print(
1304 "L_SU,set_run_button , missing flow type user- or pre-built \n"
1305 );
1306 }
1307 }
1308 else {
1309 print("L_SU,set_run_button , missing flow type Run \n");
1310 }
1311 return ();
1312 }
1313  
1314 #=head2 sub set_save_button
1315 #
1316 # called from MAIN
1317 #
1318 # foreach my $key (sort keys %$L_SU_href) {
1319 # print (" L_SU,set_save_button, key is $key, value is $L_SU_href->{$key}\n");
1320 # }
1321 #
1322 # dialog_type for set_save_button is only 'Save'
1323 #
1324 # Because private hash does not have _dialog type
1325 # it should be assigned to set_save_button after set_hash_ref transfers L_SU hash
1326 # but not before
1327 # i.e. for safety, transfer set_hash_ref first
1328 #
1329 # save can be for 2 situations: pre-built superflows and user-built flows
1330 #
1331 # collect changes to environmental indicator variables such as _has_used_SaveAs_button
1332 #
1333 # print("L_SU,set_save_button, flow_type : $L_SU_href->{_flow_type}\n");
1334 #
1335 # In: set_save_button, uses topics
1336 #
1337 # Topics originate as a dialog_type topic which can be 'Data', 'Flow
1338 # 'SaveAs', or 'Delete'
1339 #
1340 # Topic for set_save_button can also be 'Save'
1341 #
1342 # Flow types can be: user-built or pre-built superflow
1343 #
1344 # Logic for use: SaveAs_button must have been used previously or Save_button
1345 # Once Save_button is used has_used_SaveAs_button = false
1346 #
1347 #
1348 #=cut
1349 #
1350 #sub set_save_button {
1351 #
1352 # my ( $self, $topic_sref ) = @_;
1353 #
1354 # # print("L_SU,set_save_button, topic: $$topic_sref\n");
1355 #
1356 # my $message = $message_director->null_button(0);
1357 #
1358 # # a blank message
1359 # $message_w->delete( "1.0", 'end' );
1360 # $message_w->insert( 'end', $message );
1361 #
1362 # if ($topic_sref) { # i.e., topic is 'Save'
1363 # my $topic;
1364 # $topic = $$topic_sref;
1365 #
1366 # # choose between
1367 # # user-built, or pre-built superflow
1368 # if ( $L_SU_href->{_flow_type} ) {
1369 #
1370 # my $flow_type = $L_SU_href->{_flow_type};
1371 #
1372 # if ( $flow_type eq 'user_built' ) {
1373 #
1374 # my $flow_color = $L_SU_href->{_flow_color};
1375 #
1376 # # print("L_SU,set_save_button,flow_color: $L_SU_href->{_flow_color} \n");
1377 #
1378 # my $flow_color_hname = $flow_color . '_flow';
1379 #
1380 # if ($flow_color) { # e.g. grey, pink, green or blue flows
1381 #
1382 ## collect information from the most recent updates to flow packages (e.g., grey_flow.pm)
1383 #
1384 # # my $temp_hash = $flow_color_hname->get_hash_ref();
1385 #
1386 # my $temp_hash;
1387 # if ( $flow_color eq 'grey' ) {
1388 #
1389 # $temp_hash = $grey_flow->get_hash_ref();
1390 #
1391 # }
1392 # elsif ( $flow_color eq 'pink' ) {
1393 #
1394 # $temp_hash = $pink_flow->get_hash_ref();
1395 #
1396 # }
1397 # elsif ( $flow_color eq 'green' ) {
1398 #
1399 # $temp_hash = $green_flow->get_hash_ref();
1400 #
1401 # }
1402 # elsif ( $flow_color eq 'blue' ) {
1403 #
1404 # $temp_hash = $blue_flow->get_hash_ref();
1405 #
1406 # }
1407 # else {
1408 # print("L_SU, unexpected flow color\n");
1409 # }
1410 #
1411 # $L_SU_href->{_has_used_SaveAs_button} =
1412 # $temp_hash->{_has_used_SaveAs_button};
1413 # $L_SU_href->{_has_used_Save_button} =
1414 # $temp_hash->{_has_used_Save_button};
1415 # $L_SU_href->{_flow_name_out} =
1416 # $temp_hash->{_flow_name_out}; #TBD
1417 # $L_SU_href->{_has_used_open_perl_file_button} =
1418 # $temp_hash->{_has_used_open_perl_file_button};
1419 #
1420 # # check to see if the current user-built flow has used SaveAs or Save button
1421 # if ( $L_SU_href->{_has_used_SaveAs_button}
1422 # || $L_SU_href->{_has_used_Save_button}
1423 # || $L_SU_href->{_flow_name_out}
1424 # || $L_SU_href->{_has_used_open_perl_file_button} )
1425 # {
1426 #
1427 ## store possible changes in parameter values
1428 ## print("L_SU, set_save_button, saving flow \n");
1429 ## print("L_SU, set_save_button,_last_parameter_index_touched_color, $L_SU_href->{_last_parameter_index_touched_color}\n");
1430 #
1431 # if ( $flow_color eq 'grey' ) {
1432 #
1433 # $grey_flow->save_button($topic);
1434 #
1435 # }
1436 # elsif ( $flow_color eq 'pink' ) {
1437 #
1438 # $pink_flow->save_button($topic);
1439 #
1440 # }
1441 # elsif ( $flow_color eq 'green' ) {
1442 #
1443 # $green_flow->save_button($topic);
1444 #
1445 # }
1446 # elsif ( $flow_color eq 'blue' ) {
1447 #
1448 # $blue_flow->save_button($topic);
1449 #
1450 # }
1451 # else {
1452 # print("L_SU, unexpected flow color\n");
1453 # }
1454 #
1455 # # reset states
1456 # # N.B. Save_button can only be used if SaveAs is true
1457 # # But, after Save_button is used, reset _has_used_SaveAs_button to false
1458 # # and has_used_Save_button to true
1459 #
1460 # $gui_history->set_hash_ref($L_SU_href);
1461 # $gui_history->set4end_of_Save_button();
1462 # $L_SU_href = $gui_history->get_hash_ref();
1463 #
1464 ## print("2. L_SU, set_save_button, for user_built_flow, print out gui_history.txt\n");
1465 ## $gui_history->view();
1466 #
1467 # }
1468 # else {
1469 # my $message = $message_director->save_button(1);
1470 # $message_w->insert( 'end', $message );
1471 #
1472 # # print("L_SU,set_save_button, can not save user-built file\n");
1473 # }
1474 #
1475 # }
1476 # else {
1477 # print("L_SU, set_save_button, missing color\n");
1478 # }
1479 #
1480 # }
1481 # elsif ( $flow_type eq 'pre_built_superflow' ) {
1482 #
1483 ## collect latest values from a prior run of pre_built_superflow or FileDialog_button
1484 ##print("2. L_SU, set_save_button, _values_aref[0]: @{$L_SU_href->{_values_aref}}\n");
1485 #
1486 # $L_SU_href->{_dialog_type} = 'Save';
1487 #
1488 ##print("2. L_SU, set_save_button, _names_aref: @{$L_SU_href->{_names_aref}}\n"); # equi to labels_aref
1489 # $save_button->set_hash_ref($L_SU_href);
1490 #
1491 ## $save_button->set_gui_widgets($L_SU_href); # uses 27 / 115 in
1492 #
1493 # # print("2. L_SU, set_save_button, print out gui_history.txt\n");
1494 # # $gui_history->view();
1495 # $save_button->set_flow_type( $L_SU_href->{_flow_type} );
1496 # $save_button->set_prog_name_sref(
1497 # $L_SU_href->{_prog_name_sref} );
1498 #
1499 ##print("1. L_SU, set_save_button,last left listbox flow program touched had index = $L_SU_href->{_last_flow_index_touched}\n");
1500 ##print("1. L_SU, set_save_button, flow_item_up_arrow_button= $L_SU_href->{_flow_item_up_arrow_button}\n");
1501 # $save_button->set_dialog_type($topic); # set 1 of 3
1502 # # print("1. L_SU, set_save_buttonlast left listbox flow program touched had index = $L_SU_href->{_last_flow_index_touched}\n");
1503 # # print("2. L_SU, set_save_button, for pre-built stream, print out gui_history.txt\n");
1504 # # $gui_history->view();
1505 #
1506 # $save_button->director();
1507 #
1508 # $L_SU_href = $save_button->get_all_hash_ref();
1509 #
1510 ## print("2. L_SU, set_save_button, flow_item_up_arrow_button= $L_SU_href->{_flow_item_up_arrow_button}\n");
1511 ## print("L_SU, set_save_button,pre_built_flow,has_used_SaveAs_button $L_SU_href->{_has_used_SaveAs_button}\n");
1512 ## print("L_SU, set_save_button,pre_built_flow,has_used_Save_superflow $L_SU_href->{_has_used_Save_superflow}\n");
1513 ## print("L_SU, set_save_button,pre_built_flow,has_used_Save_button $L_SU_href->{_has_used_Save_button}\n");
1514 ## print("L_SU, set_save_button,pre_built_flow,is_Save_button $L_SU_href->{_is_Save_button}\n");
1515 #
1516 # }
1517 # else {
1518 # print("L_SU,set_save_button , missing flow type\n");
1519 # }
1520 # }
1521 #
1522 # }
1523 # else {
1524 # print("L_SU,set_save_button , missing dialog_type, Save \n");
1525 # }
1526 # return ();
1527 #}
1528  
1529  
1530 sub set_save_button {
1531 my ($self, $topic_sref) = @_;
1532  
1533 # Print message to indicate function execution (optional debugging)
1534 # print("L_SU, set_save_button, topic: $$topic_sref\n");
1535  
1536 # Initialize blank message
1537 my $message = $message_director->null_button(0);
1538 $message_w->delete("1.0", 'end');
1539 $message_w->insert('end', $message);
1540  
1541 # Ensure topic is provided
1542 unless ($topic_sref) {
1543 carp("L_SU, set_save_button: missing dialog_type, Save");
1544 return;
1545 }
1546  
1547 my $topic = $$topic_sref;
1548  
1549 # _Handle user-built or pre-built superflow based on flow type
1550 if ($L_SU_href->{_flow_type}) {
1551
1552 my $flow_type = $L_SU_href->{_flow_type};
1553
1554 if ($flow_type eq 'user_built') {
1555
1556 _handle_user_built_flow($topic);
1557
1558 } elsif ($flow_type eq 'pre_built_superflow') {
1559
1560 _handle_pre_built_superflow($topic);
1561
1562 } else {
1563 carp("L_SU, set_save_button: unexpected flow type");
1564 }
1565 } else {
1566 carp("L_SU, set_save_button: missing flow type");
1567 }
1568  
1569 return;
1570 }
1571  
1572 # Helper function for user-built flow
1573 sub _handle_user_built_flow {
1574 my ($topic) = @_;
1575 my $flow_color = $L_SU_href->{_flow_color};
1576  
1577 unless ($flow_color) {
1578 carp("L_SU, set_save_button: missing flow color");
1579 return;
1580 }
1581  
1582 # Map flow colors to corresponding flow objects
1583 # my %flow_map = (
1584 # grey => $grey_flow,
1585 # pink => $pink_flow,
1586 # green => $green_flow,
1587 # blue => $blue_flow,
1588 # );
1589  
1590 my $flow_object = $color_flow_h->{$flow_color};
1591  
1592 unless ($flow_object) {
1593 carp("L_SU, set_save_button: unexpected flow color");
1594 return;
1595 }
1596  
1597 # Collect the flow package data
1598 my $temp_hash = $flow_object->get_hash_ref();
1599  
1600 # Check if save actions are allowed
1601 if ($temp_hash->{_has_used_SaveAs_button} || $temp_hash->{_has_used_Save_button} || $temp_hash->{_flow_name_out} || $temp_hash->{_has_used_open_perl_file_button}) {
1602 $flow_object->save_button($topic);
1603  
1604 # Reset states and update history after saving
1605 $gui_history->set_hash_ref($L_SU_href);
1606 $gui_history->set4end_of_Save_button();
1607 $L_SU_href = $gui_history->get_hash_ref();
1608
1609 } else {
1610 my $message = $message_director->save_button(1);
1611 $message_w->insert('end', $message);
1612 }
1613 }
1614  
1615 # Helper function for pre-built superflow
1616 sub _handle_pre_built_superflow {
1617 my ($topic) = @_;
1618  
1619 $L_SU_href->{_dialog_type} = 'Save';
1620 $save_button->set_hash_ref($L_SU_href);
1621 $save_button->set_flow_type($L_SU_href->{_flow_type});
1622 $save_button->set_prog_name_sref($L_SU_href->{_prog_name_sref});
1623 $save_button->set_dialog_type($topic);
1624
1625 # Run the save button director
1626 $save_button->director();
1627  
1628 # Update the hash with changes made by the save button
1629 $L_SU_href = $save_button->get_all_hash_ref();
1630 }
1631  
1632 =head2 sub set_hash_ref
1633  
1634 imports external hash into private settings
1635 once at the start of the Main Loop
1636 Settings are lost thereafter and so it is good
1637 to store them with local names
1638
1639 =cut
1640  
1641 sub set_hash_ref {
1642 my ( $self, $hash_ref ) = @_;
1643  
1644 $gui_history->set_defaults($hash_ref);
1645  
1646 # print("L_SU,set_hash_ref: $gui_history->get_defaults()\n");
1647 $L_SU_href = $gui_history->get_defaults();
1648  
1649 # $gui_history->view();
1650 $flowNsuperflow_name_w = $L_SU_href->{_flowNsuperflow_name_w};
1651 $message_w = $L_SU_href->{_message_w};
1652 $parameter_names_frame = $L_SU_href->{_parameter_names_frame};
1653 $parameter_values_frame = $L_SU_href->{_parameter_values_frame};
1654 $parameter_values_button_frame =
1655 $L_SU_href->{_parameter_values_button_frame};
1656 $mw = $L_SU_href->{_mw};
1657  
1658 return ();
1659 }
1660  
1661 =head2 set_param_widgets
1662  
1663 Initially, checkbutton widgets and values
1664 are green ("on") or red ("off"), and
1665 Labels and Entry Widgets are made blank.
1666 get back the Label and Entry widgets
1667
1668 print("L_SU, set_param_widgets _check_buttons_settings_aref: @{$L_SU_href->{_check_buttons_settings_aref}}\n")
1669 print("L_SU, set_param_widgets _labels_w_aref: @{$L_SU_href->{_labels_w_aref}}\n");
1670
1671 =cut
1672  
1673 sub set_param_widgets {
1674 my ($self) = @_;
1675  
1676 my $param_widgets = param_widgets->new();
1677  
1678 # print("L_SU,set_param_widgets, parameter_names_frame: $parameter_names_frame\n");
1679 # $gui_history->view();
1680  
1681 $param_widgets->set_labels_frame( \$parameter_names_frame );
1682 $param_widgets->set_values_frame( \$parameter_values_frame );
1683 $param_widgets->set_check_buttons_frame( \$parameter_values_button_frame );
1684 $param_widgets->initialize_labels();
1685 $param_widgets->initialize_values();
1686 $param_widgets->initialize_check_buttons();
1687 $param_widgets->show_labels();
1688 $param_widgets->show_values();
1689 $param_widgets->show_check_buttons();
1690  
1691 $L_SU_href->{_check_buttons_w_aref} =
1692 $param_widgets->get_check_buttons_w_aref();
1693 $L_SU_href->{_check_buttons_settings_aref} =
1694 $param_widgets->get_check_buttons_settings_aref();
1695 $L_SU_href->{_labels_w_aref} = $param_widgets->get_labels_w_aref();
1696 $L_SU_href->{_values_w_aref} = $param_widgets->get_values_w_aref();
1697  
1698 return ();
1699 }
1700  
1701 =head2 sub user_built_flows/$color
1702
1703 sunix_listbox get_help (MB3)
1704 flow-item selection ('flow_select') (MB1)
1705  
1706 if neutral-colored stored parameters exist
1707 they have to be transferred from
1708 neutral_flow to either grey, pink, green, or blue, _flow
1709
1710 displays superflow name at top of gui
1711 $pre_built_big_stream ->set_flowNsuperflow_name_w($flowNsuperflow_name_w);
1712  
1713 needed for binding to file dialog options
1714 $grey_flow ->set_sub_ref(\&_FileDialog_button);
1715
1716 Display of all the parameters and names occurs via select method
1717 $pre_built_big_stream ->select();
1718
1719 return changes to $L_SU_href without altering other original values
1720 $L_SU_href = $pre_built_big_stream->get_hash_ref();
1721
1722 listbox color is selected, e.g., with a MB1 click in Main
1723  
1724 print("10. L_SU,user_built_flows, color=neutral,after MB1 occupied_listboxes: @{$L_SU_gui->{_vacant_listbox_aref}}\n");
1725  
1726 print("L_SU,start of user_built_flows, occupied listboxes= @{$L_SU_gui->{_occupied_listbox_aref}} \n");
1727 print("L_SU,user_built_flows, occupied listboxes= @{$L_SU_gui->{_vacant_listbox_aref}} \n");
1728  
1729 Determine:
1730 ARe we dealing with a color flow ?
1731 Is color flow listbox occupied ?
1732 Skip the listbox if it is empty but
1733 don't skip the listbox if it contains a flow
1734  
1735 Is particular colore flow listbox occupied ?
1736 A prior flow should exist in the list box
1737  
1738 This module is used by any colored flow
1739 delete_from_flow_button,
1740 delete_whole_flow_button, which
1741 deletes the whole flow completely, such as
1742 when deleting the last item in a flow
1743 This option is also used for moving item up or down a flow
1744 add2flows
1745  
1746 =cut
1747  
1748  
1749 sub user_built_flows {
1750 my ( $self, $method ) = @_;
1751  
1752 my $color = _get_flow_color;
1753 my $color_idx;
1754  
1755 #---------------------------------
1756 # Validate and map color to index
1757 #---------------------------------
1758 if ( $color =~ /^(grey|pink|green|blue|neutral)$/ ) {
1759  
1760 # Assign a number based on the color name
1761 $color_idx =
1762 $color eq 'grey' ? 0
1763 : $color eq 'pink' ? 1
1764 : $color eq 'green' ? 2
1765 : $color eq 'blue' ? 3
1766 : undef; # 'neutral' or anything else
1767  
1768 # print("L_SU,user_built_flows, color = $color, color_idx = $color_idx\n");
1769  
1770 # Optional: handle neutral case separately
1771 # print("color should = neutral\n") if $color eq 'neutral';
1772  
1773 }
1774 else {
1775 # If the color name doesn’t match any known option
1776 print("L_SU,user_built_flows, unexpected value: $color\n");
1777 }
1778  
1779 #---------------------------------
1780 # Handle neutral flow separately
1781 #---------------------------------
1782 if ( $color eq 'neutral' ) {
1783  
1784 # sunix_select is chosen
1785 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
1786 $color_flow_h->{$color}->$method;
1787  
1788 # last_flow_color from L_SU does not enter the gui_history
1789 # only color_flows: blue, green, pink, grey enter the flow history
1790  
1791 # bring back selected sunix program name
1792 $L_SU_href->{_prog_name_sref} = $color_flow_h->{$color}->get_prog_name_sref();
1793  
1794 _set_user_built_flow_type();
1795  
1796 }
1797 else {
1798  
1799 #---------------------------------
1800 # CASE: color is grey, pink, green, or blue
1801 #---------------------------------
1802 if ( @{ $L_SU_gui->{_occupied_listbox_aref} }[$color_idx] == $true ) {
1803  
1804 # Flow already exists — bind flow parameters to the opening files
1805 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
1806 $color_flow_h->{$color}->set_occupied_listbox_aref(
1807 $L_SU_gui->{_occupied_listbox_aref} );
1808 $color_flow_h->{$color}->set_vacant_listbox_aref(
1809 $L_SU_gui->{_vacant_listbox_aref} );
1810  
1811 if ( $method eq 'flow_select' ) {
1812  
1813 my $prior_flow_color =
1814 ( $L_SU_href->{_flow_select_color_href} )->{_prior};
1815 my $most_recent_flow_color =
1816 ( $L_SU_href->{_flow_select_color_href} )->{_most_recent};
1817 my $prior_flow_type = ($L_SU_href->{_flow_type_href})->{_prior};
1818  
1819 if ( $prior_flow_color eq $most_recent_flow_color ) {
1820  
1821 # CASE 1: Selecting the same flow color more than once
1822 $color_flow_h->{$color}->$method;
1823  
1824 }
1825 elsif ( $prior_flow_color ne $most_recent_flow_color ) {
1826  
1827 # CASE 2: Selecting a different color flow than last time
1828 # must not have just selected superflow previously
1829 if ($prior_flow_type eq 'pre_built_superflow' ) {
1830 $color_flow_h->{$color}->$method;
1831 }
1832 else {
1833 $color_flow_h->{$color}->flow_select2save_most_recent_param_flow();
1834 $color_flow_h->{$color}->$method; # TODO??? why doesn't current color become highlighted?
1835
1836 }
1837 }else {
1838 print("1839. L_SU, user_built_flows, bad value\n");
1839 }
1840  
1841 # Update L_SU hash and GUI state
1842 $L_SU_href = $color_flow_h->{$color}->get_hash_ref();
1843 $L_SU_gui->{_occupied_listbox_aref} =
1844 $color_listbox->get_flow_listbox_occupancy_aref();
1845 $L_SU_gui->{_vacant_listbox_aref} =
1846 $color_listbox->get_flow_listbox_vacancy_aref();
1847  
1848 # print("1849. L_SU, user_built_flows, flow_select: @{$L_SU_gui->{_occupied_listbox_aref}}\n");
1849  
1850 }
1851 elsif ( $method ne 'flow_select' ) {
1852  
1853 $color_flow_h->{$color}->$method;
1854  
1855 }
1856 else {
1857 print("NADA L_SU,user_built_flows, skip this method\n");
1858 }
1859  
1860 # Sync L_SU state and GUI
1861 $L_SU_href = $color_flow_h->{$color}->get_hash_ref();
1862  
1863 # Transfer updates from color_flows to GUI listboxes
1864 $color_listbox->set_flow_listbox_next_available_occupancyNvacancy_aref(
1865 $L_SU_href->{_occupied_listbox_aref} );
1866  
1867 $L_SU_gui->{_occupied_listbox_aref} =
1868 $color_listbox->get_flow_listbox_occupancy_aref();
1869 $L_SU_gui->{_vacant_listbox_aref} =
1870 $color_listbox->get_flow_listbox_vacancy_aref();
1871  
1872 # print("3. L_SU, user_built_flows, grey: @{$L_SU_gui->{_occupied_listbox_aref}}\n");
1873  
1874 }
1875 elsif ( @{ $L_SU_gui->{_occupied_listbox_aref} }[$color_idx] == $false ) {
1876  
1877 #---------------------------------
1878 # CASE: Flow does not yet exist in this colored listbox
1879 #---------------------------------
1880 if ( $method eq 'add2flow_button' ) {
1881  
1882 $color_flow_h->{$color}->set_hash_ref($L_SU_href);
1883 $color_flow_h->{$color}->set_occupied_listbox_aref(
1884 $L_SU_gui->{_occupied_listbox_aref} );
1885 $color_flow_h->{$color}->set_vacant_listbox_aref(
1886 $L_SU_gui->{_vacant_listbox_aref} );
1887  
1888 # Must precede add2flow method
1889 $gui_history->set_flow_select_color($color);
1890  
1891 # print("first time add2flow : L_SU,user_built_flows,method=$method\n");
1892 $color_flow_h->{$color}->$method;
1893 $color_flow_h->{$color}->flow_select2save_most_recent_param_flow();
1894  
1895 # Update flow_select color
1896 $L_SU_href = $color_flow_h->{$color}->get_hash_ref();
1897 $color_listbox->set_flow_listbox_color( _get_flow_color() );
1898 $L_SU_gui->{_occupied_listbox_aref} =
1899 $color_listbox->get_flow_listbox_occupancy_aref();
1900 $L_SU_gui->{_vacant_listbox_aref} =
1901 $color_listbox->get_flow_listbox_vacancy_aref();
1902  
1903 # print("2. L_SU, user_built_flows, occupied listboxes: @{$L_SU_gui->{_occupied_listbox_aref}}\n");
1904  
1905 }
1906 elsif ( $method eq 'flow_select' ) {
1907  
1908 # Indicate preferred next_available occupation of this listbox color
1909 $color_listbox->set_next_available_flow_listbox_color($color);
1910  
1911 }
1912 else {
1913 print("L_SU,user_built_flows, $color, unexpected:--$method--\n");
1914 }
1915 }
1916 else {
1917 print("L_SU,user_built_flows, $color, unexpected occupation status\n");
1918 }
1919 }
1920  
1921 return ();
1922 }
1923  
1924  
1925 sub wipe_plots_button {
1926  
1927 my ($self) = @_;
1928  
1929 system('xk');
1930  
1931 return ();
1932 }
1933  
1934 __PACKAGE__->meta->make_immutable;
1935 1;