From: Carsten Niehaus Date: Sat, 4 Jun 2005 11:16:42 +0000 (+0000) Subject: * from Martin: Add the infos of EA to the infodlg X-Git-Tag: v3.80.2~300^2~126 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=49c656f441b878a88c3651528ef1a975c78532ea;p=libqmvoc.git * from Martin: Add the infos of EA to the infodlg * from Carsten: make the "orbits" look better svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=422039 --- diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index 8af9906..0734c57 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -180,10 +180,28 @@ const QString Element::adjustUnits( const int type ) { val = electroneg(); if ( val <= 0 ) - v = i18n( "Value not defined" ); + v = i18n( "Value not defined" ); else v = QString::number( val ); } + else if ( type == EA ) //Electron affinity + { + val = electroaf(); + if ( val == 0.0 ) + v = i18n( "Value not defined" ); + else + { + if ( Prefs::energies() == 0 ) + { + v = i18n( "%1 kJ/mol" ).arg( QString::number( val ) ); + } + else // use electronvolt + { + val/=96.6; + v = i18n( "% 1 eV" ).arg( QString::number( val ) ); + } + } + } else if ( type == MASS ) // its a mass { val = mass(); diff --git a/kalzium/src/element.h b/kalzium/src/element.h index 438539c..b328c83 100644 --- a/kalzium/src/element.h +++ b/kalzium/src/element.h @@ -344,6 +344,7 @@ class Element{ BOILINGPOINT, MELTINGPOINT, EN, + EA, DATE, IE, IONICRADIUS