Began proof-of-concept memory module.
[aesalon.git] / modules / memory / src / artisan / DataStore.cpp
blobf0845014bc43d8e1083729267f8b73648e84c36e
1 #include "DataStore.h"
3 DataStore::DataStore() {
4 m_firstTime = 0.0;
7 DataStore::~DataStore() {
11 void DataStore::process(Comm::Packet *packet) {
12 uint64_t timestamp = reinterpret_cast<uint64_t *>(packet->data())[0];
13 uint64_t cpuTime = reinterpret_cast<uint64_t *>(packet->data())[1];
15 if(m_firstTime == 0.0) {
16 m_firstTime = timestamp;
18 else {
19 double value = double(cpuTime-m_lastCpuTime) / (timestamp - m_lastTime);
20 m_dataList.push_back(QPair<double, double>(timestamp - m_firstTime, value));
23 m_lastTime = timestamp;
24 m_lastCpuTime = cpuTime;