QString spin = iso.attributeNode( "spin" ).value();
double magmoment = iso.attributeNode( "magmoment" ).value().toDouble();
- Isotope *isotope = new Isotope( neutrons, percentage, weight, halflife, format, alphadecay, betaplusdecay, betaminusdecay, ecdecay, decayenergy, spin, magmoment );
+ bool alphadecay_ = false, betaminusdecay_ = false, betaplusdecay_ = false, ecdecay_ = false;
+ if ( betaplusdecay == "true" ) betaplusdecay_ = true;
+ if ( betaminusdecay == "true" ) betaminusdecay_ = true;
+ if ( ecdecay == "true" ) ecdecay_ = true;
+ if ( alphadecay == "true" ) alphadecay_ = true;
+
+
+ Isotope *isotope = new Isotope( neutrons, percentage, weight, halflife, format, alphadecay_, betaplusdecay_, betaminusdecay_, ecdecay_, decayenergy, spin, magmoment );
isolist.append( isotope );
}
return m_numOfElements;
}
-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 magmoment )
+Isotope::Isotope( int neutrons, double percentage, double weight, double halflife, QString format, bool alphadecay, bool betaplusdecay, bool betaminusdecay, bool ecdecay, double decayenergy, QString spin, double magmoment )
{
m_neutrons = neutrons;
m_percentage = percentage;
class Isotope
{
public:
- Isotope( int neutrons, double percentage, double weight, double halflife, QString format, QString alphadecay, QString betaplusdecay, QString betaminusdecay, QString ecdecay, double decayenergy, QString spin, double magmoment);
+ Isotope( int neutrons, double percentage, double weight, double halflife, QString format, bool alphadecay, bool betaplusdecay, bool betaminusdecay, bool ecdecay, double decayenergy, QString spin, double magmoment);
bool seconds() const{
if ( m_format == "seconds" )
return false;
}
+ /**
+ * @return the halflife period of the isotope it if has one. The format
+ * is defined by seconds()
+ */
double halflife() const{
return m_halflife;
}
return m_percentage;
}
+ /**
+ * @return the number of neutrons the isotope has
+ */
int neutrons() const{
return m_neutrons;
}
}
bool alphadecay() const{
- if ( m_alphadecay == "true" )
- return true;
- else
- return false;
+ return m_alphadecay;
}
bool betaplusdecay() const{
- if ( m_betaplusdecay == "true" )
- return true;
- else
- return false;
+ return m_betaplusdecay;
}
bool betaminusdecay() const{
- if ( m_betaminusdecay == "true" )
- return true;
- else
- return false;
+ return m_betaminusdecay;
}
bool ecdecay() const{
- if ( m_ecdecay == "true" )
- return true;
- else
- return false;
+ return m_ecdecay;
}
double decayenergy() const{
*/
int m_neutrons;
- /**
- * Theese variables specify the kind of decay
- * and the decay-energy
- */
- QString m_alphadecay;
- QString m_betaplusdecay;
- QString m_betaminusdecay;
- QString m_ecdecay;
+ ///Specify if the decay is of this kind
+ bool m_alphadecay;
+ ///Specify if the decay is of this kind
+ bool m_betaplusdecay;
+ ///Specify if the decay is of this kind
+ bool m_betaminusdecay;
+ ///Specify if the decay is of this kind
+ bool m_ecdecay;
+
double m_decayenergy;
/**