IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10988


Ignore:
Timestamp:
Jan 8, 2007, 4:08:02 PM (19 years ago)
Author:
jhoblitt
Message:

convert new[Exp|Imfile].flags -> .fault and change it into a S16

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r10976 r10988  
    4040static rawDetrendExpRow *newToRawDetrendExp(pxConfig *config, newExpRow *exp);
    4141static rawImfileRow *newToRawImfile(pxConfig *config, newImfileRow *exp);
    42 static psU32 mapCodeStrToInt(const char *codeStr);
    43 static bool setFaultFlags(psDB *dbh, const char *tableName, psMetadata *where, const char *codeStr);
     42//static psU32 mapCodeStrToInt(const char *codeStr);
     43static bool setFaultCode(psDB *dbh, const char *tableName, psMetadata *where, psS8 code);
    4444
    4545
     
    128128    if (faulted) {
    129129        // list only faulted rows
    130         psStringAppend(&query, " %s", "AND newExp.flags > 0");
     130        psStringAppend(&query, " %s", "AND newExp.fault != 0");
    131131    } else {
    132132        // don't list faulted rows
    133         psStringAppend(&query, " %s", "AND newExp.flags = 0");
     133        psStringAppend(&query, " %s", "AND newExp.fault = 0");
    134134    }
    135135
     
    218218    if (faulted) {
    219219        // list only faulted rows
    220         psStringAppend(&query, " %s", "AND newImfile.flags > 0");
     220        psStringAppend(&query, " %s", "AND newImfile.fault != 0");
    221221    } else {
    222222        // don't list faulted rows
    223         psStringAppend(&query, " %s", "AND newImfile.flags = 0");
     223        psStringAppend(&query, " %s", "AND newImfile.fault = 0");
    224224    }
    225225
     
    275275{
    276276    bool status = false;
    277     psString codeStr = psMetadataLookupStr(&status, config->args, "-code");
     277    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
    278278    if (!status) {
    279279        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
    280280        return false;
    281281    }
    282     if (!codeStr) {
    283         psError(PS_ERR_UNKNOWN, true, "-code is required");
    284         return false;
    285     }
    286 
    287     if (!setFaultFlags(config->dbh, "newExp", config->where, codeStr)) {
     282
     283    if (!setFaultCode(config->dbh, "newExp", config->where, code)) {
    288284        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
    289285        return false;
     
    298294
    299295    bool status = false;
    300     psString codeStr = psMetadataLookupStr(&status, config->args, "-code");
     296    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
    301297    if (!status) {
    302298        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
    303299        return false;
    304300    }
    305     if (!codeStr) {
    306         psError(PS_ERR_UNKNOWN, true, "-code is required");
    307         return false;
    308     }
    309 
    310     if (!setFaultFlags(config->dbh, "newImfile", config->where, codeStr)) {
     301
     302    if (!setFaultCode(config->dbh, "newImfile", config->where, code)) {
    311303        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
    312304        return false;
     
    316308}
    317309
    318 static bool setFaultFlags(psDB *dbh, const char *tableName, psMetadata *where, const char *codeStr)
     310
     311static bool setFaultCode(psDB *dbh, const char *tableName, psMetadata *where, psS8 code)
    319312{
    320313    PS_ASSERT_PTR_NON_NULL(dbh, false);
    321314    PS_ASSERT_PTR_NON_NULL(tableName, false);
    322     PS_ASSERT_PTR_NON_NULL(codeStr, false);
    323 
     315    PS_ASSERT_PTR_NON_NULL(where, false);
     316
     317#if 0
    324318    // map code string to numeric fault code
    325319    psU32 code = mapCodeStrToInt(codeStr);
     
    328322        return false;
    329323    }
     324#endif
    330325
    331326    // update the database
    332327    psMetadata *values = psMetadataAlloc();
    333     if (!psMetadataAddU32(values, PS_LIST_HEAD, "flags", 0, NULL, code)) {
    334         psError(PS_ERR_UNKNOWN, false, "failed to add metadata item flags");
     328    if (!psMetadataAddS8(values, PS_LIST_HEAD, "fault", 0, NULL, code)) {
     329        psError(PS_ERR_UNKNOWN, false, "failed to add metadata item fault");
    335330        psFree(values);
    336331        return false;
     
    11411136}
    11421137
     1138#if 0
    11431139static psU32 mapCodeStrToInt(const char *codeStr)
    11441140{
     
    11571153    return (psU32) -1;
    11581154}
     1155#endif
  • trunk/ippTools/src/regtoolConfig.c

    r10976 r10988  
    125125    psMetadataAddStr(faultexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
    126126        "search by exposure ID", NULL);
    127     psMetadataAddStr(faultexpArgs, PS_LIST_TAIL, "-code",  0,
    128         "set fault code (required)", NULL);
     127    psMetadataAddS8(faultexpArgs, PS_LIST_TAIL, "-code",  0,
     128        "set fault code (required)", 0);
    129129   
    130130    // -updateimfile
     
    175175    psMetadataAddStr(faultimfileArgs, PS_LIST_TAIL, "-class_id",  0,
    176176        "search by class ID", NULL);
    177     psMetadataAddStr(faultimfileArgs, PS_LIST_TAIL, "-code",  0,
    178         "set fault code (required)", NULL);
     177    psMetadataAddS8(faultimfileArgs, PS_LIST_TAIL, "-code",  0,
     178        "set fault code (required)", 0);
    179179   
    180180    // -rawimfile
Note: See TracChangeset for help on using the changeset viewer.