IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 8, 2009, 12:16:56 PM (17 years ago)
Author:
Paul Price
Message:

Adding default values for some concept interpolations. This is intended to get rid of the annoying '{CHIP.NAME}' in filenames.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfile.c

    r23487 r23746  
    205205    }
    206206    if (strstr(newName, "{CHIP.NAME}")) {
     207        const char *name = NULL;        // Name of chip
    207208        pmChip *chip = pmFPAviewThisChip(view, fpa);
    208209        if (chip) {
    209             char *name = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME");
    210             if (name) {
    211                 psStringSubstitute(&newName, name, "{CHIP.NAME}");
    212             }
    213         }
     210            name = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME");
     211            psAssert(name, "All chips should have a name");
     212        } else {
     213            name = "fpa";
     214        }
     215        psStringSubstitute(&newName, name, "{CHIP.NAME}");
     216
    214217    }
    215218    if (strstr(newName, "{CHIP.ID}")) {
     
    255258    }
    256259    if (strstr(newName, "{CELL.NAME}")) {
     260        const char *name = NULL;        // Name of cell
    257261        pmCell *cell = pmFPAviewThisCell(view, fpa);
    258262        if (cell) {
    259             char *name = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME");
    260             if (name) {
    261                 psStringSubstitute(&newName, name, "{CELL.NAME}");
    262             }
    263         }
     263            name = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME");
     264            psAssert(name, "All cells should have a name");
     265        } else {
     266            name = "chip";
     267        }
     268        psStringSubstitute(&newName, name, "{CELL.NAME}");
    264269    }
    265270    if (strstr(newName, "{CELL.N}")) {
Note: See TracChangeset for help on using the changeset viewer.