From 9bd6edd077df796677c9d069200172f930ac1304 Mon Sep 17 00:00:00 2001 From: kergoth Date: Sun, 15 Sep 2002 17:23:20 +0000 Subject: Reverting to checkbook in its previous state, hopefully i got everything. --- (limited to 'noncore/apps/checkbook/kmolcalc.h') diff --git a/noncore/apps/checkbook/kmolcalc.h b/noncore/apps/checkbook/kmolcalc.h deleted file mode 100644 index c3e02f3..0000000 --- a/noncore/apps/checkbook/kmolcalc.h +++ b/dev/null @@ -1,110 +0,0 @@ -/* - * kmolcalc.h - * - * Copyright (C) 2000 Tomislav Gountchev - */ - - -#ifndef KMOLCALC_H -#define KMOLCALC_H - -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include "kmolelements.h" -#include -#include -#include -#include -#include -#include -#include - - -/** - * KMOLCALC is the calculation engine. It knows about a hashtable of user defined atomic - * weights and group definitions ELSTABLE, and the currently processed formula, stored - * as a list of elements and their coefficients, ELEMENTS. - */ -class KMolCalc { - -public: - - KMolCalc(); - ~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. - */ - QString readFormula(const QString& s); - - /** - * Calculate and return the molecular weight of the current chemical formula. - */ - double getWeight(); - - /** - * Return the elemental composition of the current formula, as a string of tab-separated - * element - percentage pairs, separated by newlines. - */ - QString getEA(); - - - /** - * Return the empirical formula of the current compound as a QString. - */ - QString getEmpFormula(); - - /** - * Add a new element name - atomic weight record to the ELSTABLE hashtable. - * Assumes NAME has valid syntax. - */ - void defineElement(const QString& name, double weight); - - /** - * 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. - */ - QString defineGroup(const QString& name, const QString& formula); - - /** - * Remove a group or element definition from ELSTABLE. - */ - void undefineGroup(const QString& name); - - /** - * Save the element definitions file. - */ - void writeElstable(); - - /** - * Read the element definitions file and construct ELSTABLE. - */ - void readElstable(); - - /** - * The element dictionary. - */ - QDict* elstable; - - QString mwfile; - - private: - double weight; - - QString readGroup(const QString& s, ElementList* els); - void readMwfile(QFile& f); - ElementList* elements; -}; - -#endif - - - - - -- cgit v0.9.0.2