From 39a58d4bd57edc903182805518de1fa773338c49 Mon Sep 17 00:00:00 2001 From: Carsten Niehaus Date: Sun, 29 May 2005 08:54:17 +0000 Subject: [PATCH] * change to word weight to mass. * some work on the plottingdialog (see TODO) svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=419334 --- kalzium/src/element.cpp | 18 +++++++++--------- kalzium/src/element.h | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index f5f5d2c..593d368 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -55,7 +55,7 @@ QString Element::parsedOrbits() } -double Element::strippedWeight( double num ) +double Element::strippedMass( double num ) { if ( !finite( num ) ) return num; @@ -78,9 +78,9 @@ Element::~Element() -double Element::meanweight() +double Element::meanmass() { - return m_weight/m_number; + return m_mass/m_number; } const QString Element::adjustUnits( const int type, double value ) @@ -169,9 +169,9 @@ const QString Element::adjustUnits( const int type ) } } } - else if ( type == WEIGHT ) // its a weight + else if ( type == WEIGHT ) // its a mass { - val = weight(); + val = mass(); if ( val == -1 ) v = i18n( "Value unknown" ); else @@ -316,7 +316,7 @@ void Element::drawStateOfMatter( QPainter* p, double temp ) //top left p->setPen( Qt::black ); - text = QString::number( strippedWeight( weight( ) ) ); + text = QString::number( strippedMass( mass( ) ) ); p->drawText( X+5,Y+2 ,ELEMENTSIZE-2,h_small,Qt::AlignLeft, text ); text = QString::number( number() ); @@ -448,7 +448,7 @@ void Element::drawSelf( QPainter* p ) //top left p->setPen( Qt::black ); - text = QString::number( strippedWeight( weight( ) ) ); + text = QString::number( strippedMass( mass( ) ) ); p->drawText( X+5,Y+2 ,ELEMENTSIZE+4,h_small,Qt::AlignLeft, text ); text = QString::number( number() ); @@ -540,7 +540,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) {//iterate through all elements domElement = ( const QDomElement& ) elementNodes.item( i ).toElement(); - double weight = domElement.namedItem( "weight" ).toElement().text().toDouble(); + double mass = domElement.namedItem( "mass" ).toElement().text().toDouble(); double en = domElement.namedItem( "electronegativity" ).toElement().text().toDouble(); double mp = domElement.namedItem( "meltingpoint" ).toElement().text().toDouble(); double bp = domElement.namedItem( "boilingpoint" ).toElement().text().toDouble(); @@ -590,7 +590,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) e->setIsotopes(isotopes); e->setIonisationList( ionlist ); - e->setWeight( weight ); + e->setMass( mass ); e->setEN( en ); e->setMeltingpoint( mp ); e->setBoilingpoint( bp ); diff --git a/kalzium/src/element.h b/kalzium/src/element.h index c7f4214..63de255 100644 --- a/kalzium/src/element.h +++ b/kalzium/src/element.h @@ -84,7 +84,7 @@ class Element{ return m_number; } - void setWeight( double value ) { m_weight = value; } + void setMass( double value ) { m_mass = value; } void setEN( double value ) { m_EN = value; } void setMeltingpoint( double value ) { m_MP = value; } void setBoilingpoint( double value ) { m_BP = value; } @@ -245,10 +245,10 @@ class Element{ } /** - * @return the atomic weight of the element in units + * @return the atomic mass of the element in units */ - double weight() const { - return m_weight; + double mass() const { + return m_mass; } /** @@ -266,9 +266,9 @@ class Element{ } /** - * @return the meanweight of the element + * @return the meanmass of the element */ - double meanweight(); + double meanmass(); int x, y; //for the RegularPSE @@ -308,7 +308,7 @@ class Element{ /** * calculate the 4-digit value of the value @p w */ - double strippedWeight( double w ); + double strippedMass( double w ); /** @@ -335,7 +335,7 @@ class Element{ return ( y-1 )*ELEMENTSIZE + ELEMENTSIZE; } - double m_weight, + double m_mass, m_MP, m_BP, m_EN, -- 2.47.3