IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18659


Ignore:
Timestamp:
Jul 22, 2008, 9:10:30 AM (18 years ago)
Author:
eugene
Message:

changing state from old values (run, stop) to new set (new, full, cleaned, etc); using pxIsValidState where possible

Location:
branches/eam_branch_20080719/ippTools
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080719/ippTools/notes.txt

    r18627 r18659  
    1111    * difftool
    1212    * stacktool
    13     * magictool
    1413    * dettool processedimfile
    1514    * dettool processedexp
     
    2019    * dettool residimfile
    2120    * dettool residexp
     21
     22    * I am modifiying the tools to use the new states: new, full, goto_cleaned, etc.
     23      I am NOT changing: regtool, pztool, magictool, flatcorr, pxregister, pstamptool
     24
     25    * for dettool, I have added a new field, 'data_state' to the
     26      detRunSummary.  My plan here is that a complete detRunIteration
     27      is cleaned at once.  I've added functions to all of the dettool
     28      major modes to list pending entries to be cleaned and a function
     29      to update the data_state when cleaning is done.
    2230
    23312008.07.11 EAM
  • branches/eam_branch_20080719/ippTools/src/camtool.c

    r18642 r18659  
    576576
    577577    // since there is only one exp per 'run' set camRun.state = 'stop'
    578     if (!pxcamRunSetState(config, row->cam_id, "stop")) {
     578    if (!pxcamRunSetState(config, row->cam_id, "full")) {
    579579        psError(PS_ERR_UNKNOWN, false, "failed to change camRun.state for cam_id: %" PRId64, row->cam_id);
    580580        psFree(row);
  • branches/eam_branch_20080719/ippTools/src/difftool.c

    r18643 r18659  
    265265
    266266    if (count == 2) {
    267         if (!setdiffRunState(config, diff_id, "run")) {
     267        if (!setdiffRunState(config, diff_id, "new")) {
    268268            if (!psDBRollback(config->dbh)) {
    269269                psError(PS_ERR_UNKNOWN, false, "database error");
     
    502502    }
    503503
    504     if (!setdiffRunState(config, diff_id, "stop")) {
     504    if (!setdiffRunState(config, diff_id, "full")) {
    505505        if (!psDBRollback(config->dbh)) {
    506506            psError(PS_ERR_UNKNOWN, false, "database error");
     
    636636
    637637    // check that state is a valid string value
    638     if (!(
    639             (strncmp(state, "run", 4) == 0)
    640             || (strncmp(state, "stop", 5) == 0)
    641             || (strncmp(state, "reg", 4) == 0)
    642         )
    643     ) {
    644         psError(PS_ERR_UNKNOWN, false,
    645                 "invalid diffRun state: %s", state);
     638    if (!pxIsValidState(state)) {
     639        psError(PS_ERR_UNKNOWN, false, "invalid diffRun state: %s", state);
    646640        return false;
    647641    }
  • branches/eam_branch_20080719/ippTools/src/faketool.c

    r18642 r18659  
    10801080
    10811081        fakeRunRow *fakeRun = fakeRunObjectFromMetadata(row);
    1082         // set fakeRun.state to 'stop'
    1083         if (!pxfakeRunSetState(config, fakeRun->fake_id, "stop")) {
     1082        // set fakeRun.state to 'full'
     1083        if (!pxfakeRunSetState(config, fakeRun->fake_id, "full")) {
    10841084            psError(PS_ERR_UNKNOWN, false, "failed to change fakeRun.state for fake_id: %" PRId64, fakeRun->fake_id);
    10851085            psFree(fakeRun);
  • branches/eam_branch_20080719/ippTools/src/pxcam.c

    r18622 r18659  
    3535
    3636    // check that state is a valid string value
    37     if (!(
    38             (strncmp(state, "run", 4) == 0)
    39             || (strncmp(state, "stop", 5) == 0)
    40             || (strncmp(state, "reg", 4) == 0)
    41         )
    42     ) {
     37    if (!pxIsValidState(state)) {
    4338        psError(PS_ERR_UNKNOWN, false,
    4439                "invalid camRun state: %s", state);
     
    6358
    6459    // check that state is a valid string value
    65     if (!(
    66             (strncmp(state, "run", 4) == 0)
    67             || (strncmp(state, "stop", 5) == 0)
    68             || (strncmp(state, "reg", 4) == 0)
    69         )
    70     ) {
     60    if (!pxIsValidState(state)) {
    7161        psError(PS_ERR_UNKNOWN, false,
    7262                "invalid chipRun state: %s", state);
     
    10898    return true;
    10999}
    110 
    111100
    112101bool pxcamRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *label)
     
    162151    // different on 32/64
    163152    if (!p_psDBRunQuery(config->dbh, query,
    164                 "run", // state
     153                "new", // state
    165154                workdir  ? workdir  : "NULL",
    166155                "dirty", //workdir_state
  • branches/eam_branch_20080719/ippTools/src/pxfake.c

    r18622 r18659  
    3535
    3636    // check that state is a valid string value
    37     if (!(
    38             (strncmp(state, "run", 4) == 0)
    39             || (strncmp(state, "stop", 5) == 0)
    40             || (strncmp(state, "reg", 4) == 0)
    41         )
    42     ) {
     37    if (!pxIsValidState(state)) {
    4338        psError(PS_ERR_UNKNOWN, false,
    4439                "invalid fakeRun state: %s", state);
     
    6358
    6459    // check that state is a valid string value
    65     if (!(
    66             (strncmp(state, "run", 4) == 0)
    67             || (strncmp(state, "stop", 5) == 0)
    68             || (strncmp(state, "reg", 4) == 0)
    69         )
    70     ) {
     60    if (!pxIsValidState(state)) {
    7161        psError(PS_ERR_UNKNOWN, false,
    7262                "invalid fakeRun state: %s", state);
     
    164154    // different on 32/64
    165155    if (!p_psDBRunQuery(config->dbh, query,
    166                 "run", // state
     156                "new", // state
    167157                workdir  ? workdir  : "NULL",
    168158                label    ? label    : "NULL",
  • branches/eam_branch_20080719/ippTools/src/pxtools.c

    r18622 r18659  
    2929{
    3030    PS_ASSERT_PTR_NON_NULL(state, false);
     31   
     32    // XXX replace strncmp with strcmp
    3133
    3234    if (!((strncmp(state, "new", 4) == 0)
     35    || (strncmp(state, "reg", 3) == 0)
    3336    || (strncmp(state, "full", 5) == 0)
    3437    || (strncmp(state, "goto_cleaned", 8) == 0)
  • branches/eam_branch_20080719/ippTools/src/pxwarp.c

    r18479 r18659  
    3535
    3636    // check that state is a valid string value
    37     if (!(
    38             (strncmp(state, "run", 4) == 0)
    39             || (strncmp(state, "stop", 5) == 0)
    40             || (strncmp(state, "reg", 4) == 0)
    41         )
    42     ) {
    43         psError(PS_ERR_UNKNOWN, false,
    44                 "invalid warpRun state: %s", state);
     37    if (!pxIsValidState(state)) {
     38        psError(PS_ERR_UNKNOWN, false, "invalid warpRun state: %s", state);
    4539        return false;
    4640    }
     
    6357
    6458    // check that state is a valid string value
    65     if (!(
    66             (strncmp(state, "run", 4) == 0)
    67             || (strncmp(state, "stop", 5) == 0)
    68             || (strncmp(state, "reg", 4) == 0)
    69         )
    70     ) {
    71         psError(PS_ERR_UNKNOWN, false,
    72                 "invalid chipRun state: %s", state);
     59    if (!pxIsValidState(state)) {
     60        psError(PS_ERR_UNKNOWN, false, "invalid chipRun state: %s", state);
    7361        return false;
    7462    }
     
    152140        fake_id,
    153141        "warp",     // mode
    154         "run",      // state
     142        "new",      // state
    155143        workdir,
    156144        "dirty",    // workdir_state
  • branches/eam_branch_20080719/ippTools/src/stacktool.c

    r18643 r18659  
    278278
    279279        // create a new stackRun for this stack
    280         stackRunRow *run = stackRunRowAlloc(0, "run", workdir, NULL, registered, skycell_id, tess_id, filter);
     280        stackRunRow *run = stackRunRowAlloc(
     281            0,                          // ID
     282            "new",                      // state
     283            workdir,
     284            NULL,                       // workdir_state
     285            registered,
     286            skycell_id,
     287            tess_id,
     288            filter);
     289
    281290        if (!stackRunInsertObject(config->dbh, run)) {
    282291            if (!psDBRollback(config->dbh)) {
     
    363372    }
    364373
    365     stackRunRow *run = stackRunRowAlloc(0, "run", workdir, NULL, registered, skycell_id, tess_id, filter);
     374    stackRunRow *run = stackRunRowAlloc(
     375        0,                              // ID
     376        "new",                          // state
     377        workdir,
     378        NULL,                           // workdir_state
     379        registered,
     380        skycell_id,
     381        tess_id,
     382        filter);
     383
    366384    if (!run) {
    367385        psError(PS_ERR_UNKNOWN, false, "failed to alloc stackRun object");
     
    656674    }
    657675
    658     if (!setstackRunState(config, stack_id, "stop")) {
     676    if (!setstackRunState(config, stack_id, "full")) {
    659677        if (!psDBRollback(config->dbh)) {
    660678            psError(PS_ERR_UNKNOWN, false, "database error");
     
    788806
    789807    // check that state is a valid string value
    790     if (!(
    791             (strncmp(state, "run", 4) == 0)
    792             || (strncmp(state, "stop", 5) == 0)
    793             || (strncmp(state, "reg", 4) == 0)
    794         )
    795     ) {
    796         psError(PS_ERR_UNKNOWN, false,
    797                 "invalid warpRun state: %s", state);
     808    if (!pxIsValidState(state)) {
     809        psError(PS_ERR_UNKNOWN, false, "invalid stackRun state: %s", state);
    798810        return false;
    799811    }
  • branches/eam_branch_20080719/ippTools/src/warptool.c

    r18642 r18659  
    137137            fake_id,
    138138            mode,
    139             "run",      // state
     139            "new",      // state
    140140            workdir,
    141141            "dirty",    // workdir_state
Note: See TracChangeset for help on using the changeset viewer.