App-SeismicUnixGui
view release on metacpan or search on metacpan
lib/App/SeismicUnixGui/misc/control.pm view on Meta::CPAN
my ( $self, $string ) = @_;
my $logic = -1;
if ($string) {
print("control,set_empty_str2logic: string = $string\n");
if ( $string eq 'yes' ) { $logic = 1; }
}
else { # error check
$logic = 0;
print("control,set_empty_str2logic,empty string, logic= $logic\n");
}
print("control,set_empty_str2logic: logic = $logic\n");
return ($logic);
}
=head2 set_file_name
=cut
sub set_file_name {
my ( $self, $file_name_sref ) = @_;
if ($file_name_sref) {
$control->{_file_name} = $$file_name_sref;
# print("control,file_name, $control->{_file_name}\n");
}
return ();
}
=head2 set_file_name_sref
=cut
sub set_file_name_sref {
my ( $self, $file_name_sref ) = @_;
if ($file_name_sref) {
$control->{_file_name_sref} = $file_name_sref;
# print("control,file_name, $control->{_file_name_sref}\n");
}
return ();
}
=head2 set_first_name
=cut
sub set_first_name {
my ($self) = @_;
my ( $first_name, $suffix, $file_name );
# split by the escaped period
$file_name = $control->{_file_name};
( $first_name, $suffix ) = split( /\./, $file_name );
$control->{_first_name} = $first_name;
# print("control,set_first_name,is: $control->{_first_name}\n");
return ();
}
=head sub set_first_name_string
=cut
sub set_first_name_string {
my ( $self, $infected_string2B ) = @_;
# print("control,set_first_name_string, infected_string2B: $infected_string2B\n");
if ($infected_string2B) {
$control->{_first_name_string} = $infected_string2B;
# print("control,set_first_name_string, infected_string2B: $infected_string2B\n");
}
return ();
}
=head2 sub set_flow_program_name_sref
Which program in the flow is active
=cut
sub set_flow_program_name_sref {
my ( $self, $flow_program_name_sref ) = @_;
if ( length $flow_program_name_sref ) {
my $program_aref;
my @program;
$program[0] = $$flow_program_name_sref;
$program_aref = \@program;
$control->{_prog_names_aref} = $program_aref;
# print("control, set_flow_program_name_sref, program=$$flow_program_name_sref \n");
}
else {
print("control, set_flow_program_name_sref, unexpected value\n");
}
return ();
}
=head2 sub set_flow_prog_name_index
Which program in the flow is active
=cut
sub set_flow_prog_name_index {
lib/App/SeismicUnixGui/misc/control.pm view on Meta::CPAN
if ( $string eq $yes ) { $logic = 1; }
# print("4. control,set_str2logic: string = $string\n");
}
else { # error check
# print("control,set_str2logic,change parameter value string in gui to either yes or no\n");
# print("Did you forget to list an expected variable ?\n");
# print("control,set_str2logic: string = $string\n");
}
# print("control,set_str2logic: logic = $logic\n");
return ($logic);
}
else {
# print("5. control,set_str2logic,missing string\n");
}
}
else {
#print("3. control,set_str2logic: string is not defined NADA\n");
}
}
=head2 sub set_path
mark the path
=cut
sub set_path {
my ( $self, $path ) = @_;
if ( length $path ) {
$control->{_path} = $path;
# print("control,set_path, : $path\n");
}
return ();
}
=head2 set_suffix
=cut
sub set_suffix {
my ($self) = @_;
# my ( $first_name, $suffix, $file_name );
if ( length $control->{_file_name} ) {
my $first_name;
my $suffix;
# print("control,file_name,is: $control->{_file_name}\n");
# split by the escaped period
my $file_name = $control->{_file_name};
( $first_name, $suffix ) = split( /\./, $file_name );
$control->{_first_name} = $first_name;
# print("control,first_name,is: $first_name\n");
# print("control,suffix,is: $suffix\n");
if ( !($suffix) ) {
$suffix = '';
}
if ( $suffix eq '' ) {
# print("1. control,set_suffix,is: empty\n");
$control->{_suffix} = '';
}
elsif ( $suffix eq 'su' ) {
$control->{_suffix} = 'su';
# print("control,set_suffix,is: $control->{_suffix}\n");
}
elsif ( $suffix eq 'config' ) {
$control->{_suffix} = 'config';
# print("control,set_suffix,is: $control->{_suffix}\n");
}
elsif ( $suffix eq 'pl' ) {
$control->{_suffix} = 'pl';
# print("control,set_suffix,is: $control->{_suffix}\n");
}
elsif ( $suffix eq 'txt' ) {
$control->{_suffix} = 'txt';
# print("control,set_suffix,is: $control->{_suffix}\n");
}
else {
$control->{_suffix} = '';
# print("2. control,set_suffix, suffix:$suffix is empty\n");
}
}
else {
print("control,set_suffix,file_name missing\n");
}
return ();
}
=head2 sub set_suffix4oop
As needed by oop_prog_params
=cut
( run in 1.541 second using v1.01-cache-2.11-cpan-39bf76dae61 )