IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2006, 12:00:57 PM (20 years ago)
Author:
jhoblitt
Message:

implemented -newExp

File:
1 edited

Legend:

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

    r7971 r8011  
    4848static bool newExpMode(pxConfig *config)
    4949{
     50    bool status = false;
     51
     52    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
     53    if (!status) {
     54        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
     55        return false;
     56    }
     57    if (!exp_id) {
     58        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
     59        return false;
     60    }
     61    psString camera = psMetadataLookupStr(&status, config->args, "-inst");
     62    if (!status) {
     63        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst");
     64        return false;
     65    }
     66    if (!camera) {
     67        psError(PS_ERR_UNKNOWN, true, "-inst is required");
     68        return false;
     69    }
     70    psString telescope = psMetadataLookupStr(&status, config->args, "-telescope");
     71    if (!status) {
     72        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope");
     73        return false;
     74    }
     75    if (!telescope) {
     76        psError(PS_ERR_UNKNOWN, true, "-telescope is required");
     77        return false;
     78    }
     79    psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");    if (!status) {
     80        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_type");
     81        return false;
     82    }
     83    if (!exp_type) {
     84        psError(PS_ERR_UNKNOWN, true, "-exp_type is required");
     85        return false;
     86    }
     87    psS32 imfiles = psMetadataLookupS32(&status, config->args, "-imfiles");
     88    if (!status) {
     89        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -imfiles");
     90        return false;
     91    }
     92    if (!imfiles) {
     93        psError(PS_ERR_UNKNOWN, true, "-imfiles is required");
     94        return false;
     95    }
     96
     97    if (!newExpInsert(config->dbh, exp_id, camera, telescope, exp_type, imfiles)) {
     98        psError(PS_ERR_UNKNOWN, false, "database error");
     99        return false;
     100    }
     101
    50102    return true;
    51103}
Note: See TracChangeset for help on using the changeset viewer.