From: Thomas Pietrzak Date: Tue, 4 Sep 2012 14:26:57 +0000 (+0000) Subject: JND experiments. Location JND ready. X-Git-Url: https://git.thomaspietrzak.com/?a=commitdiff_plain;h=e3da4b48ad071dda2fd22bdaff36f22d465f6a54;p=tactonexperiment.git JND experiments. Location JND ready. git-svn-id: svn+ssh://thomaspietrzak.com/var/svn/rep@94 47cf9a05-e0a8-4ed5-9e9b-101a649bc004 --- diff --git a/DeltaTimeJND/DeltaTimeJND.cpp b/DeltaTimeJND/DeltaTimeJND.cpp new file mode 100644 index 0000000..703e619 --- /dev/null +++ b/DeltaTimeJND/DeltaTimeJND.cpp @@ -0,0 +1,12 @@ +#include "DeltaTimeJND.h" + +DeltaTimeJND::DeltaTimeJND(QWidget *parent, Qt::WFlags flags) + : QMainWindow(parent, flags) +{ + ui.setupUi(this); +} + +DeltaTimeJND::~DeltaTimeJND() +{ + +} diff --git a/DeltaTimeJND/DeltaTimeJND.h b/DeltaTimeJND/DeltaTimeJND.h new file mode 100644 index 0000000..9ca7248 --- /dev/null +++ b/DeltaTimeJND/DeltaTimeJND.h @@ -0,0 +1,19 @@ +#ifndef DELTATIMEJND_H +#define DELTATIMEJND_H + +#include +#include "ui_deltatimejnd.h" + +class DeltaTimeJND : public QMainWindow +{ + Q_OBJECT + +public: + DeltaTimeJND(QWidget *parent = 0, Qt::WFlags flags = 0); + ~DeltaTimeJND(); + +private: + Ui::DeltaTimeJNDClass ui; +}; + +#endif // DELTATIMEJND_H diff --git a/DeltaTimeJND/DeltaTimeJND.vcxproj b/DeltaTimeJND/DeltaTimeJND.vcxproj new file mode 100644 index 0000000..4830aeb --- /dev/null +++ b/DeltaTimeJND/DeltaTimeJND.vcxproj @@ -0,0 +1,50 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {2AEA0C75-E45A-4992-9DB3-20CA8169F47F} + Qt4VS + + + + Application + + + Application + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + AllRules.ruleset + + + AllRules.ruleset + + + + + + + + + + + \ No newline at end of file diff --git a/DeltaTimeJND/deltatimejnd.qrc b/DeltaTimeJND/deltatimejnd.qrc new file mode 100644 index 0000000..ae0ac9b --- /dev/null +++ b/DeltaTimeJND/deltatimejnd.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/DeltaTimeJND/deltatimejnd.ui b/DeltaTimeJND/deltatimejnd.ui new file mode 100644 index 0000000..4cfb199 --- /dev/null +++ b/DeltaTimeJND/deltatimejnd.ui @@ -0,0 +1,29 @@ + + DeltaTimeJNDClass + + + DeltaTimeJNDClass + + + + 0 + 0 + 600 + 400 + + + + DeltaTimeJND + + + + + + + + + + + + + diff --git a/DeltaTimeJND/main.cpp b/DeltaTimeJND/main.cpp new file mode 100644 index 0000000..778db7b --- /dev/null +++ b/DeltaTimeJND/main.cpp @@ -0,0 +1,10 @@ +#include "DeltaTimeJND.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + DeltaTimeJND w; + w.show(); + return a.exec(); +} diff --git a/LocationsJND/AnswerLocationJND.cpp b/LocationsJND/AnswerLocationJND.cpp new file mode 100644 index 0000000..1d46c18 --- /dev/null +++ b/LocationsJND/AnswerLocationJND.cpp @@ -0,0 +1,230 @@ +#include "AnswerLocationJND.h" + +#include +#include +#include +#include +#include + +AnswerLocationJND::AnswerLocationJND(QWidget *parent, Qt::WFlags flags) +:QMainWindow(parent, flags), +_logfile(NULL), _tactonPlayer("COM4"), _goodanswer(-1) +{ + //init the window + setupUi(this); +// this->layout()->setSizeConstraint(QLayout::SetFixedSize); + + for (int i = 0 ; i < 4 ; i++) + { + _currenttest[i] = 1.0; + _jnd[i] = 0.0; + } + + //init buttons + QObject::connect(_first, SIGNAL(clicked()), this, SLOT(answer())); + QObject::connect(_second, SIGNAL(clicked()), this, SLOT(answer())); +} + +AnswerLocationJND::~AnswerLocationJND() +{ + if (_logfile) + fclose(_logfile); + //reset the wristband + _tactonPlayer.stop(); +} + +void AnswerLocationJND::init(QString user, QString vibratortest, int reversals, int frequency, int duration, float deltadown) +{ + if( vibratortest == "Top") + _vibratortest = 1; + else if( vibratortest == "Down") + _vibratortest = 3; + else if( vibratortest == "Left") + _vibratortest = 2; + else + _vibratortest = 0; + + if (_vibratortest == 0) + _currentside = 1; + else + _currentside = 0; + + _reversals = reversals; + _duration = duration; + _deltadown = deltadown; + + //create log file + QString date = QDate::currentDate().toString("yyyy-MM-dd") + "-" + QTime::currentTime().toString("HH-mm-ss"); + QString logfilename = user + "-" + vibratortest + "-" + date + "-answers"; + if (_logfile = fopen(logfilename.toStdString().c_str(), "w")) + fprintf(_logfile, "TestSide,Side,Value,IntValue,GoodAnswer,UserAnswer,Error\n"); + logfilename = user + "-" + vibratortest + "-" + date + "-jnd"; + if (_logfile2 = fopen(logfilename.toStdString().c_str(), "w")) + fprintf(_logfile2, "TestSide,Side,JND\n"); + + for (int i = 0 ; i < 4 ; i++) + { + _currenttest[i] = 1.0; + _sidefinished[i] = false; + } + _sidefinished[_vibratortest] = true; + + unsigned char amp[] = {0, 0, 0, 0}; + _tactonPlayer.setAmplitudes(4, amp); + _tactonPlayer.setFrequency(frequency); + + runTrial(); +} + +void AnswerLocationJND::playTest() +{ + unsigned char amplitudes[4] = {0, 0, 0, 0}; + amplitudes[_vibratortest] = 255; + + _tactonPlayer.setAmplitudes(4, amplitudes); + + QTimer::singleShot(_duration, this, SLOT(stop())); +} + +void AnswerLocationJND::playOther() +{ + unsigned char amplitudes[4] = {0, 0, 0, 0}; + amplitudes[_currentside] = _currenttest[_currentside] * 255; + + _tactonPlayer.setAmplitudes(4, amplitudes); + + QTimer::singleShot(_duration, this, SLOT(stop())); +} + +void AnswerLocationJND::stop() +{ + unsigned char amp[] = {0, 0, 0, 0}; + _tactonPlayer.setAmplitudes(4, amp); +} + +void AnswerLocationJND::answer() +{ + QPushButton *button = (QPushButton *)sender(); + int rep; + if (button->objectName() == "_first") + rep = 0; + else if (button->objectName() == "_second") + rep = 1; + + log(rep); + + static int nb[4] = {0, 0, 0, 0}, rev[4] = {0, 0, 0, 0}; + + static bool newblock[4] = {true, true, true, true}; + static bool lastval[4]; + bool val = rep == _goodanswer; + + //reversal + if (!newblock[_currentside] && val != lastval[_currentside]) + { + rev[_currentside]++; + _jnd[_currentside] += _currenttest[_currentside] / _reversals; + + //if enough reversals the side is done + if (rev[_currentside] >= _reversals) + { + log2(); + _sidefinished[_currentside] = true; + } + //new reversal, but side not finished + else + { + //good answer: reduce the gap + if (val) + { + _currenttest[_currentside] -= _deltadown; + if (_currenttest[_currentside] < 0.0) + _currenttest[_currentside] = 0.0; + } + //wrong answer: increase the gap + else + { + _currenttest[_currentside] += _deltadown; + if (_currenttest[_currentside] > 1.0) + _currenttest[_currentside] = 1.0; + } + } + } + //no reversal + else + { + newblock[_currentside] = false; + //good answer: reduce the gap + if (val) + { + _currenttest[_currentside] -= _deltadown; + if (_currenttest[_currentside] < 0.0) + _currenttest[_currentside] = 0.0; + } + //wrong answer: increase the gap + else + { + _currenttest[_currentside] += _deltadown; + if (_currenttest[_currentside] > 1.0) + _currenttest[_currentside] = 1.0; + } + } + lastval[_currentside] = val; + + bool finished = true; + //search for the next side + for (int i = 0 ; i < 4 ; i++) + { + _currentside = (_currentside + 1) % 4; + if (!_sidefinished[_currentside]) + { + finished = false; + break; + } + } + + if (finished) + { + _first->setEnabled(false); + _second->setEnabled(false); + _label->setText("Finished!"); + return; + } + + runTrial(); +} + +void AnswerLocationJND::log(int answer) const +{ + if (_logfile == NULL) + return; + fprintf(_logfile, "%d,%d,%0.2f,%d,%d,%d,%d\n", _vibratortest, _currentside, _currenttest[_currentside], (unsigned char)(_currenttest[_currentside] * 255), _goodanswer, answer, _goodanswer == answer); +} + +void AnswerLocationJND::log2() const +{ + if (_logfile2 == NULL) + return; + fprintf(_logfile2, "%d,%d,%0.2f\n", _vibratortest, _currentside, _jnd[_currentside]); +} + +void AnswerLocationJND::runTrial() +{ + _goodanswer = rand() % 2; + + if (_goodanswer == 0) + { + QTimer::singleShot(500, this, SLOT(playOther())); + QTimer::singleShot(1500 + _duration, this, SLOT(playTest())); + } + else + { + QTimer::singleShot(500, this, SLOT(playTest())); + QTimer::singleShot(1500 + _duration, this, SLOT(playOther())); + } +} + +unsigned int AnswerLocationJND::testValue(unsigned int value, double db) const +{ + return static_cast(value / pow(10.0, db / 20.0)); +} \ No newline at end of file diff --git a/LocationsJND/AnswerLocationJND.h b/LocationsJND/AnswerLocationJND.h new file mode 100644 index 0000000..fd153eb --- /dev/null +++ b/LocationsJND/AnswerLocationJND.h @@ -0,0 +1,62 @@ +#ifndef _AnswerLocationJND_ +#define _AnswerLocationJND_ + +#include +#include + +#include +#include "ui_AnswerLocationJND.h" + + +class AnswerLocationJND : public QMainWindow, Ui::AnswerWindow +{ + Q_OBJECT + +public: + AnswerLocationJND(QWidget *parent = 0, Qt::WFlags flags = 0); + ~AnswerLocationJND(); + + void init(QString user, QString vibratortest, int reversals, int frequency, int duration, float deltadown); + + void setAnswer(bool same); + +private: + //log the answers + void log(int answer) const; + //log the JND values + void log2() const; + void runTrial(); + void runBlock(); + unsigned int testValue(unsigned int value, double db) const; + + FILE *_logfile, *_logfile2; + TactonPlayer _tactonPlayer; + + //parameters + int _vibratortest; + int _reversals; + int _duration; + double _deltadown; + + //exp status + int _goodanswer; + //current value for each side + double _currenttest[4]; + //which sides are finished? + bool _sidefinished[4]; + //id of the test vibrator + int _testid; + //id of the side currently being tested + int _currentside; + + //results + double _jnd[4]; + +private slots: + void playTest(); + void playOther(); + void stop(); + void answer(); +}; + +#endif diff --git a/LocationsJND/AnswerLocationJND.ui b/LocationsJND/AnswerLocationJND.ui new file mode 100644 index 0000000..f553408 --- /dev/null +++ b/LocationsJND/AnswerLocationJND.ui @@ -0,0 +1,78 @@ + + + AnswerWindow + + + + 0 + 0 + 491 + 230 + + + + Experiment + + + + + + + + 20 + + + + Quelle vibration est la plus forte ? + + + Qt::AlignCenter + + + + + + + + + + 0 + 100 + + + + + 20 + + + + Première + + + + + + + + 0 + 100 + + + + + 20 + + + + Seconde + + + + + + + + + + + diff --git a/LocationsJND/LocationsJND.vcxproj b/LocationsJND/LocationsJND.vcxproj new file mode 100644 index 0000000..e2503e6 --- /dev/null +++ b/LocationsJND/LocationsJND.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {9B8D15C2-0F04-4BCE-A3A4-211FCAB1C503} + Qt4VSv1.0 + + + + Application + + + Application + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + AllRules.ruleset + + + AllRules.ruleset + + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + false + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + TactonPlayerd.lib;qtmaind.lib;QtCored4.lib;QtGuid4.lib;%(AdditionalDependencies) + + + + + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(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 locationsjnd.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing locationsjnd.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" + + + + + 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 AnswerLocationJND.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing AnswerLocationJND.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" + + + + + + + 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/LocationsJND/locationsjnd.cpp b/LocationsJND/locationsjnd.cpp new file mode 100644 index 0000000..4c76284 --- /dev/null +++ b/LocationsJND/locationsjnd.cpp @@ -0,0 +1,21 @@ +#include "locationsjnd.h" + +LocationsJND::LocationsJND(QWidget *parent, Qt::WFlags flags) +: QMainWindow(parent, flags), _w() +{ + setupUi(this); + + connect(_start, SIGNAL(pressed()), this, SLOT(startExperiment())); +} + +LocationsJND::~LocationsJND() +{ + +} + +void LocationsJND::startExperiment() +{ + _w.init(_user->text(), _v0->currentText(), _reversals->value(), _frequency->value(), _duration->value(), _deltadown->value()); + _w.show(); + this->hide(); +} diff --git a/LocationsJND/locationsjnd.h b/LocationsJND/locationsjnd.h new file mode 100644 index 0000000..f0c8b3c --- /dev/null +++ b/LocationsJND/locationsjnd.h @@ -0,0 +1,24 @@ +#ifndef LOCATIONSJND_H +#define LOCATIONSJND_H + +#include +#include "ui_locationsjnd.h" + +#include "AnswerLocationJND.h" + +class LocationsJND : public QMainWindow, Ui::LocationsJNDClass +{ + Q_OBJECT + + public: + LocationsJND(QWidget *parent = 0, Qt::WFlags flags = 0); + ~LocationsJND(); + + private slots: + void startExperiment(); + + private: + AnswerLocationJND _w; +}; + +#endif // LOCATIONSJND_H diff --git a/LocationsJND/locationsjnd.qrc b/LocationsJND/locationsjnd.qrc new file mode 100644 index 0000000..df71d03 --- /dev/null +++ b/LocationsJND/locationsjnd.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/LocationsJND/locationsjnd.ui b/LocationsJND/locationsjnd.ui new file mode 100644 index 0000000..560b550 --- /dev/null +++ b/LocationsJND/locationsjnd.ui @@ -0,0 +1,161 @@ + + + LocationsJNDClass + + + + 0 + 0 + 191 + 199 + + + + LocationsJND + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + User + + + + + + + + + + Vibrator test + + + + + + + + Down + + + + + Top + + + + + Left + + + + + Right + + + + + + + + Frequency + + + + + + + 1 + + + 500 + + + 300 + + + + + + + Duration + + + + + + + 1 + + + 10000 + + + 100 + + + 200 + + + + + + + Delta down + + + + + + + 1.000000000000000 + + + 0.010000000000000 + + + 0.050000000000000 + + + + + + + Reversals + + + + + + + 100 + + + 8 + + + + + + + + + Start + + + + + + + + + + + + diff --git a/LocationsJND/main.cpp b/LocationsJND/main.cpp new file mode 100644 index 0000000..33b643d --- /dev/null +++ b/LocationsJND/main.cpp @@ -0,0 +1,10 @@ +#include "locationsjnd.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + LocationsJND w; + w.show(); + return a.exec(); +} diff --git a/Tactons Experiment.sdf b/Tactons Experiment.sdf index f82932c..1bd03a9 100644 Binary files a/Tactons Experiment.sdf and b/Tactons Experiment.sdf differ diff --git a/Tactons Experiment.sln b/Tactons Experiment.sln index ad56025..ce529ed 100644 --- a/Tactons Experiment.sln +++ b/Tactons Experiment.sln @@ -9,6 +9,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tactons patterns", "Tactons EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tactons Detection", "Tactons Detection\Tactons Detection.vcxproj", "{EC926972-4F08-4721-A572-B278203C092D}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LocationsJND", "LocationsJND\LocationsJND.vcxproj", "{9B8D15C2-0F04-4BCE-A3A4-211FCAB1C503}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -31,6 +33,10 @@ Global {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 + {9B8D15C2-0F04-4BCE-A3A4-211FCAB1C503}.Debug|Win32.ActiveCfg = Debug|Win32 + {9B8D15C2-0F04-4BCE-A3A4-211FCAB1C503}.Debug|Win32.Build.0 = Debug|Win32 + {9B8D15C2-0F04-4BCE-A3A4-211FCAB1C503}.Release|Win32.ActiveCfg = Release|Win32 + {9B8D15C2-0F04-4BCE-A3A4-211FCAB1C503}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tactons Experiment.suo b/Tactons Experiment.suo index 9e29c4b..4086475 100644 Binary files a/Tactons Experiment.suo and b/Tactons Experiment.suo differ diff --git a/Tactons JND/Tactons JND.vcxproj b/Tactons JND/Tactons JND.vcxproj index 8fb9f8c..1a59486 100644 --- a/Tactons JND/Tactons JND.vcxproj +++ b/Tactons JND/Tactons JND.vcxproj @@ -44,7 +44,7 @@ - UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_CORE_LIB;QT_GUI_LIB;QT_DLL;%(PreprocessorDefinitions) .\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) Disabled ProgramDatabase @@ -62,7 +62,7 @@ - UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;%(PreprocessorDefinitions) + UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_DLL;%(PreprocessorDefinitions) .\GeneratedFiles;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\qtmain;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;.\;%(AdditionalIncludeDirectories) @@ -105,11 +105,11 @@ $(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." "tactonsjnd.h" -o ".\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 -DQT_DLL "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." $(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." "tactonsjnd.h" -o ".\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 -DQT_DLL "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." @@ -130,11 +130,11 @@ $(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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_DLL "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-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." + "$(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 -DQT_DLL "-I.\GeneratedFiles" "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\qtmain" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I." @@ -170,7 +170,7 @@ - + \ No newline at end of file diff --git a/Tactons JND/answer3AFC.cpp b/Tactons JND/answer3AFC.cpp index 13f7cda..b441e96 100644 --- a/Tactons JND/answer3AFC.cpp +++ b/Tactons JND/answer3AFC.cpp @@ -8,7 +8,7 @@ Answer3AFC::Answer3AFC(QWidget *parent, Qt::WFlags flags) :QDialog(parent, flags), -_logfile(NULL), _tactonPlayer("COM3"), _defaulttacton(0x0f, 200, 250, 0xff), +_logfile(NULL), _tactonPlayer("COM4"), _defaulttacton(0x0f, 200, 250, 0xff), _currenttest(0.0), _goodanswer(-1), _block(0) { //init the window @@ -135,12 +135,10 @@ void Answer3AFC::answer() { QPushButton *button = (QPushButton *)sender(); int rep; - if (button->objectName() == "answer1") + if (button->objectName() == "_first") rep = 0; - else if (button->objectName() == "answer2") + else if (button->objectName() == "_second") rep = 1; - else if (button->objectName() == "answer3") - rep = 2; log(rep); _tplayed[0] = _tplayed[1] = _tplayed[2] = 0;