IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 29, 2008, 2:44:04 PM (18 years ago)
Author:
eugene
Message:

merge cvs HEAD into cleanup branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cleanup/ippTools/src/chiptool.c

    r18154 r18357  
    110110    PS_ASSERT_PTR_NON_NULL(config, NULL);
    111111
    112     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);
     112    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", false, false);
    113113
    114114    psMetadata *where = psMetadataAlloc();
    115     // convert exp_id into a psS64
    116     if (exp_id) {
    117         if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) {
    118             psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    119             psFree(where);
    120             return false;
    121         }
    122     }
    123 
     115    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    124116    PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "==");
    125117    PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
     
    158150    PXOPT_COPY_F32(config->args, where, "-solang_min", "solang", ">=");
    159151    PXOPT_COPY_F32(config->args, where, "-solang_max", "solang", "<");
     152    PXOPT_COPY_STR(config->args, where, "-comment", "comment", "LIKE");
    160153
    161154    if (!psListLength(where->list)
     
    266259
    267260    psMetadata *where = psMetadataAlloc();
    268     PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);
    269     // convert chip_id into a psS64
    270     if (chip_id) {
    271         if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) {
    272             psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
    273             psFree(where);
    274             return false;
    275         }
    276     }
    277 
    278     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);
    279     // convert exp_id into a psS64
    280     if (exp_id) {
    281         if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) {
    282             psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    283             psFree(where);
    284             return false;
    285         }
    286     }
    287 
    288     PXOPT_COPY_STR(config->args,  where, "-chip_id", "chip_id", "==");
    289     PXOPT_COPY_STR(config->args,  where, "-exp_id", "exp_id", "==");
     261    PXOPT_COPY_S64(config->args,  where, "-chip_id", "chip_id", "==");
     262    PXOPT_COPY_S64(config->args,  where, "-exp_id", "exp_id", "==");
    290263    PXOPT_COPY_STR(config->args,  where, "-exp_name", "exp_name", "==");
    291264    PXOPT_COPY_STR(config->args,  where, "-inst", "camera", "==");
     
    374347
    375348    psMetadata *where = psMetadataAlloc();
    376     PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);
    377     // convert chip_id into a psS64
    378     if (chip_id) {
    379         if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) {
    380             psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
    381             psFree(where);
    382             return false;
    383         }
    384     }
    385 
    386     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);
    387     // convert exp_id into a psS64
    388     if (exp_id) {
    389         if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) {
    390             psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    391             psFree(where);
    392             return false;
    393         }
    394     }
    395 
     349    PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
     350    PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "==");
    396351    PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "==");
    397352    PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "==");
     
    436391    }
    437392
    438     if (!convertIdToStr(output)) {
    439         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    440         psFree(output);
    441         return false;
    442     }
    443 
    444393    // negative simple so the default is true
    445394    if (!ippdbPrintMetadatas(stdout, output, "chipPendingImfile", !simple)) {
     
    460409
    461410    // chip_id, ext_tag, class_id are required
    462     PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", true, false);
    463     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false);
     411    PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false);
     412    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false);
    464413    PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
    465414
     
    501450
    502451    if (!chipProcessedImfileInsert(config->dbh,
    503                                    (psS64)atoll(chip_id),
    504                                    (psS64)atoll(exp_id),
     452                                   chip_id,
     453                                   exp_id,
    505454                                   class_id,
    506455                                   uri,
     
    572521
    573522    psMetadata *where = psMetadataAlloc();
    574     PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);
    575     // convert chip_id into a psS64
    576     if (chip_id) {
    577         if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) {
    578             psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
    579             psFree(where);
    580             return false;
    581         }
    582     }
    583 
    584     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);
    585     // convert exp_id into a psS64
    586     if (exp_id) {
    587         if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) {
    588             psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    589             psFree(where);
    590             return false;
    591         }
    592     }
    593 
     523    PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
     524    PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.chip_id", "==");
    594525    PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "==");
    595526    PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "==");
     
    642573    }
    643574
    644     if (!convertIdToStr(output)) {
    645         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    646         psFree(output);
    647         return false;
    648     }
    649 
    650575    // negative simple so the default is true
    651576    if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) {
     
    665590
    666591    psMetadata *where = psMetadataAlloc();
    667     PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false);
    668     // convert chip_id into a psS64
    669     if (chip_id) {
    670         if (!psMetadataAddS64(where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(chip_id))) {
    671             psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
    672             psFree(where);
    673             return false;
    674         }
    675     }
    676 
    677     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);
    678     // convert exp_id into a psS64
    679     if (exp_id) {
    680         if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) {
    681             psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    682             psFree(where);
    683             return false;
    684         }
    685     }
    686 
     592    PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
     593    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    687594    PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "==");
    688595    PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
     
    835742    }
    836743
    837     if (!convertIdToStr(output)) {
    838         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    839         psFree(output);
    840         return false;
    841     }
    842 
    843744    // negative simple so the default is true
    844745    if (!ippdbPrintMetadatas(stdout, output, "chipMask", !simple)) {
     
    908809    }
    909810
    910     if (!convertIdToStr(output)) {
    911         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    912         psFree(output);
    913         return false;
    914     }
    915 
    916811    // negative simple so the default is true
    917812    if (!ippdbPrintMetadatas(stdout, output, "chipUnmask", !simple)) {
     
    992887    }
    993888
    994     if (!convertIdToStr(output)) {
    995         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    996         psFree(output);
    997         return false;
    998     }
    999 
    1000889    // negative simple so the default is true
    1001890    if (!ippdbPrintMetadatas(stdout, output, "chipPendingCleanupRun", !simple)) {
     
    1063952    }
    1064953
    1065     if (!convertIdToStr(output)) {
    1066         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    1067         psFree(output);
    1068         return false;
    1069     }
    1070 
    1071954    // negative simple so the default is true
    1072955    if (!ippdbPrintMetadatas(stdout, output, "chipPendingCleanupImfile", !simple)) {
     
    11301013    }
    11311014
    1132     if (!convertIdToStr(output)) {
    1133         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    1134         psFree(output);
    1135         return false;
    1136     }
    1137 
    11381015    // negative simple so the default is true
    11391016    if (!ippdbPrintMetadatas(stdout, output, "chipDoneCleanup", !simple)) {
     
    12031080        psFree(output);
    12041081        return true;
    1205     }
    1206 
    1207     if (!convertIdToStr(output)) {
    1208         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    1209         psFree(output);
    1210         return false;
    12111082    }
    12121083
Note: See TracChangeset for help on using the changeset viewer.