diff --git a/Mainwindow.cpp b/Mainwindow.cpp index b921173..531227b 100644 --- a/Mainwindow.cpp +++ b/Mainwindow.cpp @@ -7,7 +7,6 @@ MainWindow::MainWindow(QWidget *parent) : ui(new Ui::MainWindow) { - ui->setupUi(this); /*Load defaults from settings*/ @@ -52,7 +51,6 @@ MainWindow::~MainWindow() delete ui; } - void MainWindow::on_pushButton_Run_clicked() { ui->pushButton_Run->setDisabled(true); @@ -115,19 +113,14 @@ void MainWindow::on_pushButton_Stop_clicked() ui->pushButton_Run->setDisabled(false); ui->pushButton_Pause->setChecked(false); ui->pushButton_Pause->setText("Pause"); - } - - void MainWindow::on_pushButton_selectOutputFolder_clicked() { - selectedDirectory = QFileDialog::getExistingDirectory(this, tr("Select Directory"), appSettings.value(DEFAULT_DIR_KEY).toString(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - if (!selectedDirectory.isEmpty()) { QDir currentDir; // remember this directory next time the selector is opened @@ -136,8 +129,6 @@ void MainWindow::on_pushButton_selectOutputFolder_clicked() ui->lineEdit_outputFolder->setText(selectedDirectory); } - - } void MainWindow::on_checkBox_autoFilename_clicked(bool checked) diff --git a/Mainwindow.h b/Mainwindow.h index e42e693..b0f55c5 100644 --- a/Mainwindow.h +++ b/Mainwindow.h @@ -20,9 +20,6 @@ class MainWindow : public QMainWindow { Q_OBJECT - // the state property that reflects whether the traffic light is currently paused - //Q_PROPERTY(bool paused READ paused WRITE setPaused NOTIFY pausedChanged) - public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); @@ -53,9 +50,7 @@ private slots: void updateIti(); const double userReaction = 30; //sec - // default directory const QString DEFAULT_DIR_KEY = "/home"; - // Application settings to store last used directory for select dialog QSettings appSettings; TimerDialog *timerDialog; diff --git a/StateMachineController.cpp b/StateMachineController.cpp index 26232eb..2ae4496 100644 --- a/StateMachineController.cpp +++ b/StateMachineController.cpp @@ -209,7 +209,6 @@ void StateMachineController::onStateSoundEntered() emit(writeToLogFile("EXIT",0,0,timeString)); emit(closeLogFile()); } - } void StateMachineController::onStatePauseEntered() diff --git a/StateMachineController.h b/StateMachineController.h index 5bc3fef..64baeb9 100644 --- a/StateMachineController.h +++ b/StateMachineController.h @@ -8,7 +8,6 @@ #include #include #include -#include #include #include @@ -18,10 +17,8 @@ #include "TimerDialog.h" #include "NIDAQmxInterface.h" #include "TDTInterface.h" -#include "LogFileWriter.h" - -//#include "TDTInterface.h" #include "rpcoxlib.h" +#include "LogFileWriter.h" class StateMachineController : public QObject { @@ -36,26 +33,22 @@ class StateMachineController : public QObject void stopStateMachine(); private: - // state machine - QStateMachine *stateMachine; + QStateMachine *stateMachine; /* state machine */ QState *state_preDelay; QState *state_iti; QState *state_userReaction; QState *state_acquisitionBaseline; QState *state_sound; - // the timer that triggers the state changes - QTimer *mainTimer; + QTimer *mainTimer; /*the timer that triggers the state changes*/ TimerDialog *timerDialog; - - //RPCOXLib::RPcoX* rp; NIDAQmxInterface* nidaq; TDTInterface* tdt; QThread* logFileThread; LogFileWriter* logFileWriter; int trialsTotal = -1; - int trialsCurrent = -1; // is gonna be 1-based, so first trial has index 1 + int trialsCurrent = -1; /* is gonna be 1-based, so first trial has index 1 */ private slots: void onStatePreDelayEntered(); @@ -75,8 +68,6 @@ private slots: void openLogFile(QString fileName); void closeLogFile(); void writeToLogFile(QString text, uint id, uint counter, QString stringTime); - - }; #endif // STATEMACHINECONTROLLER_H diff --git a/TDTInterface.h b/TDTInterface.h index 4fb1efc..70caed8 100644 --- a/TDTInterface.h +++ b/TDTInterface.h @@ -13,13 +13,11 @@ class TDTInterface static const int TDT_STATUS_CIRCUIT_LOADED = 0x02; static const int TDT_STATUS_CIRCUIT_RUNNING = 0x04; - ///* funciton prototypes */ + /* funciton prototypes */ void initializeInterface(); void loadRCXCircuit(QString fileName); void destroyInterface(); - /* global variables */ - //RPCOXLib::RPcoX* rp; RPCOXLib::RPcoX rp; HRESULT hr; long int tdt_status;