From 985441ea935d6aa202c8dba52b118b8cb2ad3da3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rg=20Buchwald?= Date: Sat, 16 Jul 2005 14:30:21 +0000 Subject: [PATCH] i've add the spin and the moment to the isotope-tag svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=435310 --- kalzium/src/element.cpp | 20 ++++++++----- kalzium/src/element.h | 63 +++++++++++++++++++++++++++++++---------- 2 files changed, 61 insertions(+), 22 deletions(-) diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index 321c56f..ac8061b 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -603,12 +603,15 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) QString format = iso.attributeNode( "halflifeformat" ).value(); int neutrons = iso.attributeNode( "neutron" ).value().toInt(); double percentage = iso.attributeNode( "percentage" ).value().toDouble(); - double alphadecay = iso.attributeNode( "alphadecay" ).value().toDouble(); - double betaplusdecay = iso.attributeNode( "betaplusdecay" ).value().toDouble(); - double betaminusdecay = iso.attributeNode( "betaminusdecay" ).value().toDouble(); - double ecdecay = iso.attributeNode( "ecdecay" ).value().toDouble(); - - Isotope *isotope = new Isotope( neutrons, percentage, weight, halflife, format, alphadecay, betaplusdecay, betaminusdecay, ecdecay ); + QString alphadecay = iso.attributeNode( "alphadecay" ).value(); + QString betaplusdecay = iso.attributeNode( "betaplusdecay" ).value(); + QString betaminusdecay = iso.attributeNode( "betaminusdecay" ).value(); + QString ecdecay = iso.attributeNode( "ecdecay" ).value(); + double decayenergy = iso.attributeNode( "decayenergy" ).value().toDouble(); + QString spin = iso.attributeNode( "spin" ).value(); + double moment = iso.attributeNode( "moment" ).value().toDouble(); + + Isotope *isotope = new Isotope( neutrons, percentage, weight, halflife, format, alphadecay, betaplusdecay, betaminusdecay, ecdecay, decayenergy, spin, moment ); isolist.append( isotope ); } @@ -672,7 +675,7 @@ const int KalziumDataObject::numberOfElements() const return m_numOfElements; } -Isotope::Isotope( int neutrons, double percentage, double weight, double halflife, QString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay ) +Isotope::Isotope( int neutrons, double percentage, double weight, double halflife, QString format, QString alphadecay, QString betaplusdecay, QString betaminusdecay, QString ecdecay, double decayenergy, QString spin, double moment ) { m_neutrons = neutrons; m_percentage = percentage; @@ -683,6 +686,9 @@ Isotope::Isotope( int neutrons, double percentage, double weight, double halfli m_betaplusdecay = betaplusdecay; m_betaminusdecay = betaminusdecay; m_ecdecay = ecdecay; + m_decayenergy = decayenergy; + m_spin = spin; + m_moment = moment; } QString Isotope::halflifeToHtml() const diff --git a/kalzium/src/element.h b/kalzium/src/element.h index 2b8edb2..fdd6b4e 100644 --- a/kalzium/src/element.h +++ b/kalzium/src/element.h @@ -39,7 +39,7 @@ typedef QValueList doubleList; class Isotope { public: - Isotope( int neutrons, double percentage, double weight, double halflife, QString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay); + Isotope( int neutrons, double percentage, double weight, double halflife, QString format, QString alphadecay, QString betaplusdecay, QString betaminusdecay, QString ecdecay, double decayenergy, QString spin, double moment); bool seconds() const{ if ( m_format == "seconds" ) @@ -64,20 +64,42 @@ class Isotope return m_weight; } - double alphadecay() const{ - return m_alphadecay; + bool alphadecay() const{ + if ( m_alphadecay == "true" ) + return true; + else + return false; } - double betaplusdecay() const{ - return m_betaplusdecay; + bool betaplusdecay() const{ + if ( m_betaplusdecay == "true" ) + return true; + else + return false; + } + + bool betaminusdecay() const{ + if ( m_betaminusdecay == "true" ) + return true; + else + return false; } - double betaminusdecay() const{ - return m_betaminusdecay; + bool ecdecay() const{ + if ( m_ecdecay == "true" ) + return true; + else + return false; } - double ecdecay() const{ - return m_ecdecay; + double decayenergy() const{ + return m_decayenergy; + } + QString spin() const{ + return m_spin; + } + double moment() const{ + return m_moment; } QString halflifeToHtml() const; @@ -113,13 +135,24 @@ class Isotope int m_neutrons; /** - * Thees variables specify the kind of decay - * their values specify the decay-energy + * Theese variables specify the kind of decay + * and the decay-energy + */ + QString m_alphadecay; + QString m_betaplusdecay; + QString m_betaminusdecay; + QString m_ecdecay; + double m_decayenergy; + + /** + *spin and parity + */ + QString m_spin; + + /** + * magnetic moment */ - double m_alphadecay; - double m_betaplusdecay; - double m_betaminusdecay; - double m_ecdecay; + double m_moment; }; /** -- 2.47.3