X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=cgi-bin%2Fctsim.cgi.in;fp=cgi-bin%2Fctsim.cgi.in;h=ae32a901553285ae9a2155f50d36825dc428d58d;hp=a497dd908502f1dcc3988137fc196b99161bf5b7;hb=c2da697c4203112cf53df1fcd2f8de6f5e385f14;hpb=9c75a49d81caa44eb0397f60cc442ebab1738309 diff --git a/cgi-bin/ctsim.cgi.in b/cgi-bin/ctsim.cgi.in index a497dd9..ae32a90 100755 --- a/cgi-bin/ctsim.cgi.in +++ b/cgi-bin/ctsim.cgi.in @@ -28,17 +28,14 @@ CGI::ReadParse(\%in); my $error = ""; if ($::single_process_only > 0) { - my @processes = '/bin/ps -A'; + my @processes = `/bin/ps -A`; my $running = 0; - foreach $p (@processes) { - if ($p ~= /ctsimtext/) { - $running = 1; - break; - } - if ($running > 0) { - $error .= "Another online simulation is currently running.

Click your browser's Refresh button to resubmit your simulation
"; - exit(0); + foreach my $p (@processes) { + if ($p =~ m/ctsimtext/) { + $error .= "Another online simulation is currently running.
You may wait a moment and then click your browser's Refresh button to resubmit your simulation
"; + last; } + } } my $Phantom_Name = FilterMetaChars($in{'Phantom_Name'}); @@ -111,10 +108,10 @@ my $ir_png_url = "$::url_datadir/ir-$tmpid.png"; my $pj_png_url = "$::url_datadir/pj-$tmpid.png"; my $sub_png_url = "$::url_datadir/sub-$tmpid.png"; -my $pjrec_ver = "$::bindir/pjrec"; -my $phm2pj_ver = "$::bindir/phm2pj"; -my $phm2if_ver = "$::bindir/phm2if"; -my $diff_ver = "$::bindir/if2"; +my $pjrec_ver = "$::bindir/ctsimtext pjrec"; +my $phm2pj_ver = "$::bindir/ctsimtext phm2pj"; +my $phm2if_ver = "$::bindir/ctsimtext phm2if"; +my $diff_ver = "$::bindir/ctsimtext if2"; $pjrec_ver = "/opt/lam/bin/mpirun N N $::lamrundir/pjrec-lam" if $MPI; $phm2pj_ver = "/opt/lam/bin/mpirun N N $::lamrundir/phm2pj-lam" if $MPI; @@ -185,6 +182,12 @@ if ($error ne "") { } } } + # Delete image files and projection files + unlink($phantom_fname); + unlink($ir_fname); + unlink($pj_fname); + unlink($pj_if_fname); + unlink($sub_fname); $cmdout = "$gp_cmd\n $gp_out $pj_cmd\n $pj_out $pj_if_cmd\n $pj_if_out $pjrec_cmd\n $pjrec_out $diff_cmd\n $diff_out $png1_cmd\n $png_gp_out $png2_cmd\n $png_pjrec_out $png3_cmd\n $png_pj_out $png4_cmd\n $png_sub_out"; if (open(LOGFILE,">> $logfile")) { @@ -222,8 +225,7 @@ if ($error ne "") { } $out .= "


\n"; -$out .= "Return to CT Simulation Designer.
\n"; -$out .= "Return to Med-Info.\n"; +$out .= "Return to CTSim.
\n"; $out .= " "; $out .= "\n";