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;
+ qDebug() << attrs.localName( i );
+ if (attrs.localName(i) == "units") {
+ if ( attrs.value(i) == "siUnits:s" )
+ {
+ d->currentUnit = ChemicalDataObject::s;
+ }
+ else if ( attrs.value(i) == "siUnits:y" )
+ {
+ d->currentUnit = ChemicalDataObject::y;
+ } else {
+ d->currentUnit = ChemicalDataObject::noUnit;
+ }
}
}
+ d->currentDataObject.setUnit( d->currentUnit );
d->inHalfLife = true;
}
else if (attrs.value(i) == "bo:alphaDecay")
#include "isotopeparser.h"
#include "isotope.h"
-#include <kdebug.h>
+#include <QDebug>
#include <iostream>
int main(int argc, char *argv[])
QList<Isotope*> v = parser->getIsotopes();
- kDebug() << "Found " << v.count() << " isotopes.";;
+ qDebug() << "Found " << v.count() << " isotopes.";;
- kDebug() << "As a test I am now issuing all isotopes with 50 nuclueons: ";
+ qDebug() << "As a test I am now issuing all isotopes with 50 nuclueons: ";
foreach( Isotope* i, v ){
if ( i )
{
- if (i->nucleons() == 50 )
- kDebug() << " Isotope of " << i->parentElementSymbol() << " with a mass of " << i->mass();
+ if (i->nucleons() == 50 ){
+ qDebug() << " Isotope of " << i->parentElementSymbol() << " with a mass of " << i->mass();
+ qDebug() << " Halflife: " << i->halflife() << i->halflifeObject().unitAsString( );
+ }
}
}