Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Fixed socket communication for online eye tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
MPIBR-kretschmerf committed Feb 3, 2017
1 parent a465c4c commit 7a6af0b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions AudioGameGUI.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ RESOURCES = application.qrc
RC_FILE = app.rc

QT += axcontainer

# QT automatically generates the classes from the com object
TYPELIBS = $$system(dumpcpp -getfile {D323A622-1D13-11D4-8858-444553540000})

isEmpty(TYPELIBS) {
Expand Down
1 change: 1 addition & 0 deletions SocketClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void SocketClient::connectToHost()
connect(tcpSocket, SIGNAL(connected()), this, SLOT(onConnected()));
connect(tcpSocket, SIGNAL(disconnected()), this, SLOT(onDisconnected()));
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(onReadData()), Qt::QueuedConnection);
qDebug() << "Connected";
}
}

Expand Down
2 changes: 1 addition & 1 deletion SocketClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class QNetworkSession;
#define SOCKET_FILENAME 3
#define SOCKET_TRACKINGRESULT 4

class SocketClient : public QDialog
class SocketClient : public QObject
{
Q_OBJECT

Expand Down
4 changes: 4 additions & 0 deletions StateMachineController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
StateMachineController::StateMachineController(QObject *parent):
QObject(parent)
{
qRegisterMetaType<QVector<double>>("QVector<double>");

// seed randomizer
srand(time(0));
timerDialog = new TimerDialog();
Expand Down Expand Up @@ -84,6 +86,7 @@ StateMachineController::StateMachineController(QObject *parent):
connect(socketClient, SIGNAL(socketTrackingResult(QVector<double>)), logFileWriter, SLOT(onWriteTrackingResult(QVector<double>)));

socketClient->moveToThread(socketThread);
socketThread->start();
logFileWriter->moveToThread(logFileThread);
logFileThread->start();
}else{
Expand Down Expand Up @@ -243,5 +246,6 @@ void StateMachineController::onStateSoundEntered()
void StateMachineController::onStatePauseEntered()
{
qDebug()<<"Pause state entered";
mainTimer->stop();
timerDialog->removeTimer();
}

0 comments on commit 7a6af0b

Please sign in to comment.