Changeset 10468
- Timestamp:
- Dec 4, 2006, 5:42:11 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfig.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfig.c
r10460 r10468 4 4 * @author EAM (IfA) 5 5 * 6 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-12-05 0 2:31:24$6 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-12-05 03:42:11 $ 8 8 * 9 9 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 476 476 psMetadata *rule = psMetadataLookupMetadata(&mdStatus, cameraFormat, "RULE"); 477 477 if (! mdStatus || ! rule) { 478 psError(PS_ERR_UNKNOWN, true, "Unable to read rule for camera.\n");478 psError(PS_ERR_UNKNOWN, false, "Unable to read rule for camera."); 479 479 return false; 480 480 } … … 487 487 psMetadataItem *headerItem = psMetadataLookup(header, ruleItem->name); 488 488 if (! headerItem) { 489 // It doesn't have a required header keyword, so it's not it 489 // doesn't match, but not an error 490 psTrace("psModules.config", 5, "Can't find %s", ruleItem->name); 490 491 psFree(ruleIter); 491 psError(PS_ERR_UNKNOWN, true, "Can't find %s\n", ruleItem->name);492 492 return false; 493 493 } … … 495 495 // Check to see if the rule works 496 496 if (! psMetadataItemCompare(headerItem, ruleItem)) { 497 ps Error(PS_ERR_UNKNOWN, true, "%s doesn't match.\n", ruleItem->name);497 psTrace("psModules.config", 5, "%s doesn't match.", ruleItem->name); 498 498 psFree(ruleIter); 499 499 return false; … … 504 504 return true; 505 505 } 506 507 506 508 507 // Given a camera and a header, see if any of the camera formats match the header … … 524 523 psMetadata *formats = psMetadataLookupMetadata(&mdok, camera, "FORMATS"); // List of formats 525 524 if (!mdok || !formats) { 526 psLogMsg("psModules.config", PS_LOG_WARN, "Unable to find list of FORMATS in camera %s --- ignored\n", 527 cameraName); 525 psError(PS_ERR_UNKNOWN, false, "Unable to find list of FORMATS in camera %s", cameraName); 528 526 return false; 529 527 } … … 533 531 while ((formatsItem = psMetadataGetAndIncrement(formatsIter))) { 534 532 if (formatsItem->type != PS_DATA_STRING) { 535 psLogMsg("psModules.config", PS_LOG_WARN, "In camera %s, camera format %s is not of type STR --- " 536 "ignored.\n", cameraName, formatsItem->name); 537 continue; 533 psError(PS_ERR_UNKNOWN, false, "In camera %s, camera format %s is not of type STR", cameraName, formatsItem->name); 534 return false; 538 535 } 539 536 psTrace("psModules.config", 5, "Reading camera format for %s...\n", formatsItem->name); 540 537 psMetadata *testFormat = NULL; // Format to test against what we've got 541 538 if (!pmConfigFileRead(&testFormat, formatsItem->data.V, formatsItem->name)) { 542 psLogMsg("psModules.config", PS_LOG_WARN, "Trouble reading reading camera format %s --- ignored.\n", 543 formatsItem->name); 539 psError(PS_ERR_UNKNOWN, false, "Trouble reading reading camera format %s", formatsItem->name); 544 540 psFree(testFormat); 545 continue;541 return false; 546 542 } 547 543 … … 557 553 } 558 554 } else { 559 if (psTraceGetLevel ("psModules.config") >= PS_LOG_INFO) { 560 psErrorStackPrint (stderr, "Camera %s, format %s does not match\n", cameraName, formatsItem->name); 555 psErr *error = psErrorLast(); 556 if (error->code != PS_ERR_NONE) { 557 psError (PS_ERR_UNKNOWN, false, "Error in config scripts for camera %s, format %s\n", cameraName, formatsItem->name); 558 return false; 561 559 } 562 560 } … … 611 609 config->camera = psMemIncrRefCounter(testCamera); 612 610 config->cameraName = psStringCopy(camerasItem->name); 611 } else { 612 psErr *error = psErrorLast(); 613 if (error->code != PS_ERR_NONE) { 614 psError(PS_ERR_IO, false, "Error reading camera config data for %s", camerasItem->name); 615 return NULL; 616 } 613 617 } 614 618 psFree(testCamera); … … 623 627 // Now we have the camera, we can read the recipes 624 628 pmConfigReadRecipes(config, PM_RECIPE_SOURCE_CAMERA | PM_RECIPE_SOURCE_CL); 625 626 629 return format; 627 630 }
Note:
See TracChangeset
for help on using the changeset viewer.
