Skip to content
Snippets Groups Projects
Commit eb96cb6e authored by jsiegle's avatar jsiegle
Browse files

Added MessageManagerLock back to DataThread

The DataThread shouldn't have a MML all the time, but it does need it
when signaling that the data source is not found.

Also fixed a line in the FilterViewport that was causing the enabled
status of editors to fail to update.
parent 6284cce4
No related branches found
No related tags found
No related merge requests found
...@@ -38,12 +38,14 @@ void DataThread::run() { ...@@ -38,12 +38,14 @@ void DataThread::run() {
while (! threadShouldExit()) while (! threadShouldExit())
{ {
const ScopedLock sl (lock); // const ScopedLock sl (lock);
if (!updateBuffer()) { if (!updateBuffer()) {
const MessageManagerLock mmLock (Thread::getCurrentThread());
std::cout << "Aquisition error...stopping thread." << std::endl; std::cout << "Aquisition error...stopping thread." << std::endl;
signalThreadShouldExit(); signalThreadShouldExit();
//stopAcquisition();
std::cout << "Notifying source node to stop acqusition." << std::endl; std::cout << "Notifying source node to stop acqusition." << std::endl;
sn->acquisitionStopped(); sn->acquisitionStopped();
} }
......
...@@ -58,6 +58,9 @@ float IntanThread::getSampleRate() ...@@ -58,6 +58,9 @@ float IntanThread::getSampleRate()
bool IntanThread::foundInputSource() bool IntanThread::foundInputSource()
{ {
//std::cout << "Checking for input source." << std::endl;
if (deviceFound) if (deviceFound)
{ {
int return_value; int return_value;
...@@ -189,6 +192,7 @@ bool IntanThread::updateBuffer() ...@@ -189,6 +192,7 @@ bool IntanThread::updateBuffer()
if ((bytes_read = ftdi_read_data(&ftdic, buffer, sizeof(buffer))) < 0 && isTransmitting) if ((bytes_read = ftdi_read_data(&ftdic, buffer, sizeof(buffer))) < 0 && isTransmitting)
{ {
std::cout << "NO DATA FOUND!" << std::endl; std::cout << "NO DATA FOUND!" << std::endl;
deviceFound = false;
return false; return false;
} }
......
...@@ -155,6 +155,7 @@ void SourceNode::timerCallback() ...@@ -155,6 +155,7 @@ void SourceNode::timerCallback()
//stopTimer(); // check for input source every two seconds //stopTimer(); // check for input source every two seconds
enabledState(true); enabledState(true);
GenericEditor* ed = (GenericEditor*) getEditor(); GenericEditor* ed = (GenericEditor*) getEditor();
//ed->enable();
viewport->updateVisibleEditors(ed, 4); viewport->updateVisibleEditors(ed, 4);
} }
} else { } else {
...@@ -162,6 +163,7 @@ void SourceNode::timerCallback() ...@@ -162,6 +163,7 @@ void SourceNode::timerCallback()
std::cout << "No input source found." << std::endl; std::cout << "No input source found." << std::endl;
enabledState(false); enabledState(false);
GenericEditor* ed = (GenericEditor*) getEditor(); GenericEditor* ed = (GenericEditor*) getEditor();
//ed->disable();
viewport->updateVisibleEditors(ed, 4); viewport->updateVisibleEditors(ed, 4);
} }
} }
......
...@@ -56,9 +56,9 @@ void FilterViewport::signalChainCanBeEdited(bool t) ...@@ -56,9 +56,9 @@ void FilterViewport::signalChainCanBeEdited(bool t)
{ {
canEdit = t; canEdit = t;
if (!canEdit) if (!canEdit)
std::cout << "Filter Viewport disabled."; std::cout << "Filter Viewport disabled." << std::endl;
else else
std::cout << "Filter Viewport enabled."; std::cout << "Filter Viewport enabled." << std::endl;
} }
...@@ -484,7 +484,7 @@ void FilterViewport::updateVisibleEditors(GenericEditor* activeEditor, int actio ...@@ -484,7 +484,7 @@ void FilterViewport::updateVisibleEditors(GenericEditor* activeEditor, int actio
//std::cout << "OK1." << std::endl; //std::cout << "OK1." << std::endl;
// Step 5: check the validity of the signal chain // Step 5: check the validity of the signal chain
if (action < 4) { if (action < 5) {
bool enable = true; bool enable = true;
if (editorArray.size() == 1) { if (editorArray.size() == 1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment