Changeset 12810
- Timestamp:
- Apr 11, 2007, 4:51:44 PM (19 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 3 edited
-
pmFPACopy.c (modified) (1 diff)
-
pmFPACopy.h (modified) (2 diffs)
-
pmFPAfileIO.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPACopy.c
r12791 r12810 350 350 } 351 351 352 // create a new pmChip with the data derived from the supplied chip 353 pmChip *pmChipDuplicate(pmFPA *fpa, const pmChip *sourceChip) 354 { 355 assert(sourceChip); 356 357 bool status; 358 char *chipName = psMetadataLookupStr(&status, sourceChip->concepts, "CHIP.NAME"); 359 pmChip *targetChip = pmChipAlloc (NULL, chipName); 360 targetChip->parent = fpa; 361 362 psArray *sourceCells = sourceChip->cells; // The source cells 363 364 for (int i = 0; i < sourceCells->n; i++) { 365 pmCell *sourceCell = sourceCells->data[i]; // The sources cell 366 const char *cellName = psMetadataLookupStr(NULL, sourceCell->concepts, "CELL.NAME"); // Name of cell 367 // XXX are there other concepts I need to copy first? 368 pmCell *targetCell = pmCellAlloc (targetChip, cellName); 369 int xParityTarget = psMetadataLookupS32(&status, sourceCell->concepts, "CELL.XPARITY"); // Target x parity 370 psMetadataAddS32 (targetCell->concepts, PS_LIST_TAIL, "CELL.XPARITY", PS_META_REPLACE, "", xParityTarget); 371 int yParityTarget = psMetadataLookupS32(&status, sourceCell->concepts, "CELL.YPARITY"); // Target y parity 372 psMetadataAddS32 (targetCell->concepts, PS_LIST_TAIL, "CELL.YPARITY", PS_META_REPLACE, "", yParityTarget); 373 if (!cellCopy(targetCell, sourceCell, true, 1, 1)) { 374 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "failed to duplicate chip\n"); 375 return NULL; 376 } 377 // update the attributes 378 targetCell->file_exists = sourceCell->file_exists; 379 targetCell->data_exists = sourceCell->data_exists; 380 targetCell->process = sourceCell->process; 381 } 382 383 // Update the concepts 384 psMetadataCopy(targetChip->concepts, sourceChip->concepts); 385 386 // update the attributes 387 targetChip->file_exists = sourceChip->file_exists; 388 targetChip->data_exists = sourceChip->data_exists; 389 targetChip->process = sourceChip->process; 390 391 return targetChip; 392 } 393 352 394 // Common engine for pmFPACopy and pmFPACopyStructure. 353 395 // Iterate on the components -
trunk/psModules/src/camera/pmFPACopy.h
r11253 r12810 4 4 * @author Paul Price, IfA 5 5 * 6 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-0 1-24 02:54:14 $6 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-04-12 02:51:44 $ 8 8 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 72 72 int xBin, int yBin ///< Binning factors in x and y 73 73 ); 74 75 pmChip *pmChipDuplicate(pmFPA *fpa, const pmChip *source); 76 74 77 /// @} 75 78 #endif -
trunk/psModules/src/camera/pmFPAfileIO.c
r12804 r12810 416 416 pmFPALevel level = pmFPAviewLevel (view); 417 417 if (file->fileLevel != level) { 418 psTrace("psModules.camera", 6, "skip closing of %s at this level %s: dataLevel is %s",419 file->name, pmFPALevelToName(level), pmFPALevelToName(file-> dataLevel));418 psTrace("psModules.camera", 6, "skip closing of %s at this level %s: fileLevel is %s", 419 file->name, pmFPALevelToName(level), pmFPALevelToName(file->fileLevel)); 420 420 return true; 421 421 }
Note:
See TracChangeset
for help on using the changeset viewer.
