From c1af4684814dc7bd77a3c30e0c4a853438ff35a6 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 20 Feb 2006 16:54:54 +0000 Subject: [PATCH] some fixes svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=511674 --- libscience/isotope.cpp | 24 ++++++++++-------------- libscience/isotope.h | 10 +++++----- libscience/isotopeparser.cpp | 14 +++++++------- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/libscience/isotope.cpp b/libscience/isotope.cpp index 7260899..883dc8b 100644 --- a/libscience/isotope.cpp +++ b/libscience/isotope.cpp @@ -30,8 +30,8 @@ Isotope::Isotope() Isotope::Isotope( ChemicalDataObject* mass, ChemicalDataObject* ID ) : m_parentElementSymbol( 0 ), m_mass( 0 ), m_identifier( 0 ), - m_spin( 0 ), m_magmoment( 0 ), m_halflife( 0 ), m_ecdecay( 0 ), m_betaminus( 0 ), - m_betaplus( 0 ), m_alpha( 0 ) + m_spin( 0 ), m_magmoment( 0 ), m_halflife( 0 ), m_ecdecay( 0 ), + m_betaplus( 0 ), m_betaminus( 0 ), m_alpha( 0 ) { addData( mass ); addData( ID ); @@ -61,18 +61,14 @@ void Isotope::addData( ChemicalDataObject* o ) m_halflife = o; //FIXME in the future there should be real CDOs. But CDO only supports one datavalue... - if ( o->type() == ChemicalDataObject::betaplusDecay || o->type() == ChemicalDataObject::betaminusDecay - || o->type() == ChemicalDataObject::alphaDecay || o->type() == ChemicalDataObject::ecDecay ) - { - if ( o->type() == ChemicalDataObject::betaplusDecay ) - m_betaplus = o; - if ( o->type() == ChemicalDataObject::betaminusDecay ) - m_betaminus = o; - if ( o->type() == ChemicalDataObject::alphaDecay ) - m_alpha = o; - if ( o->type() == ChemicalDataObject::ecDecay ) - m_ecdecay = o; - } + if ( o->type() == ChemicalDataObject::betaplusDecay ) + m_betaplus = o; + else if ( o->type() == ChemicalDataObject::betaminusDecay ) + m_betaminus = o; + else if ( o->type() == ChemicalDataObject::alphaDecay ) + m_alpha = o; + else if ( o->type() == ChemicalDataObject::ecDecay ) + m_ecdecay = o; } double Isotope::mass() const diff --git a/libscience/isotope.h b/libscience/isotope.h index 7720b79..603a7a8 100644 --- a/libscience/isotope.h +++ b/libscience/isotope.h @@ -92,11 +92,6 @@ class Isotope return m_alpha; } private: - ChemicalDataObject* m_ecdecay; - ChemicalDataObject* m_betaplus; - ChemicalDataObject* m_betaminus; - ChemicalDataObject* m_alpha; - /** * the symbol of the element the isotope belongs to */ @@ -128,6 +123,11 @@ class Isotope ChemicalDataObject* m_halflife; int m_nucleons; + + ChemicalDataObject* m_ecdecay; + ChemicalDataObject* m_betaplus; + ChemicalDataObject* m_betaminus; + ChemicalDataObject* m_alpha; }; #endif // ISOTOPE_H diff --git a/libscience/isotopeparser.cpp b/libscience/isotopeparser.cpp index c8b156e..565516d 100644 --- a/libscience/isotopeparser.cpp +++ b/libscience/isotopeparser.cpp @@ -107,29 +107,29 @@ bool IsotopeParser::startElement(const QString&, const QString &localName, const if ( attrs.localName( i ) == "number" ) d->currentIsotope->setNucleons( attrs.value( i ).toInt() ); } - } else if (d->inIsotope && localName == "bo:spin") { + } else if (d->inIsotope && localName == "spin") { //X kDebug() << "bo:spin" << endl; d->inSpin = true; - } else if (d->inIsotope && localName == "bo:magneticMoment") { + } else if (d->inIsotope && localName == "magmoment") { //X kDebug() << "bo:magneticMoment" << endl; d->inMagMoment = true; - } else if (d->inIsotope && localName == "bo:halfLife") { + } else if (d->inIsotope && localName == "halflife") { //X kDebug() << "bo:halfLife" << endl; d->inHalfLife = true; if ( d->currentUnit != ChemicalDataObject::noUnit ) d->currentDataObject->setUnit( d->currentUnit ); d->currentUnit = ChemicalDataObject::noUnit; - } else if (d->inIsotope && localName == "bo:alphaDecay"){ + } else if (d->inIsotope && localName == "alphadecay"){ //X kDebug() << "bo:alphaDecay" << endl; d->inAlphaDecay = true; - } else if (d->inIsotope && localName == "bo:betaplusDecay"){ + } else if (d->inIsotope && localName == "betaplusdecay"){ //X kDebug() << "bo:betaplusDecay" << endl; d->inBetaplusDecay = true; - } else if (d->inIsotope && localName == "bo:betaminusDecay"){ + } else if (d->inIsotope && localName == "betaminusdecay"){ //X kDebug() << "bo:betaminusDecay" << endl; d->inBetaminusDecay = true; - } else if (d->inIsotope && localName == "bo:ecDecay"){ + } else if (d->inIsotope && localName == "ecdecay"){ //X kDebug() << "bo:ecDecay" << endl; d->inECDecay = true; } else if (d->inIsotope && localName == "scalar") -- 2.47.3