IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9821


Ignore:
Timestamp:
Nov 1, 2006, 12:27:41 PM (20 years ago)
Author:
jhoblitt
Message:

remove dettool -updatedetrun -stop
add dettool -upratedetrun -state ...

Location:
trunk
Files:
4 edited

Legend:

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

    r9524 r9821  
    188188    my $command = "$dettool -updatedetrun -det_id $det_id";
    189189    if ($stop) {
    190         $command .= ' -stop';
     190        $command .= ' -state stop';
    191191    } else {
    192192        $command .= ' -again';
  • trunk/ippTools/scripts/dettest.sh

    r9765 r9821  
    6161dettool -residexp || exit 1
    6262
    63 dettool -updatedetrun -det_id $det_id -stop || exit 1
     63dettool -updatedetrun -det_id $det_id -state stop || exit 1
  • trunk/ippTools/src/dettool.c

    r9820 r9821  
    42854285        return false;
    42864286    }
    4287     // either -rerun or -stop must be specified
     4287    // either -rerun or -state must be specified
    42884288    bool again = psMetadataLookupBool(&status, config->args, "-again");
    42894289    if (!status) {
     
    42914291        return false;
    42924292    }
    4293     bool stop = psMetadataLookupBool(&status, config->args, "-stop");
    4294     if (!status) {
    4295         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -stop");
    4296         return false;
    4297     }
    4298     if (!(again || stop)) {
    4299         psError(PS_ERR_UNKNOWN, true, "either -again or -stop must be specified");
    4300         return false;
    4301     }
    4302     if (again && stop) {
    4303         psError(PS_ERR_UNKNOWN, true, "either -again or -stop must be specified");
    4304         return false;
    4305     }
    4306 
    4307     if (stop) {
    4308         // set detRun.state to stop
    4309         return setDetRunState(config, det_id, "stop");
     4293    psString state = psMetadataLookupStr(&status, config->args, "-state");
     4294    if (!status) {
     4295        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -state");
     4296        return false;
     4297    }
     4298    if (!(again || state)) {
     4299        psError(PS_ERR_UNKNOWN, true, "either -again or -state must be specified");
     4300        return false;
     4301    }
     4302    if (again && state) {
     4303        psError(PS_ERR_UNKNOWN, true, "either -again or -state must be specified");
     4304        return false;
     4305    }
     4306
     4307    if (state) {
     4308        // set detRun.state to state
     4309        return setDetRunState(config, det_id, state);
    43104310    }
    43114311
     
    49264926    PS_ASSERT_PTR_NON_NULL(state, false);
    49274927
     4928    // check that state is a valid string value
     4929    if (!(
     4930            (strncmp(state, "run", 4) == 0)
     4931            || (strncmp(state, "stop", 5) == 0)
     4932            || (strncmp(state, "reg", 4) == 0)
     4933        )
     4934    ) {
     4935        psError(PS_ERR_UNKNOWN, false,
     4936                "invalid detRun state: %s", state);
     4937        return false;
     4938    }
     4939
    49284940    char *query = "UPDATE detRun SET state = '%s' WHERE det_id = '%s'";
    49294941    if (!p_psDBRunQuery(config->dbh, query, state, det_id)) {
  • trunk/ippTools/src/dettoolConfig.c

    r9817 r9821  
    509509    psMetadataAddBool(updatedetrunArgs, PS_LIST_TAIL, "-again",  0,
    510510        "start a new iteration of this detrend run", false);
    511     psMetadataAddBool(updatedetrunArgs, PS_LIST_TAIL, "-stop",  0,
    512         "stop this detrend run", false);
     511    psMetadataAddStr(updatedetrunArgs, PS_LIST_TAIL, "-state",  0,
     512        "set the state of this detrend run", false);
    513513
    514514    // -rerun
Note: See TracChangeset for help on using the changeset viewer.