IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 6, 2009, 9:22:42 AM (17 years ago)
Author:
eugene
Message:

change addcamera to advancecamera; add addcamera mode matching addchip mode

File:
1 edited

Legend:

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

    r24140 r25784  
    3939static bool addchipMode(pxConfig *config);
    4040static bool addcameraMode(pxConfig *config);
     41static bool advancecameraMode(pxConfig *config);
    4142static bool dropchipMode(pxConfig *config);
    4243static bool dropcameraMode(pxConfig *config);
     
    7374        MODECASE(FLATCORR_MODE_ADDCHIP,        addchipMode);
    7475        MODECASE(FLATCORR_MODE_ADDCAMERA,      addcameraMode);
     76        MODECASE(FLATCORR_MODE_ADVANCECAMERA,  advancecameraMode);
    7577        MODECASE(FLATCORR_MODE_DROPCHIP,       dropchipMode);
    7678        MODECASE(FLATCORR_MODE_DROPCAMERA,     dropcameraMode);
     
    297299    // start a transaction so we don't end up with an exp without any associted
    298300    // imfiles
    299     if (!psDBTransaction(config->dbh)) {
    300         psError(PS_ERR_UNKNOWN, false, "database error");
    301         return false;
    302     }
     301    // if (!psDBTransaction(config->dbh)) {
     302    //     psError(PS_ERR_UNKNOWN, false, "database error");
     303    //     return false;
     304    // }
    303305
    304306    // create a new flatcorrRun
     
    333335    row->corr_id = corr_id;
    334336
     337    // if (!psDBCommit(config->dbh)) {
     338    //     psError(PS_ERR_UNKNOWN, false, "database error");
     339    //     return false;
     340    // }
     341
    335342    flatcorrRunPrintObject (stdout, row, !simple);
    336343    return true;
     
    378385}
    379386
     387static bool addcameraMode(pxConfig *config)
     388{
     389    PS_ASSERT_PTR_NON_NULL(config, false);
     390
     391    // required
     392    PXOPT_LOOKUP_S64(corr_id, config->args, "-corr_id", true, false);
     393    PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false);
     394    PXOPT_LOOKUP_S64(cam_id, config->args, "-cam_id", true, false);
     395
     396    // add a flatcorrCamLink (initial state has include = TRUE)
     397    // XXX should add checks that the chip_id and corr_id are in ChipLink
     398    if (!flatcorrCamLinkInsert(config->dbh, corr_id, chip_id, cam_id, 1)) {
     399        psError(PS_ERR_UNKNOWN, false, "database error");
     400        return false;
     401    }
     402
     403    return true;
     404}
     405
    380406// select the flatcorr chip runs that have completed and for which there is no camera entry
    381407// queue a new camera run for them
    382 static bool addcameraMode(pxConfig *config)
     408static bool advancecameraMode(pxConfig *config)
    383409{
    384410    PS_ASSERT_PTR_NON_NULL(config, false);
Note: See TracChangeset for help on using the changeset viewer.