Route and Results buttons updated.
[speedfreak] / Client / xmlwriter.cpp
index fd46a6d..3abe02a 100644 (file)
@@ -2,21 +2,20 @@
  * Xml writer
  *
  * @author     Tiina Kivilinna-Korhola
  * Xml writer
  *
  * @author     Tiina Kivilinna-Korhola
+ * @author     Toni Jussila <toni.jussila@fudeco.com>
  * @copyright  (c) 2010 Speed Freak team
  * license     http://opensource.org/licenses/gpl-license.php GNU Public License
  */
 
 #include "xmlwriter.h"
 
  * @copyright  (c) 2010 Speed Freak team
  * license     http://opensource.org/licenses/gpl-license.php GNU Public License
  */
 
 #include "xmlwriter.h"
 
-
-
 /**
   *@brief Constructor, connects object to GUI
   *@param Pointer to carmainwindow, which is temporarily used during development
   */
 XmlWriter::XmlWriter()
 {
 /**
   *@brief Constructor, connects object to GUI
   *@param Pointer to carmainwindow, which is temporarily used during development
   */
 XmlWriter::XmlWriter()
 {
-    tmpvalue = 3010;
+
 }
 
 /**
 }
 
 /**
@@ -59,13 +58,12 @@ void XmlWriter::writeRegistering(QBuffer *netbuf, QString usr, QString psswd, QS
     xmlwriter.writeEndDocument();
 }
 
     xmlwriter.writeEndDocument();
 }
 
-
 /**
   *@brief Writes Speed Freek results items as tags and contents into a buffer.
   *@todo Consider looping when writing many values.
   *@todo Replace test value to finally used variables.
   */
 /**
   *@brief Writes Speed Freek results items as tags and contents into a buffer.
   *@todo Consider looping when writing many values.
   *@todo Replace test value to finally used variables.
   */
-void XmlWriter::writeResult(QBuffer *netbuf)
+void XmlWriter::writeResult(QBuffer *netbuf, double result)
 {
     qDebug() << "_writeResult";
 
 {
     qDebug() << "_writeResult";
 
@@ -73,14 +71,11 @@ void XmlWriter::writeResult(QBuffer *netbuf)
 
     xmlwriter.writeStartDocument();
     xmlwriter.writeStartElement("result");
 
     xmlwriter.writeStartDocument();
     xmlwriter.writeStartElement("result");
-    tmpvalue++;
-    qDebug() << tmpvalue;
-    xmlwriter.writeAttribute("value", QString::number(tmpvalue));
+    xmlwriter.writeAttribute("value", QString::number(result));
     xmlwriter.writeEndElement();
     xmlwriter.writeEndDocument();
 }
 
     xmlwriter.writeEndElement();
     xmlwriter.writeEndDocument();
 }
 
-
 /**
   *@brief Write track to server.
   *@param netbuf where to write.
 /**
   *@brief Write track to server.
   *@param netbuf where to write.
@@ -117,7 +112,6 @@ void XmlWriter::writeGpsTrack(QBuffer *netbuf, int counter, int start, int stop,
     xmlwriter.writeEndDocument();
 }
 
     xmlwriter.writeEndDocument();
 }
 
-
 /**
   *@brief Opens and closes a file, when xml information is written into a file,
   *and passes file to writeXmlFile()
 /**
   *@brief Opens and closes a file, when xml information is written into a file,
   *and passes file to writeXmlFile()
@@ -160,7 +154,6 @@ bool XmlWriter::writeXmlFile(QIODevice *device)
     return true;
 }
 
     return true;
 }
 
-
 /**
   *@brief Writes Speed Freek results items as tags and contents to earlier defined target.
   *@todo Consider looping when writing many values.
 /**
   *@brief Writes Speed Freek results items as tags and contents to earlier defined target.
   *@todo Consider looping when writing many values.
@@ -174,4 +167,3 @@ void XmlWriter::writeItems()
     xmlwriter.writeAttribute("date", QDateTime::currentDateTime().toString());
     xmlwriter.writeEndElement();
 }
     xmlwriter.writeAttribute("date", QDateTime::currentDateTime().toString());
     xmlwriter.writeEndElement();
 }
-