Changeset 20636
- Timestamp:
- Nov 10, 2008, 2:03:31 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAfileDefine.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileDefine.c
r20400 r20636 77 77 78 78 // define an input-type pmFPAfile, bind to the optional fpa if supplied 79 pmFPAfile *pmFPAfileDefineInput(const pmConfig *config, pmFPA *fpa, c onst char *name)79 pmFPAfile *pmFPAfileDefineInput(const pmConfig *config, pmFPA *fpa, char *cameraName, const char *name) 80 80 { 81 81 PS_ASSERT_PTR_NON_NULL(config, NULL); … … 125 125 file->fpa = psMemIncrRefCounter(fpa); 126 126 file->camera = psMemIncrRefCounter((psMetadata *)fpa->camera); 127 file->cameraName = psMemIncrRefCounter(config->cameraName); // XXX Is this the correct thing to do?127 file->cameraName = cameraName ? psMemIncrRefCounter(cameraName) : psMemIncrRefCounter(config->cameraName); // XXX Is this the correct thing to do? 128 128 } else { 129 129 file->camera = psMemIncrRefCounter(config->camera); … … 483 483 // Determine the current format from the header; Determine camera if not specified already. 484 484 // the returned pointers 'camera' and 'formatName' are allocated here 485 format = pmConfigCameraFormatFromHeader(&camera, &formatName, config, phu, true); 485 psString cameraName = NULL; 486 format = pmConfigCameraFormatFromHeader(&camera, &cameraName, &formatName, config, phu, true); 486 487 if (!format) { 487 488 psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName); … … 495 496 // build the template fpa, set up the basic view 496 497 // XXX do we want this to be the baseCamera name or the metaCamera name? 497 fpa = pmFPAConstruct(camera, c onfig->cameraName);498 fpa = pmFPAConstruct(camera, cameraName); 498 499 if (!fpa) { 499 500 psError(PS_ERR_IO, false, "Failed to construct FPA from %s", realName); … … 510 511 // load the given filerule (from config->camera) and bind it to the fpa 511 512 // the returned file is just a view to the entry on config->files 512 file = pmFPAfileDefineInput(config, fpa, filename);513 file = pmFPAfileDefineInput(config, fpa, cameraName, filename); 513 514 if (!file) { 514 515 psError(PS_ERR_IO, false, "file %s not defined\n", filename); … … 519 520 return NULL; 520 521 } 522 psFree (cameraName); 521 523 psFree (file->filerule); // this is set in pmFPAfileDefineInput 524 522 525 file->format = format; 523 526 file->formatName = formatName; … … 659 662 // load the given filerule (from config->camera) and bind it to the fpa 660 663 // the returned file is just a view to the entry on config->files 661 file = pmFPAfileDefineInput (config, input->fpa, filename);664 file = pmFPAfileDefineInput (config, input->fpa, NULL, filename); 662 665 if (!file) { 663 666 psError(PS_ERR_IO, false, "file %s not defined\n", filename); … … 703 706 704 707 if (!format) { 705 format = pmConfigCameraFormatFromHeader(NULL, NULL, config, phu, true);708 format = pmConfigCameraFormatFromHeader(NULL, NULL, NULL, config, phu, true); 706 709 if (!format) { 707 710 psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName); … … 816 819 psMetadata *camera = NULL; 817 820 psString formatName = NULL; 818 format = pmConfigCameraFormatFromHeader (&camera, &formatName, config, phu, true); 821 psString cameraName = NULL; 822 format = pmConfigCameraFormatFromHeader (&camera, &cameraName, &formatName, config, phu, true); 819 823 if (!format) { 820 824 psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", (char *)infiles->data[0]); … … 826 830 827 831 // build the template fpa, set up the basic view 828 fpa = pmFPAConstruct (camera, c onfig->cameraName);832 fpa = pmFPAConstruct (camera, cameraName); 829 833 if (!fpa) { 830 834 psError(PS_ERR_IO, false, "Failed to construct FPA from %s", (char *)infiles->data[0]); … … 840 844 // the returned file is just a view to the entry on config->files 841 845 // we need a variable name here... (but in filerule) 842 file = pmFPAfileDefineInput (config, fpa, filename);846 file = pmFPAfileDefineInput (config, fpa, cameraName, filename); 843 847 if (!file) { 844 848 psError(PS_ERR_IO, false, "file %s not defined\n", filename); … … 848 852 return NULL; 849 853 } 854 psFree(cameraName); 850 855 FPA_TEST_ASSERT (file); 856 851 857 file->format = format; 852 858 file->formatName = formatName; … … 922 928 // load the given filerule (from config->camera) and bind it to the fpa 923 929 // the returned file is just a view to the entry on config->files 924 pmFPAfile *file = pmFPAfileDefineInput(config, fpa, filename);930 pmFPAfile *file = pmFPAfileDefineInput(config, fpa, NULL, filename); 925 931 psFree (fpa); 926 932 if (!file) { … … 1003 1009 // load the given filerule (from config->camera) and bind it to the fpa 1004 1010 // the returned file is just a view to the entry on config->files 1005 file = pmFPAfileDefineInput (config, fpa, filename);1011 file = pmFPAfileDefineInput (config, fpa, NULL, filename); 1006 1012 if (!file) { 1007 1013 psError(PS_ERR_IO, false, "file %s not defined\n", filename);
Note:
See TracChangeset
for help on using the changeset viewer.
