From: Jörg Buchwald Date: Sun, 6 Nov 2005 10:52:54 +0000 (+0000) Subject: new isotope properties X-Git-Tag: v3.80.2~225 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=2187e708a28f80f2a7615b9667e057d13091d779;p=libqmvoc.git new isotope properties svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=478255 --- diff --git a/libscience/chemicaldataobject.h b/libscience/chemicaldataobject.h index 7bebebd..8dcb7a0 100644 --- a/libscience/chemicaldataobject.h +++ b/libscience/chemicaldataobject.h @@ -62,7 +62,15 @@ class ChemicalDataObject period/**< the period of the element */, date/**< date of discovery of the element. When 0, the element has been known in ancient times. */, discoverers/** The name of the discoverers, separated by semicolomns */, - relativeAbundance/** The abundance, relative to 100 */ + relativeAbundance/** The abundance, relative to 100 */, + alphapercentage/**< The percentage of alphadecay */, + alphadecay/**< The decayenergy of alphadecay in MeV */, + betapluspercentage/**< The percentage of betaplusdecay */, + betaplusdecay/**< The decayenergy of betaplusdecay in MeV */, + betaminuspercentage/**< The percentage of betaminusdecay */, + betaminusdecay/**< The decayenergy of betaminusdecay in MeV */, + ecpercentage/**< The percentage of ecdecay */, + ecdecay/**< The decayenergy of ecminusdecay in MeV */, }; /** @@ -75,6 +83,8 @@ class ChemicalDataObject ev/**< electron volt */, nm/**< nanometer */, pm/**< picometer */, + y/**< years */, + s/**< seconds */, noUnit/**< no unit */ }; @@ -205,6 +215,8 @@ class ChemicalDataObject * - bo:ev * - bo:nm * - bo:pm + * - bo:y + * - bo:s * - bo:noUnit * * @return the BlueObeliskUnit of a ChemicalDataObject diff --git a/libscience/data/isotopes.xml b/libscience/data/isotopes.xml index 9517882..59703fd 100644 --- a/libscience/data/isotopes.xml +++ b/libscience/data/isotopes.xml @@ -32,7 +32,8 @@ - + 1.007825032 @@ -45,8 +46,19 @@ 1 - 3.016049278 - 1 + + + + + 100.0 + 0.01861 + + + 1/2+ + +2.978960 + 12.3 + 3.016049278 + 1 4.02781 diff --git a/libscience/isotopeparser.cpp b/libscience/isotopeparser.cpp index 5345bea..743be11 100644 --- a/libscience/isotopeparser.cpp +++ b/libscience/isotopeparser.cpp @@ -24,6 +24,14 @@ IsotopeParser::IsotopeParser() : QXmlDefaultHandler(), currentIsotope_(0), inAtomicNumber_(false), + inAlphaPercentage_(false), + inAlphaDecay_(false), + inBetaplusPercentage_(false), + inBetaplusDecay_(false), + inBetaminusPercentage_(false), + inBetaminusDecay_(false), + inECPercentage_(false), + inECDecay_(false), inExactMass_(false), inAbundance_(false) { @@ -55,6 +63,22 @@ bool IsotopeParser::startElement(const QString&, const QString &localName, const if (attrs.value(i) == "bo:atomicNumber") inAtomicNumber_ = true; + else if (attrs.value(i) == "bo:alphapercentage") + inAlphaPercentage_ = true; + else if (attrs.value(i) == "bo:alphadecay") + inAlphaDecay_ = true; + else if (attrs.value(i) == "bo:betapluspercentage") + inBetaplusPercentage_ = true; + else if (attrs.value(i) == "bo:betaplusdecay") + inBetaplusDecay_ = true; + else if (attrs.value(i) == "bo:betaminuspercentage") + inBetaminusPercentage_ = true; + else if (attrs.value(i) == "bo:betaminusdecay") + inBetaminusDecay_ = true; + else if (attrs.value(i) == "bo:ecpercentage") + inECPercentage_ = true; + else if (attrs.value(i) == "bo:ecdecay") + inECDecay_ = true; else if (attrs.value(i) == "bo:exactMass") inExactMass_ = true; } @@ -102,6 +126,46 @@ bool IsotopeParser::characters(const QString &ch) type = ChemicalDataObject::atomicNumber; inAtomicNumber_ = false; } + else if (inAlphaPercentage_) { + value = ch.toDouble(); + type = ChemicalDataObject::alphapercentage; + inAtomicNumber_ = false; + } + else if (inAlphaDecay_) { + value = ch.toDouble(); + type = ChemicalDataObject::alphadecay; + inAtomicNumber_ = false; + } + else if (inBetaplusPercentage_) { + value = ch.toDouble(); + type = ChemicalDataObject::betapluspercentage; + inAtomicNumber_ = false; + } + else if (inBetaplusDecay_) { + value = ch.toDouble(); + type = ChemicalDataObject::betaplusdecay; + inAtomicNumber_ = false; + } + else if (inBetaminusPercentage_) { + value = ch.toDouble(); + type = ChemicalDataObject::betaminuspercentage; + inAtomicNumber_ = false; + } + else if (inBetaminusDecay_) { + value = ch.toDouble(); + type = ChemicalDataObject::betaminusdecay; + inAtomicNumber_ = false; + } + else if (inECPercentage_) { + value = ch.toDouble(); + type = ChemicalDataObject::ecpercentage; + inAtomicNumber_ = false; + } + else if (inECDecay_) { + value = ch.toDouble(); + type = ChemicalDataObject::ecdecay; + inAtomicNumber_ = false; + } else if ( inAbundance_ ){ value = ch; type = ChemicalDataObject::relativeAbundance; diff --git a/libscience/isotopeparser.h b/libscience/isotopeparser.h index d8301d1..e11e206 100644 --- a/libscience/isotopeparser.h +++ b/libscience/isotopeparser.h @@ -52,7 +52,14 @@ class IsotopeParser : public QXmlDefaultHandler bool inIsotope_; bool inAtomicNumber_, inExactMass_; - + bool inAlphaPercentage_; + bool inAlphaDecay_; + bool inBetaplusPercentage_; + bool inBetaplusDecay_; + bool inBetaminusPercentage_; + bool inBetaminusDecay_; + bool inECPercentage_; + bool inECDecay_; bool inAbundance_; }; #endif // ISOTOPEPARSER_H