IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21314


Ignore:
Timestamp:
Feb 5, 2009, 9:41:50 AM (17 years ago)
Author:
bills
Message:

in pmConfigRead parse -image_id and -source_id arguments, save the values
in the pmConfig structure and when createing an output pmFPAfile copy
the values to the file

Location:
trunk/psModules/src
Files:
3 edited

Legend:

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

    r20636 r21314  
    208208    file->camera = psMemIncrRefCounter(camera);
    209209    file->cameraName = psMemIncrRefCounter(cameraName);
     210
     211    // Copy the file id valuves if they have been set in the config
     212    if (config->sourceId) {
     213        file->sourceId = config->sourceId;
     214    }
     215    if (config->imageId) {
     216        file->imageId = config->imageId;
     217    }
    210218
    211219    // XXX this seems a bit of a hack: use the cameraName to determine the mosaic level...
  • trunk/psModules/src/config/pmConfig.c

    r20639 r21314  
    156156    // the file structure is used to carry pmFPAfiles
    157157    config->files = psMetadataAlloc ();
     158
     159    config->sourceId = 0;
     160    config->imageId = 0;
    158161    return config;
    159162}
     
    917920            }
    918921
     922            psArgumentRemove(argNum, argc, argv);
     923        }
     924    }
     925
     926    argNum = psArgumentGet(*argc, argv, "-image_id");
     927    if (argNum > 0) {
     928        psArgumentRemove(argNum, argc, argv);
     929        if (argNum >= *argc) {
     930            psWarning("-image_id command-line switch provided without the required id number");
     931        } else {
     932            if (!sscanf(argv[argNum], "%" PRId64, &config->imageId)) {
     933                psWarning("Failed to parse image_id value %s", argv[argNum]);
     934            }
     935            psArgumentRemove(argNum, argc, argv);
     936        }
     937    }
     938
     939    argNum = psArgumentGet(*argc, argv, "-source_id");
     940    if (argNum > 0) {
     941        psArgumentRemove(argNum, argc, argv);
     942        if (argNum >= *argc) {
     943            psWarning("-source_id command-line switch provided without the required id number");
     944        } else {
     945            if (!sscanf(argv[argNum], "%" PRId64, &config->sourceId)) {
     946                psWarning("Failed to parse image_id value %s", argv[argNum]);
     947            }
    919948            psArgumentRemove(argNum, argc, argv);
    920949        }
  • trunk/psModules/src/config/pmConfig.h

    r21162 r21314  
    55 *  @author Eugene Magnier, IfA
    66 *
    7  *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2009-01-24 20:51:57 $
     7 *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2009-02-05 19:41:50 $
    99 *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    5656    int traceFD;                        ///< File descriptor for trace messages
    5757    int logFD;                          ///< File descriptor for log messages
     58    psS64 sourceId;                    ///< Database source id for output file
     59    psS64 imageId;                     ///< Database image id for output file
    5860} pmConfig;
    5961
Note: See TracChangeset for help on using the changeset viewer.