IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 1, 2010, 12:51:37 PM (16 years ago)
Author:
bills
Message:

When processing root node, insert the streaks object before the node result.
Change -addmask to not set magicRun.state to full. Do that in addresult
if node == 'root' and fault == 0. In revert delete mask objects if the
associted root node is faulted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/magic_process.pl

    r29524 r29625  
    325325}
    326326
    327 ### Input result into database
    328 {
    329     my $command = "$magictool -addresult";
    330     $command   .= " -magic_id $magic_id";
    331     $command   .= " -node $node";
    332     $command   .= " -path_base $outroot";
    333     $command   .= " -dbname $dbname" if defined $dbname;
    334 
    335     # Add the processed file to the database
    336     unless ($no_update) {
    337         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    338             run(command => $command, verbose => $verbose);
    339         unless ($success) {
    340             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    341             &my_die("Unable to perform magictool -addresult: $error_code", $magic_id, $node, $error_code);
    342         }
    343     } else {
    344         print "Skipping command: $command\n";
    345     }
    346 }
    347327
    348328if ($node eq "root") {
     
    376356        my $exposures = $mdcParser->parse_list(join "", @$stdout_buf);
    377357        my $exp = $$exposures[0]; # Exposure of interest (should only be one)
     358        if (!$exp) {
     359            &my_die("magictool -exposure returned no output", $magic_id, $node, $PS_EXIT_UNKNOWN_ERROR);
     360        }
    378361
    379362        $exp_id = $exp->{exp_id};
     
    429412            unless ($success) {
    430413                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    431                 # XXX: This my_die isn't going to work because the result for the root node was already
    432                 # added to the database up above.
    433                 # There is a magicMask has a fault column. Maybe we should
    434                 # use that and add a new revert mode that deletes the magicMask and the magicNodeResult
    435                 # for the root node.
    436414                &my_die("Unable to perform magictool -addmask: $error_code", $magic_id, $node, $error_code);
    437415            }
     
    439417            print "Skipping command: $command\n";
    440418        }
     419    }
     420}
     421
     422    ### Input result into database
     423{
     424    my $command = "$magictool -addresult";
     425    $command   .= " -magic_id $magic_id";
     426    $command   .= " -node $node";
     427    $command   .= " -path_base $outroot";
     428    $command   .= " -dbname $dbname" if defined $dbname;
     429
     430    # Add the processed file to the database
     431    unless ($no_update) {
     432        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     433            run(command => $command, verbose => $verbose);
     434        unless ($success) {
     435            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     436            # XXX: if this is the root node we need to revert delete the magicMask object
     437            # inserted above
     438            &my_die("Unable to perform magictool -addresult: $error_code", $magic_id, $node, $error_code);
     439        }
     440    } else {
     441        print "Skipping command: $command\n";
    441442    }
    442443}
Note: See TracChangeset for help on using the changeset viewer.