IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7027


Ignore:
Timestamp:
May 1, 2006, 3:05:04 PM (20 years ago)
Author:
Paul Price
Message:

Updating to use psModules head --- pmConfigRead changed, and pmConfigDB

Location:
trunk/ippTools/src
Files:
10 edited

Legend:

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

    r6978 r7027  
    1212    }
    1313
    14     if (! pmConfigRead(&config->site, &config->camera, &config->recipe, &argc, argv, RECIPE)) {
     14    config->modules = pmConfigRead(&argc, argv);
     15    if (! config->modules) {
    1516        psErrorStackPrint(stderr, "Can't find site configuration!\n");
    1617        exit(EXIT_FAILURE);
     
    5960        config->mode = PX_MODE_DONE;
    6061    }
    61    
    62     // paul's argument parsing convention requires: -key value 
     62
     63    // paul's argument parsing convention requires: -key value
    6364    psMetadataAddBool(arguments, PS_LIST_TAIL, "-quick",   0, "examine raw image table, write ppImage output", false);
    6465    psMetadataAddStr(arguments, PS_LIST_TAIL, "-define",  0, "examine raw image table, add to pending image table", "");
     
    158159
    159160    // define Database handle, if used
    160     config->dbh = pmConfigDB(config->site);
     161    config->dbh = pmConfigDB(config->modules);
    161162
    162163    return true;
    163 } 
     164}
  • trunk/ippTools/src/guidetoolConfig.c

    r7024 r7027  
    1515
    1616    // setup site config
    17     if (! pmConfigRead(&config->site, &config->camera, &config->recipe,
    18         &argc, argv, RECIPE)) {
     17    config->modules = pmConfigRead(&argc, argv);
     18    if (!config->modules) {
    1919        psError(PS_ERR_UNKNOWN, false, "Can't find site configuration!\n");
    2020        exit(EXIT_FAILURE);
     
    8989        config->mode = PX_MODE_DEFINE;
    9090    }
    91    
     91
    9292    // parse CLI for these options
    9393    psMetadata *argSet = NULL;
     
    125125        exit(EXIT_FAILURE);
    126126    }
    127    
     127
    128128    psFree(args);
    129129    psFree(pendingArgs);
     
    192192
    193193    // define Database handle, if used
    194     config->dbh = pmConfigDB(config->site);
     194    config->dbh = pmConfigDB(config->modules);
    195195
    196196    return config;
    197 } 
     197}
  • trunk/ippTools/src/pxadminConfig.c

    r6978 r7027  
    1212    }
    1313
    14     if (! pmConfigRead(&config->site, &config->camera, &config->recipe, &argc, argv, RECIPE)) {
     14    config->modules = pmConfigRead(&argc, argv);
     15
     16    if (! config->modules) {
    1517        psErrorStackPrint(stderr, "Can't find site configuration!\n");
    1618        exit(EXIT_FAILURE);
     
    4446    }
    4547
    46     // paul's argument parsing convention requires: -key value 
     48    // paul's argument parsing convention requires: -key value
    4749    psMetadataAddStr(arguments, PS_LIST_TAIL, "-create", 0,
    4850            "create the P2 tables", "");
     
    7577
    7678    // define Database handle, if used
    77     config->dbh = pmConfigDB(config->site);
     79    config->dbh = pmConfigDB(config->modules);
    7880    return config;
    79 } 
     81}
    8082
    8183/*
  • trunk/ippTools/src/pxconfig.c

    r6978 r7027  
    1717    config->start           = NULL;
    1818    config->stop            = NULL;
    19     config->camera          = NULL;
    2019    config->camera_name     = NULL;
    2120    config->telescope       = NULL;
     
    2322    config->filter          = NULL;
    2423    config->dbh             = NULL;
    25     config->site            = NULL;
    26     config->recipe          = NULL;
     24    config->modules         = NULL;
    2725    config->exp_id          = NULL;
    2826    config->class           = NULL;
     
    3836    psFree(config->start);
    3937    psFree(config->stop);
    40     psFree(config->camera);
    4138    psFree(config->camera_name);
    4239    psFree(config->telescope);
    4340    psFree(config->exp_type);
    4441    psFree(config->filter);
    45     psFree(config->dbh);
    46     psFree(config->site);
    47     psFree(config->recipe);
     42    psFree(config->dbh);
     43    psFree(config->modules);
    4844    psFree(config->exp_id);
    4945    psFree(config->class);
  • trunk/ippTools/src/pxtables.c

    r6978 r7027  
    6060    fgets (line, 128, stdin);
    6161    sscanf (line, "%s", answer);
    62              
     62
    6363    {
    6464        bool status;
    65         psString dbPassword = psMetadataLookupStr(&status, config->site, "DBPASSWORD");
     65        psString dbPassword = psMetadataLookupStr(&status, config->modules->site, "DBPASSWORD");
    6666        if (strcmp (answer, dbPassword)) goto escape;
    6767        psFree(dbPassword);
  • trunk/ippTools/src/pxtools.h

    r6978 r7027  
    66# include <unistd.h>   // for unlink
    77# include <pslib.h>
    8 # include <pmObjects.h>
    9 # include <pmPSF.h>
    10 # include <pmPSFtry.h>
    11 # include <pmModelGroup.h>
     8# include <psmodules.h>
    129# include <metadatadb.h>
    1310
     
    4037    psSphere r1;
    4138    psSphere r2;
    42     psMetadata *camera;
     39    pmConfig *modules;
    4340    char *camera_name;
    4441    char *telescope;
     
    4643    char *filter;
    4744    psDB *dbh;
    48     psMetadata *site;
    49     psMetadata *recipe;
    5045    char *exp_id;
    5146    char *class;
     
    149144rawScienceFrame *newToRawScienceFrame(newFrame *newFrame);
    150145bool rawScienceFrameInsert(pxConfig *config, rawScienceFrame *frame);
    151 rawDetrendFrame *newToRawDetrendFrame(newFrame *newFrame); 
     146rawDetrendFrame *newToRawDetrendFrame(newFrame *newFrame);
    152147bool rawDetrendFrameInsert(pxConfig *config, rawDetrendFrame *frame);
    153148
  • trunk/ippTools/src/pzgetexpConfig.c

    r6978 r7027  
    99pxConfig *pzgetexpConfig(pxConfig *config, int argc, char **argv) {
    1010    if (!config) {
    11         config = pxConfigAlloc();           
     11        config = pxConfigAlloc();
    1212    }
    1313
    14     if (! pmConfigRead(&config->site, &config->camera, &config->recipe, &argc, argv, RECIPE)) {
     14    config->modules = pmConfigRead(&argc, argv);
     15
     16    if (! config->modules) {
    1517        psError(PS_ERR_UNKNOWN, false, "Can't find site configuration!\n");
    1618        exit(EXIT_FAILURE);
     
    4648
    4749    // define Database handle, if used
    48     config->dbh = pmConfigDB(config->site);
     50    config->dbh = pmConfigDB(config->modules);
    4951    if(!config->dbh) {
    5052        psError(PS_ERR_UNKNOWN, false, "Can't connect to db\n");
     
    5456
    5557    return config;
    56 } 
     58}
  • trunk/ippTools/src/pzgetimfilesConfig.c

    r6978 r7027  
    99pxConfig *pzgetimfilesConfig(pxConfig *config, int argc, char **argv) {
    1010    if (!config) {
    11         config = pxConfigAlloc();           
     11        config = pxConfigAlloc();
    1212    }
    1313
    14     if (! pmConfigRead(&config->site, &config->camera, &config->recipe, &argc, argv, RECIPE)) {
     14    config->modules = pmConfigRead(&argc, argv);
     15
     16    if (! config->modules) {
    1517        psError(PS_ERR_UNKNOWN, false, "Can't find site configuration!\n");
    1618        exit(EXIT_FAILURE);
     
    1921    psMetadata *args = psMetadataAlloc();
    2022    psMetadataAddStr(args , PS_LIST_TAIL, "-uri", 0,
    21         "DataStore FileSet URI", ""); 
     23        "DataStore FileSet URI", "");
    2224    psMetadataAddStr(args , PS_LIST_TAIL, "-filesetid", 0,
    23         "FileSet ID", ""); 
     25        "FileSet ID", "");
    2426
    2527    bool status = false;
     
    4244
    4345    // define Database handle, if used
    44     config->dbh = pmConfigDB(config->site);
     46    config->dbh = pmConfigDB(config->modules);
    4547    if(!config->dbh) {
    4648        psError(PS_ERR_UNKNOWN, false, "Can't connect to db\n");
     
    5052
    5153    return config;
    52 } 
     54}
  • trunk/ippTools/src/pztoolConfig.c

    r6978 r7027  
    1212    }
    1313
    14     if (! pmConfigRead(&config->site, &config->camera, &config->recipe, &argc, argv, RECIPE)) {
     14    config->modules = pmConfigRead(&argc, argv);
     15
     16    if (! config->modules) {
    1517        psError(PS_ERR_UNKNOWN, false, "Can't find site configuration!\n");
    1618        exit(EXIT_FAILURE);
     
    4042        config->mode = PX_MODE_COPYDONE;
    4143    }
    42    
    43     // paul's argument parsing convention requires: -key value 
     44
     45    // paul's argument parsing convention requires: -key value
    4446    // Parse other command-line arguments
    4547    psMetadata *args = psMetadataAlloc();
     
    127129
    128130    // define Database handle, if used
    129     config->dbh = pmConfigDB(config->site);
     131    config->dbh = pmConfigDB(config->modules);
    130132
    131133    return config;
    132 } 
     134}
  • trunk/ippTools/src/regtoolConfig.c

    r6978 r7027  
    1212    }
    1313
    14     if (! pmConfigRead(&config->site, &config->camera, &config->recipe, &argc, argv, RECIPE)) {
     14    config->modules = pmConfigRead(&argc, argv);
     15
     16    if (! config->modules) {
    1517        psError(PS_ERR_UNKNOWN, false, "Can't find site configuration!\n");
    1618        exit(EXIT_FAILURE);
     
    3335        config->mode = PX_MODE_UPDATE;
    3436    }
    35    
    36     // paul's argument parsing convention requires: -key value 
     37
     38    // paul's argument parsing convention requires: -key value
    3739    // Parse other command-line arguments
    3840    psMetadata *args = psMetadataAlloc();
     
    191193
    192194    // define Database handle, if used
    193     config->dbh = pmConfigDB(config->site);
     195    config->dbh = pmConfigDB(config->modules);
    194196
    195197    return true;
    196 } 
     198}
Note: See TracChangeset for help on using the changeset viewer.