Changeset 16170 for trunk/ippTools/src/pxinject.c
- Timestamp:
- Jan 20, 2008, 3:48:37 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pxinject.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pxinject.c
r14132 r16170 79 79 PS_ASSERT_PTR_NON_NULL(config, false); 80 80 81 bool status = false; 82 psString tmp_exp_name = psMetadataLookupStr(&status, config->args, "-tmp_exp_name"); 83 if (!status) { 84 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_exp_name"); 85 return false; 86 } 87 if (!tmp_exp_name) { 88 psError(PS_ERR_UNKNOWN, true, "-tmp_exp_name is required"); 89 return false; 90 } 91 psString tmp_camera = psMetadataLookupStr(&status, config->args, "-tmp_inst"); 92 if (!status) { 93 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_inst"); 94 return false; 95 } 96 if (!tmp_camera) { 97 psError(PS_ERR_UNKNOWN, true, "-tmp_inst is required"); 98 return false; 99 } 100 psString tmp_telescope = psMetadataLookupStr(&status, config->args, "-tmp_telescope"); 101 if (!status) { 102 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_telescope"); 103 return false; 104 } 105 if (!tmp_telescope) { 106 psError(PS_ERR_UNKNOWN, true, "-tmp_telescope is required"); 107 return false; 108 } 109 110 psString workdir = psMetadataLookupStr(&status, config->args, "-workdir"); 111 if (!status) { 112 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -workdir"); 113 return false; 114 } 115 if (!workdir) { 116 psError(PS_ERR_UNKNOWN, true, "-workdir is required"); 117 return false; 118 } 119 120 psString reduction = psMetadataLookupStr(&status, config->args, "-reduction"); 121 if (!status) { 122 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -reduction"); 123 return false; 124 } 81 PXOPT_LOOKUP_STR(tmp_exp_name, config->args, "-tmp_exp_name", true, false); 82 PXOPT_LOOKUP_STR(tmp_camera, config->args, "-tmp_inst", true, false); 83 PXOPT_LOOKUP_STR(tmp_telescope, config->args, "-tmp_telescope", true, false); 84 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 85 PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); 86 PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false); 87 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", false, false); 88 PXOPT_LOOKUP_STR(end_stage, config->args, "-end_stage", false, false); 89 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 125 90 126 91 if (!newExpInsert(config->dbh, … … 132 97 workdir, 133 98 "dirty", 134 reduction 99 reduction, 100 dvodb, 101 tess_id, 102 end_stage 135 103 ) 136 104 ) { … … 150 118 psFree(exp_id); 151 119 152 bool simple = false;153 {154 bool status = false;155 simple = psMetadataLookupBool(&status, config->args, "-simple");156 if (!status) {157 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");158 psFree(md);159 return false;160 }161 }162 163 120 // negate simple so the default is true 164 121 if (!ippdbPrintMetadata(stdout, md, !simple)) { … … 177 134 PS_ASSERT_PTR_NON_NULL(config, false); 178 135 179 bool status = false; 180 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 181 if (!status) { 182 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 183 return false; 184 } 185 if (!exp_id) { 186 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 187 return false; 188 } 189 #if 0 190 psString class = psMetadataLookupStr(&status, config->args, "-class"); 191 if (!status) { 192 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class"); 193 return false; 194 } 195 if (!class) { 196 psError(PS_ERR_UNKNOWN, true, "-class is required"); 197 return false; 198 } 199 #endif 200 psString tmp_class_id = psMetadataLookupStr(&status, config->args, "-tmp_class_id"); 201 if (!status) { 202 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_class_id"); 203 return false; 204 } 205 if (!tmp_class_id) { 206 psError(PS_ERR_UNKNOWN, true, "-tmp_class_id is required"); 207 return false; 208 } 209 psString uri = psMetadataLookupStr(&status, config->args, "-uri"); 210 if (!status) { 211 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri"); 212 return false; 213 } 214 if (!uri) { 215 psError(PS_ERR_UNKNOWN, true, "-uri is required"); 216 return false; 217 } 136 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false); 137 PXOPT_LOOKUP_STR(tmp_class_id, config->args, "-tmp_class_id", true, false); 138 PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false); 218 139 219 140 // insert with error flag state set to 0 (no errors) … … 231 152 PS_ASSERT_PTR_NON_NULL(config, false); 232 153 233 bool status = false; 234 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 235 if (!status) { 236 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 237 return false; 238 } 239 if (!exp_id) { 240 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 241 return false; 242 } 243 244 psString state = psMetadataLookupStr(&status, config->args, "-state"); 245 if (!status) { 246 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -state"); 247 return false; 248 } 249 if (!state) { 250 psError(PS_ERR_UNKNOWN, true, "-state is required"); 251 return false; 252 } 154 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false); 155 PXOPT_LOOKUP_STR(state, config->args, "-state", true, false); 253 156 254 157 if (state) {
Note:
See TracChangeset
for help on using the changeset viewer.
