IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 23, 2007, 3:41:56 PM (19 years ago)
Author:
jhoblitt
Message:

s/p0/reg/g
s/p1/guide/g
s/p2/chip/g
s/p6/stack/g
s/p5/diff/g
s/p4/warp/g
s/p3/cam/g

File:
1 edited

Legend:

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

    r11997 r12024  
    9696    psString query = psStringCopy(
    9797            "SELECT"
    98             "   p3PendingExp.*,"
     98            "   camPendingExp.*,"
    9999            "   rawExp.camera,"
    100100            "   rawExp.workdir"
    101             " FROM p3PendingExp"
     101            " FROM camPendingExp"
    102102            " JOIN rawExp"
    103103            "   USING(exp_tag)"
    104             " LEFT JOIN p3ProcessedExp"
     104            " LEFT JOIN camProcessedExp"
    105105            "   USING(exp_tag)"
    106             " LEFT JOIN p3Mask"
    107             "   ON p3PendingExp.label = p3Mask.label"
     106            " LEFT JOIN camMask"
     107            "   ON camPendingExp.label = camMask.label"
    108108            " WHERE"
    109             "   p3ProcessedExp.exp_tag IS NULL"
    110             "   AND p3Mask.label IS NULL"
     109            "   camProcessedExp.exp_tag IS NULL"
     110            "   AND camMask.label IS NULL"
    111111    );
    112112
    113113    if (config->where) {
    114         psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p3PendingExp");
     114        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "camPendingExp");
    115115        psStringAppend(&query, " AND %s", whereClause);
    116116        psFree(whereClause);
     
    138138    if (!psArrayLength(output)) {
    139139        // XXX check psError here
    140         psError(PS_ERR_UNKNOWN, false, "no p3PendingExp rows found");
     140        psError(PS_ERR_UNKNOWN, false, "no camPendingExp rows found");
    141141        psFree(output);
    142142        return true;
     
    154154
    155155    // negate simple so the default is true
    156     if (!ippdbPrintMetadatas(stdout, output, "p3PendingExp", !simple)) {
     156    if (!ippdbPrintMetadatas(stdout, output, "camPendingExp", !simple)) {
    157157        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    158158        psFree(output);
     
    171171    psString query = psStringCopy(
    172172            "SELECT"
    173             "   p2ProcessedImfile.*,"
     173            "   chipProcessedImfile.*,"
    174174            "   rawExp.camera,"   
    175175            "   rawExp.workdir"   
    176             " FROM p3PendingExp"
    177             " JOIN p2ProcessedImfile"
    178             "   USING(exp_tag, p2_version)"
     176            " FROM camPendingExp"
     177            " JOIN chipProcessedImfile"
     178            "   USING(exp_tag, chip_version)"
    179179            " JOIN rawExp"
    180180            "   USING(exp_tag)"
    181             " LEFT JOIN p3ProcessedExp"
     181            " LEFT JOIN camProcessedExp"
    182182            "   USING(exp_tag)"
    183             " LEFT JOIN p3Mask"
    184             "   ON p3PendingExp.label = p3Mask.label"
     183            " LEFT JOIN camMask"
     184            "   ON camPendingExp.label = camMask.label"
    185185            " WHERE"
    186             "   p3ProcessedExp.exp_tag IS NULL"
    187             "   AND p3Mask.label IS NULL"
     186            "   camProcessedExp.exp_tag IS NULL"
     187            "   AND camMask.label IS NULL"
    188188    );
    189189
    190190    if (config->where) {
    191         psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p2ProcessedImfile");
     191        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "chipProcessedImfile");
    192192        psStringAppend(&query, " AND %s", whereClause);
    193193        psFree(whereClause);
     
    208208    if (!psArrayLength(output)) {
    209209        // XXX check psError here
    210         psError(PS_ERR_UNKNOWN, false, "no pending p2ProcessedImfile rows found");
     210        psError(PS_ERR_UNKNOWN, false, "no pending chipProcessedImfile rows found");
    211211        psFree(output);
    212212        return true;
     
    224224
    225225    // negate simple so the default is true
    226     if (!ippdbPrintMetadatas(stdout, output, "p2ProcessedImfile", !simple)) {
     226    if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) {
    227227        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    228228        psFree(output);
     
    362362
    363363    psString query = psStringCopy(
    364         "SELECT p3PendingExp.*"
    365         " FROM p3PendingExp"
    366         " LEFT JOIN p3ProcessedExp"
     364        "SELECT camPendingExp.*"
     365        " FROM camPendingExp"
     366        " LEFT JOIN camProcessedExp"
    367367        "   USING(exp_tag)"
    368368        " WHERE"
    369         "   p3ProcessedExp.exp_tag IS NULL"
    370         "   AND p3PendingExp.exp_tag = '%s'"
     369        "   camProcessedExp.exp_tag IS NULL"
     370        "   AND camPendingExp.exp_tag = '%s'"
    371371    );
    372372
     
    384384    }
    385385    if (!psArrayLength(output)) {
    386         psError(PS_ERR_UNKNOWN, false, "no p3PendingExp rows found");
     386        psError(PS_ERR_UNKNOWN, false, "no camPendingExp rows found");
    387387        psFree(output);
    388388        return true;
     
    390390
    391391    // start a transaction so we don't end up with an exp_tag is both
    392     // p3PendingExp & p3ProcessedExp
     392    // camPendingExp & camProcessedExp
    393393    if (!psDBTransaction(config->dbh)) {
    394394        psError(PS_ERR_UNKNOWN, false, "database error");
     
    397397    }
    398398
    399     p3PendingExpRow *pendingRow = p3PendingExpObjectFromMetadata(output->data[0]);
     399    camPendingExpRow *pendingRow = camPendingExpObjectFromMetadata(output->data[0]);
    400400    psFree(output);
    401     // create a new p3ProcessedImfile object
    402     p3ProcessedExpRow *row = p3ProcessedExpRowAlloc(
     401    // create a new camProcessedImfile object
     402    camProcessedExpRow *row = camProcessedExpRowAlloc(
    403403        exp_tag,
    404         pendingRow->p3_version,
    405         pendingRow->p2_version,
     404        pendingRow->cam_version,
     405        pendingRow->chip_version,
    406406        pendingRow->label,
    407407        uri,
     
    422422    );
    423423
    424     // insert the new row into the p3ProcessedImfile table
    425     if (!p3ProcessedExpInsertObject(config->dbh, row)) {
     424    // insert the new row into the camProcessedImfile table
     425    if (!camProcessedExpInsertObject(config->dbh, row)) {
    426426        // rollback
    427427        if (!psDBRollback(config->dbh)) {
     
    435435    psFree(row);
    436436
    437     // delete the p3PendingExp row from the database
    438     if (!p3PendingExpDeleteObject(config->dbh, pendingRow)) {
     437    // delete the camPendingExp row from the database
     438    if (!camPendingExpDeleteObject(config->dbh, pendingRow)) {
    439439        // rollback
    440440        if (!psDBRollback(config->dbh)) {
     
    448448    psFree(pendingRow);
    449449
    450     // point of no return for p3PendingExp -> p3ProcessedExp
     450    // point of no return for camPendingExp -> camProcessedExp
    451451    if (!psDBCommit(config->dbh)) {
    452452        psError(PS_ERR_UNKNOWN, false, "database error");
     
    476476    psString query = psStringCopy(
    477477            "SELECT"
    478             "   p3ProcessedExp.*,"
     478            "   camProcessedExp.*,"
    479479            "   rawExp.camera,"
    480480            "   rawExp.workdir"
    481             " FROM p3ProcessedExp"
     481            " FROM camProcessedExp"
    482482            " JOIN rawExp"
    483483            "   USING(exp_tag)"   
    484484            " WHERE"
    485             "   p3ProcessedExp.exp_tag IS NOT NULL"
     485            "   camProcessedExp.exp_tag IS NOT NULL"
    486486    );
    487487
     
    494494    if (faulted) {
    495495        // list only faulted rows
    496         psStringAppend(&query, " %s", "AND p3ProcessedExp.fault != 0");
     496        psStringAppend(&query, " %s", "AND camProcessedExp.fault != 0");
    497497    } else {
    498498        // don't list faulted rows
    499         psStringAppend(&query, " %s", "AND p3ProcessedExp.fault = 0");
     499        psStringAppend(&query, " %s", "AND camProcessedExp.fault = 0");
    500500    }
    501501
     
    521521    if (!psArrayLength(output)) {
    522522        // XXX check psError here
    523         psError(PS_ERR_UNKNOWN, false, "no p3ProcessedExp rows found");
     523        psError(PS_ERR_UNKNOWN, false, "no camProcessedExp rows found");
    524524        psFree(output);
    525525        return true;
     
    537537
    538538    // negate simple so the default is true
    539     if (!ippdbPrintMetadatas(stdout, output, "p3ProcessedExp", !simple)) {
     539    if (!ippdbPrintMetadatas(stdout, output, "camProcessedExp", !simple)) {
    540540        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    541541        psFree(output);
     
    560560    }
    561561
    562     if (!pxSetFaultCode(config->dbh, "p3ProcessedExp", config->where, code)) {
     562    if (!pxSetFaultCode(config->dbh, "camProcessedExp", config->where, code)) {
    563563        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
    564564        return false;
     
    584584    }
    585585
    586     if (!p3MaskInsert(config->dbh, label)) {
     586    if (!camMaskInsert(config->dbh, label)) {
    587587        psError(PS_ERR_UNKNOWN, false, "database error");
    588588        return false;
     
    596596    PS_ASSERT_PTR_NON_NULL(config, false);
    597597
    598     psString query = psStringCopy("SELECT * FROM p3Mask");
     598    psString query = psStringCopy("SELECT * FROM camMask");
    599599
    600600    if (!p_psDBRunQuery(config->dbh, query)) {
     
    612612    if (!psArrayLength(output)) {
    613613        // XXX check psError here
    614         psError(PS_ERR_UNKNOWN, false, "no p3Mask rows found");
     614        psError(PS_ERR_UNKNOWN, false, "no camMask rows found");
    615615        psFree(output);
    616616        return true;
     
    628628
    629629    // negative simple so the default is true
    630     if (!ippdbPrintMetadatas(stdout, output, "p3Mask", !simple)) {
     630    if (!ippdbPrintMetadatas(stdout, output, "camMask", !simple)) {
    631631        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    632632        psFree(output);
     
    654654    }
    655655
    656     char *query = "DELETE FROM p3Mask WHERE label = '%s'";
     656    char *query = "DELETE FROM camMask WHERE label = '%s'";
    657657
    658658    if (!p_psDBRunQuery(config->dbh, query, label)) {
Note: See TracChangeset for help on using the changeset viewer.