Changeset 13670 for trunk/psModules/src/objects/pmSourceIO.c
- Timestamp:
- Jun 5, 2007, 4:23:33 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceIO.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO.c
r13527 r13670 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-0 5-26 02:52:53 $5 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-06-06 02:23:33 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 161 161 bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 162 162 { 163 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 164 *thisView = *view; 163 165 164 166 for (int i = 0; i < fpa->chips->n; i++) { 165 166 167 pmChip *chip = fpa->chips->data[i]; 167 if (!pmChipWriteObjects (chip, view, file, config)) { 168 thisView->chip = i; 169 if (!pmChipWriteObjects (chip, thisView, file, config)) { 168 170 psError(PS_ERR_IO, false, "Failed to write %dth chip", i); 169 return false; 170 } 171 } 171 psFree (thisView); 172 return false; 173 } 174 } 175 psFree (thisView); 172 176 return true; 173 177 } … … 176 180 bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 177 181 { 182 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 183 *thisView = *view; 178 184 179 185 for (int i = 0; i < chip->cells->n; i++) { 180 186 181 187 pmCell *cell = chip->cells->data[i]; 182 if (!pmCellWriteObjects (cell, view, file, config)) { 188 thisView->cell = i; 189 if (!pmCellWriteObjects (cell, thisView, file, config)) { 183 190 psError(PS_ERR_IO, false, "Failed to write %dth cell", i); 184 return false; 185 } 186 } 191 psFree (thisView); 192 return false; 193 } 194 } 195 psFree (thisView); 187 196 return true; 188 197 } … … 191 200 bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 192 201 { 202 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 203 *thisView = *view; 193 204 194 205 for (int i = 0; i < cell->readouts->n; i++) { 195 206 196 207 pmReadout *readout = cell->readouts->data[i]; 197 if (!pmReadoutWriteObjects (readout, view, file, config)) { 208 thisView->readout = i; 209 if (!pmReadoutWriteObjects (readout, thisView, file, config)) { 198 210 psError(PS_ERR_IO, false, "Failed to write %dth readout", i); 199 return false; 200 } 201 } 211 psFree (thisView); 212 return false; 213 } 214 } 215 psFree (thisView); 202 216 return true; 203 217 } … … 464 478 bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 465 479 { 480 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 481 *thisView = *view; 482 466 483 for (int i = 0; i < fpa->chips->n; i++) { 467 484 pmChip *chip = fpa->chips->data[i]; 468 pmChipReadObjects (chip, view, file, config); 469 } 485 thisView->chip = i; 486 pmChipReadObjects (chip, thisView, file, config); 487 } 488 psFree (thisView); 470 489 return true; 471 490 } … … 474 493 bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 475 494 { 495 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 496 *thisView = *view; 497 476 498 chip->data_exists = false; 477 499 for (int i = 0; i < chip->cells->n; i++) { 478 500 pmCell *cell = chip->cells->data[i]; 479 pmCellReadObjects (cell, view, file, config); 501 thisView->cell = i; 502 pmCellReadObjects (cell, thisView, file, config); 480 503 if (!cell->data_exists) continue; 481 504 chip->data_exists = true; 482 505 } 506 psFree (thisView); 483 507 return true; 484 508 } … … 487 511 bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 488 512 { 513 pmFPAview *thisView = pmFPAviewAlloc (view->nRows); 514 *thisView = *view; 515 489 516 // multiple readout mode is not yet defined for CMP or CMF files 490 517 // if they have not been allocated, allocate a single readout … … 497 524 for (int i = 0; i < cell->readouts->n; i++) { 498 525 pmReadout *readout = cell->readouts->data[i]; 499 pmReadoutReadObjects (readout, view, file, config); 526 thisView->readout = i; 527 pmReadoutReadObjects (readout, thisView, file, config); 500 528 if (!readout->data_exists) { 501 529 continue; … … 510 538 cell->data_exists = true; 511 539 } 540 psFree (thisView); 512 541 return true; 513 542 }
Note:
See TracChangeset
for help on using the changeset viewer.
