#include </home/clem/local/src/opie/noncore/apps/oxygen/kmolcalc.h>
Collaboration diagram for KMolCalc:

Public Member Functions | |
| KMolCalc () | |
| ~KMolCalc () | |
| QString | readFormula (const QString &s) |
| double | getWeight () |
| QString | getEA () |
| QString | getEmpFormula () |
| void | defineElement (const QString &name, double weight) |
| QString | defineGroup (const QString &name, const QString &formula) |
| void | undefineGroup (const QString &name) |
| void | readElstable () |
Public Attributes | |
| QDict< SubUnit > * | elstable |
| QString | mwfile |
Private Member Functions | |
| QString | readGroup (const QString &s, ElementList *els) |
| void | readMwfile (QFile &f) |
Private Attributes | |
| double | weight |
| ElementList * | elements |
Definition at line 31 of file kmolcalc.h.
|
|
Construct a new calculator object. Definition at line 21 of file kmolcalc.cpp. References elements, elstable, NULL, and readElstable(). |
|
|
Definition at line 27 of file kmolcalc.cpp. References elements. |
|
||||||||||||
|
Add a new element name - atomic weight record to the ELSTABLE hashtable. Assumes NAME has valid syntax. Definition at line 180 of file kmolcalc.cpp. References elstable, and QDict< type >::replace(). |
|
||||||||||||
|
Add a new group definition to the ELSTABLE. Returns "OK" if OK, error message if parsing FORMULA fails. Assumes the syntax of NAME is correct. Definition at line 189 of file kmolcalc.cpp. References ElementList::contains(), elstable, error(), readGroup(), and QDict< type >::replace(). |
|
|
Return the elemental composition of the current formula, as a string of tab-separated element - percentage pairs, separated by newlines. Definition at line 142 of file kmolcalc.cpp. References elements, elstable, ElementList::getEA(), ElementList::getWeight(), and weight. Referenced by calcDlgUI::calc(). |
|
|
Return the empirical formula of the current compound as a QString. Definition at line 151 of file kmolcalc.cpp. References elements, and ElementList::getEmpFormula(). Referenced by calcDlgUI::calc(). |
|
|
Calculate and return the molecular weight of the current chemical formula. Definition at line 133 of file kmolcalc.cpp. References elements, elstable, ElementList::getWeight(), and weight. Referenced by calcDlgUI::calc(). |
|
|
Read the element definitions file and construct ELSTABLE. Definition at line 31 of file kmolcalc.cpp. References elstable, QFile::exists(), f, mwfile, QPEApplication::qpeDir(), readMwfile(), QPtrCollection::setAutoDelete(), TRUE, and weight. Referenced by KMolCalc(). |
|
|
Parse a string S and construct the ElementList ELEMENTS, representing the composition of S. Returns "OK" if successful, or an error message if parsing failed. The elements is S must be valid element or group symbols, as stored in ELSTABLE. See help files for correct formula syntax. Definition at line 49 of file kmolcalc.cpp. References elements, readGroup(), and weight. Referenced by calcDlgUI::calc(). |
|
||||||||||||
|
Definition at line 57 of file kmolcalc.cpp. References SubUnit::addTo(), ElementList::addTo(), elstable, errors, QDict< type >::find(), i, ElementList::isEmpty(), QString::isEmpty(), QString::left(), QString::length(), QString::mid(), NULL, and TRUE. Referenced by defineGroup(), and readFormula(). |
|
|
Definition at line 156 of file kmolcalc.cpp. References elstable, QTextStream::eof(), SubUnit::getName(), IO_ReadOnly, SubUnit::makeSubUnit(), QFile::open(), QTextStream::readLine(), QDict< type >::replace(), and s. Referenced by readElstable(). |
|
|
Remove a group or element definition from ELSTABLE. Definition at line 171 of file kmolcalc.cpp. References elstable, and QDict< type >::remove(). |
|
|
Definition at line 97 of file kmolcalc.h. Referenced by getEA(), getEmpFormula(), getWeight(), KMolCalc(), readFormula(), and ~KMolCalc(). |
|
|
The element dictionary. Definition at line 88 of file kmolcalc.h. Referenced by defineElement(), defineGroup(), getEA(), getWeight(), KMolCalc(), readElstable(), readGroup(), readMwfile(), and undefineGroup(). |
|
|
Definition at line 90 of file kmolcalc.h. Referenced by readElstable(). |
|
|
Definition at line 93 of file kmolcalc.h. Referenced by getEA(), getWeight(), readElstable(), and readFormula(). |
1.4.2