IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6658


Ignore:
Timestamp:
Mar 20, 2006, 5:06:42 PM (20 years ago)
Author:
jhoblitt
Message:

add pzPendingExp, pzPendingImfiles, & summitExp tables
change table create/drop to use simple macros

File:
1 edited

Legend:

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

    r6341 r6658  
    11#include "pxtools.h"
     2
     3#define CREATE_TABLE(createFunc) \
     4    if (!createFunc(config->dbh)) { \
     5        psError(PS_ERR_UNKNOWN, false, "dbh access failed"); \
     6        status = false; \
     7    }
     8
     9#define DROP_TABLE(dropFunc) \
     10    if (!dropFunc(config->dbh)) { \
     11        psError(PS_ERR_UNKNOWN, false, "dbh access failed"); \
     12        status = false; \
     13    }
    214
    315bool pxCreateTables(pxConfig *config) {
     
    618    PS_ASSERT_PTR_NON_NULL(config, false);
    719
    8     if (!newExpCreateTable(config->dbh)) {
    9         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    10         status = false;
    11     }
    12     if (!newImfileCreateTable(config->dbh)) {
    13         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    14         status = false;
    15     }
    16     if (!rawScienceExpCreateTable(config->dbh)) {
    17         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    18         status = false;
    19     }
    20     if (!rawImfileCreateTable(config->dbh)) {
    21         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    22         status = false;
    23     }
    24     if (!rawDetrendExpCreateTable(config->dbh)) {
    25         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    26         status = false;
    27     }
    28     if (!p1PendingExpCreateTable(config->dbh)) {
    29         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    30         status = false;
    31     }
    32     if (!p2PendingExpCreateTable(config->dbh)) {
    33         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    34         status = false;
    35     }
    36     if (!p2PendingImfileCreateTable(config->dbh)) {
    37         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    38         status = false;
    39     }
    40     if (!p2DoneExpCreateTable(config->dbh)) {
    41         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    42         status = false;
    43     }
    44     if (!p2DoneImfileCreateTable(config->dbh)) {
    45         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    46         status = false;
    47     }
    48     if (!p3PendingExpCreateTable(config->dbh)) {
    49         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    50         status = false;
    51     }
    52     if (!masterDetrendFramesCreateTable(config->dbh)) {
    53         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    54         status = false;
    55     }
    56     if (!masterDetrendImfileCreateTable(config->dbh)) {
    57         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    58         status = false;
    59     }
     20    CREATE_TABLE(summitExpCreateTable);
     21    CREATE_TABLE(pzPendingExpCreateTable);
     22    CREATE_TABLE(pzPendingImfilesCreateTable);
     23    CREATE_TABLE(newExpCreateTable);
     24    CREATE_TABLE(newImfileCreateTable);
     25    CREATE_TABLE(rawScienceExpCreateTable);
     26    CREATE_TABLE(rawImfileCreateTable);
     27    CREATE_TABLE(rawDetrendExpCreateTable);
     28    CREATE_TABLE(p1PendingExpCreateTable);
     29    CREATE_TABLE(p2PendingExpCreateTable);
     30    CREATE_TABLE(p2PendingImfileCreateTable);
     31    CREATE_TABLE(p2DoneExpCreateTable);
     32    CREATE_TABLE(p2DoneImfileCreateTable);
     33    CREATE_TABLE(p3PendingExpCreateTable);
     34    CREATE_TABLE(masterDetrendFramesCreateTable);
     35    CREATE_TABLE(masterDetrendImfileCreateTable);
    6036
    6137    return true;
     
    8864    }
    8965
    90     if (!newExpDropTable(config->dbh)) {
    91         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    92         status = false;
    93     }
    94     if (!newImfileDropTable(config->dbh)) {
    95         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    96         status = false;
    97     }
    98     if (!rawScienceExpDropTable(config->dbh)) {
    99         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    100         status = false;
    101     }
    102     if (!rawImfileDropTable(config->dbh)) {
    103         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    104         status = false;
    105     }
    106     if (!rawDetrendExpDropTable(config->dbh)) {
    107         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    108         status = false;
    109     }
    110     if (!p1PendingExpDropTable(config->dbh)) {
    111         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    112         status = false;
    113     }
    114     if (!p2PendingExpDropTable(config->dbh)) {
    115         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    116         status = false;
    117     }
    118     if (!p2PendingImfileDropTable(config->dbh)) {
    119         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    120         status = false;
    121     }
    122     if (!p2DoneExpDropTable(config->dbh)) {
    123         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    124         status = false;
    125     }
    126     if (!p2DoneImfileDropTable(config->dbh)) {
    127         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    128         status = false;
    129     }
    130     if (!p3PendingExpDropTable(config->dbh)) {
    131         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    132         status = false;
    133     }
    134     if (!masterDetrendFramesDropTable(config->dbh)) {
    135         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    136         status = false;
    137     }
    138     if (!masterDetrendImfileDropTable(config->dbh)) {
    139         psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    140         status = false;
    141     }
     66    DROP_TABLE(summitExpDropTable);
     67    DROP_TABLE(pzPendingExpDropTable);
     68    DROP_TABLE(pzPendingImfilesDropTable);
     69    DROP_TABLE(newExpDropTable);
     70    DROP_TABLE(newImfileDropTable);
     71    DROP_TABLE(rawScienceExpDropTable);
     72    DROP_TABLE(rawImfileDropTable);
     73    DROP_TABLE(rawDetrendExpDropTable);
     74    DROP_TABLE(p1PendingExpDropTable);
     75    DROP_TABLE(p2PendingExpDropTable);
     76    DROP_TABLE(p2PendingImfileDropTable);
     77    DROP_TABLE(p2DoneExpDropTable);
     78    DROP_TABLE(p2DoneImfileDropTable);
     79    DROP_TABLE(p3PendingExpDropTable);
     80    DROP_TABLE(masterDetrendFramesDropTable);
     81    DROP_TABLE(masterDetrendImfileDropTable);
    14282
    14383    return status;
Note: See TracChangeset for help on using the changeset viewer.