IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 22, 2006, 10:45:22 AM (19 years ago)
Author:
Paul Price
Message:

Propagating change to psPipe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageAddstar.c

    r8751 r10144  
    2121    pmFPAfile *file = psMetadataLookupPtr (&status, config->files, "PSASTRO.OUTPUT");
    2222    if (!status) {
    23         psError (PS_ERR_IO, true, "no PSASTRO.OUTPUT file defined");
    24         return false;
     23        psError (PS_ERR_IO, true, "no PSASTRO.OUTPUT file defined");
     24        return false;
    2525    }
    2626
     
    3030    pmFPAview *view = pmFPAviewAlloc (0);
    3131    if (file->fileLevel == PM_FPA_LEVEL_CHIP) {
    32         // call addstar on this file
    33         setFilename (file, view);
    34         addstarFile (addstarCommand, file->filename);
    35         return true;
     32        // call addstar on this file
     33        setFilename (file, view);
     34        addstarFile (addstarCommand, file->filename);
     35        return true;
    3636    }
    3737
     
    4040        if (!chip->process || !chip->file_exists) { continue; }
    4141
    42         if (file->fileLevel == PM_FPA_LEVEL_CHIP) {
    43             // call addstar on this file
    44             setFilename (file, view);
    45             addstarFile (addstarCommand, file->filename);
    46             continue;
    47         }
     42        if (file->fileLevel == PM_FPA_LEVEL_CHIP) {
     43            // call addstar on this file
     44            setFilename (file, view);
     45            addstarFile (addstarCommand, file->filename);
     46            continue;
     47        }
    4848
    49         while ((cell = pmFPAviewNextCell (view, file->fpa, 1)) != NULL) {
    50             psLogMsg ("ppImageAddstar", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    51             if (! cell->process || ! cell->file_exists) { continue; }
     49        while ((cell = pmFPAviewNextCell (view, file->fpa, 1)) != NULL) {
     50            psLogMsg ("ppImageAddstar", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     51            if (! cell->process || ! cell->file_exists) { continue; }
    5252
    53             if (file->fileLevel == PM_FPA_LEVEL_CELL) {
    54                 // call addstar on this file
    55                 setFilename (file, view);
    56                 addstarFile (addstarCommand, file->filename);
    57                 continue;
    58             }
     53            if (file->fileLevel == PM_FPA_LEVEL_CELL) {
     54                // call addstar on this file
     55                setFilename (file, view);
     56                addstarFile (addstarCommand, file->filename);
     57                continue;
     58            }
    5959
    60             // process each of the readouts
    61             while ((readout = pmFPAviewNextReadout (view, file->fpa, 1)) != NULL) {
    62                 if (! readout->data_exists) { continue; }
     60            // process each of the readouts
     61            while ((readout = pmFPAviewNextReadout (view, file->fpa, 1)) != NULL) {
     62                if (! readout->data_exists) { continue; }
    6363
    64                 if (file->fileLevel == PM_FPA_LEVEL_READOUT) {
    65                     // call addstar on this file
    66                     setFilename (file, view);
    67                     addstarFile (addstarCommand, file->filename);
    68                     continue;
    69                 } else {
    70                     psError (PS_ERR_IO, true, "inconsistent fileLevel for %s: %d\n", file->name, file->fileLevel);
    71                     return false;
    72                 }
    73             }
    74         }
     64                if (file->fileLevel == PM_FPA_LEVEL_READOUT) {
     65                    // call addstar on this file
     66                    setFilename (file, view);
     67                    addstarFile (addstarCommand, file->filename);
     68                    continue;
     69                } else {
     70                    psError (PS_ERR_IO, true, "inconsistent fileLevel for %s: %d\n", file->name, file->fileLevel);
     71                    return false;
     72                }
     73            }
     74        }
    7575    }
    7676    return true;
     
    9090    // indirect filenames are not allowed for output
    9191    if (!strcasecmp (file->filename, "@FILES")) {
    92         psError(PS_ERR_IO, true, "indirect filenames are not allowed for output : %s\n", file->name);
    93         return false;
     92        psError(PS_ERR_IO, true, "indirect filenames are not allowed for output : %s\n", file->name);
     93        return false;
    9494    }
    9595    if (!strcasecmp (file->filename, "@DETDB")) {
    96         psError(PS_ERR_IO, true, "detrend db filenames are not allowed for output : %s\n", file->name);
    97         return false;
     96        psError(PS_ERR_IO, true, "detrend db filenames are not allowed for output : %s\n", file->name);
     97        return false;
    9898    }
    9999    return true;
     
    104104    bool status;
    105105    char *addstarLine = psStringSubstitute (addstarCommand, filename, "%s");
    106        
     106
    107107    // catch addstar stderr/stdout and do what?
    108108    psIOBuffer *buffer = psIOBufferAlloc (512);
    109109    psPipe *pipe = psPipeOpen (addstarLine);
    110     status = psIOBufferReadEmpty (buffer, 100, pipe->stdout);
     110    status = psIOBufferReadEmpty (buffer, 100, pipe->fd_stdout);
    111111    if (!status) {
    112         psError (PS_ERR_IO, false, "detselect is not responding");
     112        psError (PS_ERR_IO, false, "detselect is not responding");
    113113    }
    114114    psFree (addstarLine);
Note: See TracChangeset for help on using the changeset viewer.