Changeset 18552
- Timestamp:
- Jul 15, 2008, 10:21:17 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/web/request.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/web/request.php
r18247 r18552 19 19 // BEGIN Local configuration 20 20 21 $COMMAND_DIR = "/export/data0/bills/psconfig/debug.linrh64/bin"; 22 $dsroot = "/export/data1/datastore/dsroot"; 23 $dbname = "simtest"; 21 $COMMAND_DIR = "XXX"; 22 $WORKDIR = "XXX"; 23 $dsroot = "XXX"; 24 $dbname = "XXX"; 24 25 25 26 // END Local configuration … … 52 53 53 54 // Initialize the request variables that we depend upon 54 $rvar_project="simtest"; 55 $rvar_project=""; 56 57 $gpc1_selected=""; 58 $mops_selected=""; 59 $simtest_selected=""; 60 61 $require_class_id = 0; 55 62 56 63 $rvar_user_tag=""; … … 81 88 82 89 import_request_variables("gp", "rvar_"); 90 91 if ($rvar_project == "gpc1") { 92 $gpc1_selected = "selected"; 93 $require_class_id = 1; 94 } else if ($rvar_project == "simtest") { 95 $simtest_selected = "selected"; 96 $require_class_id = 0; 97 } else { 98 $mops_selected = "selected"; 99 $require_class_id = 0; 100 } 83 101 84 102 // figure out which select_by is set and save it's checked value … … 184 202 } 185 203 204 } else { 205 $last_request_id = 0; 186 206 } 187 207 } catch (Exception $e) { … … 229 249 $cmd = "pstamp_runcommand.sh pstamp_webrequest.pl"; 230 250 231 // NOTE: If it is used, -list_uri must be the first argument to pstamp_webrequest.pl232 233 251 if ($list_checked) { 234 $cmd .= " - list_uri";252 $cmd .= " --job_type list_uri"; 235 253 $making_stamps = 0; 236 254 } else if ($get_checked) { 237 255 $making_stamps = 0; 238 $cmd .= " - get_image";256 $cmd .= " --job_type get_image"; 239 257 } 240 258 … … 246 264 throw new Exception('project must be specified.'); 247 265 } 248 $cmd .= " - project $rvar_project";266 $cmd .= " --project $rvar_project"; 249 267 250 268 if (!$rvar_user_tag) { … … 308 326 309 327 if (($rvar_img_type == "raw") || ($rvar_img_type == "chip")) { 310 # if (! $rvar_class_id ) {311 #throw new Exception("must specify Class ID with Image Type $rvar_img_type.");312 #}313 if ((!$rvar_class_id) || ($rvar_class_id = "all")) {328 if ($require_class_id && ! $rvar_class_id ) { 329 throw new Exception("must specify Class ID with Image Type $rvar_img_type."); 330 } 331 if ((!$rvar_class_id) || ($rvar_class_id == "all")) { 314 332 $cmd .= " null"; 315 333 } else { … … 328 346 global $COMMAND_DIR; 329 347 330 // echo "running $command_line\n";348 // echo "running $command_line\n"; 331 349 332 350 exec ("$COMMAND_DIR/$command_line", $output_array, $command_status); 333 351 334 352 $size = sizeof($output_array); 335 // echo "output_array contains $size lines\n";353 // echo "command_status: $command_status output_array contains $size lines\n"; 336 354 if ($command_status == 0) { 337 355 // On success we just remember the results … … 361 379 $doURL = 1; 362 380 if ($doURL) { 363 //echo "output_line: $line\n";381 // echo "output_line: $line\n"; 364 382 $elements = explode(" ", $line); 365 383 if (count($elements) == 3) { … … 428 446 global $outFileset; 429 447 global $dsroot; 430 $parse_error = "$ dsroot/$outFileset/parse_error";448 $parse_error = "$WORKDIR/$request_id/parse_error.txt"; 431 449 #echo "reading $parse_error\n"; 432 450 // readfile( $parse_error ); … … 520 538 <tr><td><b>Project:</b> </td> 521 539 <td><select name="project"> 522 <!-- <option>gpc1 --> 523 <option>simtest 540 <option <?php echo $gpc1_selected;?> >gpc1 541 <option <?php echo $mops_selected;?> >megacam-mops 542 <option <?php echo $simtest_selected;?> >simtest 524 543 </td> 525 544 </tr> … … 562 581 563 582 <b> 564 <?php if ( $rvar_project == "gpc1") {583 <?php if (0 && $rvar_project == "gpc1") { 565 584 echo "Chip ID:"; 566 585 } else { … … 747 766 <?php 748 767 $size = sizeof($output_array); 768 // echo "<pre>size of output array is $size\n</pre>"; 749 769 if ($command_status == 0) { 750 770 if ($list_checked) { … … 752 772 // later we might add links to cause a stamp to be made from a selected file 753 773 for ($i = 0; $i < $size; $i++) { 754 echo "<tr><td>$output_array[$i]</td></tr>"; 774 // $uri = array_shift($output_array); 775 $uri = $output_array[$i]; 776 echo "<tr><td>$uri</td></tr>"; 755 777 } 756 778 } else { 757 779 // output the list of urls 758 780 for ($i = 0; $i < $size; $i++) { 759 printURL($output_array[$i]); 781 // $uri = array_shift($output_array); 782 $uri = $output_array[$i]; 783 printURL($uri); 760 784 } 761 785 }
Note:
See TracChangeset
for help on using the changeset viewer.
