diff --git a/Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj b/Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj index ce4fa41386447c4abf0f2ab7fe41763caf137693..a4af177b4721522963e88fdb78474ce370e1bc6c 100644 --- a/Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj @@ -2995,7 +2995,6 @@ 9D050A509BEB9E3879DA35C6 /* ostrich.ttf */, 66F524552E8DE88CDC2E40FD /* silkscreen-serialized */, D01254FA41688494C3CB0889 /* silkscreen.ttf */, - 61317B5191E05925F232E18C /* unibody-8.otf */, ); name = Fonts; sourceTree = "<group>"; @@ -3829,7 +3828,7 @@ 41375E3272D6505F75FDEEEB /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0440; + LastUpgradeCheck = 0600; }; buildConfigurationList = 3B096175C0B17BFA58475A08 /* Build configuration list for PBXProject "open-ephys" */; compatibilityVersion = "Xcode 3.2"; diff --git a/Source/Processors/DataThreads/RHD2000Editor.cpp b/Source/Processors/DataThreads/RHD2000Editor.cpp index 1256dfc37d20094d258b32aed35e119e286c60b5..4c9619a5b4d6574ba42188d0cad83c4c4d93dd8a 100644 --- a/Source/Processors/DataThreads/RHD2000Editor.cpp +++ b/Source/Processors/DataThreads/RHD2000Editor.cpp @@ -1,4 +1,4 @@ -/* +/* ------------------------------------------------------------------ This file is part of the Open Ephys GUI @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ +*/ #include "RHD2000Editor.h" #include "../../UI/EditorViewport.h" @@ -481,13 +481,14 @@ void FPGAcanvas::updateImpedance(Array<int> streams, Array<int> channels, Array< RHD2000Editor::RHD2000Editor(GenericProcessor* parentNode, RHD2000Thread* board_, - bool useDefaultParameterEditors + bool useDefaultParameterEditors ) : VisualizerEditor(parentNode, useDefaultParameterEditors), board(board_) { canvas = nullptr; desiredWidth = 330; tabText = "FPGA"; + // add headstage-specific controls (currently just an enable/disable button) for (int i = 0; i < 4; i++) { @@ -496,17 +497,22 @@ RHD2000Editor::RHD2000Editor(GenericProcessor* parentNode, addAndMakeVisible(hsOptions); hsOptions->setBounds(3, 28+i*20, 70, 18); } - + // add sample rate selection sampleRateInterface = new SampleRateInterface(board, this); addAndMakeVisible(sampleRateInterface); sampleRateInterface->setBounds(80, 25, 100, 50); - + // add Bandwidth selection bandwidthInterface = new BandwidthInterface(board, this); addAndMakeVisible(bandwidthInterface); - bandwidthInterface->setBounds(80, 65, 80, 50); - + bandwidthInterface->setBounds(80, 58, 80, 50); + + // add DSP selection + dspInterface = new DSPInterface(board, this); + addAndMakeVisible(dspInterface); + dspInterface->setBounds(80, 58, 80, 50); + // add rescan button rescanButton = new UtilityButton("RESCAN", Font("Small Text", 13, Font::plain)); rescanButton->setRadius(3.0f); @@ -514,17 +520,17 @@ RHD2000Editor::RHD2000Editor(GenericProcessor* parentNode, rescanButton->addListener(this); rescanButton->setTooltip("Check for connected headstages"); addAndMakeVisible(rescanButton); - + for (int i = 0; i < 2; i++) { ElectrodeButton* button = new ElectrodeButton(-1); electrodeButtons.add(button); - + button->setBounds(190+i*25, 40, 25, 15); button->setChannelNum(-1); button->setToggleState(false, dontSendNotification); button->setRadioGroupId(999); - + addAndMakeVisible(button); button->addListener(this); @@ -536,13 +542,12 @@ RHD2000Editor::RHD2000Editor(GenericProcessor* parentNode, } } - audioLabel = new Label("audio label", "Audio out"); audioLabel->setBounds(180,25,75,15); audioLabel->setFont(Font("Small Text", 10, Font::plain)); audioLabel->setColour(Label::textColourId, Colours::darkgrey); addAndMakeVisible(audioLabel); - + // add HW audio parameter selection audioInterface = new AudioInterface(board, this); addAndMakeVisible(audioInterface); @@ -555,7 +560,22 @@ RHD2000Editor::RHD2000Editor(GenericProcessor* parentNode, adcButton->addListener(this); adcButton->setClickingTogglesState(true); adcButton->setTooltip("Enable/disable ADC channels"); - addAndMakeVisible(adcButton); + addAndMakeVisible(adcButton); + + // add DSP Offset Button + dspoffsetButton = new UtilityButton("DSP", Font("Very Small Text", 13, Font::plain)); + dspoffsetButton->setRadius(3.0f); // sets the radius of the button's corners + dspoffsetButton->setBounds(80, 108,30,18); // sets the x position, y position, width, and height of the button + dspoffsetButton->addListener(this); + dspoffsetButton->setClickingTogglesState(true); // makes the button toggle its state when clicked + dspoffsetButton->setTooltip("Enable/disable DSP offset removal"); + addAndMakeVisible(dspoffsetButton); // makes the button a child component of the editor and makes it visible + dspoffsetButton->setToggleState(true, dontSendNotification); + + // add DSP Frequency Selection field + dspInterface = new DSPInterface(board, this); + addAndMakeVisible(dspInterface); + dspInterface->setBounds(110, 108, 80, 50); ttlSettleLabel = new Label("TTL Settle","TTL Settle"); ttlSettleLabel->setFont( Font("Small Text", 11, Font::plain)); @@ -600,13 +620,12 @@ RHD2000Editor::RHD2000Editor(GenericProcessor* parentNode, } dacHPFcombo->setSelectedId(1, sendNotification); addAndMakeVisible(dacHPFcombo); - - + } RHD2000Editor::~RHD2000Editor() { - + } void RHD2000Editor::scanPorts() @@ -653,16 +672,16 @@ void RHD2000Editor::comboBoxChanged(ComboBox* comboBox) void RHD2000Editor::buttonEvent(Button* button) { - VisualizerEditor::buttonEvent(button); + VisualizerEditor::buttonEvent(button); if (button == rescanButton && !acquisitionIsActive) { board->scanPorts(); - + for (int i = 0; i < 4; i++) { headstageOptionsInterfaces[i]->checkEnabledState(); - } - board->updateChannelNames(); + } + board->updateChannelNames(); } else if (button == electrodeButtons[0]) { @@ -681,7 +700,13 @@ void RHD2000Editor::buttonEvent(Button* button) { board->setTTLoutputMode(dacTTLButton->getToggleState()); } - + else if (button == dspoffsetButton && !acquisitionIsActive) + { + std::cout << "DSP offset " << button->getToggleState() << std::endl; + board->setDSPOffset(button->getToggleState()); + getEditorViewport()->makeEditorVisible(this, false, true); + } + } void RHD2000Editor::channelChanged(int chan) @@ -692,39 +717,46 @@ void RHD2000Editor::channelChanged(int chan) { electrodeButtons[i]->setChannelNum(chan); electrodeButtons[i]->repaint(); - board->assignAudioOut(i, chan); + } } } void RHD2000Editor::startAcquisition() { - + channelSelector->startAcquisition(); + rescanButton->setEnabledState(false); - adcButton->setEnabledState(false); + adcButton->setEnabledState(false); + dspoffsetButton-> setEnabledState(false); acquisitionIsActive = true; if (canvas !=nullptr) - canvas->channelList->setEnabled(false); + canvas->channelList->setEnabled(false); } void RHD2000Editor::stopAcquisition() { - + channelSelector->stopAcquisition(); - + rescanButton->setEnabledState(true); adcButton->setEnabledState(true); - + dspoffsetButton-> setEnabledState(true); + acquisitionIsActive = false; if (canvas != nullptr) canvas->channelList->setEnabled(true); - // canvas->channelList->setEnabled(true); + // canvas->channelList->setEnabled(true); } void RHD2000Editor::saveCustomParameters(XmlElement* xml) { + xml->setAttribute("SampleRate", sampleRateInterface->getSelectedId()); + xml->setAttribute("LowCut", bandwidthInterface->getLowerBandwidth()); + xml->setAttribute("HighCut", bandwidthInterface->getUpperBandwidth()); + xml->setAttribute("ADCsOn", adcButton->getToggleState()); xml->setAttribute("SampleRate", sampleRateInterface->getSelectedId()); xml->setAttribute("LowCut", bandwidthInterface->getLowerBandwidth()); xml->setAttribute("HighCut", bandwidthInterface->getUpperBandwidth()); @@ -734,7 +766,9 @@ void RHD2000Editor::saveCustomParameters(XmlElement* xml) xml->setAttribute("NoiseSlicer", audioInterface->getNoiseSlicerLevel()); xml->setAttribute("TTLFastSettle", ttlSettleCombo->getSelectedId()); xml->setAttribute("DAC_TTL", dacTTLButton->getToggleState()); - xml->setAttribute("DAC_HPF", dacHPFcombo->getSelectedId()); + xml->setAttribute("DAC_HPF", dacHPFcombo->getSelectedId()); + xml->setAttribute("DSPOffset", dspoffsetButton->getToggleState()); + xml->setAttribute("DSPCutoffFreq", dspInterface->getDspCutoffFreq()); } void RHD2000Editor::loadCustomParameters(XmlElement* xml) @@ -751,7 +785,9 @@ void RHD2000Editor::loadCustomParameters(XmlElement* xml) audioInterface->setNoiseSlicerLevel(xml->getIntAttribute("NoiseSlicer")); ttlSettleCombo->setSelectedId(xml->getIntAttribute("TTLFastSettle")); dacTTLButton->setToggleState(xml->getBoolAttribute("DAC_TTL"), sendNotification); - dacHPFcombo->setSelectedId(xml->getIntAttribute("DAC_HPF")); + dacHPFcombo->setSelectedId(xml->getIntAttribute("DAC_HPF")); + dspoffsetButton->setToggleState(xml->getBoolAttribute("DSPOffset"), sendNotification); + dspInterface->setDspCutoffFreq(xml->getDoubleAttribute("DSPCutoffFreq")); } @@ -768,90 +804,90 @@ Visualizer* RHD2000Editor::createNewCanvas() BandwidthInterface::BandwidthInterface(RHD2000Thread* board_, RHD2000Editor* editor_) : - board(board_), editor(editor_) +board(board_), editor(editor_) { - + name = "Bandwidth"; - + lastHighCutString = "7500"; lastLowCutString = "1"; - + actualUpperBandwidth = 7500.0f; actualLowerBandwidth = 1.0f; - + upperBandwidthSelection = new Label("UpperBandwidth",lastHighCutString); // this is currently set in RHD2000Thread, the cleaner would be to set it here again upperBandwidthSelection->setEditable(true,false,false); upperBandwidthSelection->addListener(this); upperBandwidthSelection->setBounds(30,30,60,20); upperBandwidthSelection->setColour(Label::textColourId, Colours::darkgrey); addAndMakeVisible(upperBandwidthSelection); - - + + lowerBandwidthSelection = new Label("LowerBandwidth",lastLowCutString); lowerBandwidthSelection->setEditable(true,false,false); lowerBandwidthSelection->addListener(this); lowerBandwidthSelection->setBounds(25,10,60,20); lowerBandwidthSelection->setColour(Label::textColourId, Colours::darkgrey); - + addAndMakeVisible(lowerBandwidthSelection); - - - + + + } BandwidthInterface::~BandwidthInterface() { - + } void BandwidthInterface::labelTextChanged(Label* label) { - + if (!(editor->acquisitionIsActive) && board->foundInputSource()) { if (label == upperBandwidthSelection) { - + Value val = label->getTextValue(); double requestedValue = double(val.getValue()); - + if (requestedValue < 100.0 || requestedValue > 20000.0 || requestedValue < lastLowCutString.getFloatValue()) { editor->sendActionMessage("Value out of range."); - + label->setText(lastHighCutString, dontSendNotification); - + return; } - + actualUpperBandwidth = board->setUpperBandwidth(requestedValue); - + std::cout << "Setting Upper Bandwidth to " << requestedValue << std::endl; std::cout << "Actual Upper Bandwidth: " << actualUpperBandwidth << std::endl; label->setText(String(round(actualUpperBandwidth*10.f)/10.f), dontSendNotification); - + } else { - + Value val = label->getTextValue(); double requestedValue = double(val.getValue()); - + if (requestedValue < 0.1 || requestedValue > 500.0 || requestedValue > lastHighCutString.getFloatValue()) { editor->sendActionMessage("Value out of range."); - + label->setText(lastLowCutString, dontSendNotification); - + return; } - + actualLowerBandwidth = board->setLowerBandwidth(requestedValue); - + std::cout << "Setting Lower Bandwidth to " << requestedValue << std::endl; std::cout << "Actual Lower Bandwidth: " << actualLowerBandwidth << std::endl; - + label->setText(String(round(actualLowerBandwidth*10.f)/10.f), dontSendNotification); } } @@ -864,7 +900,7 @@ void BandwidthInterface::labelTextChanged(Label* label) label->setText(lastLowCutString, dontSendNotification); return; } - + } void BandwidthInterface::setLowerBandwidth(double value) @@ -892,28 +928,28 @@ double BandwidthInterface::getUpperBandwidth() void BandwidthInterface::paint(Graphics& g) { - + g.setColour(Colours::darkgrey); - + g.setFont(Font("Small Text",10,Font::plain)); - + g.drawText(name, 0, 0, 200, 15, Justification::left, false); - + g.drawText("Low: ", 0, 10, 200, 20, Justification::left, false); - + g.drawText("High: ", 0, 30, 200, 20, Justification::left, false); - + } // Sample rate Options -------------------------------------------------------------------- SampleRateInterface::SampleRateInterface(RHD2000Thread* board_, RHD2000Editor* editor_) : - board(board_), editor(editor_) +board(board_), editor(editor_) { - + name = "Sample Rate"; - + sampleRateOptions.add("1.00 kS/s"); sampleRateOptions.add("1.25 kS/s"); sampleRateOptions.add("1.50 kS/s"); @@ -931,22 +967,22 @@ SampleRateInterface::SampleRateInterface(RHD2000Thread* board_, sampleRateOptions.add("20.0 kS/s"); sampleRateOptions.add("25.0 kS/s"); sampleRateOptions.add("30.0 kS/s"); - - + + rateSelection = new ComboBox("Sample Rate"); rateSelection->addItemList(sampleRateOptions, 1); rateSelection->setSelectedId(17, dontSendNotification); rateSelection->addListener(this); - + rateSelection->setBounds(0,15,300,20); addAndMakeVisible(rateSelection); - - + + } SampleRateInterface::~SampleRateInterface() { - + } void SampleRateInterface::comboBoxChanged(ComboBox* cb) @@ -956,9 +992,9 @@ void SampleRateInterface::comboBoxChanged(ComboBox* cb) if (cb == rateSelection) { board->setSampleRate(cb->getSelectedId()-1); - + std::cout << "Setting sample rate to index " << cb->getSelectedId()-1 << std::endl; - + editor->getEditorViewport()->makeEditorVisible(editor, false, true); } } @@ -977,13 +1013,13 @@ void SampleRateInterface::setSelectedId(int id) void SampleRateInterface::paint(Graphics& g) { - + g.setColour(Colours::darkgrey); - + g.setFont(Font("Small Text",10,Font::plain)); - + g.drawText(name, 0, 0, 200, 15, Justification::left, false); - + } @@ -992,9 +1028,9 @@ void SampleRateInterface::paint(Graphics& g) HeadstageOptionsInterface::HeadstageOptionsInterface(RHD2000Thread* board_, RHD2000Editor* editor_, int hsNum) : - isEnabled(false), board(board_), editor(editor_) +isEnabled(false), board(board_), editor(editor_) { - + switch (hsNum) { case 0 : @@ -1012,15 +1048,15 @@ HeadstageOptionsInterface::HeadstageOptionsInterface(RHD2000Thread* board_, default: name = "X"; } - + hsNumber1 = hsNum*2; // data stream 1 hsNumber2 = hsNumber1+1; // data stream 2 - + channelsOnHs1 = 0; channelsOnHs2 = 0; - - - + + + hsButton1 = new UtilityButton(" ", Font("Small Text", 13, Font::plain)); hsButton1->setRadius(3.0f); hsButton1->setBounds(23,1,20,17); @@ -1028,7 +1064,7 @@ HeadstageOptionsInterface::HeadstageOptionsInterface(RHD2000Thread* board_, hsButton1->setCorners(true, false, true, false); hsButton1->addListener(this); addAndMakeVisible(hsButton1); - + hsButton2 = new UtilityButton(" ", Font("Small Text", 13, Font::plain)); hsButton2->setRadius(3.0f); hsButton2->setBounds(43,1,20,17); @@ -1036,20 +1072,20 @@ HeadstageOptionsInterface::HeadstageOptionsInterface(RHD2000Thread* board_, hsButton2->setCorners(false, true, false, true); hsButton2->addListener(this); addAndMakeVisible(hsButton2); - + checkEnabledState(); } HeadstageOptionsInterface::~HeadstageOptionsInterface() { - + } void HeadstageOptionsInterface::checkEnabledState() { isEnabled = (board->isHeadstageEnabled(hsNumber1) || board->isHeadstageEnabled(hsNumber2)); - + if (board->isHeadstageEnabled(hsNumber1)) { channelsOnHs1 = 32; @@ -1062,7 +1098,7 @@ void HeadstageOptionsInterface::checkEnabledState() hsButton1->setLabel(" "); hsButton1->setEnabledState(false); } - + if (board->isHeadstageEnabled(hsNumber2)) { channelsOnHs2 = 32; @@ -1075,17 +1111,17 @@ void HeadstageOptionsInterface::checkEnabledState() hsButton2->setLabel(" "); hsButton2->setEnabledState(false); } - + repaint(); - + } void HeadstageOptionsInterface::buttonClicked(Button* button) { - + if (!(editor->acquisitionIsActive) && board->foundInputSource()) { - + //std::cout << "Acquisition is not active" << std::endl; if (button == hsButton1) { @@ -1093,11 +1129,12 @@ void HeadstageOptionsInterface::buttonClicked(Button* button) channelsOnHs1 = 16; else channelsOnHs1 = 32; - + //std::cout << "HS1 has " << channelsOnHs1 << " channels." << std::endl; - + hsButton1->setLabel(String(channelsOnHs1)); board->setNumChannels(hsNumber1, channelsOnHs1); + board->updateChannelNames(); editor->updateSettings(); @@ -1108,42 +1145,42 @@ void HeadstageOptionsInterface::buttonClicked(Button* button) channelsOnHs2 = 16; else channelsOnHs2 = 32; - + hsButton2->setLabel(String(channelsOnHs2)); board->setNumChannels(hsNumber2, channelsOnHs2); board->updateChannelNames(); editor->updateSettings(); } - - + + editor->getEditorViewport()->makeEditorVisible(editor, false, true); } - + } void HeadstageOptionsInterface::paint(Graphics& g) { g.setColour(Colours::lightgrey); - + g.fillRoundedRectangle(5,0,getWidth()-10,getHeight(),4.0f); - + if (isEnabled) g.setColour(Colours::black); else g.setColour(Colours::grey); - + g.setFont(Font("Small Text",15,Font::plain)); - + g.drawText(name, 8, 2, 200, 15, Justification::left, false); - + } // (Direct OpalKelly) Audio Options -------------------------------------------------------------------- AudioInterface::AudioInterface(RHD2000Thread* board_, - RHD2000Editor* editor_) : + RHD2000Editor* editor_) : board(board_), editor(editor_) { @@ -1192,7 +1229,7 @@ void AudioInterface::labelTextChanged(Label* label) std::cout << "Setting Noise Slicer Level to " << requestedValue << std::endl; label->setText(String((roundFloatToInt)(actualNoiseSlicerLevel)), dontSendNotification); - + } } else { @@ -1229,7 +1266,78 @@ void AudioInterface::paint(Graphics& g) g.drawText(name, 0, 0, 200, 15, Justification::left, false); g.drawText("Level: ", 0, 10, 200, 20, Justification::left, false); + +} + + + +// DSP Options -------------------------------------------------------------------- + +DSPInterface::DSPInterface(RHD2000Thread* board_, + RHD2000Editor* editor_) : +board(board_), editor(editor_) +{ + name = "DSP"; + + dspOffsetSelection = new Label("DspOffsetSelection",String(round(board->getDspCutoffFreq()*10.f)/10.f)); + dspOffsetSelection->setEditable(true,false,false); + dspOffsetSelection->addListener(this); + dspOffsetSelection->setBounds(0,0,30,20); + dspOffsetSelection->setColour(Label::textColourId, Colours::darkgrey); + + addAndMakeVisible(dspOffsetSelection); + +} + +DSPInterface::~DSPInterface() +{ + +} + + +void DSPInterface::labelTextChanged(Label* label) +{ + + if (!(editor->acquisitionIsActive) && board->foundInputSource()) + { + if (label == dspOffsetSelection) + { + + Value val = label->getTextValue(); + double requestedValue = double(val.getValue()); + + actualDspCutoffFreq = board->setDspCutoffFreq(requestedValue); + + std::cout << "Setting DSP Cutoff Freq to " << requestedValue << std::endl; + std::cout << "Actual DSP Cutoff Freq: " << actualDspCutoffFreq << std::endl; + label->setText(String(round(actualDspCutoffFreq*10.f)/10.f), dontSendNotification); + + } + } + else if (editor->acquisitionIsActive) + { + editor->sendActionMessage("Can't change DSP cutoff while acquisition is active!"); + } } +void DSPInterface::setDspCutoffFreq(double value) +{ + actualDspCutoffFreq = board->setDspCutoffFreq(value); + dspOffsetSelection->setText(String(round(actualDspCutoffFreq*10.f)/10.f), dontSendNotification); +} + + +double DSPInterface::getDspCutoffFreq() +{ + return actualDspCutoffFreq; +} +void DSPInterface::paint(Graphics& g) +{ + + g.setColour(Colours::darkgrey); + + g.setFont(Font("Small Text",10,Font::plain)); + +} diff --git a/Source/Processors/DataThreads/RHD2000Editor.h b/Source/Processors/DataThreads/RHD2000Editor.h index e461ab2828661b333a218e383041010d699257d1..73e75da1332a679dfce14b74522b3d2e88e4dc6a 100644 --- a/Source/Processors/DataThreads/RHD2000Editor.h +++ b/Source/Processors/DataThreads/RHD2000Editor.h @@ -33,6 +33,7 @@ class HeadstageOptionsInterface; class SampleRateInterface; class BandwidthInterface; +class DSPInterface; class AudioInterface; class RHD2000Thread; @@ -182,12 +183,15 @@ private: ScopedPointer<SampleRateInterface> sampleRateInterface; ScopedPointer<BandwidthInterface> bandwidthInterface; + ScopedPointer<DSPInterface> dspInterface; ScopedPointer<AudioInterface> audioInterface; ScopedPointer<UtilityButton> rescanButton,dacTTLButton; - ScopedPointer<UtilityButton> adcButton; - ScopedPointer<ComboBox> ttlSettleCombo,dacHPFcombo; + ScopedPointer<UtilityButton> adcButton; + + ScopedPointer<UtilityButton> dspoffsetButton; + ScopedPointer<ComboBox> ttlSettleCombo,dacHPFcombo; ScopedPointer<Label> audioLabel,ttlSettleLabel,dacHPFlabel ; @@ -261,6 +265,33 @@ private: }; +class DSPInterface : public Component, +public Label::Listener +{ +public: + DSPInterface(RHD2000Thread*, RHD2000Editor*); + ~DSPInterface(); + + void paint(Graphics& g); + void labelTextChanged(Label* te); + + void setDspCutoffFreq(double value); + double getDspCutoffFreq(); + +private: + + String name; + + RHD2000Thread* board; + RHD2000Editor* editor; + + ScopedPointer<Label> dspOffsetSelection; + + double actualDspCutoffFreq; + +}; + + class SampleRateInterface : public Component, public ComboBox::Listener diff --git a/Source/Processors/DataThreads/RHD2000Thread.cpp b/Source/Processors/DataThreads/RHD2000Thread.cpp index 5a6194797519d6367308ecf464f5c2a50152a8b6..e4969c8c4f2b74396b1d16e25766df273dad252b 100644 --- a/Source/Processors/DataThreads/RHD2000Thread.cpp +++ b/Source/Processors/DataThreads/RHD2000Thread.cpp @@ -913,6 +913,7 @@ double RHD2000Thread::setUpperBandwidth(double upper) return actualUpperBandwidth; } + double RHD2000Thread::setLowerBandwidth(double lower) { desiredLowerBandwidth = lower; @@ -921,7 +922,28 @@ double RHD2000Thread::setLowerBandwidth(double lower) return actualLowerBandwidth; } + +double RHD2000Thread::setDspCutoffFreq(double freq) +{ + + desiredDspCutoffFreq = freq; + + updateRegisters(); + + return actualDspCutoffFreq; +} + +double RHD2000Thread::getDspCutoffFreq() +{ + + return actualDspCutoffFreq; +} +void RHD2000Thread::setDSPOffset(bool state) +{ + dspEnabled = state; + updateRegisters(); + void RHD2000Thread::setTTLoutputMode(bool state) { ttlMode = state; @@ -940,7 +962,7 @@ void RHD2000Thread::setFastTTLSettle(bool state, int channel) { fastTTLSettleEnabled = state; fastSettleTTLChannel = channel; - dacOutputShouldChange = true; + dacOutputShouldChange = true; } int RHD2000Thread::setNoiseSlicerLevel(int level) @@ -1197,9 +1219,11 @@ void RHD2000Thread::updateRegisters() // Before generating register configuration command sequences, set amplifier // bandwidth paramters. actualDspCutoffFreq = chipRegisters.setDspCutoffFreq(desiredDspCutoffFreq); + //std::cout << "DSP Cutoff Frequency " << actualDspCutoffFreq << std::endl; actualLowerBandwidth = chipRegisters.setLowerBandwidth(desiredLowerBandwidth); actualUpperBandwidth = chipRegisters.setUpperBandwidth(desiredUpperBandwidth); chipRegisters.enableDsp(dspEnabled); + //std::cout << "DSP Offset Status " << dspEnabled << std::endl; // turn on aux inputs chipRegisters.enableAux1(true); diff --git a/Source/Processors/DataThreads/RHD2000Thread.h b/Source/Processors/DataThreads/RHD2000Thread.h index b77781ec9e932a2cb15181a254abae1ae97a7b80..08b7831de3e38086bd7b1d29c82793b9a976e46a 100644 --- a/Source/Processors/DataThreads/RHD2000Thread.h +++ b/Source/Processors/DataThreads/RHD2000Thread.h @@ -72,8 +72,13 @@ public: void setSampleRate(int index, bool temporary = false); double setUpperBandwidth(double upper); // set desired BW, returns actual BW - double setLowerBandwidth(double lower); + double setLowerBandwidth(double lower); + + double setDspCutoffFreq(double freq); + double getDspCutoffFreq(); + void setDSPOffset(bool state); + int setNoiseSlicerLevel(int level); void runImpedanceTest(Array<int> &stream, Array<int> &channel, Array<float> &magnitude, Array<float> &phase); void setFastTTLSettle(bool state, int channel); diff --git a/Source/Processors/LfpDisplayNode/LfpDisplayCanvas.cpp b/Source/Processors/LfpDisplayNode/LfpDisplayCanvas.cpp index 22058f92df9d5879b7ed61b037e64725c2439b22..15ad29b6a6cc22bc4ad3af2b322fd7688b4109ad 100755 --- a/Source/Processors/LfpDisplayNode/LfpDisplayCanvas.cpp +++ b/Source/Processors/LfpDisplayNode/LfpDisplayCanvas.cpp @@ -70,18 +70,34 @@ LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) : addAndMakeVisible(timescale); voltageRanges.add("-"); // placeholder for custom ranges (set by scroll wheel etc.) - voltageRanges.add("50"); + voltageRanges.add("25"); + voltageRanges.add("50"); voltageRanges.add("100"); voltageRanges.add("250"); + voltageRanges.add("400"); voltageRanges.add("500"); + voltageRanges.add("750"); voltageRanges.add("1000"); voltageRanges.add("2000"); voltageRanges.add("5000"); - - timebases.add("1.0"); + voltageRanges.add("10000"); + voltageRanges.add("50000"); + voltageRanges.add("100000"); + voltageRanges.add("500000"); + voltageRanges.add("1000000"); + voltageRanges.add("2000000"); + voltageRanges.add("5000000"); + + + timebases.add("0.25"); + timebases.add("0.5"); + timebases.add("1.0"); timebases.add("2.0"); - timebases.add("5.0"); + timebases.add("3.0"); + timebases.add("4.0"); + timebases.add("5.0"); timebases.add("10.0"); + timebases.add("20.0"); spreads.add("-"); // placeholder for custom ranges (set by scroll wheel etc.) spreads.add("10"); @@ -89,8 +105,12 @@ LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) : spreads.add("30"); spreads.add("40"); spreads.add("50"); - spreads.add("60"); - spreads.add("100"); + spreads.add("60"); + spreads.add("70"); + spreads.add("80"); + spreads.add("90"); + spreads.add("100"); + spreads.add("100"); colorGroupings.add("1"); colorGroupings.add("2"); diff --git a/Source/Processors/SourceNode/SourceNodeEditor.cpp b/Source/Processors/SourceNode/SourceNodeEditor.cpp index 89ca028d7b07fbdd898dd85770fe14550b613895..808534a3c4aa05d1ceb7e0ad46830113a9139587 100755 --- a/Source/Processors/SourceNode/SourceNodeEditor.cpp +++ b/Source/Processors/SourceNode/SourceNodeEditor.cpp @@ -77,6 +77,8 @@ SourceNodeEditor::SourceNodeEditor(GenericProcessor* parentNode, bool useDefault //values.add(1); values.add(2), values.add(3); //createRadioButtons(10, 25, 100, values); + + } diff --git a/Source/Processors/SourceNode/SourceNodeEditor.h b/Source/Processors/SourceNode/SourceNodeEditor.h index ea2b9f729b543e89ed773d5e7ed6c8aa75c8876d..f4a94262e8fe999403d82b40048a3d38efff8768 100755 --- a/Source/Processors/SourceNode/SourceNodeEditor.h +++ b/Source/Processors/SourceNode/SourceNodeEditor.h @@ -51,6 +51,7 @@ private: ImageIcon* icon; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SourceNodeEditor); + };