Changeset 7679 for trunk/psModules/src/camera/pmFPAfile.c
- Timestamp:
- Jun 24, 2006, 1:03:51 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAfile.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfile.c
r7618 r7679 114 114 } 115 115 116 // XXX reconsider this function name / concept117 # if 0118 bool pmFPAfileAddFileNames (psMetadata *files, char *name, char *value, int mode)119 {120 PS_ASSERT_PTR_NON_NULL(files, false);121 PS_ASSERT_PTR_NON_NULL(name, false);122 PS_ASSERT_INT_POSITIVE(strlen(name), false);123 PS_ASSERT_PTR_NON_NULL(value, false);124 PS_ASSERT_INT_POSITIVE(strlen(value), false);125 126 // add the output names to the output-type files127 psMetadataItem *item = NULL;128 psMetadataIterator *iter = psMetadataIteratorAlloc (files, PS_LIST_HEAD, NULL);129 while ((item = psMetadataGetAndIncrement (iter)) != NULL) {130 pmFPAfile *file = item->data.V;131 132 if (file->mode == mode) {133 psMetadataAddStr (file->names, PS_LIST_TAIL, name, PS_META_NO_REPLACE, "", value);134 }135 }136 psFree (iter);137 return true;138 }139 # endif140 141 116 // select the rule from the camera configuration, perform substitutions as needed 142 117 char *pmFPAfileNameFromRule (char *rule, pmFPAfile *file, const pmFPAview *view) … … 166 141 } 167 142 } 143 if (strstr (newName, "{CHIP.N}") != NULL) { 144 char *name = NULL; 145 if (view->chip < 0) { 146 psStringAppend (&name, "XX"); 147 } else { 148 psStringAppend (&name, "%02d", view->chip); 149 } 150 newName = psStringSubstitute (newName, name, "{CHIP.N}"); 151 psFree (name); 152 } 168 153 if (strstr (newName, "{CELL.NAME}") != NULL) { 169 154 pmCell *cell = pmFPAviewThisCell (view, file->fpa); … … 175 160 } 176 161 } 162 if (strstr (newName, "{CELL.N}") != NULL) { 163 char *name = NULL; 164 if (view->cell < 0) { 165 psStringAppend (&name, "XX"); 166 } else { 167 psStringAppend (&name, "%02d", view->cell); 168 } 169 newName = psStringSubstitute (newName, name, "{CELL.N}"); 170 } 177 171 if (strstr (newName, "{EXTNAME}") != NULL) { 178 172 pmHDU *hdu = pmFPAviewThisHDU (view, file->fpa); … … 181 175 } 182 176 } 177 if (strstr (newName, "{FILTER}") != NULL) { 178 if (file->fpa != NULL) { 179 char *name = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.FILTER"); 180 if (name != NULL) { 181 newName = psStringSubstitute (newName, name, "{FILTER}"); 182 } 183 } 184 } 185 if (strstr (newName, "{CAMERA}") != NULL) { 186 if (file->fpa != NULL) { 187 char *name = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.CAMERA"); 188 if (name != NULL) { 189 newName = psStringSubstitute (newName, name, "{CAMERA}"); 190 } 191 } 192 } 193 if (strstr (newName, "{FILTER.ID}") != NULL) { 194 if (file->fpa != NULL) { 195 char *filterName = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.FILTER"); 196 psMetadata *filterTable = psMetadataLookupPtr (NULL, file->camera, "FILTER.ID"); 197 if (filterName && filterTable) { 198 char *ID = psMetadataLookupStr (NULL, filterTable, filterName); 199 newName = psStringSubstitute (newName, ID, "{FILTER.ID}"); 200 } 201 } 202 } 183 203 return newName; 184 204 }
Note:
See TracChangeset
for help on using the changeset viewer.
