From 3631ad1eb07de99931a8177006b5764b9582f121 Mon Sep 17 00:00:00 2001 From: Friedrich Kretschmer Date: Fri, 17 Nov 2017 14:46:40 +0100 Subject: [PATCH] Reworked stopping of state machine (addition to older fix) --- StateMachineController.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/StateMachineController.cpp b/StateMachineController.cpp index ee3177f..6da1d3a 100644 --- a/StateMachineController.cpp +++ b/StateMachineController.cpp @@ -122,10 +122,11 @@ StateMachineController::~StateMachineController() void StateMachineController::startStateMachine(audioGameSettings settings) { - nidaq->DAQmxInitializeInterface(); + if(stateMachine->isRunning()) //this should not happen + stopStateMachine(); + //stateMachine->stop(); - if(stateMachine->isRunning()) - stateMachine->stop(); + nidaq->DAQmxInitializeInterface(); this->settings = settings; trialsCurrent = 1; // set index for first trial (1-based) @@ -147,6 +148,7 @@ void StateMachineController::pauseStateMachine() void StateMachineController::stopStateMachine() { + qDebug()<<"StateMachineController:stopStateMachine()"; timerDialog->removeTimer(); mainTimer->stop(); stateMachine->stop();