IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11242


Ignore:
Timestamp:
Jan 22, 2007, 5:18:21 PM (19 years ago)
Author:
magnier
Message:

correctly handle invalid camera format vs config error

Location:
trunk/psModules/src/camera
Files:
2 edited

Legend:

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

    r11226 r11242  
    267267    psArray *infiles = psMetadataLookupPtr(&status, config->arguments, argname);
    268268    if (!status) {
    269         //        psTrace("psModules.camera", 5, "Failed to find %s in argument list", argname);
    270269        psError(PS_ERR_UNEXPECTED_NULL, false, "Failed to find %s in argument list", argname);
    271270        return NULL;
     
    326325        return NULL;
    327326    }
     327    file->format = format;
    328328
    329329    // adjust the rules to identify these files in the file->names data
     
    373373                return NULL;
    374374            }
    375             if (!pmConfigValidateCameraFormat (format, phu)) {
     375            bool valid = false;
     376            if (!pmConfigValidateCameraFormat (&valid, format, phu)) {
     377                psError (PS_ERR_UNKNOWN, false, "Error in config scripts\n");
     378                psFree (realName);
     379                psFitsClose (fits);
     380                return NULL;
     381            }
     382            if (!valid) {
    376383                psError(PS_ERR_IO, false, "file %s is not from the required camera", realName);
    377384                psFree (realName);
     
    404411    }
    405412    psFree (fpa);
    406 
    407     file->format = format;
    408413    if (found)
    409414        *found = true;
     
    492497            return NULL;
    493498        }
    494         if (!pmConfigValidateCameraFormat (input->format, phu)) {
     499        bool valid = false;
     500        if (!pmConfigValidateCameraFormat (&valid, input->format, phu)) {
     501            psError (PS_ERR_UNKNOWN, false, "Error in config scripts\n");
     502            psFree (realName);
     503            psFitsClose (fits);
     504            return NULL;
     505        }
     506        if (!valid) {
    495507            psError(PS_ERR_IO, false, "specified data file %s does not match format of supplied INPUT\n", realName);
    496508            psFree (realName);
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r10966 r11242  
    8989                }
    9090            } else {
    91                 pmConfigValidateCameraFormat (file->format, phu);
     91                bool valid;
     92                if (!pmConfigValidateCameraFormat (&valid, file->format, phu)) {
     93                    psError (PS_ERR_UNKNOWN, false, "Error in config scripts\n");
     94                    psFree (phu);
     95                    return NULL;
     96                }
     97                if (!valid) {
     98                    psError(PS_ERR_IO, false, "file %s is not from the required camera", file->filename);
     99                    psFree (phu);
     100                    return NULL;
     101                }
    92102            }
    93103            pmFPAview *thisView = pmFPAAddSourceFromHeader (file->fpa, phu, file->format);
Note: See TracChangeset for help on using the changeset viewer.