Changeset 27869 for trunk/ippToPsps/scripts/ippToPsps_run.pl
- Timestamp:
- May 6, 2010, 9:43:18 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/scripts/ippToPsps_run.pl (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/scripts/ippToPsps_run.pl
r27847 r27869 12 12 13 13 # globals 14 my ($verbose, $save_temps, $no_op, $no_update, $camera, $ product, $output, $dvodb, $datastoreProduct, $label, $singleExpId, $no_publish);14 my ($verbose, $save_temps, $no_op, $no_update, $camera, $batchType, $output, $dvodb, $datastoreProduct, $label, $singleExpId, $no_publish); 15 15 16 16 # TODO temporary until we use database to store current jobid … … 31 31 GetOptions( 32 32 'output|o=s' => \$output, 33 ' product|p=s' => \$product,33 'batch|b=s' => \$batchType, 34 34 'dvodb|d=s' => \$dvodb, 35 35 'label|l=s' => \$label, 36 36 'expid|e=s' => \$singleExpId, 37 ' dsproduct|s=s' => \$datastoreProduct,37 'product|p=s' => \$datastoreProduct, 38 38 'no_publish' => \$no_publish, 39 39 'verbose|v' => \$verbose, … … 53 53 "--dvodb <path>\n". 54 54 "\n Optional:\n\n". 55 "-- dsproduct <datastoreProductName>\n".55 "--product <datastoreProduct>\n". 56 56 "--no_publish - won't publish to datastore\n". 57 57 "--save_temps - will save temporary files\n". … … 60 60 -exitval => 3 61 61 ) unless 62 defined $ productand62 defined $batchType and 63 63 defined $output and 64 64 defined $dvodb and … … 190 190 191 191 # run IppToPsps program 192 if (runIppToPsps($db, $expId, $batchOutputPath, $ product)) {192 if (runIppToPsps($db, $expId, $batchOutputPath, $batchType)) { 193 193 194 194 # write batch manifest and tar and zip up 195 if (writeBatchManifest($batchOutputPath, $batchDir, $ product)) {195 if (writeBatchManifest($batchOutputPath, $batchDir, $batchType)) { 196 196 197 197 if (tarAndZipDirectory($jobOutputPath, $batchDir)) { … … 225 225 } 226 226 227 if ($ producteq "init" ) {print "* Wrote initialisation batch\n"; last;}227 if ($batchType eq "init" ) {print "* Wrote initialisation batch\n"; last;} 228 228 229 229 … … 278 278 ####################################################################################### 279 279 sub runIppToPsps { 280 my ($db, $expId, $batchOutputPath, $ product) = @_;280 my ($db, $expId, $batchOutputPath, $batchType) = @_; 281 281 282 282 my $success = 0; 283 283 284 284 # before anything else, we can publish the init batch 285 if ($ product=~ /init/) {285 if ($batchType =~ /init/) { 286 286 $success = produceInit($batchOutputPath); 287 287 } 288 elsif ($ product=~ /det/) {288 elsif ($batchType =~ /det/) { 289 289 $success = produceDetections($db, $expId, $batchOutputPath); 290 290 } 291 elsif ($ product=~ /diff/) {291 elsif ($batchType =~ /diff/) { 292 292 $success = produceDiffs($db, $expId, $batchOutputPath); 293 293 } … … 344 344 sub writeBatchManifest { 345 345 346 my ($path,$batch,$ product) = @_;346 my ($path,$batch,$batchType) = @_; 347 347 348 348 use XML::Writer; … … 359 359 # determine batch 'type' 360 360 my $type; 361 if($ producteq 'init') {$type = "IN";}362 elsif($ producteq 'det') {$type = "P2";}363 elsif ($ producteq 'stack') {$type = "ST";}364 elsif ($ producteq 'diff') {$type = "OB";}361 if($batchType eq 'init') {$type = "IN";} 362 elsif($batchType eq 'det') {$type = "P2";} 363 elsif ($batchType eq 'stack') {$type = "ST";} 364 elsif ($batchType eq 'diff') {$type = "OB";} 365 365 else {$type = "UNKNOWN";} 366 366 … … 373 373 my $maxObjId; 374 374 my $filename; 375 if($ producteq 'det') {375 if($batchType eq 'det') { 376 376 377 377 while (<MYFILE>) { … … 410 410 411 411 # write manifest element TODO untidy 412 if($ producteq 'det' && $filename eq $f) {412 if($batchType eq 'det' && $filename eq $f) { 413 413 414 414 $writer->startTag('manifest', … … 437 437 #$writer->startTag('md5'); $writer->characters("$md5sum"); $writer->endTag(); 438 438 439 #if($ producteq 'det' && $filename eq $f) {439 #if($batchType eq 'det' && $filename eq $f) { 440 440 441 441 # $writer->startTag('minObjId'); $writer->characters("$minObjId"); $writer->endTag(); … … 584 584 my ($outputPath) = @_; 585 585 586 my $success = runProgram( "NULL", $outputPath, 0, $ product);586 my $success = runProgram( "NULL", $outputPath, 0, $batchType); 587 587 return $success; 588 588 } … … 628 628 close $tempFile; 629 629 630 $success = runProgram($tempName, $outputPath, $expId, $ product);630 $success = runProgram($tempName, $outputPath, $expId, $batchType); 631 631 return $success; 632 632 } … … 677 677 } 678 678 679 my $ret = runProgram($tempName, $outputPath, $expId, $ product);679 my $ret = runProgram($tempName, $outputPath, $expId, $batchType); 680 680 681 681 close $tempFile; … … 690 690 ####################################################################################### 691 691 sub runProgram { 692 my ($input, $output, $expid, $ product) = @_;692 my ($input, $output, $expid, $batchType) = @_; 693 693 694 694 # build command … … 699 699 $command .= " -config config"; # TODO 700 700 $command .= " -expid $expid"; 701 $command .= " -product $ product";701 $command .= " -product $batchType"; 702 702 $command .= " -results $resultsFileName"; 703 703
Note:
See TracChangeset
for help on using the changeset viewer.
