IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 29, 2010, 4:22:09 PM (16 years ago)
Author:
rhenders
Message:

Removed dependance on column numbers: now looks-up using column names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/ippToPspsConfig.c

    r28249 r28556  
    616616                column->ippType = ippToPsps_GetDataType(buffer);
    617617
    618                 // IPP column
    619                 ippToPspsConfig_getAttribute(node, "ippColumn", buffer);
    620                 column->ippColNum = atoi(buffer);
    621 
    622618                column->usingDefault = false;
    623619
    624                 //psLogMsg("ippToPsps", PS_LOG_INFO, "...mapping PSPS:'%s' to '%s'", column->pspsName, column->ippName );
     620                //psLogMsg("ippToPsps", PS_LOG_INFO, "...mapping PSPS:'%s' to '%s' '%d'", column->pspsName, column->ippName, column->ippColNum );
    625621            }
    626622        }
     
    734730    int readStatus = 0;
    735731    int writeStatus = 0;
    736 
     732   
     733    // first loop round all columns and get IPP col numbers for provided column names
     734    if(!fromHeader) {
     735
     736        for (uint32_t i=0; i<table->numOfColumns; i++) {
     737
     738            if (strlen(table->columns[i].ippName) < 1) continue;
     739            readStatus = 0;
     740            fits_get_colnum(fitsIn, CASESEN, table->columns[i].ippName, &table->columns[i].ippColNum, &readStatus);
     741            if (readStatus) psError(PS_ERR_IO, false, "%d Unable to read col num for '%s' '%s' %d", i, table->columns[i].pspsName, table->columns[i].ippName, table->columns[i].ippColNum);
     742        }
     743    }
    737744
    738745    int col;
Note: See TracChangeset for help on using the changeset viewer.