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

    r18153 r18357  
    8787static bool detrunsummaryMode(pxConfig *config);
    8888static bool revertdetrunsummaryMode(pxConfig *config);
     89static bool updatedetrunsummaryMode(pxConfig *config);
     90// run
    8991static bool updatedetrunMode(pxConfig *config);
    9092static bool rerunMode(pxConfig *config);
     
    179181        MODECASE(DETTOOL_MODE_DETRUNSUMMARY,    detrunsummaryMode);
    180182        MODECASE(DETTOOL_MODE_REVERTDETRUNSUMMARY, revertdetrunsummaryMode);
     183        MODECASE(DETTOOL_MODE_UPDATEDETRUNSUMMARY, updatedetrunsummaryMode);
    181184        MODECASE(DETTOOL_MODE_UPDATEDETRUN,     updatedetrunMode);
    182185        MODECASE(DETTOOL_MODE_RERUN,            rerunMode);
     
    456459    }
    457460
    458     if (!convertIdToStr(detRuns)) {
    459         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    460         psFree(detRuns);
    461         return false;
    462     }
    463 
    464461    // negative simple so the default is true
    465462    if (!ippdbPrintMetadatas(stdout, detRuns, "detRun", !simple)) {
     
    719716    }
    720717
    721     // convert det_id to a string externaly
    722     if (!convertIdToStr(detRuns)) {
    723         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
    724         psFree(detRuns);
    725         return false;
    726     }
    727 
    728718    // negative simple so the default is true
    729719    if (!ippdbPrintMetadatas(stdout, detRuns, "detRun", !simple)) {
     
    10121002    }
    10131003
    1014     // convert det_id to a string externaly
    1015     if (!convertIdToStr(detRuns)) {
    1016         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    1017         psFree(detRuns);
    1018         return false;
    1019     }
    1020 
    10211004    // negative simple so the default is true
    10221005    if (!ippdbPrintMetadatas(stdout, newDetRuns, "detRun", !simple)) {
     
    11111094        psFree(runs);
    11121095        return true;
    1113     }
    1114 
    1115     // convert det_id to a string externaly
    1116     if (!convertIdToStr(runs)) {
    1117         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    1118         psFree(runs);
    1119         return false;
    11201096    }
    11211097
     
    11801156        psFree(output);
    11811157        return true;
    1182     }
    1183 
    1184     // convert det_id to a string externaly
    1185     if (!convertIdToStr(output)) {
    1186         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    1187         psFree(output);
    1188         return false;
    11891158    }
    11901159
     
    38513820
    38523821
     3822static bool updatedetrunsummaryMode(pxConfig *config)
     3823{
     3824    PS_ASSERT_PTR_NON_NULL(config, false);
     3825
     3826    // required
     3827    PXOPT_LOOKUP_STR(det_id, config->args, "-det_id", true, false);
     3828
     3829    PXOPT_LOOKUP_BOOL(accept, config->args, "-accept", false);
     3830    PXOPT_LOOKUP_BOOL(reject, config->args, "-reject", false);
     3831
     3832    if (accept && reject) {
     3833        psError(PS_ERR_UNKNOWN, true, "-accept and -reject are exclusive");
     3834        return false;
     3835    }
     3836
     3837    if (!(accept || reject)) {
     3838        psError(PS_ERR_UNKNOWN, true, "either -accept or -reject is required");
     3839        return false;
     3840    }
     3841
     3842    char *query = "UPDATE detRunSummary SET accept = %d WHERE det_id = %"PRId64;
     3843    if (!p_psDBRunQuery(config->dbh, query, accept, (psS64)atoll(det_id))) {
     3844        psError(PS_ERR_UNKNOWN, false, "database error");
     3845        return false;
     3846    }
     3847
     3848    return true;
     3849}
     3850
     3851
    38533852static bool updatedetrunMode(pxConfig *config)
    38543853{
     
    42524251    }
    42534252
    4254     if (!convertIdToStr(detRuns)) {
    4255         psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    4256         psFree(detRuns);
    4257         return false;
    4258     }
    4259 
    42604253    // negative simple so the default is true
    42614254    if (!ippdbPrintMetadatas(stdout, detRuns, "detRun", !simple)) {
Note: See TracChangeset for help on using the changeset viewer.