#include "chemicaldataobject.h"
#include <kdebug.h>
-#include <klocale.h>
Isotope::Isotope()
- : m_mass( 0 ), m_identifier( 0 )
-{
-}
-
-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_betaplus( 0 ), m_betaminus( 0 ), m_alpha( 0 )
-{
- addData( mass );
- addData( ID );
+{
}
-Isotope::~Isotope(){}
-
+Isotope::~Isotope()
+{
+}
ChemicalDataObject* Isotope::data() const
{
{
//X kDebug() << "setting inIsotope true!" << endl;
d->currentIsotope = new Isotope();
+ d->currentIsotope->addData( new ChemicalDataObject( QVariant( d->currentElementSymbol ), ChemicalDataObject::symbol ) );
d->inIsotope = true;
for (int i = 0; i < attrs.length(); ++i)
{
} else if (d->inIsotope && localName == "halflife") {
//X kDebug() << "bo:halfLife" << endl;
d->inHalfLife = true;
- if ( d->currentUnit != ChemicalDataObject::noUnit )
- d->currentDataObject->setUnit( d->currentUnit );
+//X if ( d->currentUnit != ChemicalDataObject::noUnit )
+//X d->currentDataObject->setUnit( d->currentUnit );
- d->currentUnit = ChemicalDataObject::noUnit;
+//X d->currentUnit = ChemicalDataObject::noUnit;
} else if (d->inIsotope && localName == "alphadecay"){
//X kDebug() << "bo:alphaDecay" << endl;
d->inAlphaDecay = true;
{
if ( localName == "isotope" )
{
- d->currentIsotope->addData( new ChemicalDataObject( QVariant( d->currentElementSymbol ), ChemicalDataObject::symbol ) );
d->isotopes.append(d->currentIsotope);
- d->currentIsotope = 0;
d->currentDataObject = 0;
+ d->currentIsotope = 0;
d->inIsotope = false;
}
- else if ( localName == "scalar" )
- {
- if ( d->currentDataObject->type() == ChemicalDataObject::exactMass ){
- d->currentDataObject->setErrorValue( d->currentErrorValue );
- }
- }
else if ( localName == "isotopeList" )
{//a new list of isotopes start...
//X kDebug() << "setting d->inElement FALSE" << endl;
else//it is a non known value. Do not create a wrong object but return
return true;
+ if ( type == ChemicalDataObject::exactMass )
+ {
+ d->currentDataObject->setErrorValue( d->currentErrorValue );
+ }
+
d->currentDataObject->setData( value );
d->currentDataObject->setType( type );
if ( d->currentIsotope )
+ {
d->currentIsotope->addData( d->currentDataObject );
+ d->currentDataObject = 0;
+ }
return true;
}