fixed database playback
authorKevron Rees <kevron.m.rees@intel.com>
Mon, 27 Oct 2014 16:42:31 +0000 (09:42 -0700)
committerKevron Rees <kevron.m.rees@intel.com>
Mon, 27 Oct 2014 17:00:36 +0000 (10:00 -0700)
examples/databasesource.in
plugins/database/databasesink.cpp
plugins/database/databasesink.h

index ccfa491..69ab8cb 100644 (file)
@@ -4,7 +4,7 @@
       "name" : "Database Source",
       "path" : "@PLUGIN_INSTALL_PATH@/databasesinkplugin.so",
       "playbackOnLoad" : "true",
-      "databaseFile" : "generated.db"
+      "databaseFile" : "/tmp/storage"
     }
   ],
   "sinks": [
index dbc141e..318cd67 100644 (file)
@@ -329,16 +329,14 @@ void DatabaseSink::startPlayback()
                obj.key = results[i][0];
                obj.value = results[i][1];
                obj.source = results[i][2];
-               obj.time = boost::lexical_cast<double>(results[i][3]);
-
-               /// TODO: figure out why sequence is broken:
-
-//             obj->sequence = boost::lexical_cast<int>(results[i][4]);
+               obj.zone = boost::lexical_cast<double>(results[i][3]);
+               obj.time = boost::lexical_cast<double>(results[i][4]);
+               obj.sequence = boost::lexical_cast<double>(results[i][5]);
 
                playbackShared->playbackQueue.push_back(obj);
        }
 
-       g_timeout_add(0,getNextEvent,playbackShared);
+       g_timeout_add(0, getNextEvent, playbackShared);
 }
 
 void DatabaseSink::initDb()
index 2ec319f..bb9697a 100644 (file)
@@ -172,7 +172,8 @@ public:
 
        bool operator ==(const DBObject & other) const
        {
-               return (key == other.key && source == other.source && zone == other.zone);
+               return (key == other.key && source == other.source && zone == other.zone &&
+                               value == other.value && sequence == other.sequence && time == other.time);
        }
 
        bool operator != (const DBObject & other)