IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20636


Ignore:
Timestamp:
Nov 10, 2008, 2:03:31 PM (17 years ago)
Author:
eugene
Message:

be explicit about the camera name vs camera format

File:
1 edited

Legend:

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

    r20400 r20636  
    7777
    7878// define an input-type pmFPAfile, bind to the optional fpa if supplied
    79 pmFPAfile *pmFPAfileDefineInput(const pmConfig *config, pmFPA *fpa, const char *name)
     79pmFPAfile *pmFPAfileDefineInput(const pmConfig *config, pmFPA *fpa, char *cameraName, const char *name)
    8080{
    8181    PS_ASSERT_PTR_NON_NULL(config, NULL);
     
    125125        file->fpa = psMemIncrRefCounter(fpa);
    126126        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?
    128128    } else {
    129129        file->camera = psMemIncrRefCounter(config->camera);
     
    483483    // Determine the current format from the header; Determine camera if not specified already.
    484484    // 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);
    486487    if (!format) {
    487488        psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName);
     
    495496    // build the template fpa, set up the basic view
    496497    // XXX do we want this to be the baseCamera name or the metaCamera name?
    497     fpa = pmFPAConstruct(camera, config->cameraName);
     498    fpa = pmFPAConstruct(camera, cameraName);
    498499    if (!fpa) {
    499500        psError(PS_ERR_IO, false, "Failed to construct FPA from %s", realName);
     
    510511    // load the given filerule (from config->camera) and bind it to the fpa
    511512    // 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);
    513514    if (!file) {
    514515        psError(PS_ERR_IO, false, "file %s not defined\n", filename);
     
    519520        return NULL;
    520521    }
     522    psFree (cameraName);
    521523    psFree (file->filerule); // this is set in pmFPAfileDefineInput
     524
    522525    file->format = format;
    523526    file->formatName = formatName;
     
    659662    // load the given filerule (from config->camera) and bind it to the fpa
    660663    // 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);
    662665    if (!file) {
    663666        psError(PS_ERR_IO, false, "file %s not defined\n", filename);
     
    703706
    704707        if (!format) {
    705             format = pmConfigCameraFormatFromHeader(NULL, NULL, config, phu, true);
     708            format = pmConfigCameraFormatFromHeader(NULL, NULL, NULL, config, phu, true);
    706709            if (!format) {
    707710                psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName);
     
    816819    psMetadata *camera = NULL;
    817820    psString formatName = NULL;
    818     format = pmConfigCameraFormatFromHeader (&camera, &formatName, config, phu, true);
     821    psString cameraName = NULL;
     822    format = pmConfigCameraFormatFromHeader (&camera, &cameraName, &formatName, config, phu, true);
    819823    if (!format) {
    820824        psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", (char *)infiles->data[0]);
     
    826830
    827831    // build the template fpa, set up the basic view
    828     fpa = pmFPAConstruct (camera, config->cameraName);
     832    fpa = pmFPAConstruct (camera, cameraName);
    829833    if (!fpa) {
    830834        psError(PS_ERR_IO, false, "Failed to construct FPA from %s", (char *)infiles->data[0]);
     
    840844    // the returned file is just a view to the entry on config->files
    841845    // we need a variable name here... (but in filerule)
    842     file = pmFPAfileDefineInput (config, fpa, filename);
     846    file = pmFPAfileDefineInput (config, fpa, cameraName, filename);
    843847    if (!file) {
    844848        psError(PS_ERR_IO, false, "file %s not defined\n", filename);
     
    848852        return NULL;
    849853    }
     854    psFree(cameraName);
    850855    FPA_TEST_ASSERT (file);
     856
    851857    file->format = format;
    852858    file->formatName = formatName;
     
    922928    // load the given filerule (from config->camera) and bind it to the fpa
    923929    // 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);
    925931    psFree (fpa);
    926932    if (!file) {
     
    10031009        // load the given filerule (from config->camera) and bind it to the fpa
    10041010        // 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);
    10061012        if (!file) {
    10071013            psError(PS_ERR_IO, false, "file %s not defined\n", filename);
Note: See TracChangeset for help on using the changeset viewer.