IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23389 for trunk/ippTools/src


Ignore:
Timestamp:
Mar 18, 2009, 10:18:37 AM (17 years ago)
Author:
bills
Message:

change states from 'run' and 'stop' to 'new' and 'full'
add label to magicDSRun

Location:
trunk/ippTools/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/magicdstool.c

    r21433 r23389  
    242242
    243243        // create a new magicRun for this group
    244         magicRunRow *run = magicRunRowAlloc(0, exp_id, "run", workdir, "dirty", label, dvodb, registered, 0);
     244        magicRunRow *run = magicRunRowAlloc(0, exp_id, "new", workdir, "dirty", label, dvodb, registered, 0);
    245245        if (!run) {
    246246            psAbort("failed to alloc magicRun object");
     
    320320    PXOPT_LOOKUP_STR(stage, config->args, "-stage", true, false);
    321321    PXOPT_LOOKUP_STR(outroot, config->args, "-outroot", true, false);
     322
     323    // optional
    322324    PXOPT_LOOKUP_STR(recoveryroot, config->args, "-recoveryroot", false, false);
    323325    PXOPT_LOOKUP_BOOL(re_place, config->args, "-replace", false);
    324326    PXOPT_LOOKUP_BOOL(remove, config->args, "-remove", false);
    325 
    326     // optional
    327327    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     328    PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
    328329
    329330    psS64 stage_id = 0, cam_id = 0;
     
    337338            0,          // ID
    338339            magic_id,
    339             "run",      // state
     340            "new",      // state
    340341            stage,
    341342            stage_id,
    342343            cam_id,
     344            label,
    343345            outroot,
    344346            recoveryroot,
     
    396398    PXOPT_COPY_S64(config->args, where, "-magic_ds_id", "magic_ds_id", "==");
    397399    PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "==");
    398 //    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
     400    PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
    399401
    400402    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     
    685687        psS64 magic_ds_id = psMetadataLookupS64(NULL, row, "magic_ds_id");
    686688
    687         // set magicDSRun.state to 'stop'
    688         if (!setmagicDSRunState(config, magic_ds_id, "stop")) {
     689        // set magicDSRun.state to 'full'
     690        if (!setmagicDSRunState(config, magic_ds_id, "full")) {
    689691            psError(PS_ERR_UNKNOWN, false, "failed to change magicDSRun.state for magic_ds_id: %" PRId64,
    690692                magic_ds_id);
     
    795797    // check that state is a valid string value
    796798    if (!(
    797             (strncmp(state, "run", 4) == 0)
    798             || (strncmp(state, "stop", 5) == 0)
     799            (strncmp(state, "new", 4) == 0)
     800            || (strncmp(state, "full", 5) == 0)
    799801        )
    800802    ) {
  • trunk/ippTools/src/magicdstoolConfig.c

    r21433 r23389  
    7070    psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-replace", 0, "use the simple output format", false);
    7171    psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-remove", 0, "use the simple output format", false);
    72 //    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-label", 0, "define label", NULL);
     72    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-label", 0, "define label", NULL);
    7373    psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false);
    7474
     
    8888    psMetadataAddS64(todestreakArgs, PS_LIST_TAIL, "-magic_ds_id", 0, "search by magic Destreak ID", 0);
    8989    psMetadataAddS64(todestreakArgs, PS_LIST_TAIL, "-magic_id", 0, "search by magic ID", 0);
    90 //    psMetadataAddS64(todestreakArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", 0);
     90    psMetadataAddStr(todestreakArgs, PS_LIST_TAIL, "-label", 0, "define label", NULL);
    9191    psMetadataAddU64(todestreakArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0);
    9292    psMetadataAddBool(todestreakArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false);
  • trunk/ippTools/src/magictool.c

    r21402 r23389  
    217217
    218218        // create a new magicRun for this group
    219         magicRunRow *run = magicRunRowAlloc(0, exp_id, diff_id, "run", workdir, "dirty", label, dvodb, registered, 0);
     219        magicRunRow *run = magicRunRowAlloc(0, exp_id, diff_id, "new", workdir, "dirty", label, dvodb, registered, 0);
    220220        if (!run) {
    221221            psAbort("failed to alloc magicRun object");
     
    538538
    539539    if (code > 0) {
    540         char *query = "UPDATE magicRun SET fault = %d, state = 'stop' WHERE magic_id = %" PRId64;
     540        char *query = "UPDATE magicRun SET fault = %d, state = 'full' WHERE magic_id = %" PRId64;
    541541        if (!p_psDBRunQueryF(config->dbh, query, code, magic_id)) {
    542542            psError(PS_ERR_UNKNOWN, false,
     
    10881088    }
    10891089
    1090     // Set to "run"
     1090    // Set to "new"
    10911091    {
    10921092        psString query = psStringCopy("UPDATE magicRun JOIN magicMask USING(magic_id) "
    1093                                       "SET magicRun.state = 'run' WHERE magicMask.fault != 0");
     1093                                      "SET magicRun.state = 'new' WHERE magicMask.fault != 0");
    10941094
    10951095        if (psListLength(where->list)) {
     
    14811481    // check that state is a valid string value
    14821482    if (!(
    1483             (strncmp(state, "run", 4) == 0)
    1484             || (strncmp(state, "stop", 5) == 0)
     1483            (strncmp(state, "new", 4) == 0)
     1484            || (strncmp(state, "full", 5) == 0)
    14851485            || (strncmp(state, "reg", 4) == 0)
    14861486        )
Note: See TracChangeset for help on using the changeset viewer.