IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14608


Ignore:
Timestamp:
Aug 22, 2007, 2:49:43 PM (19 years ago)
Author:
magnier
Message:

adding formatName to file, setting correctly

Location:
branches/eam_branch_20070817/psModules/src/camera
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070817/psModules/src/camera/pmFPAfile.c

    r14202 r14608  
    3232    psFree (file->camera);
    3333    psFree (file->format);
     34    psFree (file->formatName);
    3435    psFree (file->name);
    3536
     
    7374    file->camera = NULL;
    7475    file->format = NULL;
     76    file->formatName = NULL;
    7577    file->name = NULL;
    7678
  • branches/eam_branch_20070817/psModules/src/camera/pmFPAfile.h

    r14202 r14608  
    44 * @author EAM, IfA
    55 *
    6  * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-07-14 03:17:44 $
     6 * @version $Revision: 1.19.4.1 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-08-23 00:49:43 $
    88 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    99 */
     
    9191    psMetadata *camera;                 // Camera configuration
    9292    psMetadata *format;                 // Camera format
     93    char *formatName;                   // name of the camera format
    9394}
    9495pmFPAfile;
  • branches/eam_branch_20070817/psModules/src/camera/pmFPAfileDefine.c

    r14595 r14608  
    203203    }
    204204    file->format = psMemIncrRefCounter(format);
     205    file->formatName = psStringCopy(formatName);
    205206
    206207    if (fpa) {
     
    351352    psFree (format);
    352353    file->format = psMemIncrRefCounter(format);
     354    file->formatName = psStringCopy(config->formatName);
    353355
    354356    // adjust the rules to identify these files in the file->names data
     
    440442// save the pmFPAfile on config->files
    441443// return the pmFPAfile (a view to the one saved on config->files)
    442 pmFPAfile *pmFPAfileBindFromArgs (bool *success, pmFPAfile *input, const pmConfig *config, const char *filename, const char *argname)
     444pmFPAfile *pmFPAfileBindFromArgs (bool *success, pmFPAfile *input, pmConfig *config, const char *filename, const char *argname)
    443445{
    444446    PS_ASSERT_PTR_NON_NULL(input, NULL);
     
    511513
    512514        if (!format) {
    513             format = pmConfigCameraFormatFromHeader((pmConfig*)config, phu, true);
     515            format = pmConfigCameraFormatFromHeader(config, phu, true);
    514516            if (!format) {
    515517                psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName);
     
    562564    psFree(file->format);
    563565    file->format = format;
     566    file->formatName = psStringCopy(config->formatName);
    564567
    565568    if (success) *success = true;
     
    639642    psFree (file->format);
    640643    file->format = format;
     644    file->formatName = psStringCopy(config->formatName);
    641645
    642646    // adjust the rules to identify these files in the file->names data
     
    925929    pmFPAfile *file = pmFPAfileDefineOutput (config, fpa, filename);
    926930    if (!file) {
    927         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     931        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    928932        return NULL;
    929933    }
     
    944948    pmFPAfile *file = pmFPAfileDefineOutput (config, NULL, filename);
    945949    if (!file) {
    946         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     950        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    947951        return NULL;
    948952    }
    949953    if (!file->camera) {
    950         psErrorStackPrint(stderr, "file %s does not define a new camera\n", filename);
     954        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s does not define a new camera\n", filename);
    951955        return NULL;
    952956    }
     
    987991    }
    988992    if (!file) {
    989         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     993        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    990994        return NULL;
    991995    }
     
    10261030        // Find the correct camera configuration
    10271031        file = pmFPAfileDefineOutputForFormat(config, NULL, filename, newCameraName, config->formatName);
     1032        psFree(newCameraName);
    10281033        psFree(cameraName);
    10291034    }
    10301035    if (!file) {
    1031         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     1036        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    10321037        return NULL;
    10331038    }
     
    10701075        psFree(original);
    10711076
    1072         file = pmFPAfileDefineOutputForFormat(config, NULL, filename, newCameraName, config->formatName);
     1077        file = pmFPAfileDefineOutputForFormat(config, NULL, filename, cameraName, config->formatName);
    10731078        psFree(cameraName);
    10741079    }
    10751080    if (!file) {
    1076         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     1081        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    10771082        return NULL;
    10781083    }
Note: See TracChangeset for help on using the changeset viewer.