IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8012


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

implement -newImfile

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r8011 r8012  
    7777        return false;
    7878    }
    79     psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");    if (!status) {
     79    psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");
     80    if (!status) {
    8081        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_type");
    8182        return false;
     
    105106static bool newImfileMode(pxConfig *config)
    106107{
     108    bool status = false;
     109
     110    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
     111    if (!status) {
     112        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
     113        return false;
     114    }
     115    if (!exp_id) {
     116        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
     117        return false;
     118    }
     119    psString class = psMetadataLookupStr(&status, config->args, "-class");
     120    if (!status) {
     121        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class");
     122        return false;
     123    }
     124    if (!class) {
     125        psError(PS_ERR_UNKNOWN, true, "-class is required");
     126        return false;
     127    }
     128    psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
     129    if (!status) {
     130        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id");
     131        return false;
     132    }
     133    if (!class_id) {
     134        psError(PS_ERR_UNKNOWN, true, "-class_id is required");
     135        return false;
     136    }
     137    psString uri = psMetadataLookupStr(&status, config->args, "-uri");
     138    if (!status) {
     139        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri");
     140        return false;
     141    }
     142    if (!uri) {
     143        psError(PS_ERR_UNKNOWN, true, "-uri is required");
     144        return false;
     145    }
     146
     147    if (!newImfileInsert(config->dbh, exp_id, class, class_id, uri)) {
     148        psError(PS_ERR_UNKNOWN, false, "database error");
     149        return false;
     150    }
     151
    107152    return true;
    108153}
  • trunk/ippTools/src/pxinjectConfig.c

    r8008 r8012  
    3838    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    3939        "define the exp_id (required)", NULL);
    40     psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-inst",  0,
    41         "define the camera name (required)", NULL);
    42     psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-telescope",  0,
    43         "define the telescope name (required)", NULL);
    44     psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-exp_type",  0,
    45         "define the type of exposure (required)", NULL);
    46     psMetadataAddS32(newImfileArgs, PS_LIST_TAIL, "-imfiles",  0,
    47         "define the number of imfiles in this exp (required)", 0);
     40    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-class",  0,
     41        "define the class (required)", NULL);
     42    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-class_id",  0,
     43        "define the class ID (required)", NULL);
     44    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-uri",  0,
     45        "define the URI (required)", NULL);
    4846
    4947#define PXTOOL_MODE(option, modeval, argset) \
Note: See TracChangeset for help on using the changeset viewer.