IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 28, 2007, 2:06:47 PM (19 years ago)
Author:
Paul Price
Message:

During the recent reorganisation here, I didn't realise that there is
a function that calls addSource() that wants NOT to install the HDUs,
etc (it only wants to find the appropriate chip or cell). Pushed the
responsibility for this into the addSource_CHIP_etc functions.

File:
1 edited

Legend:

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

    r15068 r15087  
    701701                                pmChip *chip, // Known chip to which to add, or NULL
    702702                                const psMetadata *format, // The camera format
    703                                 pmHDU *phdu // The Primary HDU
     703                                pmHDU *phdu, // The Primary HDU
     704                                bool install // Install the HDUs?
    704705                                )
    705706{
     
    746747    }
    747748
     749    if (!install) {
     750        // Everything below is about installing the HDUs
     751        psFree(chipType);
     752        return true;
     753    }
     754
    748755    if (!addHDUtoChip(chip, phdu)) {
    749756        psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to chip\n");
     
    803810                                pmChip *chip, // Known chip to which to add, or NULL
    804811                                const psMetadata *format, // The camera format
    805                                 pmHDU *phdu // Primary HDU
     812                                pmHDU *phdu, // Primary HDU
     813                                bool install // Install the HDUs?
    806814                                )
    807815{
     
    845853    }
    846854
     855    if (!install) {
     856        // Everything below is about installing the HDU
     857        psFree(chipType);
     858        return true;
     859    }
     860
    847861    if (!addHDUtoChip(chip, phdu)) {
    848862        psError(PS_ERR_UNKNOWN, false, "Unable to add HDU to chip\n");
     
    879893                                pmCell *cell, // Known cell to which to add, or NULL
    880894                                const psMetadata *format, // The camera format
    881                                 pmHDU *phdu // The Primary HDU
     895                                pmHDU *phdu, // The Primary HDU
     896                                bool install // Install the HDUs?
    882897                                )
    883898{
     
    10291044        psFree(cellNames);
    10301045        psFree(cellTypes);
     1046    }
     1047
     1048    if (!install) {
     1049        // Everything below is about installing the HDU
     1050        psFree(chipNames);
     1051        psFree(cellNames);
     1052        psFree(cellTypes);
     1053        return true;
    10311054    }
    10321055
     
    12011224          switch (extLevel) {
    12021225            case PM_FPA_LEVEL_CELL:
    1203               if (install) {
    1204                   phdu->blankPHU = true;
    1205                   if (!addSource_CHIP_CELL(view, fpa, chip, format, phdu)) {
    1206                       psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
    1207                       psFree(phdu);
    1208                       psFree(view);
    1209                       return NULL;
    1210                   }
     1226              phdu->blankPHU = true;
     1227              if (!addSource_CHIP_CELL(view, fpa, chip, format, phdu, install)) {
     1228                  psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
     1229                  psFree(phdu);
     1230                  psFree(view);
     1231                  return NULL;
    12111232              }
    12121233              psFree(phdu);
    12131234              return view;
    12141235            case PM_FPA_LEVEL_NONE:
    1215               if (install) {
    1216                   phdu->blankPHU = false;
    1217                   if (!addSource_CHIP_NONE(view, fpa, chip, format, phdu)) {
    1218                       psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
    1219                       psFree(phdu);
    1220                       psFree(view);
    1221                       return NULL;
    1222                   }
     1236              phdu->blankPHU = false;
     1237              if (!addSource_CHIP_NONE(view, fpa, chip, format, phdu, install)) {
     1238                  psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
     1239                  psFree(phdu);
     1240                  psFree(view);
     1241                  return NULL;
    12231242              }
    12241243              psFree(phdu);
     
    12431262              cell = chip->cells->data[phuView->cell];
    12441263          }
    1245           if (install) {
    1246               phdu->blankPHU = false;
    1247               if (!addSource_CELL_NONE(view, fpa, cell, format, phdu)) {
    1248                   psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
    1249                   psFree(phdu);
    1250                   psFree(view);
    1251                   return NULL;
    1252               }
     1264          phdu->blankPHU = false;
     1265          if (!addSource_CELL_NONE(view, fpa, cell, format, phdu, install)) {
     1266              psError(PS_ERR_UNKNOWN, false, "Unable to add source.");
     1267              psFree(phdu);
     1268              psFree(view);
     1269              return NULL;
    12531270          }
    12541271          psFree(phdu);
Note: See TracChangeset for help on using the changeset viewer.