Index: trunk/Sick/SickLMSSensor.cpp
===================================================================
--- trunk/Sick/SickLMSSensor.cpp	(revision 37)
+++ trunk/Sick/SickLMSSensor.cpp	(revision 42)
@@ -86,6 +86,5 @@
 }
 
-//////////////////////////////////////////////////////////////////////////
-/// Destructor.
+
 SickLMSSensor::~SickLMSSensor()
 {
@@ -94,6 +93,5 @@
 }
 
-//////////////////////////////////////////////////////////////////////////
-/// Called by the ComponentManager to start the component
+
 void SickLMSSensor::startActivity()
 {
@@ -143,5 +141,5 @@
 
         try {
-            dbtFile_.open(kSickDbtFileName, WriteMode, TELEM_SICK, sizeof(SickLMS_dbt));
+            dbtFile_.open(kSickDbtFileName, WriteMode, TELEM_SICK_LMS, sizeof(SickLMS_dbt));
         } catch (DbiteException & e) {
             cerr << "error opening dbt file: "<< kSickDbtFileName << ", " << e.what() << endl;
@@ -174,6 +172,6 @@
 }
 
-//////////////////////////////////////////////////////////////////////////
-/// Called by the ComponentManager to stop the component
+
+
 void SickLMSSensor::stopActivity()
 {
@@ -200,6 +198,5 @@
 }
 
-//////////////////////////////////////////////////////////////////////////
-///
+
 void SickLMSSensor::configure(){
     // Start measuring
@@ -212,5 +209,5 @@
 
 
-/// Data must be parsed in slot customEvent
+/* Data must be parsed in slot customEvent */
 void SickLMSSensor::askScanCfg(){
     char buf[100];
@@ -222,6 +219,5 @@
 
 
-//////////////////////////////////////////////////////////////////////////
-///
+
 int SickLMSSensor::isMessageComplete(const char* packets, unsigned int size)
 {
@@ -234,7 +230,5 @@
 
 
-//////////////////////////////////////////////////////////////////////////
-/// look for the position of the Start of Text character
-/// Return it if found else return -1
+
 int SickLMSSensor::findSTX(const char* packets, const unsigned int size ){
     int i = 0;
@@ -248,8 +242,4 @@
 
 
-//////////////////////////////////////////////////////////////////////////
-/// this function is called when no complete message has been found
-/// we set the flag previousData to true for the next processing stage
-/// and we store the timestamp of the bytes acquisition
 void SickLMSSensor::storePendingBytes(road_time_t time)
 {
@@ -261,10 +251,5 @@
 }
 
-//////////////////////////////////////////////////////////////////////////
-/// Analyse the ethernet packet received from the Sick LMS and try to find a
-/// complete message (scan data message)
-/// If a message has been found it is added at the end of the message list
-/// else the pending bytes are stored to be analyzed by further icoming data
-//////////////////////////////////////////////////////////////////////////
+
 void SickLMSSensor::reconstituteMessage(const char * packet, const int length, road_time_t time)
 { 
@@ -332,11 +317,4 @@
 
 
-/**
- * \fn
- * \brief
- * \param
- * \param
- * \return
- */
 int SickLMSSensor::splitMessage(MessageLMS* message){
 
@@ -357,7 +335,6 @@
 }
 
-//////////////////////////////////////////////////////////////////////////
-/// Convert hexadecimal value stored as ASCII string to long
-/// Warning : alpha characters must be in capital letters
+
+
 long SickLMSSensor::xstol(std::string str){
     long ret = 0;
@@ -587,6 +564,5 @@
 }
 
-//////////////////////////////////////////////////////////////////////////
-/// write the data on the disk:
+
 void SickLMSSensor::writeData(MessageLMS &msg)
 {
@@ -595,9 +571,19 @@
     entry.scanNumber = xstol(msg.splitMessage->at(7));
     entry.scannerStatus = xstol(msg.splitMessage->at(6));
-    entry.time = msg.time;
-    entry.timerange = msg.timerange;
+    /* time in SickLMS_dbt is used uniquely when DBT file read */
+        //    entry.time = msg.time;
+        //    entry.timerange = msg.timerange;
     entry.scanFrequency = msg.data.scanFrequency;
     entry.angleResolution = msg.data.angleResolution;
     entry.startAngle = msg.data.startAngle;
+
+    // Initialisation
+    entry.dist_len1 = entry.dataPos_dist1 = 0;
+    entry.dist_len2 = entry.dataPos_dist2 = 0;
+    entry.dist_len3 = entry.dataPos_dist3 = 0;
+    entry.dist_len4 = entry.dataPos_dist4 = 0;
+    entry.dist_len5 = entry.dataPos_dist5 = 0;
+    entry.rssi_len1 = entry.dataPos_rssi1 = 0;
+    entry.rssi_len2 = entry.dataPos_rssi2 = 0;
 
     if(msg.data.dist_len1){
@@ -687,7 +673,5 @@
 
 
-//////////////////////////////////////////////////////////////////////////
-/// Event call by the SickSocket class when new data has been arrived
-/// on the network.
+
 void SickLMSSensor::customEvent(QEvent * e)
 {
