]> Git trees. - libqmvoc.git/commitdiff
improve the isotope-api a bit, but a big FIXME
authorCarsten Niehaus <cniehaus@gmx.de>
Mon, 20 Feb 2006 14:35:33 +0000 (14:35 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Mon, 20 Feb 2006 14:35:33 +0000 (14:35 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=511624

libscience/isotope.cpp
libscience/isotope.h

index 2e28e4ebc2be408d4251aacb4aa4f533d6a68618..607e24724ef72d2cb5b017e37daca3f63bd0d2e2 100644 (file)
@@ -30,7 +30,8 @@ Isotope::Isotope()
 
 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_spin( 0 ), m_magmoment( 0 ), m_halflife( 0 ), m_ecday( 0 ), m_betaminus( 0 ),
+       m_betaplus( 0 ), m_alpha( 0 )
 {
        addData( mass );
        addData( ID );
@@ -58,6 +59,20 @@ void Isotope::addData( ChemicalDataObject* o )
                m_magmoment = o;
        else if ( o->type() == ChemicalDataObject::halfLife )
                m_halflife = o;
+       
+       //FIXME in the future there should be real CDOs. But CDO only supports one datavalue...
+       if ( o->type() == ChemicalDataObject::betaplusDecay || o->type() == ChemicalDataObject::betaminusDecay
+                       || o->type() == ChemicalDataObject::alphaDecay || o->type() == ChemicalDataObject::ecDecay )
+       {
+               if ( o->type() == ChemicalDataObject::betaplusDecay )
+                       m_betaplus = o;
+               if (  o->type() == ChemicalDataObject::betaminusDecay )
+                       m_betaminus = o;
+               if ( o->type() == ChemicalDataObject::alphaDecay )
+                       m_alpha = o;
+               if ( o->type() == ChemicalDataObject::ecDecay )
+                       m_ecday = o;
+       }
 }
 
 double Isotope::mass() const
index 6c16be0dd49e326c3ea24dcd488ac64ac387a87a..ca1860e99cbf55999a355a7bd0a4f5226c12a6a0 100644 (file)
@@ -55,8 +55,20 @@ class Isotope
                void addData( ChemicalDataObject* o );
 
                void setNucleons( int number );
+               
+               /**
+                * @return the sum of protons and neutrons
+                */
                int nucleons() const;
 
+               //FIXME
+               //need to be made private. But that comes later
+
+               ChemicalDataObject* m_ecday;
+               ChemicalDataObject* m_betaplus;
+               ChemicalDataObject* m_betaminus; 
+               ChemicalDataObject* m_alpha;
+               
        private:
                /**
                 * the symbol of the element the isotope belongs to