IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6109


Ignore:
Timestamp:
Jan 20, 2006, 5:17:09 PM (20 years ago)
Author:
jhoblitt
Message:

whitespace reform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/p2insertPendingFrames.c

    r6086 r6109  
    77bool p2insertPendingFrames (p2Config *config, psArray *rawFrames) {
    88
    9     psMetadata *where = psMetadataAlloc ();
     9    psMetadata *where = psMetadataAlloc();
    1010
    1111    for (int i = 0; i < rawFrames->n; i++) {
    12         ppRawFrame *rawFrame = rawFrames->data[i];
     12        ppRawFrame *rawFrame = rawFrames->data[i];
    1313
    14         // find the next available version numbers
    15         psMetadataAddStr (where, PS_LIST_TAIL, "EXP_ID", PS_META_REPLACE, "==", rawFrame->exposure->exp_id);
    16         psArray *exposures = p2PendingExpSelectRowObjects(config->database, where, MAX_ROWS);
    17         int version = -1;
    18         for (int j = 0; j < exposures->n; j++) {
    19             p2PendingExpRow *exposure = exposures->data[j];
    20             version = PS_MAX (version, exposure->p2_version);
    21         }
    22         version ++;
     14        // find the next available version numbers
     15        psMetadataAddStr(where, PS_LIST_TAIL, "EXP_ID", PS_META_REPLACE, "==",
     16            rawFrame->exposure->exp_id);
     17        psArray *exposures = p2PendingExpSelectRowObjects(config->database,
     18            where, MAX_ROWS);
    2319
    24         p2PendingExpRow *pendingExposure = p2PendingExpRowAlloc(
    25         rawFrame->exposure->exp_id,
    26         rawFrame->exposure->camera,
    27         rawFrame->exposure->filter,
    28         rawFrame->exposure->class,
    29         rawFrame->exposure->nclass,
    30         0xff,
    31         version
    32         // pendingExposure->Ndone = 0;
    33         // pendingExposure->state = P2_STATE_PENDING;
    34     );
     20        int version = -1;
     21        for (int j = 0; j < exposures->n; j++) {
     22            p2PendingExpRow *exposure = exposures->data[j];
     23            version = PS_MAX(version, exposure->p2_version);
     24        }
     25        version ++;
    3526
    36         psArray *pendingImages = psArrayAlloc (rawFrame->images->n);
    37         pendingImages->n = 0;
    38         for (int j = 0; j < rawFrame->images->n; j++) {
    39             rawImfileRow *rawImage = rawFrame->images->data[j];
    40             p2PendingImfileRow *pendingImage = p2PendingImfileRowAlloc(
    41                 rawImage->exp_id,
    42                 rawImage->exptype,
    43                 rawImage->class,
    44                 rawImage->class_id,
    45                 version, // p1
    46                 version, // p2
    47             "",
    48             "",
    49                 // XXX cleanup the url somehow
    50                 rawImage->url
     27        p2PendingExpRow *pendingExposure = p2PendingExpRowAlloc(
     28            rawFrame->exposure->exp_id,
     29            rawFrame->exposure->camera,
     30            rawFrame->exposure->filter,
     31            rawFrame->exposure->class,
     32            rawFrame->exposure->nclass,
     33            0xff,
     34            version
     35            // pendingExposure->Ndone = 0;
     36            // pendingExposure->state = P2_STATE_PENDING;
    5137        );
    5238
    53             psArrayAdd (pendingImages, 100, pendingImage);
    54         }
    55        
    56         p2PendingExpInsertObject (config->database, pendingExposure);
     39        psArray *pendingImages = psArrayAlloc(rawFrame->images->n);
     40        pendingImages->n = 0;
     41        for (int j = 0; j < rawFrame->images->n; j++) {
     42            rawImfileRow *rawImage = rawFrame->images->data[j];
     43            p2PendingImfileRow *pendingImage = p2PendingImfileRowAlloc(
     44                rawImage->exp_id,
     45                rawImage->exptype,
     46                rawImage->class,
     47                rawImage->class_id,
     48                version, // p1
     49                version, // p2
     50                "",
     51                "",
     52                // XXX cleanup the url somehow
     53                rawImage->url
     54            );
    5755
    58     for (int i = 0; i < pendingImages->n; i++) {
    59             p2PendingImfileInsertObject(config->database, pendingImages->data[i]);
     56            psArrayAdd(pendingImages, 100, pendingImage);
     57        }
     58       
     59        p2PendingExpInsertObject(config->database, pendingExposure);
     60
     61        for (int i = 0; i < pendingImages->n; i++) {
     62                p2PendingImfileInsertObject(config->database,
     63                    pendingImages->data[i]);
     64        }
    6065    }
    6166
    62     }
    6367    return true;
    64 } 
     68}
    6569
    6670// XXX the filename layout is defined by this code
Note: See TracChangeset for help on using the changeset viewer.