]> Git trees. - libqmvoc.git/commitdiff
* load the new data
authorCarsten Niehaus <cniehaus@gmx.de>
Tue, 3 Jan 2006 14:36:08 +0000 (14:36 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Tue, 3 Jan 2006 14:36:08 +0000 (14:36 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=493866

libscience/chemicaldataobject.cpp
libscience/chemicaldataobject.h
libscience/elementparser.cpp
libscience/tests/Makefile.am

index 5719ca4da4f45bfb5669aa33d264b8200ae6dc94..860faf1fb4bdc98092547cbf8dbb1ac101e2367b 100644 (file)
@@ -197,8 +197,23 @@ QString ChemicalDataObject::dictRef() const
                case relativeAbundance:
                        botype = "relativeAbundance";
                        break;
+               case family:
+                       botype ="family";
+                       break;
+               case group:
+                       botype ="group";
+                       break;
+               case acidicbehaviour:
+                       botype ="acidicbehaviour";
+                       break;
+               case electronicConfiguration:
+                       botype ="electronicConfiguration";
+                       break;
+               case crystalstructure:
+                       botype ="crystalstructure";
+                       break;
        }
-       
+
        botype = botype.prepend( "bo:" );
        
        return botype;
@@ -222,6 +237,10 @@ QString ChemicalDataObject::unitAsString() const
                        break;
                case noUnit:
                        return "noUnit";
+               case y:
+                       return "y";
+               case s:
+                       return "s";
        }
        
        bounit = bounit.prepend( "bo:" );
index 008779b4da98d35f2af68355c56a09fd118f4b81..7a988e996d0097bbf032480dba63040bda6e6201 100644 (file)
@@ -58,6 +58,10 @@ class ChemicalDataObject
                        boilingpoint/**< the boilingpoint */,
                        periodTableBlock/**< the block of the element */,
                        family/** "Noblegas" "Non-Metal" "Rare_Earth" "Alkaline_Earth" "Alkali_Earth" "Transition" "Other_Metal" "Metalloids" "Halogene" */,
+                       group,
+                       crystalstructure,
+                       electronicConfiguration,
+                       acidicbehaviour,
                        nameOrigin/**< the origin of the name */,
                        orbit/**< the quantumorbit of the element */,
                        period/**< the period of the element */,
index 39ecc252c6b30bae3da4f28d89ef1abf7048deed..9058cc366e65f9049e2e1416f28c39f12d82a64e 100644 (file)
@@ -41,7 +41,12 @@ public:
        inNameOrigin(false),
        inDiscoveryDate(false),
        inDiscoverers(false),
-       inPeriod(false)
+       inPeriod(false),
+       inCrystalstructure( false ),
+       inAcidicbehaviour( false ),
+       inFamily( false ),
+       inGroup( false ),
+       inElectronicconfiguration( false )
        {
        }
 
@@ -69,6 +74,11 @@ public:
        bool inDiscoveryDate;
        bool inDiscoverers;
        bool inPeriod;
+       bool inCrystalstructure;
+       bool inAcidicbehaviour;
+       bool inFamily;
+       bool inGroup;
+       bool inElectronicconfiguration;
 };
 
 ElementSaxParser::ElementSaxParser()
@@ -131,6 +141,16 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co
                                d->inDiscoverers = true;
                        else if (attrs.value(i) == "bo:period")
                                d->inPeriod = true;
+                       else if (attrs.value(i) == "bo:crystalstructure")
+                               d->inCrystalstructure = true;
+                       else if (attrs.value(i) == "bo:acidicbehaviour")
+                               d->inAcidicbehaviour = true;
+                       else if (attrs.value(i) == "bo:family")
+                               d->inFamily = true;
+                       else if (attrs.value(i) == "bo:group")
+                               d->inGroup = true;
+                       else if (attrs.value(i) == "bo:electronicConfiguration")
+                               d->inElectronicconfiguration = true;
                }
        }
        return true;
@@ -248,6 +268,31 @@ bool ElementSaxParser::characters(const QString &ch)
                type = ChemicalDataObject::period; 
                d->inPeriod = false;
        }
+       else if (d->inCrystalstructure) {
+               value = ch;
+               type = ChemicalDataObject::crystalstructure; 
+               d->inCrystalstructure = false;
+       }
+       else if (d->inAcidicbehaviour) {
+               value = ch.toInt();
+               type = ChemicalDataObject::acidicbehaviour; 
+               d->inAcidicbehaviour = false;
+       }
+       else if (d->inFamily) {
+               value = ch;
+               type = ChemicalDataObject::family; 
+               d->inFamily = false;
+       }
+       else if (d->inGroup) {
+               value = ch.toInt();
+               type = ChemicalDataObject::group; 
+               d->inGroup = false;
+       }
+       else if (d->inElectronicconfiguration) {
+               value = ch;
+               type = ChemicalDataObject::electronicConfiguration; 
+               d->inElectronicconfiguration = false;
+       }
        else//it is a non known value. Do not create a wrong object but return
                return true;
 
index 41849be7986136af160489c0ec1cbaea90cb5d69..e78896f6501345ed867afe20aa086c24b8dd56d7 100644 (file)
@@ -8,11 +8,11 @@ xmlreadingtest_SOURCES = xmlreadingtest.cpp
 xmlreadingtest_LDFLAGS = $(all_libraries)
 xmlreadingtest_LDADD = ../libscience.la
 
-isotopereadingtest_SOURCES = isotopereadingtest.cpp
-isotopereadingtest_LDFLAGS = $(all_libraries)
-isotopereadingtest_LDADD = ../libscience.la
+#isotopereadingtest_SOURCES = isotopereadingtest.cpp
+#isotopereadingtest_LDFLAGS = $(all_libraries)
+#isotopereadingtest_LDADD = ../libscience.la
 
-cmlspectest_SOURCES = cmlspectest.cpp
-cmlspectest_LDFLAGS = $(all_libraries)
-cmlspectest_LDADD = ../libscience.la
+#cmlspectest_SOURCES = cmlspectest.cpp
+#cmlspectest_LDFLAGS = $(all_libraries)
+#cmlspectest_LDADD = ../libscience.la
 METASOURCES = AUTO