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 );
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
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
*/
ChemicalDataObject* m_halflife;
int m_nucleons;
+
+ ChemicalDataObject* m_ecdecay;
+ ChemicalDataObject* m_betaplus;
+ ChemicalDataObject* m_betaminus;
+ ChemicalDataObject* m_alpha;
};
#endif // ISOTOPE_H
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")