diff --git a/Source/Processors/DataThreads/RHD2000Thread.cpp b/Source/Processors/DataThreads/RHD2000Thread.cpp index 702ad2e2e6f2a88872f2e6972efb9a66e684db13..047f564232d570c727be5c3969796827ea6f7c07 100644 --- a/Source/Processors/DataThreads/RHD2000Thread.cpp +++ b/Source/Processors/DataThreads/RHD2000Thread.cpp @@ -87,7 +87,7 @@ void RHD2000Thread::initializeBoard() if (!evalBoard->uploadFpgaBitfile(bitfilename)) { - std::cout << "Couldn't upload bitfile." << std::endl; + std::cout << "Couldn't upload bitfile from " << bitfilename << std::endl; // what to do if there's an error } diff --git a/Source/Processors/Visualization/LfpDisplayCanvas.cpp b/Source/Processors/Visualization/LfpDisplayCanvas.cpp index efe84d1897979a6ea9a5b5bc1a6109c102c06749..42dc6e02a70e1d1401eea463cb3b6f2faaf7a197 100755 --- a/Source/Processors/Visualization/LfpDisplayCanvas.cpp +++ b/Source/Processors/Visualization/LfpDisplayCanvas.cpp @@ -463,6 +463,20 @@ void LfpDisplayCanvas::saveVisualizerParameters(XmlElement* xml) xmlNode->setAttribute("EventButtonState", eventButtonState); + String channelDisplayState = ""; + + for (int i = 0; i < nChans; i++) + { + if (lfpDisplay->getEnabledState(i)) + { + channelDisplayState += "1"; + } else { + channelDisplayState += "0"; + } + } + + xmlNode->setAttribute("ChannelDisplayState", channelDisplayState); + xmlNode->setAttribute("ScrollX",viewport->getViewPositionX()); xmlNode->setAttribute("ScrollY",viewport->getViewPositionY()); } @@ -481,7 +495,7 @@ void LfpDisplayCanvas::loadVisualizerParameters(XmlElement* xml) viewport->setViewPosition(xmlNode->getIntAttribute("ScrollX"), xmlNode->getIntAttribute("ScrollY")); - int eventButtonState = xmlNode->getIntAttribute("eventButtonState"); + int eventButtonState = xmlNode->getIntAttribute("EventButtonState"); for (int i = 0; i < 8; i++) { @@ -489,6 +503,21 @@ void LfpDisplayCanvas::loadVisualizerParameters(XmlElement* xml) eventDisplayInterfaces[i]->checkEnabledState(); } + + String channelDisplayState = xmlNode->getStringAttribute("ChannelDisplayState"); + + for (int i = 0; i < channelDisplayState.length(); i++) + { + + if (channelDisplayState.substring(i,i+1).equalsIgnoreCase("1")) + { + lfpDisplay->setEnabledState(true, i); + } else { + lfpDisplay->setEnabledState(false, i); + } + + + } } } @@ -596,6 +625,7 @@ int LfpDisplay::getNumChannels() return numChans; } + void LfpDisplay::setNumChannels(int numChannels) { numChans = numChannels; @@ -861,11 +891,27 @@ bool LfpDisplay::getEventDisplayState(int ch) return eventDisplayEnabled[ch]; } -void LfpDisplay::setEnabledState(bool state, int ch) +void LfpDisplay::setEnabledState(bool state, int chan) { - channels[ch]->setEnabledState(state); + + if (chan < numChans) + { + + channels[chan]->setEnabledState(state); + channelInfo[chan]->setEnabledState(state); + } } + bool LfpDisplay::getEnabledState(int chan) + { + if (chan < numChans) + { + return channels[chan]->getEnabledState(); + } + + return false; + } + // ------------------------------------------------------------------ @@ -894,6 +940,10 @@ LfpChannelDisplay::~LfpChannelDisplay() void LfpChannelDisplay::setEnabledState(bool state) { + + + std::cout << "Setting channel " << name << " to " << state << std::endl; + isEnabled = state; } @@ -1139,6 +1189,11 @@ void LfpChannelDisplayInfo::buttonClicked(Button* button) } +void LfpChannelDisplayInfo::setEnabledState(bool state) +{ + enableButton->setToggleState(state, false); +} + void LfpChannelDisplayInfo::paint(Graphics& g) { diff --git a/Source/Processors/Visualization/LfpDisplayCanvas.h b/Source/Processors/Visualization/LfpDisplayCanvas.h index 44f1498dd97e805637c52623acb5ce382fef73f3..4c6426480d74986b539d22cd4a71cb2b89c10e02 100755 --- a/Source/Processors/Visualization/LfpDisplayCanvas.h +++ b/Source/Processors/Visualization/LfpDisplayCanvas.h @@ -187,7 +187,7 @@ public: bool getEventDisplayState(int ch); void setEnabledState(bool, int); - + bool getEnabledState(int); Array<Colour> channelColours; @@ -233,6 +233,7 @@ public: int getRange(); void setEnabledState(bool); + bool getEnabledState() {return isEnabled;} bool fullredraw; // used to indicate that a full redraw is required. is set false after each full redraw @@ -273,6 +274,8 @@ public: void resized(); + void setEnabledState(bool); + private: ScopedPointer<UtilityButton> enableButton;