From 97094d81d71f315c1a4c16f487849975fa988ed8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rg=20Buchwald?= Date: Fri, 1 Sep 2006 13:18:51 +0000 Subject: [PATCH] re-added halflife svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=579708 --- libscience/data/isotopes.xml | 2 +- libscience/isotopeparser.cpp | 43 ++++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/libscience/data/isotopes.xml b/libscience/data/isotopes.xml index f7d9222..be61bfa 100644 --- a/libscience/data/isotopes.xml +++ b/libscience/data/isotopes.xml @@ -31,7 +31,7 @@ - 99.9885 + 99.9885 1.007825032 1/2+ +2.792846 diff --git a/libscience/isotopeparser.cpp b/libscience/isotopeparser.cpp index fac2e5e..f830557 100644 --- a/libscience/isotopeparser.cpp +++ b/libscience/isotopeparser.cpp @@ -116,20 +116,20 @@ bool IsotopeParser::startElement(const QString&, const QString &localName, const } else if (d->inIsotope && localName == "magmoment") { //X kDebug() << "bo:magneticMoment" << endl; d->inMagMoment = true; - } else if (d->inIsotope && localName == "halflife") { +// }else if (d->inIsotope && localName == "halflife") { //X kDebug() << "bo:halfLife" << endl; - for (int i = 0; i < attrs.length(); ++i) - { - if ( attrs.localName( i ) == "unit" ) - { - d->currentDataObject->setUnit( d->currentUnit ); - } - else - { - d->currentUnit = ChemicalDataObject::noUnit; - } - } - d->inHalfLife = true; +// for (int i = 0; i < attrs.length(); ++i) +// { +// if ( attrs.localName( i ) == "unit" ) +// { +// d->currentDataObject->setUnit( d->currentUnit ); +// } +// else +// { +// d->currentUnit = ChemicalDataObject::noUnit; +// } +// } +// d->inHalfLife = true; //X if ( d->currentUnit != ChemicalDataObject::noUnit ) //X d->currentDataObject->setUnit( d->currentUnit ); @@ -160,8 +160,23 @@ bool IsotopeParser::startElement(const QString&, const QString &localName, const d->inAtomicNumber = true; else if (attrs.value(i) == "bo:exactMass") d->inExactMass = true; + else if (attrs.value(i) == "bo:halfLife"){ + for (int i = 0; i < attrs.length(); ++i) + { + if ( attrs.localName( i ) == "unit" ) + { + d->currentDataObject->setUnit( d->currentUnit ); + } + else + { + d->currentUnit = ChemicalDataObject::noUnit; + } + } + d->inHalfLife = true; + } } - } else if (d->inIsotope && localName == "bo:relativeAbundance") { + } + else if (d->inIsotope && localName == "bo:relativeAbundance") { //X kDebug() << "bo:relativeAbundance" << endl; d->inAbundance = true; } -- 2.47.3