Index: trunk/FACT++/src/tngweather.cc
===================================================================
--- trunk/FACT++/src/tngweather.cc	(revision 16954)
+++ trunk/FACT++/src/tngweather.cc	(revision 16955)
@@ -21,5 +21,5 @@
 #include "HeadersTNGWeather.h"
 
-#include <Soprano/Soprano>
+#include <QtXml/QDomDocument>
 
 namespace ba = boost::asio;
@@ -127,116 +127,109 @@
         }
 
-        const Soprano::Parser* p = Soprano::PluginManager::instance()->discoverParserForSerialization( Soprano::SerializationRdfXml );
-        Soprano::StatementIterator it = p->parseString(QString(data.c_str()), QUrl(""), Soprano::SerializationRdfXml );
-
+        QDomDocument doc;
+        if (!doc.setContent(QString(data.data()), false))
+        {
+            Warn("Parsing of xml failed [0].");
+            PostClose(false);
+            return;
+        }
+
+        if (fIsVerbose)
+            Out() << "Parsed:\n-------\n" << doc.toString().toStdString() << endl;
+
+        const QDomElement root = doc.documentElement();
+        const QDomElement item = root.firstChildElement("item");
+
+        const QDomElement med   = item.firstChildElement("tngw:dimmSeeing.median");
+        const QDomElement sdev  = item.firstChildElement("tngw:dimmSeeing.stdev");
+        const QDomElement dust  = item.firstChildElement("tngw:dustTotal");
+        const QDomElement delta = item.firstChildElement("tngw:deltaM1");
+        const QDomElement pres  = item.firstChildElement("tngw:airPressure");
+        const QDomElement dew   = item.firstChildElement("tngw:dewPoint");
+        const QDomElement wdir  = item.firstChildElement("tngw:windDirection");
+        const QDomElement speed = item.firstChildElement("tngw:windSpeed");
+        const QDomElement hum   = item.firstChildElement("tngw:hum");
+        const QDomElement tmp0  = item.firstChildElement("tngw:tempGround");
+        const QDomElement tmp2  = item.firstChildElement("tngw:temp2M");
+        const QDomElement tmp5  = item.firstChildElement("tngw:temp5M");
+        const QDomElement tmp10 = item.firstChildElement("tngw:temp10M");
+        const QDomElement solar = item.firstChildElement("tngw:solarimeter");
+        const QDomElement date  = item.firstChildElement("tngw:date");
+
+        if (med.isNull()  || sdev.isNull()  || dust.isNull()  || delta.isNull() ||
+            pres.isNull() || dew.isNull()   || wdir.isNull()  || speed.isNull() ||
+            hum.isNull()  || hum.isNull()   || tmp0.isNull()  || tmp2.isNull()  ||
+            tmp5.isNull() || tmp10.isNull() || solar.isNull() || date.isNull())
+        {
+            Warn("Parsing of xml failed [1].");
+            PostClose(false);
+            return;
+        }
 
         DimWeather w;
-        Time time(Time::none);
-        try
-        {
-            while (it.next())
-            {
-                const string pre = (*it).predicate().toString().toStdString();
-                const string obj = (*it).object().toString().toStdString();
-
-                const size_t slash = pre.find_last_of('/');
-                if (slash==string::npos)
-                    continue;
-
-                const string id = pre.substr(slash+1);
-
-                if (obj=="N/A")
-                    continue;
-
-                if (id=="dimmSeeing")
-                    w.fSeeing = stof(obj);
-                if (id=="dustTotal")
-                    w.fDustTotal = stof(obj);
-                if (id=="deltaM1")
-                    w.fDeltaM1 = stof(obj);
-                if (id=="airPressure")
-                    w.fAirPressure = stof(obj);
-                if (id=="dewPoint")
-                    w.fDewPoint = stof(obj);
-                if (id=="windDirection")
-                    w.fWindDirection = stof(obj);
-                if (id=="windSpeed")
-                    w.fWindSpeed = stof(obj)*3.6;
-                if (id=="hum")
-                    w.fHumidity = stof(obj);
-                if (id=="tempGround")
-                    w.fTempGround = stof(obj);
-                if (id=="temp2M")
-                    w.fTemp2M = stof(obj);
-                if (id=="temp5M")
-                    w.fTemp5M = stof(obj);
-                if (id=="temp10M")
-                    w.fTemp10M = stof(obj);
-                if (id=="date")
-                {
-                    time.SetFromStr(obj, "%Y-%m-%dT%H:%M:%S");
-
-                    if (!time.IsValid())
-                    {
-                        struct tm tm;
-
-                        vector<char> buf(255);
-                        if (strptime(obj.c_str(), "%c", &tm))
-                            time = Time(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
-                                        tm.tm_hour,      tm.tm_min,   tm.tm_sec);
-                    }
-                }
-
-                /*
-                 Out() << "S: " << (*it).subject().toString().toStdString() << endl;
-                 Out() << "P: " << (*it).predicate().toString().toStdString() << endl;
-                 Out() << "O: " << (*it).object().toString().toStdString() << endl;
-                 Out() << "C: " << (*it).context().toString().toStdString() << endl;
-                 */
-            }
-
-            if (!time.IsValid())
-                throw runtime_error("time invalid");
-
-            if (time!=fLastReport && fIsVerbose)
-            {
-                Out() << endl;
-                Out() << "Date:           " << time             << endl;
-                Out() << "Seeing:         " << w.fSeeing        << endl;
-                Out() << "DustTotal:      " << w.fDustTotal     << endl;
-                Out() << "DeltaM1:        " << w.fDeltaM1       << endl;
-                Out() << "AirPressure:    " << w.fAirPressure   << endl;
-                Out() << "DewPoint:       " << w.fDewPoint      << endl;
-                Out() << "WindDirection:  " << w.fWindDirection << endl;
-                Out() << "WindSpeed:      " << w.fWindSpeed     << endl;
-                Out() << "Humidity:       " << w.fHumidity      << endl;
-                Out() << "TempGround:     " << w.fTempGround    << endl;
-                Out() << "Temp2M:         " << w.fTemp2M        << endl;
-                Out() << "Temp5M:         " << w.fTemp5M        << endl;
-                Out() << "Temp10M:        " << w.fTemp10M       << endl;
-                Out() << endl;
-            }
-
-            fLastReport = time;
-
-            UpdateWeather(time, w);
-
-            if (fDust==w.fDustTotal)
-                return;
-
-            UpdateDust(time, w.fDustTotal);
-            fDust = w.fDustTotal;
-
-            ostringstream out;
-            out << setprecision(3) << "Dust: " << fDust << "ug/m^3 [" << time << "]";
-            Message(out);
-        }
-
-        catch (const exception &e)
-        {
-            Out() << "Corrupted data received: " << e.what() << endl;
-            fLastReport = Time(Time::none);
-            return;
-        }
+        w.fSeeingMed     = med  .text().toFloat();
+        w.fSeeingStdev   = sdev .text().toFloat();
+        w.fDustTotal     = dust .text().toFloat();
+        w.fDeltaM1       = delta.text().toFloat();
+        w.fAirPressure   = pres .text().toFloat();
+        w.fDewPoint      = dew  .text().toFloat();
+        w.fWindDirection = wdir .text().toFloat();
+        w.fWindSpeed     = speed.text().toFloat()*3.6;
+        w.fHumidity      = hum  .text().toFloat();
+        w.fTempGround    = tmp0 .text().toFloat();
+        w.fTemp2M        = tmp2 .text().toFloat();
+        w.fTemp5M        = tmp5 .text().toFloat();
+        w.fTemp10M       = tmp10.text().toFloat();
+        w.fSolarimeter   = solar.text().toFloat();
+
+        const string obj = date.text().toStdString();
+
+        Time time(obj);
+        if (!time.IsValid())
+        {
+            struct tm tm;
+
+            vector<char> buf(255);
+            if (strptime(obj.c_str(), "%c", &tm))
+                time = Time(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+                            tm.tm_hour,      tm.tm_min,   tm.tm_sec);
+        }
+
+        if (!time.IsValid())
+            throw runtime_error("time invalid");
+
+        if (time!=fLastReport && fIsVerbose)
+        {
+            Out() << endl;
+            Out() << "Date:           " << time             << endl;
+            Out() << "Seeing:         " << w.fSeeingMed << " +- " << w.fSeeingStdev << endl;
+            Out() << "DustTotal:      " << w.fDustTotal     << endl;
+            Out() << "DeltaM1:        " << w.fDeltaM1       << endl;
+            Out() << "AirPressure:    " << w.fAirPressure   << endl;
+            Out() << "DewPoint:       " << w.fDewPoint      << endl;
+            Out() << "WindDirection:  " << w.fWindDirection << endl;
+            Out() << "WindSpeed:      " << w.fWindSpeed     << endl;
+            Out() << "Humidity:       " << w.fHumidity      << endl;
+            Out() << "TempGround:     " << w.fTempGround    << endl;
+            Out() << "Temp2M:         " << w.fTemp2M        << endl;
+            Out() << "Temp5M:         " << w.fTemp5M        << endl;
+            Out() << "Temp10M:        " << w.fTemp10M       << endl;
+            Out() << "Solarimeter:    " << w.fSolarimeter   << endl;
+            Out() << endl;
+        }
+
+        fLastReport = time;
+
+        UpdateWeather(time, w);
+
+        if (fDust==w.fDustTotal)
+            return;
+
+        UpdateDust(time, w.fDustTotal);
+        fDust = w.fDustTotal;
+
+        ostringstream out;
+        out << setprecision(3) << "Dust: " << fDust << "ug/m^3 [" << time << "]";
+        Message(out);
     }
 
@@ -385,5 +378,5 @@
     ConnectionDimWeather(ba::io_service& ioservice, MessageImp &imp) :
         ConnectionWeather(ioservice, imp),
-        fDimWeather("TNG_WEATHER/DATA", "F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1",
+        fDimWeather("TNG_WEATHER/DATA", "F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1",
                      "|T_10M[deg C]:Temperature 10m above ground"
                      "|T_5M[deg C]:Temperature 5m above ground"
@@ -397,5 +390,7 @@
                      "|DeltaM1"
                      "|Dust[ug/m^3]:Dust (total)"
-                     "|Seeing[W/m^2]:Seeing"),
+                     "|Seeing[arcsec]:Seeing Median"
+                     "|SeeingStdev[arcsec]:Seeing Stdev"
+                     "|Solarimeter[W/m^2]:Solarimeter"),
         fDimAtmosphere("TNG_WEATHER/DUST", "F:1",
                        "|Dust[ug/m^3]:Dust (total)")
