return m_weight/m_number;
}
-const QString Element::adjustUnits( const int type )
+const QString Element::adjustUnits( const int type, double value )
{
QString v = QString::null;
-
- double val = 0.0; //the value to convert
-
- if ( type == IE || type == IE2 ) //an ionization energy
+ if ( type == IE ) //an ionization energy
{
- if ( type == IE )
- val = ie();
- else
- val = ie2();
-
- if ( val == -1 )
- v = i18n( "Value unknown" );
- else
+ if ( Prefs::energies() == 0 )
{
- if ( Prefs::energies() == 0 )
- {
- val*=96.6;
- v = QString::number( val );
- v.append( "kJ/mol" );
- }
- else // use electronvolt
- {
- v = QString::number( val );
- v.append( "eV" );
- }
+ value*=96.6;
+ v = QString::number( value );
+ v.append( "kJ/mol" );
+ }
+ else // use electronvolt
+ {
+ v = QString::number( value );
+ v.append( "eV" );
}
}
- else if ( type == BOILINGPOINT || type == MELTINGPOINT ) // convert a temperature
+ return v;
+}
+
+const QString Element::adjustUnits( const int type )
+{
+ QString v = QString::null;
+
+ double val = 0.0; //the value to convert
+
+ if ( type == BOILINGPOINT || type == MELTINGPOINT ) // convert a temperature
{
if ( type == BOILINGPOINT )
val = boiling();
}
if (!layoutFile.open(IO_ReadOnly))
- KMessageBox::information( 0, i18n("data.xml io-errro"), i18n( "Loading File - IO_ReadOnly" ) );
+ KMessageBox::information( 0, i18n("data.xml IO-error"), i18n( "Loading File - IO_ReadOnly" ) );
///Check if document is well-formed
if (!doc.setContent(&layoutFile))
QString oxydation = domElement.namedItem( "oxydation" ).toElement().text();
QString acidicbehaviour = domElement.namedItem( "acidicbehaviour" ).toElement().text();
QString isotopes = domElement.namedItem( "isotopes" ).toElement().text();
+
+ QDomNodeList elist = domElement.elementsByTagName( "energy" );
+ QValueList<double> ionlist;
+ for( uint i = 0; i < elist.length(); i++ )
+ {
+ ionlist.append( elist.item( i ).toElement().text().toDouble() );
+ }
Element *e = new Element();
e->setDate(date);
e->setOxydation(oxydation);
e->setAcidicbehaviour(acidicbehaviour);
e->setIsotopes(isotopes);
+ e->setIonisationList( ionlist );
e->setWeight( weight );
e->setEN( en );
typedef QValueList<Element*> EList;
typedef QValueList<coordinate> CList;
+typedef QValueList<double> doubleList;
/**
* @short this class contains all Element-objects as
void setOxydation( QString value ) { m_oxstage = value; }
void setAcidicbehaviour( QString value ) { m_acidbeh = value; }
void setIsotopes( QString value ) { m_isotopes = value; }
+
+ void setIonisationList( doubleList l ){
+ m_ionenergies = l;
+ }
+
+ QValueList<double> ionisationList() const{
+ return m_ionenergies;
+ }
/**
*/
const QString adjustUnits( const int type );
+ /**
+ * needed for values stored in a QValueList<double>
+ */
+ const QString adjustUnits( const int type, double value );
+
/**
* missing
*/
m_orbits,
m_isotopes,
m_scientist;
+
+ doubleList m_ionenergies;
public:
/**