X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=cgi-bin%2Fctsim.cgi.in;h=4a2824ffeabf3c37991c6b1db235a7bd967636b5;hb=bde04020170bb0a7e49d433b10098db7becbac5f;hp=ac31936d15c0bc42d68b9b54d0698e33fd9abfeb;hpb=d0628f1ae00136e2202a614917f52a2b0655df70;p=ctsim.git diff --git a/cgi-bin/ctsim.cgi.in b/cgi-bin/ctsim.cgi.in index ac31936..4a2824f 100755 --- a/cgi-bin/ctsim.cgi.in +++ b/cgi-bin/ctsim.cgi.in @@ -9,7 +9,7 @@ use Fcntl ':flock'; require './ctsim.conf'; my $opt_d = 0; -$ENV{'PATH'} = $::bindir; +$ENV{'PATH'} = "$::bindir:$::lamrundir"; my $fromhost = $ENV{'REMOTE_HOST'}; @@ -56,16 +56,16 @@ my $Disp_Min = "auto"; my $Disp_Max = "auto"; $Disp_Min = FilterToNumber($in{'Disp_Min'}) if ($in{'Disp_Min'} ne "auto" && $in{'Disp_Min'} ne ""); $Disp_Max = FilterToNumber($in{'Disp_Max'}) if ($in{'Disp_Max'} ne "auto" && $in{'Disp_Max'} ne ""); -if ($Disp_Min ne 'auto' && ! ($Disp_Min =~ /^[\d\.]+$/)) { - $error .= "Display Minimum must be 'auto' or numeric (received '$Disp_Min')
"; +if ($Disp_Min ne 'auto' && ! ($Disp_Min =~ /^[\d\.\-]+$/)) { + $error .= "Display Minimum must be 'auto' or numeric (received $Disp_Min)
"; } -if ($Disp_Max ne 'auto' && ! ($Disp_Max =~ /^[\d\.]+$/)) { - $error .= "Display Maximum must be 'auto' or numeric (received '$Disp_Max')
"; +if ($Disp_Max ne 'auto' && ! ($Disp_Max =~ /^[\d\.\-]+$/)) { + $error .= "Display Maximum must be 'auto' or numeric (received $Disp_Max)
"; } my $MPI_Str = FilterMetaChars($in{'MPI'}); my $MPI = 0; -$MPI = 1 if ($MPI_Str eq "yes"); +$MPI = 1 if ($MPI_Str eq "yes" && $::mpi_enable ne ""); $error .= "IR Nx and Ny must be between 5 and 1024
" if ($IR_Nx < 5 || $IR_Nx > 1024 || $IR_Ny < 5 || $IR_Ny > 1024); $error .= "IR Filter Parameter must be between 0 and 1
" if ($IR_Filter_Param < 0 || $IR_Filter_Param > 1); @@ -98,9 +98,9 @@ my $ctrec_ver = "$::bindir/ctrec"; my $phm2rs_ver = "$::bindir/phm2rs"; my $phm2sdf_ver = "$::bindir/phm2sdf"; my $diff_ver = "$::bindir/sdf-2"; -$ctrec_ver = "/opt/lam/bin/mpirun N N $::bindir/ctrec-lam" if $MPI; -$phm2rs_ver = "/opt/lam/bin/mpirun N N $::bindir/phm2rs-lam" if $MPI; -$phm2sdf_ver = "/opt/lam/bin/mpirun N N $::bindir/phm2sdf-lam" if $MPI; +$ctrec_ver = "/opt/lam/bin/mpirun N N $::lamrundir/ctrec-lam" if $MPI; +$phm2rs_ver = "/opt/lam/bin/mpirun N N $::lamrundir/phm2rs-lam" if $MPI; +$phm2sdf_ver = "/opt/lam/bin/mpirun N N $::lamrundir/phm2sdf-lam" if $MPI; my $gp_cmd = "$phm2sdf_ver $phantom_fname $Phantom_Nx $Phantom_Ny --phantom $Phantom_Name --nsample $Phantom_NSample"; my $rs_cmd = "$phm2rs_ver $rs_fname $RS_NDet $RS_NRot --phantom $Phantom_Name --nray $RS_NRay --rotangle $RS_RotAngle"; @@ -282,6 +282,6 @@ sub FilterMetaChars sub FilterToNumber { my $var = pop(@_); - $var =~ /^(\d*\.*\d*)$/; + $var =~ /^(\-*\d*\.*\d*)$/; $1; }