From 86d4f08fe0fa289845155e36d991a2d969fd3922 Mon Sep 17 00:00:00 2001 From: Martin Pfeiffer Date: Tue, 12 Jul 2005 13:25:20 +0000 Subject: [PATCH] =?utf8?q?patch=20of=20J=C3=B6rg=20Buchwald?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=433983 --- kalzium/src/element.cpp | 12 ++++++++++-- kalzium/src/element.h | 37 +++++++++++++++++++++++++++++-------- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index 9bb3427..d9b81c8 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -626,8 +626,12 @@ 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 ); + Isotope *isotope = new Isotope( neutrons, percentage, weight, halflife, format, alphadecay, betaplusdecay, betaminusdecay, ecdecay ); isolist.append( isotope ); } @@ -681,13 +685,17 @@ const int KalziumDataObject::numberOfElements() const return m_numOfElements; } -Isotope::Isotope( int neutrons, double percentage, double weight, double halflife, QString format ) +Isotope::Isotope( int neutrons, double percentage, double weight, double halflife, QString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay ) { m_neutrons = neutrons; m_percentage = percentage; m_halflife = halflife; m_format = format; m_weight = weight; + m_alphadecay = alphadecay; + m_betaplusdecay = betaplusdecay; + m_betaminusdecay = betaminusdecay; + m_ecdecay = ecdecay; } QString Isotope::halflifeToHtml() const diff --git a/kalzium/src/element.h b/kalzium/src/element.h index d27960c..7b5a69c 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 ); + Isotope( int neutrons, double percentage, double weight, double halflife, QString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay); bool seconds() const{ if ( m_format == "seconds" ) @@ -63,6 +63,22 @@ class Isotope double weight() const{ return m_weight; } + + double alphadecay() const{ + return m_alphadecay; + } + + double betaplusdecay() const{ + return m_betaplusdecay; + } + + double betaminusdecay() const{ + return m_betaminusdecay; + } + + double ecdecay() const{ + return m_ecdecay; + } QString halflifeToHtml() const; @@ -95,6 +111,15 @@ class Isotope * the number of neutrons */ int m_neutrons; + + /** + * Thees variables specify the kind of decay + * their values specify the decay-energy + */ + double m_alphadecay; + double m_betaplusdecay; + double m_betaminusdecay; + double m_ecdecay; }; /** @@ -212,9 +237,9 @@ class Element{ m_ionenergies = l; } - QValueList isotopeList()const{ - return m_isotopeList; - } + QValueList isotopes() const{ + return m_isotopeList; + } void setIsotopeList( QValueList list ){ m_isotopeList = list; @@ -448,10 +473,6 @@ class Element{ return m_Color; } - QValueList isotopes() const{ - return m_isotopeList; - } - void setupXY(); private: -- 2.47.3