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

Merge branch 'master' of https://github.com/open-ephys/GUI

parents 186c5c76 e0b1f543
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -6,7 +6,7 @@ This GUI was designed to provide a fast and flexible interface for acquiring and
Everything is written in C++, with the help of the Juce_ library. Juce is lightweight, easy to learn, and completely cross-platform. What's more, it includes a variety of classes for audio processing, which have been co-opted to process neural data. It might be necessary to create custom data processing classes in the future, but for now, Juce takes care of a lot of the messy bits involved in analyzing many parallel data streams.
This repository contains all of the files you'll need to compile and run the GUI on Linux, Mac OS X, and Windows. The makefile (for Linux), XCode project (for Mac), and Visual Studio 2012 project (Windows) are located in the Builds/ directory. Extra Windows dependencies (such as DLLs) are conveniently located in the windeps/ folder.
This repository contains all of the files you'll need to compile and run the GUI on Linux, Mac OS X, and Windows. The makefile (for Linux), XCode project (for Mac), and Visual Studio 2012 project (Windows) are located in the Builds/ directory.
We recommend reading through the wiki_ before attempting to make any changes.
......
......@@ -293,6 +293,10 @@ void RHD2000Thread::initializeBoard()
void RHD2000Thread::scanPorts()
{
if (!deviceFound) //Safety to avoid crashes if board not present
{
return;
}
// Scan SPI ports
int delay, stream, id;
......@@ -850,6 +854,11 @@ void RHD2000Thread::setSampleRate(int sampleRateIndex, bool isTemporary)
void RHD2000Thread::updateRegisters()
{
if (!deviceFound) //Safety to avoid crashes loading a chain with Rythm node withouth a board
{
return;
}
// Set up an RHD2000 register object using this sample rate to
// optimize MUX-related register settings.
chipRegisters.defineSampleRate(boardSampleRate);
......
......@@ -75,6 +75,8 @@ PhaseDetectorEditor::PhaseDetectorEditor(GenericProcessor* parentNode, bool useD
backgroundColours.add(Colours::blue);
plusButton->setToggleState(true, true);
//interfaces.clear();
}
......@@ -129,6 +131,7 @@ void PhaseDetectorEditor::buttonEvent(Button* button)
void PhaseDetectorEditor::addDetector()
{
std::cout << "Adding detector" << std::endl;
PhaseDetector* pd = (PhaseDetector*) getProcessor();
......@@ -143,16 +146,19 @@ void PhaseDetectorEditor::addDetector()
String itemName = "Detector ";
itemName += detectorNumber;
//jassert detectorNumber == 1;
//std::cout << itemName << std::endl;
detectorSelector->addItem(itemName, detectorNumber);
detectorSelector->setSelectedId(detectorNumber, false);
for (int i = 0; i < detectorNumber-1; i++)
for (int i = 0; i < interfaces.size()-1; i++)
{
interfaces[i]->setVisible(false);
}
}
void PhaseDetectorEditor::saveEditorParameters(XmlElement* xml)
......@@ -208,6 +214,8 @@ DetectorInterface::DetectorInterface(PhaseDetector* pd, Colour c, int id) :
sineWave.startNewSubPath(5,35);
std::cout << "Creating sine wave" << std::endl;
for (double i = 0; i < 2*PI; i += PI/10)
{
sineWave.lineTo(i*12 + 5.0f, -sin(i)*20 + 35);
......@@ -215,6 +223,8 @@ DetectorInterface::DetectorInterface(PhaseDetector* pd, Colour c, int id) :
sineWave.addEllipse(2,35,4,4);
std::cout << "Creating phase buttons" << std::endl;
for (int phase = 0; phase < 4; phase++)
{
ElectrodeButton* phaseButton = new ElectrodeButton(-1);
......@@ -229,6 +239,9 @@ DetectorInterface::DetectorInterface(PhaseDetector* pd, Colour c, int id) :
addAndMakeVisible(phaseButton);
}
std::cout << "Creating combo boxes" << std::endl;
inputSelector = new ComboBox();
inputSelector->setBounds(140,5,50,20);
inputSelector->addItem("-",1);
......@@ -240,6 +253,9 @@ DetectorInterface::DetectorInterface(PhaseDetector* pd, Colour c, int id) :
gateSelector->setBounds(140,30,50,20);
gateSelector->addItem("-",1);
gateSelector->addListener(this);
std::cout << "Populating combo boxes" << std::endl;
for (int i = 1; i < 9; i++)
{
......@@ -261,10 +277,15 @@ DetectorInterface::DetectorInterface(PhaseDetector* pd, Colour c, int id) :
outputSelector->setSelectedId(1);
addAndMakeVisible(outputSelector);
std::cout << "Updating channels" << std::endl;
updateChannels(processor->getNumInputs());
processor->addModule();
std::cout << "Updating processor" << std::endl;
processor->addModule();
}
......@@ -315,6 +336,11 @@ void DetectorInterface::updateChannels(int numChannels)
inputSelector->clear();
inputSelector->addItem("-", 1);
if (numChannels > 2048) // channel count hasn't been updated yet
{
return;
}
for (int i = 0; i < numChannels; i++)
{
......
......@@ -44,6 +44,7 @@ DataWindow::~DataWindow()
void DataWindow::closeButtonPressed()
{
setContentNonOwned(0,false);
setVisible(false);
controlButton->setToggleState(false,false);
}
\ No newline at end of file
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