Changeset 11421 for trunk/psModules/src/detrend/pmDetrendDB.c
- Timestamp:
- Jan 29, 2007, 6:46:20 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmDetrendDB.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmDetrendDB.c
r11108 r11421 6 6 #include <string.h> 7 7 #include <pslib.h> 8 #include "pmConfig.h" 8 9 #include "pmFPA.h" 9 10 #include "pmFPALevel.h" … … 93 94 // detselect -camera (camera) -time (time) -type (type) [others] 94 95 // returns: (type) (class) (exp_flag) DONE 95 pmDetrendSelectResults *pmDetrendSelect (const pmDetrendSelectOptions *options) 96 { 96 pmDetrendSelectResults *pmDetrendSelect (const pmDetrendSelectOptions *options, 97 const pmConfig *config) 98 { 99 PS_ASSERT_PTR_NON_NULL(options, NULL); 100 PS_ASSERT_PTR_NON_NULL(config, NULL); 101 PS_ASSERT_PTR_NON_NULL(config->site, NULL); 102 103 bool mdok; // Status of MD lookup 104 const char *dbserver = psMetadataLookupStr(&mdok, config->site, "DBSERVER"); // Database server 105 if (!mdok || strlen(dbserver) == 0) { 106 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find DBSERVER in site configuration.\n"); 107 return NULL; 108 } 109 const char *dbname = psMetadataLookupStr(&mdok, config->site, "DBNAME"); // Database name 110 if (!mdok || strlen(dbname) == 0) { 111 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find DBNAME in site configuration.\n"); 112 return NULL; 113 } 114 const char *dbuser = psMetadataLookupStr(&mdok, config->site, "DBUSER"); // Database user 115 if (!mdok || strlen(dbuser) == 0) { 116 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find DBUSER in site configuration.\n"); 117 return NULL; 118 } 119 const char *dbpassword = psMetadataLookupStr(&mdok, config->site, "DBPASSWORD"); // Database password 120 if (!mdok || strlen(dbpassword) == 0) { 121 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find DBPASSWORD in site configuration.\n"); 122 return NULL; 123 } 124 97 125 int status, exit_status; 98 126 char *line = NULL; … … 101 129 unsigned int nFail; 102 130 103 // XXXXX ***** MAJOR HACK ***** Josh dropped INST from detrun, so I am using 'object' for104 // now in dettool ('object' is not relevant to detrun!!!)105 106 131 pmDetrendSelectResults *results = pmDetrendSelectResultsAlloc(); 107 psStringAppend (&line, "detselect -search -inst %s -det_type %s -time %s", options->camera, type, time); 132 psStringAppend (&line, "detselect -search -inst %s -det_type %s -time %s " 133 "-dbserver %s -dbname %s -dbuser %s -dbpassword %s", 134 options->camera, type, time, dbserver, dbname, dbuser, dbpassword); 108 135 109 136 if (options->filter) {
Note:
See TracChangeset
for help on using the changeset viewer.
