From: Thomas Pietrzak Date: Thu, 11 Aug 2011 19:03:10 +0000 (+0000) Subject: detection + patterns X-Git-Url: https://git.thomaspietrzak.com/?a=commitdiff_plain;h=e7ce7ab2b7d1850fdd6d9b139fee8e23b01e60f3;p=tactonexperiment.git detection + patterns git-svn-id: svn+ssh://thomaspietrzak.com/var/svn/rep@43 47cf9a05-e0a8-4ed5-9e9b-101a649bc004 --- diff --git a/Tactons Detection/AnswerDetection.cpp b/Tactons Detection/AnswerDetection.cpp new file mode 100644 index 0000000..e6b9a40 --- /dev/null +++ b/Tactons Detection/AnswerDetection.cpp @@ -0,0 +1,151 @@ +#include "AnswerDetection.h" + +#include +#include +#include +#include +#include + +AnswerDetection::AnswerDetection(QWidget *parent, Qt::WFlags flags) +:QDialog(parent, flags), +_logfile(NULL), _tactonPlayer("COM3"), _current(0), _currentvalue(0) +{ + //init the window + setupUi(this); + this->layout()->setSizeConstraint(QLayout::SetFixedSize); + + //init buttons + QObject::connect(now, SIGNAL(clicked()), this, SLOT(answer())); +} + +AnswerDetection::~AnswerDetection() +{ + if (_logfile) + fclose(_logfile); + //reset the wristband + _tactonPlayer.stop(); +} + +void AnswerDetection::init(QString user, unsigned int repetitions, unsigned int step, unsigned int delay, QString order, QString gesture) +{ + _user = user; + _repetitions = repetitions; + _step = step; + _delay = delay; + _order = order; + _gesture = gesture; + + _timer = new QTimer(this); + connect(_timer, SIGNAL(timeout()), this, SLOT(play())); + + //create log file + QString date = QDate::currentDate().toString("yyyy-MM-dd") + "-" + QTime::currentTime().toString("HH-mm-ss"); + QString logfilename = user + "-" + "-" + gesture + "-" + date; + if (_logfile = fopen(logfilename.toStdString().c_str(), "w")) + fprintf(_logfile, "DIRECTION,FREQUENCY,LOCATION,VALUE\n"); + + //load icons + FILE *f = fopen("Frequencies.txt", "r"); + if (f) + { + char buffer[256]; + QList > temp; + while ((fgets(buffer, 256, f)) != NULL) + { + unsigned int val = atoi(buffer); + _values.push_back(val); + temp.push_back(QPair(1,val)); + temp.push_back(QPair(2,val)); + temp.push_back(QPair(4,val)); + temp.push_back(QPair(8,val)); + } + fclose(f); + for (int i = 0 ; i < _repetitions ; i++) + { + //shuffle + for (int i = 0; i < temp.count(); i++) + temp.swap(i, (rand() % (temp.count() - i)) + i); + _trials.append(temp); + } + } + runTrial(); +} + +void AnswerDetection::log() const +{ + if (_logfile == NULL) + return; + QString direction; + if (isAscending()) + direction = "Ascending"; + else + direction = "Descending"; + fprintf(_logfile, "%s,%d,%d,%d\n", direction.toAscii().constData(), _trials.at(_current).second, _trials.at(_current).first, _currentvalue); +} + +void AnswerDetection::runTrial() +{ + if (_current >= _trials.count()) + { + now->setEnabled(false); + return; + } + + //set label and amplitude + if (isAscending()) + { + label->setText("Click when you feel a vibration"); + _currentvalue = 0; + qDebug() << "f=" << QString::number(_trials.at(_current).second); + } + else + { + label->setText("Click when you stop feeling the vibration"); + _currentvalue = 20; + qDebug() << "f=" << QString::number(_trials.at(_current).second); + } + + //play + _timer->start(_delay); +} + +void AnswerDetection::answer() +{ + _timer->stop(); + log(); + _current++; + + runTrial(); +} + +bool AnswerDetection::isAscending() const +{ + if (_order == "Ascending / Descending") + return _current % 2 == 0; + else + return _current % 2 != 0; +} + +void AnswerDetection::play() +{ + Tacton t(_trials.at(_current).first, _delay, _trials.at(_current).second, _currentvalue); + _tactonPlayer.play(t); + + char buffer[256]; + memset(buffer, 0, 256); + _tactonPlayer.debugRead(buffer, 256); + qDebug() << "Read: " << buffer; + + if (isAscending()) + { + if (_currentvalue + _step > 255) + return; + _currentvalue += _step; + } + else + { + if (_currentvalue < _step) + return; + _currentvalue -= _step; + } +} diff --git a/Tactons Detection/AnswerDetection.h b/Tactons Detection/AnswerDetection.h new file mode 100644 index 0000000..511470f --- /dev/null +++ b/Tactons Detection/AnswerDetection.h @@ -0,0 +1,51 @@ +#ifndef _ANSWERDETECTION_ +#define _ANSWERDETECTION_ + +#include + +#include +#include +#include +#include "ui_AnswerDetection.h" + + +class AnswerDetection : public QDialog, Ui::AnswerDetectionClass +{ + Q_OBJECT + +public: + AnswerDetection(QWidget *parent = 0, Qt::WFlags flags = 0); + ~AnswerDetection(); + + void init(QString user, unsigned int repetitions, unsigned int step, unsigned int delay, QString order, QString gesture); + bool isAscending() const; + +private: + void log() const; + + FILE *_logfile; + TactonPlayer _tactonPlayer; + + //exp parameters + QString _user; + unsigned int _repetitions, _step, _delay; + QString _order; + QString _gesture; + + //exp data + QList _values; + QList > _trials; + + //exp status + unsigned int _current; + unsigned char _currentvalue; + + QTimer *_timer; + +private slots: + void runTrial(); + void answer(); + void play(); +}; + +#endif diff --git a/Tactons Detection/AnswerDetection.ui b/Tactons Detection/AnswerDetection.ui new file mode 100644 index 0000000..f0f635b --- /dev/null +++ b/Tactons Detection/AnswerDetection.ui @@ -0,0 +1,43 @@ + + + AnswerDetectionClass + + + + 0 + 0 + 400 + 165 + + + + Dialog + + + + + + + 20 + + + + Click when you feel a vibration + + + Qt::AlignCenter + + + + + + + Now! + + + + + + + + diff --git a/Tactons Detection/Frequencies.txt b/Tactons Detection/Frequencies.txt new file mode 100644 index 0000000..0b69506 --- /dev/null +++ b/Tactons Detection/Frequencies.txt @@ -0,0 +1,6 @@ +16 +32 +64 +128 +256 +512 \ No newline at end of file diff --git a/Tactons Detection/Tactons Detection.vcxproj b/Tactons Detection/Tactons Detection.vcxproj new file mode 100644 index 0000000..fb7a808 --- /dev/null +++ b/Tactons Detection/Tactons Detection.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {EC926972-4F08-4721-A572-B278203C092D} + Qt4VSv1.0 + + + + Application + + + Application + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + AllRules.ruleset + + + AllRules.ruleset + + + $(SolutionDir)$(ConfigurationName) + $(SolutionDir)$(ConfigurationName) + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + TactonPlayer.lib;qtmaind.lib;QtCored4.lib;QtGuid4.lib;%(AdditionalDependencies) + + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) + + + MultiThreadedDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + false + TactonPlayer.lib;qtmain.lib;QtCore4.lib;QtGui4.lib;%(AdditionalDependencies) + + + + + + true + + + true + + + + + + + + + true + + + true + + + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "tactonsdetection.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "tactonsdetection.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." + + + + + + + Document + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + + + + + + + \ No newline at end of file diff --git a/Tactons Detection/main.cpp b/Tactons Detection/main.cpp new file mode 100644 index 0000000..9577311 --- /dev/null +++ b/Tactons Detection/main.cpp @@ -0,0 +1,13 @@ +#include "tactonsdetection.h" +#include + +#include + +int main(int argc, char *argv[]) +{ + srand(time(NULL)); + QApplication a(argc, argv); + TactonsDetection w; + w.show(); + return a.exec(); +} diff --git a/Tactons Detection/tactonsdetection.cpp b/Tactons Detection/tactonsdetection.cpp new file mode 100644 index 0000000..f2bf9e1 --- /dev/null +++ b/Tactons Detection/tactonsdetection.cpp @@ -0,0 +1,23 @@ +#include "tactonsdetection.h" + +TactonsDetection::TactonsDetection(QWidget *parent, Qt::WFlags flags) + : QMainWindow(parent, flags) +{ + setupUi(this); + + this->layout()->setSizeConstraint(QLayout::SetFixedSize); + + QObject::connect(buttonstart, SIGNAL(clicked()), this, SLOT(runBlock())); +} + +TactonsDetection::~TactonsDetection() +{ + +} + +void TactonsDetection::runBlock(void) +{ + this->hide(); + w.init(username->text(), repetitions->value(), step->value(), delay->value(), order->currentText(), gesture->currentText()); + w.show(); +} diff --git a/Tactons Detection/tactonsdetection.h b/Tactons Detection/tactonsdetection.h new file mode 100644 index 0000000..a9d44a0 --- /dev/null +++ b/Tactons Detection/tactonsdetection.h @@ -0,0 +1,24 @@ +#ifndef TACTONSDETECTION_H +#define TACTONSDETECTION_H + +#include +#include "ui_tactonsdetection.h" + +#include "AnswerDetection.h" + +class TactonsDetection : public QMainWindow, Ui::TactonsDetectionClass +{ + Q_OBJECT + +public: + TactonsDetection(QWidget *parent = 0, Qt::WFlags flags = 0); + ~TactonsDetection(); + +private: + AnswerDetection w; + +private slots: + void runBlock(); +}; + +#endif // TACTONSDETECTION_H diff --git a/Tactons Detection/tactonsdetection.ui b/Tactons Detection/tactonsdetection.ui new file mode 100644 index 0000000..9fa3a78 --- /dev/null +++ b/Tactons Detection/tactonsdetection.ui @@ -0,0 +1,154 @@ + + + TactonsDetectionClass + + + + 0 + 0 + 223 + 201 + + + + TactonsDetection + + + + + + + + + + Start experiment + + + + + + + + + + + User: + + + + + + + + + + 1 + + + 50 + + + 1 + + + + + + + Repetitions: + + + + + + + Step: + + + + + + + 1 + + + 30 + + + 1 + + + + + + + + Rest + + + + + + + + + Ascending / Descending + + + + + Descending / Ascending + + + + + + + + 10 + + + 10000 + + + 10 + + + 1000 + + + + + + + Gesture: + + + + + + + Order: + + + + + + + Delay: + + + + + + + + + + + + + + + + diff --git a/Tactons Experiment.sln b/Tactons Experiment.sln index 2f5c058..ad56025 100644 --- a/Tactons Experiment.sln +++ b/Tactons Experiment.sln @@ -5,6 +5,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tactons Experiment", "Tacto EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tactons JND", "Tactons JND\Tactons JND.vcxproj", "{454A6651-24D2-4DBA-A579-FDACD5CAC68C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tactons patterns", "Tactons patterns\Tactons patterns.vcxproj", "{3978B08B-EFB4-443A-9B39-035F6796DDEE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tactons Detection", "Tactons Detection\Tactons Detection.vcxproj", "{EC926972-4F08-4721-A572-B278203C092D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -19,6 +23,14 @@ Global {454A6651-24D2-4DBA-A579-FDACD5CAC68C}.Debug|Win32.Build.0 = Debug|Win32 {454A6651-24D2-4DBA-A579-FDACD5CAC68C}.Release|Win32.ActiveCfg = Release|Win32 {454A6651-24D2-4DBA-A579-FDACD5CAC68C}.Release|Win32.Build.0 = Release|Win32 + {3978B08B-EFB4-443A-9B39-035F6796DDEE}.Debug|Win32.ActiveCfg = Debug|Win32 + {3978B08B-EFB4-443A-9B39-035F6796DDEE}.Debug|Win32.Build.0 = Debug|Win32 + {3978B08B-EFB4-443A-9B39-035F6796DDEE}.Release|Win32.ActiveCfg = Release|Win32 + {3978B08B-EFB4-443A-9B39-035F6796DDEE}.Release|Win32.Build.0 = Release|Win32 + {EC926972-4F08-4721-A572-B278203C092D}.Debug|Win32.ActiveCfg = Debug|Win32 + {EC926972-4F08-4721-A572-B278203C092D}.Debug|Win32.Build.0 = Debug|Win32 + {EC926972-4F08-4721-A572-B278203C092D}.Release|Win32.ActiveCfg = Release|Win32 + {EC926972-4F08-4721-A572-B278203C092D}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tactons Experiment.suo b/Tactons Experiment.suo index 50cfefd..9e29c4b 100644 Binary files a/Tactons Experiment.suo and b/Tactons Experiment.suo differ diff --git a/Tactons Experiment/Frequencies.txt b/Tactons Experiment/Frequencies.txt index b5b045f..f6736ca 100644 --- a/Tactons Experiment/Frequencies.txt +++ b/Tactons Experiment/Frequencies.txt @@ -1,6 +1,6 @@ -1;1111;200;50;100 -1;1111;200;100;100 -1;1111;200;150;100 -1;1111;200;200;100 +1;1111;200;15;100 +1;1111;200;31;100 +1;1111;200;62;100 +1;1111;200;125;100 1;1111;200;250;100 -1;1111;200;300;100 +1;1111;200;500;100 diff --git a/Tactons JND/Amplitudes.txt b/Tactons JND/Amplitudes.txt new file mode 100644 index 0000000..137ce0b --- /dev/null +++ b/Tactons JND/Amplitudes.txt @@ -0,0 +1,5 @@ +100 +80 +60 +40 +20 \ No newline at end of file diff --git a/Tactons JND/Durations.txt b/Tactons JND/Durations.txt new file mode 100644 index 0000000..601fcc4 --- /dev/null +++ b/Tactons JND/Durations.txt @@ -0,0 +1,6 @@ +300 +250 +200 +150 +100 +50 \ No newline at end of file diff --git a/Tactons JND/Experiments.txt b/Tactons JND/Experiments.txt new file mode 100644 index 0000000..7fadde1 --- /dev/null +++ b/Tactons JND/Experiments.txt @@ -0,0 +1,3 @@ +Frequencies +Amplitudes +Durations diff --git a/Tactons JND/Frequencies.txt b/Tactons JND/Frequencies.txt new file mode 100644 index 0000000..c5b431b --- /dev/null +++ b/Tactons JND/Frequencies.txt @@ -0,0 +1 @@ +50 \ No newline at end of file diff --git a/Tactons JND/Gestures.txt b/Tactons JND/Gestures.txt new file mode 100644 index 0000000..9664aa6 --- /dev/null +++ b/Tactons JND/Gestures.txt @@ -0,0 +1,7 @@ +Rest +Arm up +Arm right +Arm left +Arm down +Circle side +Circle front \ No newline at end of file diff --git a/Tactons patterns/AnswerPattern.cpp b/Tactons patterns/AnswerPattern.cpp new file mode 100644 index 0000000..e44ed36 --- /dev/null +++ b/Tactons patterns/AnswerPattern.cpp @@ -0,0 +1,207 @@ +#include "AnswerPattern.h" + +#include + +#include +#include +#include +#include + +#define VIBRATIONDURATION 500 + +AnswerPattern::AnswerPattern(QWidget *parent, Qt::WFlags flags) +: QDialog(parent, flags), _logfile(NULL), _tactonPlayer("COM3"), _current(0) +{ + //init the window + setupUi(this); + this->layout()->setSizeConstraint(QLayout::SetFixedSize); +} + +AnswerPattern::~AnswerPattern() +{ + if (_logfile) + fclose(_logfile); + //reset the wristband + _tactonPlayer.stop(); +} + +void AnswerPattern::init(QString user, int repetitions, QString placement, QString gesture) +{ + _user = user; + _repetitions = repetitions; + _placement = placement; + _gesture = gesture; + + if (placement == "placement1") + { + setPicture(answer1, "placement1pattern0001.png"); + setPicture(answer2, "placement1pattern0011.png"); + setPicture(answer3, "placement1pattern0010.png"); + setPicture(answer4, "placement1pattern1010.png"); + setPicture(answer5, "placement1pattern1000.png"); + setPicture(answer6, "placement1pattern1100.png"); + setPicture(answer7, "placement1pattern0100.png"); + setPicture(answer8, "placement1pattern0101.png"); + setPicture(answer9, "placement1pattern0111.png"); + setPicture(answer10, "placement1pattern0000.png"); + setPicture(answer11, "placement1pattern1011.png"); + setPicture(answer12, "placement1pattern1111.png"); + setPicture(answer13, "placement1pattern1110.png"); + setPicture(answer14, "placement1pattern0110.png"); + setPicture(answer15, "placement1pattern1101.png"); + setPicture(answer16, "placement1pattern1001.png"); + //init buttons + QObject::connect(answer1, SIGNAL(clicked()), this, SLOT(press0001())); + QObject::connect(answer2, SIGNAL(clicked()), this, SLOT(press0011())); + QObject::connect(answer3, SIGNAL(clicked()), this, SLOT(press0010())); + QObject::connect(answer4, SIGNAL(clicked()), this, SLOT(press1010())); + QObject::connect(answer5, SIGNAL(clicked()), this, SLOT(press1000())); + QObject::connect(answer6, SIGNAL(clicked()), this, SLOT(press1100())); + QObject::connect(answer7, SIGNAL(clicked()), this, SLOT(press0100())); + QObject::connect(answer8, SIGNAL(clicked()), this, SLOT(press0101())); + QObject::connect(answer9, SIGNAL(clicked()), this, SLOT(press0111())); + QObject::connect(answer10, SIGNAL(clicked()), this, SLOT(press0000())); + QObject::connect(answer11, SIGNAL(clicked()), this, SLOT(press1011())); + QObject::connect(answer12, SIGNAL(clicked()), this, SLOT(press1111())); + QObject::connect(answer13, SIGNAL(clicked()), this, SLOT(press1110())); + QObject::connect(answer14, SIGNAL(clicked()), this, SLOT(press0110())); + QObject::connect(answer15, SIGNAL(clicked()), this, SLOT(press1101())); + QObject::connect(answer16, SIGNAL(clicked()), this, SLOT(press1001())); + } + else if (placement == "placement2") + { + setPicture(answer1, "placement2pattern0011.png"); + setPicture(answer2, "placement2pattern0010.png"); + setPicture(answer3, "placement2pattern0110.png"); + setPicture(answer4, "placement2pattern0100.png"); + setPicture(answer5, "placement2pattern1100.png"); + setPicture(answer6, "placement2pattern1000.png"); + setPicture(answer7, "placement2pattern1001.png"); + setPicture(answer8, "placement2pattern0001.png"); + setPicture(answer9, "placement2pattern1010.png"); + setPicture(answer10, "placement2pattern0111.png"); + setPicture(answer11, "placement2pattern0000.png"); + setPicture(answer12, "placement2pattern1110.png"); + setPicture(answer13, "placement2pattern0101.png"); + setPicture(answer14, "placement2pattern1101.png"); + setPicture(answer15, "placement2pattern1111.png"); + setPicture(answer16, "placement2pattern1011.png"); + //init buttons + QObject::connect(answer1, SIGNAL(clicked()), this, SLOT(press0011())); + QObject::connect(answer2, SIGNAL(clicked()), this, SLOT(press0010())); + QObject::connect(answer3, SIGNAL(clicked()), this, SLOT(press0110())); + QObject::connect(answer4, SIGNAL(clicked()), this, SLOT(press0100())); + QObject::connect(answer5, SIGNAL(clicked()), this, SLOT(press1100())); + QObject::connect(answer6, SIGNAL(clicked()), this, SLOT(press1000())); + QObject::connect(answer7, SIGNAL(clicked()), this, SLOT(press1001())); + QObject::connect(answer8, SIGNAL(clicked()), this, SLOT(press0001())); + QObject::connect(answer9, SIGNAL(clicked()), this, SLOT(press1010())); + QObject::connect(answer10, SIGNAL(clicked()), this, SLOT(press0111())); + QObject::connect(answer11, SIGNAL(clicked()), this, SLOT(press0000())); + QObject::connect(answer12, SIGNAL(clicked()), this, SLOT(press1110())); + QObject::connect(answer13, SIGNAL(clicked()), this, SLOT(press0101())); + QObject::connect(answer14, SIGNAL(clicked()), this, SLOT(press1101())); + QObject::connect(answer15, SIGNAL(clicked()), this, SLOT(press1111())); + QObject::connect(answer16, SIGNAL(clicked()), this, SLOT(press1011())); + } + + //create log file + QString date = QDate::currentDate().toString("yyyy-MM-dd") + "-" + QTime::currentTime().toString("HH-mm-ss"); + QString logfilename = user + "-" + placement + "-" + gesture + "-" + date; + _logfile = fopen(logfilename.toStdString().c_str(), "w"); + + //generate the block + for (int i = 0 ; i < _repetitions ; i++) + { + QList temp; + //generate the block + for (int j = 1 ; j < 16 ; j++) + { + QString s; + s.setNum(j, 2); + while (s.length() < 4) + s = "0" + s; + temp.push_back(s); + } + //shuffle + for (int j = 0; j < temp.count(); j++) + temp.swap(j, (rand() % (temp.count() - j)) + j); + //add the block to the trial + _trials.append(temp); + } + + toggleButtons(); + QTimer::singleShot(VIBRATIONDURATION, this, SLOT(runTrial())); +} + +void AnswerPattern::runTrial() +{ + Tacton t(_trials.at(_current).toStdString().c_str(), VIBRATIONDURATION, 250, 255); + _tactonPlayer.play(t); + //enable buttons after + QTimer::singleShot(VIBRATIONDURATION, this, SLOT(toggleButtons())); + +} + +void AnswerPattern::toggleButtons() +{ + answer1->setEnabled(!answer1->isEnabled()); + answer2->setEnabled(!answer2->isEnabled()); + answer3->setEnabled(!answer3->isEnabled()); + answer4->setEnabled(!answer4->isEnabled()); + answer5->setEnabled(!answer5->isEnabled()); + answer6->setEnabled(!answer6->isEnabled()); + answer7->setEnabled(!answer7->isEnabled()); + answer8->setEnabled(!answer8->isEnabled()); + answer9->setEnabled(!answer9->isEnabled()); + answer10->setEnabled(!answer10->isEnabled()); + answer11->setEnabled(!answer11->isEnabled()); + answer12->setEnabled(!answer12->isEnabled()); + answer13->setEnabled(!answer13->isEnabled()); + answer14->setEnabled(!answer14->isEnabled()); + answer15->setEnabled(!answer15->isEnabled()); + answer16->setEnabled(!answer16->isEnabled()); +} + +void AnswerPattern::setPicture(QPushButton *button, QString picture) +{ + QIcon icon; + icon.addPixmap(QPixmap(picture), QIcon::Normal, QIcon::Off); + button->setIcon(icon); +} + +void AnswerPattern::log(QString answer) +{ + if (_logfile == NULL) + return; + fprintf(_logfile, "%d,%s,%s\n", _current, _trials.at(_current).toAscii().constData(), answer.toAscii().constData()); +} + +void AnswerPattern::press0000() { setAnswer("0000"); } +void AnswerPattern::press0001() { setAnswer("0001"); } +void AnswerPattern::press0010() { setAnswer("0010"); } +void AnswerPattern::press0011() { setAnswer("0011"); } +void AnswerPattern::press0100() { setAnswer("0100"); } +void AnswerPattern::press0101() { setAnswer("0101"); } +void AnswerPattern::press0110() { setAnswer("0110"); } +void AnswerPattern::press0111() { setAnswer("0111"); } +void AnswerPattern::press1000() { setAnswer("1000"); } +void AnswerPattern::press1001() { setAnswer("1001"); } +void AnswerPattern::press1010() { setAnswer("1010"); } +void AnswerPattern::press1011() { setAnswer("1011"); } +void AnswerPattern::press1100() { setAnswer("1100"); } +void AnswerPattern::press1101() { setAnswer("1101"); } +void AnswerPattern::press1110() { setAnswer("1110"); } +void AnswerPattern::press1111() { setAnswer("1111"); } + +void AnswerPattern::setAnswer(QString answer) +{ + log(answer); + _current++; + + //disable buttons + toggleButtons(); + + if (_current < _trials.count()) + runTrial(); +} \ No newline at end of file diff --git a/Tactons patterns/AnswerPattern.h b/Tactons patterns/AnswerPattern.h new file mode 100644 index 0000000..0c35a49 --- /dev/null +++ b/Tactons patterns/AnswerPattern.h @@ -0,0 +1,53 @@ +#ifndef _ANSWERPATTERN_ +#define _ANSWERPATTERN_ + +#include +#include "ui_AnswerPattern.h" + +#include + +class AnswerPattern : public QDialog, Ui::AnswerPatternClass +{ + Q_OBJECT + +public: + AnswerPattern(QWidget *parent = 0, Qt::WFlags flags = 0); + ~AnswerPattern(); + + void init(QString user, int repetitions, QString placement, QString gesture); + +private: + void setPicture(QPushButton *button, QString picture); + void log(QString answer); + void setAnswer(QString answer); + + FILE *_logfile; + TactonPlayer _tactonPlayer; + QString _user; + int _repetitions; + QString _placement; + QString _gesture; + QList _trials; + int _current; +private slots: + void toggleButtons(); + void runTrial(); + void press0000(); + void press0001(); + void press0010(); + void press0011(); + void press0100(); + void press0101(); + void press0110(); + void press0111(); + void press1000(); + void press1001(); + void press1010(); + void press1011(); + void press1100(); + void press1101(); + void press1110(); + void press1111(); +}; + +#endif diff --git a/Tactons patterns/AnswerPattern.ui b/Tactons patterns/AnswerPattern.ui new file mode 100644 index 0000000..39e580d --- /dev/null +++ b/Tactons patterns/AnswerPattern.ui @@ -0,0 +1,325 @@ + + + AnswerPatternClass + + + + 0 + 0 + 1042 + 589 + + + + Pattern recognition + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + 200 + 100 + + + + + + + + 200 + 100 + + + + + + + + + diff --git a/Tactons patterns/AnswerPatterns.ui b/Tactons patterns/AnswerPatterns.ui new file mode 100644 index 0000000..e376840 --- /dev/null +++ b/Tactons patterns/AnswerPatterns.ui @@ -0,0 +1,51 @@ + + + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + 0 + 21 + 800 + 560 + + + + + + + 0 + 0 + 800 + 21 + + + + + + + 0 + 581 + 800 + 19 + + + + + + + diff --git a/Tactons patterns/Tactons patterns.vcxproj b/Tactons patterns/Tactons patterns.vcxproj new file mode 100644 index 0000000..f379766 --- /dev/null +++ b/Tactons patterns/Tactons patterns.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {3978B08B-EFB4-443A-9B39-035F6796DDEE} + Qt4VSv1.0 + + + + Application + + + Application + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + AllRules.ruleset + + + AllRules.ruleset + + + $(SolutionDir)$(ConfigurationName) + $(SolutionDir)$(ConfigurationName) + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + tactonplayer.lib;qtmaind.lib;QtCored4.lib;QtGuid4.lib;%(AdditionalDependencies) + + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) + + + MultiThreadedDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + false + tactonplayer.lib;qtmain.lib;QtCore4.lib;QtGui4.lib;%(AdditionalDependencies) + + + + + + true + + + true + + + + + + + + + true + + + true + + + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "tactonspatterns.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." "tactonspatterns.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I." "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." "-I." "-I." "-I." + + + + + + + Document + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + + + + + + + \ No newline at end of file diff --git a/Tactons patterns/main.cpp b/Tactons patterns/main.cpp new file mode 100644 index 0000000..4c56932 --- /dev/null +++ b/Tactons patterns/main.cpp @@ -0,0 +1,10 @@ +#include "tactonspatterns.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + Tactonspatterns w; + w.show(); + return a.exec(); +} diff --git a/Tactons patterns/placement1pattern0000.png b/Tactons patterns/placement1pattern0000.png new file mode 100644 index 0000000..11fc9b7 Binary files /dev/null and b/Tactons patterns/placement1pattern0000.png differ diff --git a/Tactons patterns/placement1pattern0001.png b/Tactons patterns/placement1pattern0001.png new file mode 100644 index 0000000..c313cbb Binary files /dev/null and b/Tactons patterns/placement1pattern0001.png differ diff --git a/Tactons patterns/placement1pattern0010.png b/Tactons patterns/placement1pattern0010.png new file mode 100644 index 0000000..9e108cc Binary files /dev/null and b/Tactons patterns/placement1pattern0010.png differ diff --git a/Tactons patterns/placement1pattern0011.png b/Tactons patterns/placement1pattern0011.png new file mode 100644 index 0000000..03c6138 Binary files /dev/null and b/Tactons patterns/placement1pattern0011.png differ diff --git a/Tactons patterns/placement1pattern0100.png b/Tactons patterns/placement1pattern0100.png new file mode 100644 index 0000000..b9f98bc Binary files /dev/null and b/Tactons patterns/placement1pattern0100.png differ diff --git a/Tactons patterns/placement1pattern0101.png b/Tactons patterns/placement1pattern0101.png new file mode 100644 index 0000000..f3aa749 Binary files /dev/null and b/Tactons patterns/placement1pattern0101.png differ diff --git a/Tactons patterns/placement1pattern0110.png b/Tactons patterns/placement1pattern0110.png new file mode 100644 index 0000000..f789564 Binary files /dev/null and b/Tactons patterns/placement1pattern0110.png differ diff --git a/Tactons patterns/placement1pattern0111.png b/Tactons patterns/placement1pattern0111.png new file mode 100644 index 0000000..cbaedf3 Binary files /dev/null and b/Tactons patterns/placement1pattern0111.png differ diff --git a/Tactons patterns/placement1pattern1000.png b/Tactons patterns/placement1pattern1000.png new file mode 100644 index 0000000..7b24eee Binary files /dev/null and b/Tactons patterns/placement1pattern1000.png differ diff --git a/Tactons patterns/placement1pattern1001.png b/Tactons patterns/placement1pattern1001.png new file mode 100644 index 0000000..1c2f9a4 Binary files /dev/null and b/Tactons patterns/placement1pattern1001.png differ diff --git a/Tactons patterns/placement1pattern1010.png b/Tactons patterns/placement1pattern1010.png new file mode 100644 index 0000000..1b3b477 Binary files /dev/null and b/Tactons patterns/placement1pattern1010.png differ diff --git a/Tactons patterns/placement1pattern1011.png b/Tactons patterns/placement1pattern1011.png new file mode 100644 index 0000000..376d927 Binary files /dev/null and b/Tactons patterns/placement1pattern1011.png differ diff --git a/Tactons patterns/placement1pattern1100.png b/Tactons patterns/placement1pattern1100.png new file mode 100644 index 0000000..1912df6 Binary files /dev/null and b/Tactons patterns/placement1pattern1100.png differ diff --git a/Tactons patterns/placement1pattern1101.png b/Tactons patterns/placement1pattern1101.png new file mode 100644 index 0000000..f88427d Binary files /dev/null and b/Tactons patterns/placement1pattern1101.png differ diff --git a/Tactons patterns/placement1pattern1110.png b/Tactons patterns/placement1pattern1110.png new file mode 100644 index 0000000..e3721f4 Binary files /dev/null and b/Tactons patterns/placement1pattern1110.png differ diff --git a/Tactons patterns/placement1pattern1111.png b/Tactons patterns/placement1pattern1111.png new file mode 100644 index 0000000..0532b20 Binary files /dev/null and b/Tactons patterns/placement1pattern1111.png differ diff --git a/Tactons patterns/placement2pattern0000.png b/Tactons patterns/placement2pattern0000.png new file mode 100644 index 0000000..d609021 Binary files /dev/null and b/Tactons patterns/placement2pattern0000.png differ diff --git a/Tactons patterns/placement2pattern0001.png b/Tactons patterns/placement2pattern0001.png new file mode 100644 index 0000000..d491770 Binary files /dev/null and b/Tactons patterns/placement2pattern0001.png differ diff --git a/Tactons patterns/placement2pattern0010.png b/Tactons patterns/placement2pattern0010.png new file mode 100644 index 0000000..cd790dc Binary files /dev/null and b/Tactons patterns/placement2pattern0010.png differ diff --git a/Tactons patterns/placement2pattern0011.png b/Tactons patterns/placement2pattern0011.png new file mode 100644 index 0000000..925478b Binary files /dev/null and b/Tactons patterns/placement2pattern0011.png differ diff --git a/Tactons patterns/placement2pattern0100.png b/Tactons patterns/placement2pattern0100.png new file mode 100644 index 0000000..54d7ea1 Binary files /dev/null and b/Tactons patterns/placement2pattern0100.png differ diff --git a/Tactons patterns/placement2pattern0101.png b/Tactons patterns/placement2pattern0101.png new file mode 100644 index 0000000..b4457ec Binary files /dev/null and b/Tactons patterns/placement2pattern0101.png differ diff --git a/Tactons patterns/placement2pattern0110.png b/Tactons patterns/placement2pattern0110.png new file mode 100644 index 0000000..1cd000a Binary files /dev/null and b/Tactons patterns/placement2pattern0110.png differ diff --git a/Tactons patterns/placement2pattern0111.png b/Tactons patterns/placement2pattern0111.png new file mode 100644 index 0000000..861ec8e Binary files /dev/null and b/Tactons patterns/placement2pattern0111.png differ diff --git a/Tactons patterns/placement2pattern1000.png b/Tactons patterns/placement2pattern1000.png new file mode 100644 index 0000000..1693b3f Binary files /dev/null and b/Tactons patterns/placement2pattern1000.png differ diff --git a/Tactons patterns/placement2pattern1001.png b/Tactons patterns/placement2pattern1001.png new file mode 100644 index 0000000..aad85a0 Binary files /dev/null and b/Tactons patterns/placement2pattern1001.png differ diff --git a/Tactons patterns/placement2pattern1010.png b/Tactons patterns/placement2pattern1010.png new file mode 100644 index 0000000..a81d310 Binary files /dev/null and b/Tactons patterns/placement2pattern1010.png differ diff --git a/Tactons patterns/placement2pattern1011.png b/Tactons patterns/placement2pattern1011.png new file mode 100644 index 0000000..fa26912 Binary files /dev/null and b/Tactons patterns/placement2pattern1011.png differ diff --git a/Tactons patterns/placement2pattern1100.png b/Tactons patterns/placement2pattern1100.png new file mode 100644 index 0000000..392b862 Binary files /dev/null and b/Tactons patterns/placement2pattern1100.png differ diff --git a/Tactons patterns/placement2pattern1101.png b/Tactons patterns/placement2pattern1101.png new file mode 100644 index 0000000..f9874b5 Binary files /dev/null and b/Tactons patterns/placement2pattern1101.png differ diff --git a/Tactons patterns/placement2pattern1110.png b/Tactons patterns/placement2pattern1110.png new file mode 100644 index 0000000..86dc6e0 Binary files /dev/null and b/Tactons patterns/placement2pattern1110.png differ diff --git a/Tactons patterns/placement2pattern1111.png b/Tactons patterns/placement2pattern1111.png new file mode 100644 index 0000000..df5a87e Binary files /dev/null and b/Tactons patterns/placement2pattern1111.png differ diff --git a/Tactons patterns/tactonspatterns.cpp b/Tactons patterns/tactonspatterns.cpp new file mode 100644 index 0000000..3f0db81 --- /dev/null +++ b/Tactons patterns/tactonspatterns.cpp @@ -0,0 +1,24 @@ +#include "tactonspatterns.h" + +Tactonspatterns::Tactonspatterns(QWidget *parent, Qt::WFlags flags) + : QMainWindow(parent, flags) +{ + setupUi(this); + + this->layout()->setSizeConstraint(QLayout::SetFixedSize); + + QObject::connect(buttonstart, SIGNAL(clicked()), this, SLOT(runBlock())); +} + +Tactonspatterns::~Tactonspatterns() +{ + +} + +void Tactonspatterns::runBlock(void) +{ + this->hide(); + w.init(username->text(), repetitions->value(), placement->currentText(), gesture->currentText()); + w.show(); +} + diff --git a/Tactons patterns/tactonspatterns.h b/Tactons patterns/tactonspatterns.h new file mode 100644 index 0000000..ce249c0 --- /dev/null +++ b/Tactons patterns/tactonspatterns.h @@ -0,0 +1,24 @@ +#ifndef TACTONSPATTERNS_H +#define TACTONSPATTERNS_H + +#include +#include "ui_tactonspatterns.h" + +#include "AnswerPattern.h" + +class Tactonspatterns : public QMainWindow, Ui::TactonspatternsClass +{ + Q_OBJECT + +public: + Tactonspatterns(QWidget *parent = 0, Qt::WFlags flags = 0); + ~Tactonspatterns(); + +private: + AnswerPattern w; + +private slots: + void runBlock(); +}; + +#endif // TACTONSPATTERNS_H diff --git a/Tactons patterns/tactonspatterns.ui b/Tactons patterns/tactonspatterns.ui new file mode 100644 index 0000000..4c11c36 --- /dev/null +++ b/Tactons patterns/tactonspatterns.ui @@ -0,0 +1,107 @@ + + + TactonspatternsClass + + + + 0 + 0 + 234 + 188 + + + + Tactonspatterns + + + + + + + + + User: + + + + + + + + + + Repetitions: + + + + + + + 1 + + + 100 + + + 1 + + + + + + + Placement: + + + + + + + + placement1 + + + + + placement2 + + + + + + + + Gesture: + + + + + + + + Rest + + + + + + + + + + + + + Start experiment + + + + + + + + + + + +