-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdbdata.h
40 lines (29 loc) · 873 Bytes
/
dbdata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef DBDATA_H
#define DBDATA_H
#include <iostream>
#include <QObject>
#include <QtSql>
class DBData : public QObject
{
Q_OBJECT
public:
DBData(QObject *parent = 0);
~DBData();
void insertBus(double time, int current_l, int spring_l, float pwm_l, int current_r, int spring_r, float pwm_r);
void insertControl(double time, int current_angle, int target_angle, int left_error, int right_error);
void insertSpike(double time, QString population, uint neuron);
void setBusRecord(bool _active);
void setControlRecord(bool _active);
void setSpikeRecord(bool _active);
void clearAllData();
void setupDB();
private:
QSqlDatabase db;
QSqlQuery* insertQueryBus;
QSqlQuery* insertQueryControl;
QSqlQuery* insertQuerySpike;
bool busRecord;
bool controlRecord;
bool spikeRecord;
};
#endif // DBDATA_H