Changeset 7200 for trunk/MagicSoft/Mars/mfbase
- Timestamp:
- 07/19/05 15:53:36 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mfbase/MF.cc
r6932 r7200 477 477 Int_t MF::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 478 478 { 479 Bool_t rc = MFilter::ReadEnv(env, prefix, print); 480 if (rc==kERROR) 481 return kERROR; 482 483 if (!IsEnvDefined(env, prefix, "Condition", print)) 484 { 485 if (rc) 479 480 /* 481 Bool_t rc = MFilter::ReadEnv(env, prefix, print); 482 if (rc==kERROR) 483 return kERROR; 484 */ 485 if (IsEnvDefined(env, prefix, "Condition", print)) 486 { 487 TString rule = GetEnvValue(env, prefix, "Condition", ""); 488 rule.ReplaceAll(" ", ""); 489 490 Int_t idx=0; 491 while (1) 492 { 493 TString cond; 494 if (IsEnvDefined(env, prefix, Form("%d", idx), print)) 495 { 496 cond += "("; 497 cond += GetEnvValue(env, prefix, Form("%d", idx), ""); 498 cond += ")"; 499 } 500 501 if (cond.IsNull()) 502 break; 503 504 rule.ReplaceAll(Form("{%d}", idx), cond); 505 idx++; 506 } 507 508 if (fF) 509 { 510 delete fF; 511 fF = 0; 512 } 513 514 if (rule.IsNull()) 515 { 516 *fLog << warn << GetDescriptor() << " ::ReadEnv - WARNING: Empty condition found." << endl; 517 SetAllowEmpty(); 518 return kTRUE; 519 } 520 521 SetAllowEmpty(kFALSE); 522 523 if (!(fF=ParseString(rule, 1))) 524 { 525 *fLog << err << "MF::ReadEnv - ERROR: Parsing '" << rule << "' failed." << endl; 526 return kERROR; 527 } 528 529 if (print) 530 { 531 *fLog << inf << "found: "; 532 fF->Print(); 533 *fLog << endl; 534 } 535 } 536 else 537 { 538 if (!fF) 486 539 { 487 540 *fLog << warn << GetDescriptor() << " ::ReadEnv - WARNING: No condition found." << endl; 488 541 SetAllowEmpty(); 489 } 490 return rc; 491 } 492 493 TString rule = GetEnvValue(env, prefix, "Condition", ""); 494 rule.ReplaceAll(" ", ""); 495 496 Int_t idx=0; 497 while (1) 498 { 499 TString cond; 500 if (IsEnvDefined(env, prefix, Form("%d", idx), print)) 501 { 502 cond += "("; 503 cond += GetEnvValue(env, prefix, Form("%d", idx), ""); 504 cond += ")"; 505 } 506 507 if (cond.IsNull()) 508 break; 509 510 rule.ReplaceAll(Form("{%d}", idx), cond); 511 idx++; 512 } 513 514 if (fF) 515 { 516 delete fF; 517 fF = 0; 518 } 519 520 if (rule.IsNull()) 521 { 522 *fLog << warn << GetDescriptor() << " ::ReadEnv - WARNING: Empty condition found." << endl; 523 SetAllowEmpty(); 524 return kTRUE; 525 } 526 527 SetAllowEmpty(kFALSE); 528 529 if (!(fF=ParseString(rule, 1))) 530 { 531 *fLog << err << "MF::ReadEnv - ERROR: Parsing '" << rule << "' failed." << endl; 532 return kERROR; 533 } 534 535 if (print) 536 { 537 *fLog << inf << "found: "; 538 fF->Print(); 539 *fLog << endl; 542 return kFALSE; 543 } 540 544 } 541 545 … … 546 550 // might check for "Inverted" in this case both gets inverted 547 551 // and double-inversion is no inversion 552 /* 548 553 if (IsEnvDefined(env, prefix, "Inverted", print)) 549 554 if (GetEnvValue(env, prefix, "Inverted", kFALSE)==kTRUE) 550 SetInverted(kFALSE); 555 SetInverted(kFALSE);*/ 551 556 552 557 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.