Changeset 14214 for trunk/ippTools/src/chiptool.c
- Timestamp:
- Jul 13, 2007, 5:44:48 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/chiptool.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r14120 r14214 93 93 } 94 94 95 #define ADDRENAMEPARAMSTR(from, to, oldname, newname ) \95 #define ADDRENAMEPARAMSTR(from, to, oldname, newname, comment) \ 96 96 { \ 97 97 bool status = false; \ … … 102 102 } \ 103 103 if (str) { \ 104 if (!psMetadataAddStr(to, PS_LIST_TAIL, newname, 0, "==", str)) { \104 if (!psMetadataAddStr(to, PS_LIST_TAIL, newname, PS_META_DUPLICATE_OK, comment, str)) { \ 105 105 psError(PS_ERR_UNKNOWN, false, "failed to add item " newname); \ 106 106 psFree(to); \ … … 110 110 } 111 111 112 #define ADDPARAMSTR(from, to, name) ADDRENAMEPARAMSTR(from, to, name, name) 113 114 #define ADDPARAMF(from, to, type, name) \ 112 #define ADDPARAMSTR(from, to, name) \ 113 ADDRENAMEPARAMSTR(from, to, name, name, "==") 114 115 #define ADDRENAMEPARAMF(from, to, type, oldname, newname, comment) \ 115 116 { \ 116 117 bool status = false; \ 117 ps##type var = psMetadataLookup##type(&status, from, "-" name); \118 ps##type var = psMetadataLookup##type(&status, from, "-" oldname); \ 118 119 if (!status) { \ 119 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -" name); \120 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -" oldname); \ 120 121 return false; \ 121 122 } \ 122 123 if (!isnan(var)) { \ 123 if (!psMetadataAdd##type(to, PS_LIST_TAIL, #name, 0, "==", var)) { \124 psError(PS_ERR_UNKNOWN, false, "failed to add item " n ame); \124 if (!psMetadataAdd##type(to, PS_LIST_TAIL, newname, PS_META_DUPLICATE_OK, comment, var)) { \ 125 psError(PS_ERR_UNKNOWN, false, "failed to add item " newname); \ 125 126 psFree(to); \ 126 127 return false; \ … … 129 130 } 130 131 132 #define ADDPARAMF(from, to, type, name) \ 133 ADDRENAMEPARAMF(from, to, type, name, name, "==") 134 131 135 static bool queueMode(pxConfig *config) 132 136 { … … 134 138 135 139 psMetadata *where = psMetadataAlloc(); 136 ADDPARAMSTR(config->args, where, "exp_id"); 140 // convert exp_id into a psS64 141 { 142 bool status = false; 143 psString var = psMetadataLookupStr(&status, config->args, "-exp_id"); 144 if (!status) { 145 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 146 return false; 147 } 148 if (var) { 149 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(var))) { 150 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 151 psFree(where); 152 return false; 153 } 154 } 155 } 137 156 ADDPARAMSTR(config->args, where, "exp_name"); 138 ADDRENAMEPARAMSTR(config->args, where, "inst", "camera" );157 ADDRENAMEPARAMSTR(config->args, where, "inst", "camera", "=="); 139 158 ADDPARAMSTR(config->args, where, "telescope"); 140 ADDPARAMSTR(config->args, where, "dateobs"); 159 ADDPARAMSTR(config->args, where, "dateobs_begin"); 160 ADDPARAMSTR(config->args, where, "dateobs_end"); 161 ADDPARAMSTR(config->args, where, "exp_tag"); 141 162 ADDPARAMSTR(config->args, where, "exp_type"); 142 ADDPARAMSTR(config->args, where, " imfiles");143 ADDPARAMSTR(config->args, where, " workdir");163 ADDPARAMSTR(config->args, where, "filelevel"); 164 ADDPARAMSTR(config->args, where, "reduction"); 144 165 ADDPARAMSTR(config->args, where, "filter"); 145 ADDPARAMF(config->args, where, F32, "airmass"); 146 ADDPARAMF(config->args, where, F32, "ra"); 147 ADDPARAMF(config->args, where, F32, "decl"); 148 ADDPARAMF(config->args, where, F32, "exp_time"); 149 ADDPARAMF(config->args, where, F32, "bg"); 150 ADDPARAMF(config->args, where, F32, "bg_stdev"); 151 ADDPARAMF(config->args, where, F32, "bg_mean_stdev"); 152 ADDPARAMF(config->args, where, F64, "alt"); 153 ADDPARAMF(config->args, where, F64, "az"); 154 ADDPARAMF(config->args, where, F32, "ccd_temp"); 155 ADDPARAMF(config->args, where, F64, "posang"); 166 ADDRENAMEPARAMF(config->args, where, F64, "airmass_min", "airmass", ">="); 167 ADDRENAMEPARAMF(config->args, where, F64, "airmass_max", "airmass", "<"); 168 ADDRENAMEPARAMF(config->args, where, F64, "ra_min", "ra", ">="); 169 ADDRENAMEPARAMF(config->args, where, F64, "ra_max", "ra", "<"); 170 ADDRENAMEPARAMF(config->args, where, F64, "decl_min", "decl", ">="); 171 ADDRENAMEPARAMF(config->args, where, F64, "decl_max", "decl", "<"); 172 ADDRENAMEPARAMF(config->args, where, F32, "exp_time_min", "exp_time", ">="); 173 ADDRENAMEPARAMF(config->args, where, F32, "exp_time_max", "exp_time", "<"); 174 ADDRENAMEPARAMF(config->args, where, F32, "sat_pixel_frac_min", "sat_pixel_frac", ">="); 175 ADDRENAMEPARAMF(config->args, where, F32, "sat_pixel_frac_max", "sat_pixel_frac", "<"); 176 ADDRENAMEPARAMF(config->args, where, F64, "bg_min", "bt", ">="); 177 ADDRENAMEPARAMF(config->args, where, F64, "bg_max", "bt", "<"); 178 ADDRENAMEPARAMF(config->args, where, F64, "bg_stdev_min", "bg_stdev", ">="); 179 ADDRENAMEPARAMF(config->args, where, F64, "bg_stdev_max", "bg_stdev", "<"); 180 ADDRENAMEPARAMF(config->args, where, F64, "bg_mean_stdev_min", "bg_mean_stdev", ">="); 181 ADDRENAMEPARAMF(config->args, where, F64, "bg_mean_stdev_max", "bg_mean_stdev", "<"); 182 ADDRENAMEPARAMF(config->args, where, F64, "alt_min", "alt", ">="); 183 ADDRENAMEPARAMF(config->args, where, F64, "alt_max", "alt", "<"); 184 ADDRENAMEPARAMF(config->args, where, F64, "az_min", "az", ">="); 185 ADDRENAMEPARAMF(config->args, where, F64, "az_max", "az", "<"); 186 ADDRENAMEPARAMF(config->args, where, F32, "ccd_temp_min", "ccd_temp", ">="); 187 ADDRENAMEPARAMF(config->args, where, F32, "ccd_temp_max", "ccd_temp", "<"); 188 ADDRENAMEPARAMF(config->args, where, F64, "posang_min", "posang", ">="); 189 ADDRENAMEPARAMF(config->args, where, F64, "posang_max", "posang", "<"); 156 190 ADDPARAMSTR(config->args, where, "object"); 191 ADDRENAMEPARAMF(config->args, where, F32, "solang_min", "solang", ">="); 192 ADDRENAMEPARAMF(config->args, where, F32, "solang_max", "solang", "<"); 157 193 158 194 if (where->list->n < 1) { … … 236 272 psMetadata *md = output->data[i]; 237 273 238 psS tring exp_id = psMetadataLookupStr(&status, md, "exp_id");274 psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id"); 239 275 if (!status) { 240 276 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id"); … … 249 285 } 250 286 psError(PS_ERR_UNKNOWN, false, 251 "failed to trying to queue exp_id: % s", exp_id);287 "failed to trying to queue exp_id: %" PRId64, exp_id); 252 288 psFree(output); 253 289 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
