IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15765


Ignore:
Timestamp:
Dec 7, 2007, 3:20:29 PM (18 years ago)
Author:
jhoblitt
Message:

impliment -done

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r15758 r15765  
    526526    PS_ASSERT_PTR_NON_NULL(config, false);
    527527
     528    bool status = false;
     529    psString corr_id = psMetadataLookupStr(&status, config->args, "-corr_id");
     530    if (!status) {
     531        psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -corr_id");
     532        return false;
     533    }
     534
     535    psString stats = psMetadataLookupStr(&status, config->args, "-stats");
     536    if (!status) {
     537        psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -stats");
     538        return false;
     539    }
     540
     541    if (!psDBTransaction(config->dbh)) {
     542        psError(PS_ERR_UNKNOWN, false, "database error");
     543        return false;
     544    }
     545
     546    if (!setflatcorrRunState(config, (psS64)atoll(corr_id), "stop")) {
     547        if (!psDBRollback(config->dbh)) {
     548            psError(PS_ERR_UNKNOWN, false, "database error");
     549        }
     550        psError(PS_ERR_UNKNOWN, false, "failed to set run state");
     551        return false;
     552    }
     553
     554    char *query = "UPDATE flatcorrRun SET stats = '%s' WHERE corr_id = %" PRId64;
     555    if (!p_psDBRunQuery(config->dbh, query, stats, (psS64)atoll(corr_id))) {
     556        psError(PS_ERR_UNKNOWN, false,
     557                "failed to change state for corr_id %" PRId64, (psS64)atoll(corr_id));
     558        return false;
     559    }
     560
     561    if (!psDBCommit(config->dbh)) {
     562        psError(PS_ERR_UNKNOWN, false, "database error");
     563        return false;
     564    }
     565
    528566    return false;
    529567}
  • trunk/ippTools/src/flatcorrConfig.c

    r15758 r15765  
    158158            "define correction id (required)", NULL);
    159159    psMetadataAddStr(doneArgs, PS_LIST_TAIL, "-stats",  0,
    160             "define stats", NULL);
     160            "define stats (required)", NULL);
    161161
    162162    psFree(now);
Note: See TracChangeset for help on using the changeset viewer.