IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 25, 2008, 2:41:18 PM (18 years ago)
Author:
jhoblitt
Message:

add pxwarpQueueByCamID()
modify camtool so that it can auto-start warp runs

File:
1 edited

Legend:

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

    r16170 r16242  
    3030#include "pxtools.h"
    3131#include "warptool.h"
     32#include "pxwarp.h"
    3233
    3334static psS64 definerunMode(pxConfig *config);
     
    4647
    4748static bool parseAndInsertSkyCellMap(pxConfig *config, const char *mapfile);
    48 static bool setwarpRunState(pxConfig *config, psS64 warp_id, const char *state);
    4949static bool isValidMode(pxConfig *config, const char *mode);
    5050bool warpCompletedRuns(pxConfig *config);
     
    200200        return false;
    201201    }
    202     if (!setwarpRunState(config, warp_id, "run")) {
     202    if (!pxwarpRunSetState(config, warp_id, "run")) {
    203203        // rollback
    204204        if (!psDBRollback(config->dbh)) {
     
    227227    if (state) {
    228228        // set detRun.state to state
    229         return setwarpRunState(config, (psS64)atoll(warp_id), state);
     229        return pxwarpRunSetState(config, (psS64)atoll(warp_id), state);
    230230    }
    231231
     
    999999
    10001000
    1001 static bool setwarpRunState(pxConfig *config, psS64 warp_id, const char *state)
    1002 {
    1003     PS_ASSERT_PTR_NON_NULL(state, false);
    1004 
    1005     // check that state is a valid string value
    1006     if (!(
    1007             (strncmp(state, "run", 4) == 0)
    1008             || (strncmp(state, "stop", 5) == 0)
    1009             || (strncmp(state, "reg", 4) == 0)
    1010         )
    1011     ) {
    1012         psError(PS_ERR_UNKNOWN, false,
    1013                 "invalid warpRun state: %s", state);
    1014         return false;
    1015     }
    1016 
    1017     char *query = "UPDATE warpRun SET state = '%s' WHERE warp_id = %" PRId64;
    1018     if (!p_psDBRunQuery(config->dbh, query, state, warp_id)) {
    1019         psError(PS_ERR_UNKNOWN, false,
    1020                 "failed to change state for warp_id %" PRId64, warp_id);
    1021         return false;
    1022     }
    1023 
    1024     return true;
    1025 }
    1026 
    1027 
    10281001static bool isValidMode(pxConfig *config, const char *mode)
    10291002{
Note: See TracChangeset for help on using the changeset viewer.