IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2008, 5:45:56 PM (18 years ago)
Author:
Paul Price
Message:

Removing use of pmConfig.complete in favour of proper use of what's now called pmConfigFileIngest (used to be metadataItemReadFile). The idea is that configuration files are read in to the metadata item where they are defined. The result is that the .ipprc (pmConfig.user) can be dumped to a file, and will contain all the other stuff as well, so that it can be loaded in (using '-ipprc XXX' on the command-line) and we have a fully defined configuration without having to load anything else (which may have changed). The problem with pmConfig.complete was that it produced multiple unsynchronised versions: you could access and change data in pmConfig.complete without pmConfig.user or pmConfig.system being updated. This check in restores things to the way they used to be, where everything is synchronised.

File:
1 edited

Legend:

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

    r18567 r18908  
    2424
    2525# define FPA_TEST_ASSERT(A){ \
    26         assert(A->format == NULL); \
    27         assert(A->formatName == NULL); \
    28         assert(A->filerule == NULL); \
    29         assert(A->filesrc == NULL); }
     26        assert(A->format == NULL); \
     27        assert(A->formatName == NULL); \
     28        assert(A->filerule == NULL); \
     29        assert(A->filesrc == NULL); }
    3030
    3131// Parse an option from a metadata, returning the appropriate integer value
     
    164164    } else {
    165165        bool mdok;                      // Status of MD lookup
    166         psMetadata *cameras = psMetadataLookupMetadata(&mdok, config->complete, "CAMERAS"); // Known cameras
     166        psMetadata *cameras = psMetadataLookupMetadata(&mdok, config->system, "CAMERAS"); // Known cameras
    167167        if (!mdok || !cameras) {
    168168            psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find CAMERAS in the system configuration.\n");
     
    486486        psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName);
    487487        psFree(phu);
    488         psFree(camera);
    489         psFree(formatName);
     488        psFree(camera);
     489        psFree(formatName);
    490490        psFree(realName);
    491491        return NULL;
     
    498498        psError(PS_ERR_IO, false, "Failed to construct FPA from %s", realName);
    499499        psFree(phu);
    500         psFree(camera);
    501         psFree(formatName);
     500        psFree(camera);
     501        psFree(formatName);
    502502        psFree(realName);
    503503        psFree(format);
     
    513513        psError(PS_ERR_IO, false, "file %s not defined\n", filename);
    514514        psFree(phu);
    515         psFree(formatName);
     515        psFree(formatName);
    516516        psFree(format);
    517517        psFree(fpa);
    518518        return NULL;
    519519    }
    520     psFree (file->filerule); // this is set in pmFPAfileDefineInput 
     520    psFree (file->filerule); // this is set in pmFPAfileDefineInput
    521521    file->format = format;
    522522    file->formatName = formatName;
     
    534534
    535535    if (file->type == PM_FPA_FILE_MASK) {
    536         if (!pmConfigMaskReadHeader (config, phu)) {
    537             psError(PS_ERR_IO, false, "error in mask bits");
    538             return NULL;
    539         }
     536        if (!pmConfigMaskReadHeader (config, phu)) {
     537            psError(PS_ERR_IO, false, "error in mask bits");
     538            return NULL;
     539        }
    540540    }
    541541
     
    549549            if (!realName) {
    550550                psError(PS_ERR_IO, false, "Failed to convert file name %s", (char *) infiles->data[i]);
    551                 psFree(phu);
    552                 psFree(fpa);
     551                psFree(phu);
     552                psFree(fpa);
    553553                return NULL;
    554554            }
     
    558558                psError(PS_ERR_IO, false, "Failed to open file %s\n", realName);
    559559                psFree(realName);
    560                 psFree(phu);
    561                 psFree(fpa);
     560                psFree(phu);
     561                psFree(fpa);
    562562                return NULL;
    563563            }
     
    567567                psFree(realName);
    568568                psFitsClose(fits);
    569                 psFree(phu);
    570                 psFree(fpa);
     569                psFree(phu);
     570                psFree(fpa);
    571571                return NULL;
    572572            }
     
    576576                psFree(realName);
    577577                psFitsClose(fits);
    578                 psFree(phu);
    579                 psFree(fpa);
     578                psFree(phu);
     579                psFree(fpa);
    580580                return NULL;
    581581            }
     
    584584                psFree(realName);
    585585                psFitsClose(fits);
    586                 psFree(phu);
    587                 psFree(fpa);
     586                psFree(phu);
     587                psFree(fpa);
    588588                return NULL;
    589589            }
     
    744744        psMetadataAddStr (file->names, PS_LIST_TAIL, name, 0, "", infiles->data[i]);
    745745
    746         if ((i == 0) && (file->type == PM_FPA_FILE_MASK)) {
    747             if (!pmConfigMaskReadHeader (config, phu)) {
    748                 psError(PS_ERR_IO, false, "error in mask bits");
    749                 return NULL;
    750             }
    751         }
     746        if ((i == 0) && (file->type == PM_FPA_FILE_MASK)) {
     747            if (!pmConfigMaskReadHeader (config, phu)) {
     748                psError(PS_ERR_IO, false, "error in mask bits");
     749                return NULL;
     750            }
     751        }
    752752
    753753        psFree(view);
     
    819819        psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", (char *)infiles->data[0]);
    820820        psFree(phu);
    821         psFree(camera);
    822         psFree(formatName);
     821        psFree(camera);
     822        psFree(formatName);
    823823        return NULL;
    824824    }
     
    829829        psError(PS_ERR_IO, false, "Failed to construct FPA from %s", (char *)infiles->data[0]);
    830830        psFree(phu);
    831         psFree(camera);
    832         psFree(formatName);
     831        psFree(camera);
     832        psFree(formatName);
    833833        psFree(format);
    834834        return NULL;
     
    863863
    864864    if (file->type == PM_FPA_FILE_MASK) {
    865         if (!pmConfigMaskReadHeader (config, phu)) {
    866             psError(PS_ERR_IO, false, "error in mask bits");
    867             return NULL;
    868         }
     865        if (!pmConfigMaskReadHeader (config, phu)) {
     866            psError(PS_ERR_IO, false, "error in mask bits");
     867            return NULL;
     868        }
    869869    }
    870870
Note: See TracChangeset for help on using the changeset viewer.