Changeset 12455 for trunk/psModules/src/camera/pmFPAfileDefine.c
- Timestamp:
- Mar 15, 2007, 2:29:17 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAfileDefine.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileDefine.c
r12300 r12455 68 68 69 69 file->filerule = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "FILENAME.RULE")); 70 file->filextra = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "FILENAME.XTRA"));71 file->extrule = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "EXTNAME.RULE"));72 file->extxtra = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "EXTNAME.XTRA"));73 70 74 71 type = psMetadataLookupStr (&status, data, "FILE.TYPE"); … … 155 152 156 153 file->filerule = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "FILENAME.RULE")); 157 file->filextra = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "FILENAME.XTRA"));158 file->extrule = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "EXTNAME.RULE"));159 file->extxtra = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "EXTNAME.XTRA"));160 154 161 155 const char *type = psMetadataLookupStr (&status, data, "FILE.TYPE"); … … 338 332 // adjust the rules to identify these files in the file->names data 339 333 psFree (file->filerule); 340 psFree (file->filextra);334 // XXX DROP ME: psFree (file->filesrc); 341 335 file->filerule = psStringCopy ("@FILES"); 342 file->filextra = psStringCopy ("{CHIP.NAME}.{CELL.NAME}"); 343 344 // find the matching fileLevel 345 psMetadata *filemenu = psMetadataLookupPtr (&status, format, "FILE"); 346 if (!filemenu) { 347 psError (PS_ERR_IO, true, "missing FILE in FORMAT"); 348 return NULL; 349 } 350 char *levelName = psMetadataLookupStr (&status, filemenu, "PHU"); 351 if (!levelName) { 352 psError (PS_ERR_IO, true, "missing PHU in FILE in FORMAT"); 353 return NULL; 354 } 355 file->fileLevel = pmFPALevelFromName (levelName); 336 file->filesrc = psStringCopy ("{CHIP.NAME}.{CELL.NAME}"); 337 338 file->fileLevel = pmFPAPHULevel(format); 356 339 if (file->fileLevel == PM_FPA_LEVEL_NONE) { 357 psError (PS_ERR_IO, true, "unknown level"); 340 psError(PS_ERR_IO, true, "Unable to determine file level for %s\n", file->name); 341 psFree(phu); 342 psFree(fpa); 343 psFree(format); 344 psFree(file); 358 345 return NULL; 359 346 } … … 411 398 412 399 // associate the filename with the FPA element 413 char *name = pmFPAfileNameFromRule (file->file xtra, file, view);400 char *name = pmFPAfileNameFromRule (file->filesrc, file, view); 414 401 415 402 // save the name association in the pmFPAfile structure … … 482 469 // define the rule to identify these files in the file->names data 483 470 psFree (file->filerule); 484 psFree (file->file xtra);471 psFree (file->filesrc); 485 472 file->filerule = psStringCopy ("@FILES"); 486 file->file xtra= psStringCopy ("{CHIP.NAME}.{CELL.NAME}");473 file->filesrc = psStringCopy ("{CHIP.NAME}.{CELL.NAME}"); 487 474 488 475 // examine the list of input files and validate their cameras … … 534 521 535 522 // associate the filename with the FPA element 536 char *name = pmFPAfileNameFromRule (file->file xtra, file, view);523 char *name = pmFPAfileNameFromRule (file->filesrc, file, view); 537 524 538 525 // save the name association in the pmFPAfile structure … … 602 589 if (!fpa) { 603 590 psError(PS_ERR_IO, false, "Failed to construct FPA from %s", (char *)infiles->data[0]); 591 psFree(phu); 592 psFree(format); 604 593 return NULL; 605 594 } … … 621 610 // adjust the rules to identify these files in the file->names data 622 611 psFree (file->filerule); 623 psFree (file->file xtra);612 psFree (file->filesrc); 624 613 file->filerule = psStringCopy ("@FILES"); 625 file->filextra = psStringCopy ("{CHIP.NAME}.{CELL.NAME}"); 626 627 // find the matching fileLevel 628 psMetadata *filemenu = psMetadataLookupPtr (&status, format, "FILE"); 629 if (!filemenu) { 630 psError (PS_ERR_IO, true, "missing FILE in FORMAT"); 614 file->filesrc = psStringCopy ("{CHIP.NAME}.{CELL.NAME}"); 615 616 file->fileLevel = pmFPAPHULevel(format); 617 if (file->fileLevel == PM_FPA_LEVEL_NONE) { 618 psError(PS_ERR_IO, true, "Unable to determine file level for %s\n", file->name); 631 619 psFree(phu); 632 620 psFree(fpa); 633 psFree(format); 634 return NULL; 635 } 636 char *levelName = psMetadataLookupStr (&status, filemenu, "PHU"); 637 if (!levelName) { 638 psError (PS_ERR_IO, true, "missing PHU in FILE in FORMAT"); 639 psFree(phu); 640 psFree(fpa); 641 psFree(format); 642 return NULL; 643 } 644 file->fileLevel = pmFPALevelFromName (levelName); 645 if (file->fileLevel == PM_FPA_LEVEL_NONE) { 646 psError (PS_ERR_IO, true, "unknown level"); 647 psFree(phu); 648 psFree(fpa); 621 psFree(file); 649 622 psFree(format); 650 623 return NULL; … … 657 630 psFree(phu); 658 631 psFree(fpa); 632 psFree(file); 659 633 psFree(format); 660 634 return NULL; … … 662 636 663 637 // associate the filename with the FPA element 664 char *name = pmFPAfileNameFromRule (file->file xtra, file, view);638 char *name = pmFPAfileNameFromRule (file->filesrc, file, view); 665 639 666 640 // save the name association in the pmFPAfile structure 667 641 psMetadataAddStr (file->names, PS_LIST_TAIL, name, 0, "", infiles->data[entry]); 668 642 669 psFree (view); 670 psFree (name); 671 psFree (phu); 672 psFree (fpa); 643 psFree(phu); 644 psFree(fpa); 645 psFree(view); 646 psFree(name); 647 psFree(format); 673 648 674 649 if (found) … … 881 856 } 882 857 file->detrend = results; 883 884 // replace the existing value of filextra with the selected detID885 psFree (file->filextra);886 file->filextra = psStringCopy (results->detID);887 888 // set the fileLevel based on the detDB results889 // XXX this is not supplied by the db. use the config value for now.890 // file->fileLevel = results->level;891 858 892 859 psFree (options);
Note:
See TracChangeset
for help on using the changeset viewer.
