diff --git a/Builds/Linux/build/savedState.xml b/Builds/Linux/build/savedState.xml index f52f35a70b7a8d25c8161e120f2085adcfe8d206..9e08444200a1c9d7a5e694302e0ed958f4472f8e 100644 --- a/Builds/Linux/build/savedState.xml +++ b/Builds/Linux/build/savedState.xml @@ -6,4 +6,8 @@ <PROCESSOR name="Filters/Bandpass Filter" insertionPoint="1"/> <PROCESSOR name="Sinks/LFP Viewer" insertionPoint="2"/> </SIGNALCHAIN> + <SIGNALCHAIN> + <PROCESSOR name="Sources/Signal Generator" insertionPoint="0"/> + <PROCESSOR name="Sinks/LFP Viewer" insertionPoint="1"/> + </SIGNALCHAIN> </PROCESSORGRAPH> diff --git a/Builds/Linux/build/windowState.xml b/Builds/Linux/build/windowState.xml index 0ef953c393f0a8456074b59b56e498baccf98d3d..fbc6626a1ab8109c1421ad8fa0231555ecc35ea8 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="484" y="308" w="899" h="753" fullscreen="0"/> + <BOUNDS x="1899" y="136" w="971" h="884" fullscreen="0"/> </MAINWINDOW> diff --git a/Source/Processors/SourceNode.cpp b/Source/Processors/SourceNode.cpp index 661273b585e74fc9437578c4a116b28dc7761b82..ac4c431d65c645cb2a40f587921cab8debcf442c 100644 --- a/Source/Processors/SourceNode.cpp +++ b/Source/Processors/SourceNode.cpp @@ -16,7 +16,7 @@ SourceNode::SourceNode(const String& name_) : GenericProcessor(name_), dataThread(0), - sourceCheckInterval(1500) + sourceCheckInterval(750), wasDisabled(true) { if (getName().equalsIgnoreCase("Intan Demo Board")) { dataThread = new IntanThread(this); @@ -156,6 +156,8 @@ bool SourceNode::enable() { std::cout << "Source node received enable signal" << std::endl; + wasDisabled = false; + if (dataThread != 0) { if (dataThread->foundInputSource()) @@ -171,6 +173,8 @@ bool SourceNode::enable() { stopTimer(); + + // bool return_code = true; // if (getName().equalsIgnoreCase("Intan Demo Board")) { @@ -203,23 +207,23 @@ bool SourceNode::disable() { startTimer(2000); - // if (dataThread != 0) { - // delete dataThread; - // dataThread = 0; - // } + wasDisabled = true; return true; } void SourceNode::acquisitionStopped() { - 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); - } + //if (!dataThread->foundInputSource()) { + + if (!wasDisabled) { + std::cout << "Source node sending signal to UI." << std::endl; + UI->disableCallbacks(); + enabledState(false); + GenericEditor* ed = (GenericEditor*) getEditor(); + viewport->updateVisibleEditors(ed, 4); + } + //} } diff --git a/Source/Processors/SourceNode.h b/Source/Processors/SourceNode.h index 5605d2c49a369455f700c31302680f87d47d56b5..7472e63bf7d3f0bf799862ae3f98fb8be6d32290 100644 --- a/Source/Processors/SourceNode.h +++ b/Source/Processors/SourceNode.h @@ -62,6 +62,8 @@ private: int sourceCheckInterval; + bool wasDisabled; + //const String name; void timerCallback(); diff --git a/Source/Processors/Visualization/LfpDisplayCanvas.cpp b/Source/Processors/Visualization/LfpDisplayCanvas.cpp index fc7278df70101039eaee4158275b38ba02514be3..4745a7159de2a37b7d316e9a3b324a796c898fa4 100644 --- a/Source/Processors/Visualization/LfpDisplayCanvas.cpp +++ b/Source/Processors/Visualization/LfpDisplayCanvas.cpp @@ -11,7 +11,7 @@ #include "LfpDisplayCanvas.h" LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* n) : processor(n), - xBuffer(10), yBuffer(10), + xBuffer(0), yBuffer(10), plotHeight(60), selectedChan(-1), screenBufferIndex(0), timebase(1.0f), displayGain(5.0f), displayBufferIndex(0) { @@ -45,7 +45,7 @@ void LfpDisplayCanvas::newOpenGLContextCreated() setUp2DCanvas(); activateAntiAliasing(); - glClearColor (0.8, 0.8, 0.8, 1.0); + glClearColor (0.8, 0.8, 0.9, 1.0); resized(); screenBuffer = new AudioSampleBuffer(nChans, 10000); @@ -187,7 +187,7 @@ void LfpDisplayCanvas::renderOpenGL() if (checkBounds(i)) { setViewport(i); - drawBorder(isSelected); + //drawBorder(isSelected); drawChannelInfo(i,isSelected); drawWaveform(i,isSelected); } @@ -293,12 +293,12 @@ void LfpDisplayCanvas::drawChannelInfo(int chan, bool isSelected) alpha = 1.0f; glColor4f(0.0f,0.0f,0.0f,alpha); - glRasterPos2f(5.0f/getWidth(),0.3); - String s = String("Channel "); + glRasterPos2f(5.0f/getWidth(),0.9); + String s = "";//String("Channel "); s += (chan+1); - getFont(String("miso-regular"))->FaceSize(16); - getFont(String("miso-regular"))->Render(s); + getFont(String("cpmono-extra-light"))->FaceSize(35); + getFont(String("cpmono-extra-light"))->Render(s); } int LfpDisplayCanvas::getTotalHeight() @@ -307,23 +307,23 @@ int LfpDisplayCanvas::getTotalHeight() } -// void LfpDisplayCanvas::mouseDown(const MouseEvent& e) -// { +void LfpDisplayCanvas::mouseDown(const MouseEvent& e) +{ -// Point<int> pos = e.getPosition(); -// int xcoord = pos.getX(); + Point<int> pos = e.getPosition(); + int xcoord = pos.getX(); -// if (xcoord < getWidth()-getScrollBarWidth()) -// { -// int chan = (e.getMouseDownY() + getScrollAmount())/(yBuffer+plotHeight); + if (xcoord < getWidth()-getScrollBarWidth()) + { + int chan = (e.getMouseDownY() + getScrollAmount())/(yBuffer+plotHeight); -// selectedChan = chan; + selectedChan = chan; -// repaint(); -// } + repaint(); + } -// mouseDownInCanvas(e); -// } + mouseDownInCanvas(e); +} // void LfpDisplayCanvas::mouseDrag(const MouseEvent& e) {mouseDragInCanvas(e);} // void LfpDisplayCanvas::mouseMove(const MouseEvent& e) {mouseMoveInCanvas(e);} diff --git a/Source/Processors/Visualization/LfpDisplayCanvas.h b/Source/Processors/Visualization/LfpDisplayCanvas.h index 5ed80dab59119135924088b66a8f26c56752da65..ff39ca0c4ddb7108de62cb0edf9210279ac888f5 100644 --- a/Source/Processors/Visualization/LfpDisplayCanvas.h +++ b/Source/Processors/Visualization/LfpDisplayCanvas.h @@ -74,7 +74,7 @@ private: int getTotalHeight(); // void resized(); - // void mouseDown(const MouseEvent& e); + void mouseDown(const MouseEvent& e); // void mouseDrag(const MouseEvent& e); // void mouseMove(const MouseEvent& e); // void mouseUp(const MouseEvent& e);