IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9160


Ignore:
Timestamp:
Oct 3, 2006, 2:07:34 PM (20 years ago)
Author:
jhoblitt
Message:

add setDetRunState()

File:
1 edited

Legend:

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

    r9146 r9160  
    6464static psArray *searchRawImfiles(pxConfig *config, psMetadata *where);
    6565static psS32 incrementIteration(pxConfig *config, const char *det_id);
     66static bool setDetRunState(pxConfig *config, const char *det_id, const char *state);
    6667
    6768# define MODECASE(caseName, func) \
     
    273274    // the first iteration is always 0
    274275    // XXX the camera name is set from the first inputExp
    275     detRunInsert(config->dbh, 0, det_type);
     276    detRunInsert(config->dbh, 0, det_type, "run");
    276277    long det_id = psDBLastInsertID(config->dbh);
    277278
     
    478479    // the first iteration is always 0
    479480    // XXX the camera name is set from the first inputExp
    480     detRunInsert(config->dbh, 0, det_type);
     481    detRunInsert(config->dbh, 0, det_type, "run");
    481482    long det_id = psDBLastInsertID(config->dbh);
    482483
     
    43894390    }
    43904391
    4391     // XXX stop deson't actually do anything at this point
    43924392    if (stop) {
    4393         return true;
     4393        // set detRun.state to stop
     4394        return setDetRunState(config, det_id, "stop");
    43944395    }
    43954396
     
    48464847}
    48474848
     4849static bool setDetRunState(pxConfig *config, const char *det_id, const char *state)
     4850{
     4851    PS_ASSERT_PTR_NON_NULL(det_id, false);
     4852    PS_ASSERT_PTR_NON_NULL(state, false);
     4853
     4854    char *query = "UPDATE detRun SET state = '%s' WHERE position = '%s'";
     4855    if (!p_psDBRunQuery(config->dbh, query, state, det_id)) {
     4856        psError(PS_ERR_UNKNOWN, false,
     4857                "failed to change state for det_id %s", det_id);
     4858        return false;
     4859    }
     4860
     4861    return true;
     4862}
Note: See TracChangeset for help on using the changeset viewer.