Fixed bug in the filtering of the monomer mass differences.
Filippo Rusconi (Debian Maintainer)
14 years ago
1634 | 1634 | QStringList * |
1635 | 1635 | PolChemDef::differenceBetweenMonomers(double threshold, int monoOrAvg) |
1636 | 1636 | { |
1637 | // qDebug() << __FILE__ << __LINE__ | |
1638 | // << "threshold" << threshold; | |
1639 | ||
1637 | 1640 | QStringList *list = new QStringList(); ; |
1638 | 1641 | |
1639 | 1642 | // We iterate in the list of monomers and compute a difference of |
1686 | 1689 | // At this point, make sure that diff is within the |
1687 | 1690 | // threshold. Note that to avoid duplicates, we remove all |
1688 | 1691 | // values that are negative. |
1689 | ||
1690 | if (abs(diff) <= threshold) | |
1692 | ||
1693 | if (diff >= 0 && diff <= threshold) | |
1691 | 1694 | { |
1692 | if (diff < 0) | |
1693 | { | |
1694 | // QString line = QString("---%1 - %2 = %3") | |
1695 | // .arg(monomer2->name()) | |
1696 | // .arg(monomer1->name()) | |
1697 | // .arg(diff); | |
1698 | ||
1699 | // list->append(line); | |
1700 | } | |
1701 | else | |
1702 | { | |
1703 | QString line = QString("%1 - %2 = %3") | |
1704 | .arg(monomer2->name()) | |
1705 | .arg(monomer1->name()) | |
1706 | .arg(diff); | |
1707 | ||
1708 | list->append(line); | |
1709 | } | |
1695 | QString line = QString("%1 - %2 = %3") | |
1696 | .arg(monomer2->name()) | |
1697 | .arg(monomer1->name()) | |
1698 | .arg(diff); | |
1699 | ||
1700 | list->append(line); | |
1710 | 1701 | } |
1711 | 1702 | } |
1712 | 1703 | // End of |