]> Git trees. - libqmvoc.git/commitdiff
i've add the spin and the moment to the isotope-tag
authorJörg Buchwald <buchwaldj@web.de>
Sat, 16 Jul 2005 14:30:21 +0000 (14:30 +0000)
committerJörg Buchwald <buchwaldj@web.de>
Sat, 16 Jul 2005 14:30:21 +0000 (14:30 +0000)
svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=435310

kalzium/src/element.cpp
kalzium/src/element.h

index 321c56faa616713fa65a7110f27907a91360a8d1..ac8061b98f0e87ca27dffa166253b93939010656 100644 (file)
@@ -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
index 2b8edb2fa60661b86792f30067c269c65596ed99..fdd6b4e83dd25914d9babc041421eadb960cdfd2 100644 (file)
@@ -39,7 +39,7 @@ typedef QValueList<double> 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;
 };
 
 /**