Changeset 18163 for trunk/psModules/src/concepts/pmConcepts.c
- Timestamp:
- Jun 17, 2008, 12:16:38 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConcepts.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConcepts.c
r18104 r18163 10 10 #include <string.h> 11 11 12 #include "pmConfig.h" 12 13 #include "pmHDU.h" 13 14 #include "pmFPA.h" … … 195 196 unsigned int *read, // What's already been read 196 197 pmConceptSource source, // The source of the concepts to read 197 p sDB *db, // Database handle198 pmConfig *config, // Configuration 198 199 psMetadata *target // Place into which to read the concepts 199 200 ) … … 256 257 #ifdef HAVE_PSDB 257 258 if (source & PM_CONCEPT_SOURCE_DATABASE && !(*read & PM_CONCEPT_SOURCE_DATABASE)) { 258 if (p_pmConceptsReadFromDatabase(target, *specs, fpa, chip, cell, db)) {259 if (p_pmConceptsReadFromDatabase(target, *specs, fpa, chip, cell, config)) { 259 260 *read |= PM_CONCEPT_SOURCE_DATABASE; 260 261 } else { … … 276 277 const pmCell *cell, // The cell 277 278 pmConceptSource source, // The source of the concepts to write 278 p sDB *db, // Database handle279 pmConfig *config, // Configuration 279 280 const psMetadata *concepts // The concepts to write out 280 281 ) … … 299 300 } 300 301 if (source & PM_CONCEPT_SOURCE_DATABASE) { 301 p_pmConceptsWriteToDatabase(*specs, fpa, chip, cell, db, concepts);302 p_pmConceptsWriteToDatabase(*specs, fpa, chip, cell, config, concepts); 302 303 } 303 304 … … 306 307 307 308 308 bool pmConceptsRead(pmFPA *fpa, pmChip *chip, pmCell *cell, pmConceptSource source, p sDB *db)309 bool pmConceptsRead(pmFPA *fpa, pmChip *chip, pmCell *cell, pmConceptSource source, pmConfig *config) 309 310 { 310 311 PS_ASSERT_PTR_NON_NULL(fpa, false); 311 bool success = conceptsRead(&conceptsFPA, fpa, chip, cell, &fpa->conceptsRead, source, db, fpa->concepts); 312 bool success = conceptsRead(&conceptsFPA, fpa, chip, cell, &fpa->conceptsRead, source, 313 config, fpa->concepts); 312 314 if (chip) { 313 success &= conceptsRead(&conceptsChip, fpa, chip, cell, &chip->conceptsRead, source, db, chip->concepts); 315 success &= conceptsRead(&conceptsChip, fpa, chip, cell, &chip->conceptsRead, source, 316 config, chip->concepts); 314 317 } 315 318 if (cell) { 316 success &= conceptsRead(&conceptsCell, fpa, chip, cell, &cell->conceptsRead, source, db, cell->concepts); 319 success &= conceptsRead(&conceptsCell, fpa, chip, cell, &cell->conceptsRead, source, 320 config, cell->concepts); 317 321 } 318 322 … … 329 333 330 334 331 bool pmConceptsReadFPA(pmFPA *fpa, pmConceptSource source, bool propagateDown, p sDB *db)335 bool pmConceptsReadFPA(pmFPA *fpa, pmConceptSource source, bool propagateDown, pmConfig *config) 332 336 { 333 337 PS_ASSERT_PTR_NON_NULL(fpa, false); 334 338 psTrace("psModules.concepts", 5, "Reading FPA concepts: %p %p\n", conceptsFPA, fpa->concepts); 335 bool success = conceptsRead(&conceptsFPA, fpa, NULL, NULL, &fpa->conceptsRead, source, db, fpa->concepts); 339 bool success = conceptsRead(&conceptsFPA, fpa, NULL, NULL, &fpa->conceptsRead, source, 340 config, fpa->concepts); 336 341 if (propagateDown) { 337 342 psArray *chips = fpa->chips; // Array of chips … … 339 344 pmChip *chip = chips->data[i]; // Chip of interest 340 345 if (chip) { 341 success &= pmConceptsReadChip(chip, source, false, true, db);346 success &= pmConceptsReadChip(chip, source, false, true, config); 342 347 } 343 348 } … … 347 352 } 348 353 349 bool pmConceptsWriteFPA(const pmFPA *fpa, pmConceptSource source, bool propagateDown, p sDB *db)354 bool pmConceptsWriteFPA(const pmFPA *fpa, pmConceptSource source, bool propagateDown, pmConfig *config) 350 355 { 351 356 PS_ASSERT_PTR_NON_NULL(fpa, false); 352 357 psTrace("psModules.concepts", 5, "Writing FPA concepts: %p %p\n", conceptsFPA, fpa->concepts); 353 bool success = conceptsWrite(&conceptsFPA, fpa, NULL, NULL, source, db, fpa->concepts);358 bool success = conceptsWrite(&conceptsFPA, fpa, NULL, NULL, source, config, fpa->concepts); 354 359 if (propagateDown) { 355 360 psArray *chips = fpa->chips; // Array of chips … … 357 362 pmChip *chip = chips->data[i]; // Chip of interest 358 363 if (chip && !chip->hdu) { 359 success &= pmConceptsWriteChip(chip, source, false, true, db);364 success &= pmConceptsWriteChip(chip, source, false, true, config); 360 365 } 361 366 } … … 372 377 373 378 bool pmConceptsReadChip(pmChip *chip, pmConceptSource source, bool propagateUp, 374 bool propagateDown, p sDB *db)379 bool propagateDown, pmConfig *config) 375 380 { 376 381 PS_ASSERT_PTR_NON_NULL(chip, false); 377 382 psTrace("psModules.concepts", 5, "Reading chip concepts: %p %p\n", conceptsChip, chip->concepts); 378 383 pmFPA *fpa = chip->parent; // FPA to which the chip belongs 379 bool success = conceptsRead(&conceptsChip, fpa, chip, NULL, &chip->conceptsRead, source, db,384 bool success = conceptsRead(&conceptsChip, fpa, chip, NULL, &chip->conceptsRead, source, config, 380 385 chip->concepts); 381 386 if (propagateUp) { 382 success &= conceptsRead(&conceptsFPA, fpa, chip, NULL, &fpa->conceptsRead, source, db, fpa->concepts); 387 success &= conceptsRead(&conceptsFPA, fpa, chip, NULL, &fpa->conceptsRead, source, 388 config, fpa->concepts); 383 389 } 384 390 if (propagateDown) { … … 387 393 pmCell *cell = cells->data[i]; // Cell of interest 388 394 if (cell) { 389 success &= pmConceptsReadCell(cell, source, false, db);395 success &= pmConceptsReadCell(cell, source, false, config); 390 396 } 391 397 } … … 395 401 396 402 bool pmConceptsWriteChip(const pmChip *chip, pmConceptSource source, bool propagateUp, 397 bool propagateDown, p sDB *db)403 bool propagateDown, pmConfig *config) 398 404 { 399 405 PS_ASSERT_PTR_NON_NULL(chip, false); 400 406 psTrace("psModules.concepts", 5, "Writing chip concepts: %p %p\n", conceptsChip, chip->concepts); 401 407 pmFPA *fpa = chip->parent; // FPA to which the chip belongs 402 bool success = conceptsWrite(&conceptsChip, fpa, chip, NULL, source, db, chip->concepts);408 bool success = conceptsWrite(&conceptsChip, fpa, chip, NULL, source, config, chip->concepts); 403 409 if (propagateUp && !fpa->hdu) { 404 success &= conceptsWrite(&conceptsFPA, fpa, chip, NULL, source, db, fpa->concepts);410 success &= conceptsWrite(&conceptsFPA, fpa, chip, NULL, source, config, fpa->concepts); 405 411 } 406 412 if (propagateDown) { … … 409 415 pmCell *cell = cells->data[i]; // Cell of interest 410 416 if (cell && !cell->hdu) { 411 success &= pmConceptsWriteCell(cell, source, false, db);417 success &= pmConceptsWriteCell(cell, source, false, config); 412 418 } 413 419 } … … 423 429 } 424 430 425 bool pmConceptsReadCell(pmCell *cell, pmConceptSource source, bool propagateUp, p sDB *db)431 bool pmConceptsReadCell(pmCell *cell, pmConceptSource source, bool propagateUp, pmConfig *config) 426 432 { 427 433 PS_ASSERT_PTR_NON_NULL(cell, false); … … 430 436 pmFPA *fpa = chip->parent; // FPA to which the chip belongs 431 437 432 bool success = conceptsRead(&conceptsCell, fpa, chip, cell, &cell->conceptsRead, source, db,438 bool success = conceptsRead(&conceptsCell, fpa, chip, cell, &cell->conceptsRead, source, config, 433 439 cell->concepts); 434 440 if (propagateUp) { 435 success &= conceptsRead(&conceptsChip, fpa, chip, cell, &chip->conceptsRead, source, db,441 success &= conceptsRead(&conceptsChip, fpa, chip, cell, &chip->conceptsRead, source, config, 436 442 chip->concepts); 437 success &= conceptsRead(&conceptsFPA, fpa, chip, cell, &fpa->conceptsRead, source, db,443 success &= conceptsRead(&conceptsFPA, fpa, chip, cell, &fpa->conceptsRead, source, config, 438 444 fpa->concepts); 439 445 } … … 442 448 } 443 449 444 bool pmConceptsWriteCell(const pmCell *cell, pmConceptSource source, bool propagateUp, p sDB *db)450 bool pmConceptsWriteCell(const pmCell *cell, pmConceptSource source, bool propagateUp, pmConfig *config) 445 451 { 446 452 PS_ASSERT_PTR_NON_NULL(cell, false); … … 449 455 pmFPA *fpa = chip->parent; // FPA to which the chip belongs 450 456 451 bool success = conceptsWrite(&conceptsCell, fpa, chip, cell, source, db, cell->concepts);457 bool success = conceptsWrite(&conceptsCell, fpa, chip, cell, source, config, cell->concepts); 452 458 if (propagateUp) { 453 459 if (!chip->hdu) { 454 success &= conceptsWrite(&conceptsChip, fpa, chip, cell, source, db, chip->concepts);460 success &= conceptsWrite(&conceptsChip, fpa, chip, cell, source, config, chip->concepts); 455 461 if (!fpa->hdu) { 456 success &= conceptsWrite(&conceptsFPA, fpa, chip, cell, source, db, fpa->concepts);462 success &= conceptsWrite(&conceptsFPA, fpa, chip, cell, source, config, fpa->concepts); 457 463 } 458 464 }
Note:
See TracChangeset
for help on using the changeset viewer.
