From c5c13d8d7bf86a53751362540178593a4cebcf1f Mon Sep 17 00:00:00 2001 From: jsiegle <jsiegle@mit.edu> Date: Mon, 13 Feb 2012 12:09:17 -0500 Subject: [PATCH] Fixed bug in SourceNode stopping acquisition There was a minor bug in the SourceNode code, which caused it to delay restarting acquisition for about 1 second after acquisition was stopped. Now acquisition from the Intan Board can be restarted almost immediately after it finishes. --- Builds/Linux/build/savedState.xml | 4 +++- Builds/Linux/build/windowState.xml | 2 +- Source/Processors/DataThreads/IntanThread.cpp | 2 ++ Source/Processors/FilterNode.cpp | 2 +- Source/Processors/SourceNode.cpp | 12 +++++++----- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Builds/Linux/build/savedState.xml b/Builds/Linux/build/savedState.xml index 7d087eb0c..a7a54b2f6 100644 --- a/Builds/Linux/build/savedState.xml +++ b/Builds/Linux/build/savedState.xml @@ -3,6 +3,8 @@ <PROCESSORGRAPH> <SIGNALCHAIN> <PROCESSOR name="Sources/Intan Demo Board" insertionPoint="0"/> - <PROCESSOR name="Sinks/LFP Viewer" insertionPoint="1"/> + <PROCESSOR name="Filters/Bandpass Filter" insertionPoint="1"/> + <PROCESSOR name="Filters/Bandpass Filter" insertionPoint="2"/> + <PROCESSOR name="Sinks/LFP Viewer" insertionPoint="3"/> </SIGNALCHAIN> </PROCESSORGRAPH> diff --git a/Builds/Linux/build/windowState.xml b/Builds/Linux/build/windowState.xml index 3488bf5bf..0172cab1b 100644 --- a/Builds/Linux/build/windowState.xml +++ b/Builds/Linux/build/windowState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <MAINWINDOW> - <BOUNDS x="1739" y="52" w="1181" h="831" fullscreen="0"/> + <BOUNDS x="1745" y="52" w="1229" h="968" fullscreen="0"/> </MAINWINDOW> diff --git a/Source/Processors/DataThreads/IntanThread.cpp b/Source/Processors/DataThreads/IntanThread.cpp index fec0ac7db..b8c1faeb1 100644 --- a/Source/Processors/DataThreads/IntanThread.cpp +++ b/Source/Processors/DataThreads/IntanThread.cpp @@ -94,6 +94,8 @@ bool IntanThread::stopAcquisition() unsigned char buf[4097]; // has to be bigger than the on-chip buffer ftdi_read_data(&ftdic, buf, sizeof(buf)); closeUSB(); + } else { + deviceFound = false; } return true; diff --git a/Source/Processors/FilterNode.cpp b/Source/Processors/FilterNode.cpp index 265969772..7f247fabc 100644 --- a/Source/Processors/FilterNode.cpp +++ b/Source/Processors/FilterNode.cpp @@ -208,7 +208,7 @@ void FilterNode::process(AudioSampleBuffer &buffer, //int nSamps = getNumSamples(midiMessages); //std::cout << nSamples << std::endl; - filter->process (nSamples, buffer.getArrayOfChannels()); + //filter->process (nSamples, buffer.getArrayOfChannels()); //std::cout << "Filter node:" << *buffer.getSampleData(0,0); diff --git a/Source/Processors/SourceNode.cpp b/Source/Processors/SourceNode.cpp index ef09b9c3c..661273b58 100644 --- a/Source/Processors/SourceNode.cpp +++ b/Source/Processors/SourceNode.cpp @@ -213,11 +213,13 @@ bool SourceNode::disable() { void SourceNode::acquisitionStopped() { - std::cout << "Source node sending signal to UI." << std::endl; - UI->disableCallbacks(); - enabledState(false); - GenericEditor* ed = (GenericEditor*) getEditor(); - viewport->updateVisibleEditors(ed, 4); + if (!dataThread->foundInputSource()) { + std::cout << "Source node sending signal to UI." << std::endl; + UI->disableCallbacks(); + enabledState(false); + GenericEditor* ed = (GenericEditor*) getEditor(); + viewport->updateVisibleEditors(ed, 4); + } } -- GitLab