Commit 7f4cc142 authored by Adrien Dorsaz's avatar Adrien Dorsaz

Add .pro file and add needed files to create an sbs2 application.

parent d9f614be
# Add more folders to ship with the application, here
folder_01.source = qml/sbs2-HelloWorld
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =
# If your application uses the Qt Mobility libraries, uncomment the following
# lines and add the respective components to the MOBILITY variable.
# CONFIG += mobility
# MOBILITY +=
# Speed up launching on MeeGo/Harmattan when using applauncherd daemon
# CONFIG += qdeclarative-boostable
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp \
mycallback.cpp
# Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()
include(./think-core/src/sbs2.pri)
HEADERS += \
mycallback.h
#include <QApplication>
#include <QtDeclarative>
#include <mycallback.h>
#include <hardware/emotiv/sbs2emotivdatareader.h>
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
//set path where recorded data will be stored
qDebug() << "catalogPath: "<<Sbs2Common::setDefaultCatalogPath();
//set path where application data is stored
qDebug() << "rootAppPath: "<<Sbs2Common::setDefaultRootAppPath();
//create MyCallback object
MyCallback* myCallback = new MyCallback();
Sbs2EmotivDataReader* sbs2DataReader = Sbs2EmotivDataReader::New(myCallback,0);
//required for proper closing of the app
QObject::connect(app.data(), SIGNAL(aboutToQuit()), sbs2DataReader, SLOT(aboutToQuit()));
QObject::connect((QObject*)viewer.engine(), SIGNAL(quit()), app.data(), SLOT(quit()));
return app->exec();
}
#include "mycallback.h"
MyCallback::MyCallback(QObject *parent) :
Sbs2Callback(parent)
{
}
/**
Reimplemented callback method. This method sees single packets and handles them.
*/
void MyCallback::getData(Sbs2Packet *packet)
{
//set current packet, increment counters
setPacket(packet);
if (currentPacketCounter%8 == 0)
emit timeTick8();
emit valueSignal((QVariant)thisPacket->filteredValues["O2"]);
}
#ifndef MYCALLBACK_H
#define MYCALLBACK_H
#include <sbs2callback.h>
class MyCallback : public Sbs2Callback
{
Q_OBJECT
public:
explicit MyCallback(QObject *parent = 0);
void getData(Sbs2Packet *packet);
signals:
void valueSignal(QVariant value);
public slots:
};
#endif // MYCALLBACK_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment