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/camtool.c

    r16170 r16242  
    2727
    2828#include "pxtools.h"
     29#include "pxwarp.h"
    2930#include "camtool.h"
    3031
     
    485486        code
    486487    );
    487     psFree(pendingRow);
    488488
    489489    if (!camProcessedExpInsertObject(config->dbh, row)) {
     
    494494        psError(PS_ERR_UNKNOWN, false, "database error");
    495495        psFree(row);
     496        psFree(pendingRow);
    496497        return false;
    497498    }
     
    501502        psError(PS_ERR_UNKNOWN, false, "failed to change camRun.state for cam_id: %" PRId64, row->cam_id);
    502503        psFree(row);
    503         return false;
    504     }
    505 
     504        psFree(pendingRow);
     505        return false;
     506    }
     507
     508    // should we stop here or proceed on to the warp stage?
     509    // NULL for end_stage means go as far as possible
     510    // we can't start a warp run unlesss tess_id is defined
     511    if ((pendingRow->end_stage && psStrcasestr(pendingRow->end_stage, "cam"))
     512        || pendingRow->tess_id == NULL) {
     513        psFree(row);
     514        psFree(pendingRow);
     515        if (!psDBCommit(config->dbh)) {
     516            psError(PS_ERR_UNKNOWN, false, "database error");
     517            return false;
     518        }
     519
     520        return true;
     521    }
    506522    psFree(row);
     523    // else continue on...
     524
     525    if (!pxwarpQueueByCamID(config,
     526            pendingRow->cam_id,
     527            pendingRow->workdir,
     528            pendingRow->dvodb,
     529            pendingRow->tess_id,
     530            pendingRow->end_stage
     531    )) {
     532        // rollback
     533        if (!psDBRollback(config->dbh)) {
     534            psError(PS_ERR_UNKNOWN, false, "database error");
     535        }
     536        psError(PS_ERR_UNKNOWN, false, "failed to queue new warpRun");
     537        psFree(pendingRow);
     538        return false;
     539    }
     540    psFree(pendingRow);
    507541
    508542    if (!psDBCommit(config->dbh)) {
Note: See TracChangeset for help on using the changeset viewer.