Bug correction :

when defining rule<minSpacing, nWell, active>
        and then      rule<minSpacing, nWell>
        in technology file
        
        the first rule was ever return even if techno.getRule(minSpacing, nWell) was called.
This commit is contained in:
Damien Dupuis 2010-07-12 13:24:33 +00:00
parent 09cd76f80f
commit 8107ef6433
1 changed files with 19 additions and 17 deletions

View File

@ -47,27 +47,29 @@ ARule* Techno::addARule (Name name, double value, Name ref, Name layer1, Name la
}
Rule* Techno::getRule(Name name, Name layer1, Name layer2) {
bool testL1 = (layer1 == Name("")) ? false : true;
bool testL2 = (layer2 == Name("")) ? false : true;
//bool testL1 = (layer1 == Name("")) ? false : true;
//bool testL2 = (layer2 == Name("")) ? false : true;
for (size_t i = 0 ; i < _rules.size() ; i++) {
Rule* rule = _rules[i];
if (rule->getName() == name) {
if (testL1) {
if (rule->getLayer1() == layer1) {
if (testL2) {
if (rule->getLayer2() == layer2) {
// if (rule->getName() == name) {
// if (testL1) {
// if (rule->getLayer1() == layer1) {
// if (testL2) {
// if (rule->getLayer2() == layer2) {
// return rule;
// }
// } else {
// return rule;
// }
// }
// } else {
// return rule;
// }
// }
if ((rule->getName() == name) && (rule->getLayer1() == layer1) && (rule-getLayer2() == layer2))
return rule;
}
} else {
return rule;
}
}
} else {
return rule;
}
}
}
string error ("[ERROR] Could not find rule: ");
error += name.getString();
error += ".";