IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17874


Ignore:
Timestamp:
May 30, 2008, 5:19:49 PM (18 years ago)
Author:
Paul Price
Message:

Finally finished and tested code to get concepts from the database.

Location:
trunk/psModules/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConcepts.c

    r17867 r17874  
    12261226        replace[0] = '{'; \
    12271227        strcpy(replace + 1, concept); \
    1228         strcpy(replace + length + 1, "}"); \
     1228        strcpy(replace + length, "}"); \
    12291229        \
    12301230        psTrace("psModules.concepts", 10, "Interpolating concept %s for %s", replace, value); \
     
    12591259        char concept[length];  // Name of concept
    12601260        strncpy(concept, start + 1, length - 1);
    1261         concept[length] = '\0';
     1261        concept[length - 1] = '\0';
    12621262
    12631263        psTrace("psModules.concepts", 7, "Interpolating concept %s", concept);
  • trunk/psModules/src/concepts/pmConceptsRead.c

    r17868 r17874  
    373373}
    374374
    375 // XXX --- the below code has NOT been tested!
    376375bool p_pmConceptsReadFromDatabase(psMetadata *target, const psMetadata *specs,
    377376                                  const pmFPA *fpa, const pmChip *chip, const pmCell *cell, psDB *db)
  • trunk/psModules/src/config/pmConfig.c

    r17548 r17874  
    880880    }
    881881
     882    if (!config->database) {
     883        psDB *dbh = pmConfigDB(config); // Database handle
     884        if (!dbh) {
     885            psError(PS_ERR_UNKNOWN, false, "Unable to open database connection.");
     886            psFree(config);
     887            return NULL;
     888        }
     889        config->database = dbh;
     890    }
    882891
    883892    psErrorClear();   // we may have failed to find some items in the metadata
     
    13441353    }
    13451354
    1346     // no files found: this is not really an error 
     1355    // no files found: this is not really an error
    13471356    if (files->n == 0) {
    13481357        psFree (files);
     
    15531562    psMetadata *scheme = psMetadataLookupMetadata(&mdok, fitstypes, fitsType);
    15541563    if (!scheme) {
    1555         psWarning("Unable to find specified FITS Type %s in camera configuration.", fitsType);
    1556         return NULL;
     1564        psWarning("Unable to find specified FITS Type %s in camera configuration.", fitsType);
     1565        return NULL;
    15571566    }
    15581567
    15591568    return scheme;
    15601569}
     1570
     1571
     1572#if 0
     1573bool pmConfigDump(const pmConfig *config, const pmFPA *source, const char *outroot)
     1574{
     1575    PS_ASSERT_PTR_NON_NULL(config, false);
     1576    PS_ASSERT_STRING_NON_EMPTY(outroot, false);
     1577
     1578    pmFPAview *view = source ? pmFPAviewTop(source) : pmFPAviewAlloc(0);// View to top level
     1579    if (!view) {
     1580        psError(PS_ERR_UNKNOWN, false, "Unable to determine top view for FPA.");
     1581        return false;
     1582    }
     1583
     1584    psMetadata *dumpRules = psMetadataLookupMetadata(NULL, config->system, "CONFIG.RULES"); // Name rules
     1585    if (!dumpRules) {
     1586        psError(PS_ERR_UNKNOWN, false, "Unable to find CONFIG.RULES in system configuration");
     1587        psFree(view);
     1588        return false;
     1589    }
     1590
     1591    const char *name =
     1592#endif
Note: See TracChangeset for help on using the changeset viewer.