]> Git trees. - libqmvoc.git/commitdiff
re-added halflife
authorJörg Buchwald <buchwaldj@web.de>
Fri, 1 Sep 2006 13:18:51 +0000 (13:18 +0000)
committerJörg Buchwald <buchwaldj@web.de>
Fri, 1 Sep 2006 13:18:51 +0000 (13:18 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=579708

libscience/data/isotopes.xml
libscience/isotopeparser.cpp

index f7d92222076cca09c6c72f4babbcc421e908da03..be61bfad006d898026a08dc08fdaa90c0400585d 100644 (file)
@@ -31,7 +31,7 @@
 </isotopeList>
 <isotopeList id="H">
        <isotope id="H1" number="1" elementType="H">
-               <abundance dictRef="bo:relativeAbundance">99.9885</abundance>
+               <scalar dictRef="bo:relativeAbundance">99.9885</scalar>
                <scalar dictRef="bo:exactMass" errorValue="0.0001E-6">1.007825032</scalar>
                <scalar dictRef="bo:spin">1/2+</scalar>
                <scalar dictRef="bo:magneticMoment">+2.792846</scalar>
index fac2e5e27947f1bd009b7ea488ba5b6e7c40e1b6..f830557661a64b659c44606317659d9f13acd0d9 100644 (file)
@@ -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;
        }