IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ppImage

  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageDefineFile.c

    r13562 r23352  
    55# include "ppImage.h"
    66
    7 bool ppImageDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType) {
     7bool ppImageDefineFile(pmConfig *config, pmFPA *input, char *filerule, char *argname,
     8                       pmFPAfileType fileType, pmDetrendType detrendType)
     9{
     10    bool status;
     11    pmFPAfile *file = NULL;             // File to be defined
    812
    9     bool status;
    10     pmFPAfile *file;
    11 
    12     // look for the file on the argument list
    13     file = pmFPAfileDefineFromArgs  (&status, config, filerule, argname);
    14     if (!status) {
    15         psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
    16         return false;
     13    if (!file) {
     14        // look for the file on the RUN metadata
     15        file = pmFPAfileDefineFromRun(&status, config, filerule);
     16        if (!status) {
     17            psError(PS_ERR_UNKNOWN, false, "failed to load file definition");
     18            return false;
     19        }
    1720    }
    18     if (file) {
    19         if (file->type != fileType) {
    20             psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType));
    21             return false;
    22         }
    23         return true;
     21    if (!file) {
     22        // look for the file on the argument list
     23        file = pmFPAfileDefineFromArgs(&status, config, filerule, argname);
     24        if (!status) {
     25            psError(PS_ERR_UNKNOWN, false, "failed to load file definition");
     26            return false;
     27        }
     28    }
     29    if (!file) {
     30        // look for the file in the camera config table
     31        file = pmFPAfileDefineFromConf(&status, config, filerule);
     32        if (!status) {
     33            psError(PS_ERR_UNKNOWN, false, "failed to load file definition");
     34            return false;
     35        }
     36    }
     37    if (!file) {
     38        // look for the file to be loaded from the detrend database
     39        file = pmFPAfileDefineFromDetDB(&status, config, filerule, input, detrendType);
     40        if (!status) {
     41            psError(PS_ERR_UNKNOWN, false, "failed to load file definition");
     42            return false;
     43        }
    2444    }
    2545
    26     // look for the file in the camera config table
    27     file = pmFPAfileDefineFromConf  (&status, config, filerule);
    28     if (!status) {
    29         psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
    30         return false;
    31     }
    32     if (file) {
    33         if (file->type != fileType) {
    34             psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType));
    35             return false;
    36         }
    37         return true;
     46    if (!file) {
     47        return false;
    3848    }
    3949
    40     // look for the file to be loaded from the detrend database
    41     file = pmFPAfileDefineFromDetDB (&status, config, filerule, input, detrendType);
    42     if (!status) {
    43         psError (PS_ERR_UNKNOWN, false, "failed to load file definition");
    44         return false;
     50    if (file->type != fileType) {
     51        psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType(fileType));
     52        return false;
    4553    }
    46     if (file) {
    47         if (file->type != fileType) {
    48             psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType));
    49             return false;
    50         }
    51         return true;
    52     }
    53     return false;
     54    return true;
    5455}
    5556
Note: See TracChangeset for help on using the changeset viewer.