Skip to content
Snippets Groups Projects
Commit 3fe158fa authored by Adam Mokhtari's avatar Adam Mokhtari
Browse files

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

parents 2ef4ec75 56937928
No related branches found
No related tags found
No related merge requests found
Showing
with 1549 additions and 1022 deletions
......@@ -8,6 +8,11 @@
Builds/Linux/build/open-ephys
Resources/Fonts/font_serializer/Builds/Linux/build/
JuceLibraryCode/jucer/Builds/Linux/build
JuceLibraryCode/jucer/Builds/VisualStudio2010/Debug
JuceLibraryCode/jucer/Builds/VisualStudio2010/Release
JuceLibraryCode/jucer/Builds/VisualStudio2010/*.user
JuceLibraryCode/jucer/Builds/VisualStudio2010/The Jucer.sdf
JuceLibraryCode/jucer/Builds/VisualStudio2010/The Jucer.v11.suo
# 3. extra files
Builds/Linux/build/data
......@@ -22,6 +27,7 @@ Builds/VisualStudio2012/Debug
Builds/VisualStudio2012/Release
Builds/VisualStudio2012/ipch
Builds/VisualStudio2012/open-ephys.sdf
Builds/VisualStudio2012/open-ephys.opensdf
Builds/VisualStudio2012/open-ephys.suo
Builds/VisualStudio2012/open-ephys.v11.suo
Builds/VisualStudio2012/open-ephys.vcxproj.user
......
......@@ -75,6 +75,7 @@ OBJECTS := \
$(OBJDIR)/SpikeDisplayNode_9c52e4ad.o \
$(OBJDIR)/WiFiOutput_fa464ec5.o \
$(OBJDIR)/LfpDisplayNode_30ef22fd.o \
$(OBJDIR)/RecordControl_3e1c6062.o \
$(OBJDIR)/Merger_2f90542e.o \
$(OBJDIR)/Splitter_6e27a57b.o \
$(OBJDIR)/SpikePlot_c1cf98bd.o \
......@@ -91,6 +92,7 @@ OBJECTS := \
$(OBJDIR)/SpikeDetector_300d85e7.o \
$(OBJDIR)/AudioNode_94606ff3.o \
$(OBJDIR)/EventNode_95c842b7.o \
$(OBJDIR)/RecordControlEditor_244084cb.o \
$(OBJDIR)/ResamplingNodeEditor_f2d6f061.o \
$(OBJDIR)/FPGAOutputEditor_cfe00f8a.o \
$(OBJDIR)/ArduinoOutputEditor_1118f008.o \
......@@ -317,6 +319,11 @@ $(OBJDIR)/LfpDisplayNode_30ef22fd.o: ../../Source/Processors/LfpDisplayNode.cpp
@echo "Compiling LfpDisplayNode.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/RecordControl_3e1c6062.o: ../../Source/Processors/Utilities/RecordControl.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling RecordControl.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/Merger_2f90542e.o: ../../Source/Processors/Utilities/Merger.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling Merger.cpp"
......@@ -397,6 +404,11 @@ $(OBJDIR)/EventNode_95c842b7.o: ../../Source/Processors/EventNode.cpp
@echo "Compiling EventNode.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/RecordControlEditor_244084cb.o: ../../Source/Processors/Editors/RecordControlEditor.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling RecordControlEditor.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/ResamplingNodeEditor_f2d6f061.o: ../../Source/Processors/Editors/ResamplingNodeEditor.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling ResamplingNodeEditor.cpp"
......
This diff is collapsed.
......@@ -154,6 +154,7 @@
<ClCompile Include="..\..\Source\Processors\SpikeDisplayNode.cpp"/>
<ClCompile Include="..\..\Source\Processors\WiFiOutput.cpp"/>
<ClCompile Include="..\..\Source\Processors\LfpDisplayNode.cpp"/>
<ClCompile Include="..\..\Source\Processors\Utilities\RecordControl.cpp"/>
<ClCompile Include="..\..\Source\Processors\Utilities\Merger.cpp"/>
<ClCompile Include="..\..\Source\Processors\Utilities\Splitter.cpp"/>
<ClCompile Include="..\..\Source\Processors\Visualization\SpikePlotting\SpikePlot.cpp"/>
......@@ -170,6 +171,7 @@
<ClCompile Include="..\..\Source\Processors\SpikeDetector.cpp"/>
<ClCompile Include="..\..\Source\Processors\AudioNode.cpp"/>
<ClCompile Include="..\..\Source\Processors\EventNode.cpp"/>
<ClCompile Include="..\..\Source\Processors\Editors\RecordControlEditor.cpp"/>
<ClCompile Include="..\..\Source\Processors\Editors\ResamplingNodeEditor.cpp"/>
<ClCompile Include="..\..\Source\Processors\Editors\FPGAOutputEditor.cpp"/>
<ClCompile Include="..\..\Source\Processors\Editors\ArduinoOutputEditor.cpp"/>
......@@ -261,6 +263,7 @@
<ClInclude Include="..\..\Source\Processors\SpikeDisplayNode.h"/>
<ClInclude Include="..\..\Source\Processors\WiFiOutput.h"/>
<ClInclude Include="..\..\Source\Processors\LfpDisplayNode.h"/>
<ClInclude Include="..\..\Source\Processors\Utilities\RecordControl.h"/>
<ClInclude Include="..\..\Source\Processors\Utilities\Merger.h"/>
<ClInclude Include="..\..\Source\Processors\Utilities\Splitter.h"/>
<ClInclude Include="..\..\Source\Processors\Visualization\SpikePlotting\SpikePlot.h"/>
......@@ -279,6 +282,7 @@
<ClInclude Include="..\..\Source\Processors\SpikeDetector.h"/>
<ClInclude Include="..\..\Source\Processors\AudioNode.h"/>
<ClInclude Include="..\..\Source\Processors\EventNode.h"/>
<ClInclude Include="..\..\Source\Processors\Editors\RecordControlEditor.h"/>
<ClInclude Include="..\..\Source\Processors\Editors\ResamplingNodeEditor.h"/>
<ClInclude Include="..\..\Source\Processors\Editors\FPGAOutputEditor.h"/>
<ClInclude Include="..\..\Source\Processors\Editors\ArduinoOutputEditor.h"/>
......
......@@ -331,6 +331,9 @@
<ClCompile Include="..\..\Source\Processors\LfpDisplayNode.cpp">
<Filter>open-ephys\Source\Processors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Utilities\RecordControl.cpp">
<Filter>open-ephys\Source\Processors\Utilities</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Utilities\Merger.cpp">
<Filter>open-ephys\Source\Processors\Utilities</Filter>
</ClCompile>
......@@ -379,6 +382,9 @@
<ClCompile Include="..\..\Source\Processors\EventNode.cpp">
<Filter>open-ephys\Source\Processors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Editors\RecordControlEditor.cpp">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Editors\ResamplingNodeEditor.cpp">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClCompile>
......@@ -648,6 +654,9 @@
<ClInclude Include="..\..\Source\Processors\LfpDisplayNode.h">
<Filter>open-ephys\Source\Processors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Utilities\RecordControl.h">
<Filter>open-ephys\Source\Processors\Utilities</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Utilities\Merger.h">
<Filter>open-ephys\Source\Processors\Utilities</Filter>
</ClInclude>
......@@ -702,6 +711,9 @@
<ClInclude Include="..\..\Source\Processors\EventNode.h">
<Filter>open-ephys\Source\Processors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Editors\RecordControlEditor.h">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Editors\ResamplingNodeEditor.h">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClInclude>
......
......@@ -161,12 +161,18 @@
<ClCompile Include="..\..\Source\Dsp\State.cpp" />
<ClCompile Include="..\..\Source\Audio\AudioComponent.cpp" />
<ClCompile Include="..\..\Source\Processors\ArduinoOutput.cpp" />
<ClCompile Include="..\..\Source\Processors\AudioResamplingNode.cpp" />
<ClCompile Include="..\..\Source\Processors\Channel.cpp" />
<ClCompile Include="..\..\Source\Processors\Editors\RecordControlEditor.cpp" />
<ClCompile Include="..\..\Source\Processors\Editors\ResamplingNodeEditor.cpp" />
<ClCompile Include="..\..\Source\Processors\EventDetector.cpp" />
<ClCompile Include="..\..\Source\Processors\FPGAOutput.cpp" />
<ClCompile Include="..\..\Source\Processors\Parameter.cpp" />
<ClCompile Include="..\..\Source\Processors\PhaseDetector.cpp" />
<ClCompile Include="..\..\Source\Processors\Serial\ofArduino.cpp" />
<ClCompile Include="..\..\Source\Processors\Serial\ofSerial.cpp" />
<ClCompile Include="..\..\Source\Processors\SpikeDisplayNode.cpp" />
<ClCompile Include="..\..\Source\Processors\Utilities\RecordControl.cpp" />
<ClCompile Include="..\..\Source\Processors\WiFiOutput.cpp" />
<ClCompile Include="..\..\Source\Processors\LfpDisplayNode.cpp" />
<ClCompile Include="..\..\Source\Processors\Utilities\Merger.cpp" />
......@@ -263,13 +269,19 @@
<ClInclude Include="..\..\Source\Dsp\Utilities.h" />
<ClInclude Include="..\..\Source\Audio\AudioComponent.h" />
<ClInclude Include="..\..\Source\Processors\ArduinoOutput.h" />
<ClInclude Include="..\..\Source\Processors\AudioResamplingNode.h" />
<ClInclude Include="..\..\Source\Processors\Channel.h" />
<ClInclude Include="..\..\Source\Processors\Editors\RecordControlEditor.h" />
<ClInclude Include="..\..\Source\Processors\Editors\ResamplingNodeEditor.h" />
<ClInclude Include="..\..\Source\Processors\EventDetector.h" />
<ClInclude Include="..\..\Source\Processors\FPGAOutput.h" />
<ClInclude Include="..\..\Source\Processors\Parameter.h" />
<ClInclude Include="..\..\Source\Processors\PhaseDetector.h" />
<ClInclude Include="..\..\Source\Processors\Serial\ofArduino.h" />
<ClInclude Include="..\..\Source\Processors\Serial\ofConstants.h" />
<ClInclude Include="..\..\Source\Processors\Serial\ofSerial.h" />
<ClInclude Include="..\..\Source\Processors\SpikeDisplayNode.h" />
<ClInclude Include="..\..\Source\Processors\Utilities\RecordControl.h" />
<ClInclude Include="..\..\Source\Processors\WiFiOutput.h" />
<ClInclude Include="..\..\Source\Processors\LfpDisplayNode.h" />
<ClInclude Include="..\..\Source\Processors\Utilities\Merger.h" />
......
......@@ -345,6 +345,24 @@
<ClCompile Include="..\..\Source\Processors\FPGAOutput.cpp">
<Filter>open-ephys\Source\Processors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Channel.cpp">
<Filter>open-ephys\Source\Processors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\AudioResamplingNode.cpp">
<Filter>open-ephys\Source\Processors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Editors\ResamplingNodeEditor.cpp">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\PhaseDetector.cpp">
<Filter>open-ephys\Source\Processors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Editors\RecordControlEditor.cpp">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Utilities\RecordControl.cpp">
<Filter>open-ephys\Source\Processors\Utilities</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Source\AccessClass.h">
......@@ -647,5 +665,23 @@
<ClInclude Include="..\..\Source\Processors\FPGAOutput.h">
<Filter>open-ephys\Source\Processors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Channel.h">
<Filter>open-ephys\Source\Processors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\AudioResamplingNode.h">
<Filter>open-ephys\Source\Processors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Editors\ResamplingNodeEditor.h">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\PhaseDetector.h">
<Filter>open-ephys\Source\Processors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Editors\RecordControlEditor.h">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Utilities\RecordControl.h">
<Filter>open-ephys\Source\Processors\Utilities</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
This diff is collapsed.
......@@ -10,8 +10,8 @@
*/
#ifndef __APPHEADERFILE_DFAE8F6C__
#define __APPHEADERFILE_DFAE8F6C__
#ifndef __APPHEADERFILE_4C95AFCD__
#define __APPHEADERFILE_4C95AFCD__
#include "AppConfig.h"
#include "juce_amalgamated.h"
......@@ -24,4 +24,4 @@ namespace ProjectInfo
const int versionNumber = 0x0;
}
#endif // __APPHEADERFILE_DFAE8F6C__
#endif // __APPHEADERFILE_4C95AFCD__
......@@ -42,7 +42,7 @@ AudioProcessorEditor* ArduinoOutput::createEditor()
return editor;
}
void ArduinoOutput::handleEvent(int eventType, MidiMessage& event)
void ArduinoOutput::handleEvent(int eventType, MidiMessage& event, int sampleNum)
{
if (eventType == TTL)
{
......
......@@ -57,7 +57,7 @@ public:
void setParameter (int parameterIndex, float newValue);
void handleEvent(int eventType, MidiMessage& event);
void handleEvent(int eventType, MidiMessage& event, int sampleNum);
bool enable();
bool disable();
......
......@@ -166,32 +166,35 @@ void AudioNode::process(AudioSampleBuffer &buffer,
// clear the left and right channels
buffer.clear(0,0,buffer.getNumSamples());
buffer.clear(1,0,buffer.getNumSamples());
for (int i = 2; i < buffer.getNumChannels(); i++)
if (channelPointers.size() > 0)
{
if (channelPointers[i-2]->isMonitored)
for (int i = 2; i < buffer.getNumChannels(); i++)
{
buffer.addFrom(0, // destination channel
0, // destination start sample
buffer, // source
i, // source channel
0, // source start sample
buffer.getNumSamples(), // number of samples
volume // gain to apply
);
buffer.addFrom(1, // destination channel
0, // destination start sample
buffer, // source
i, // source channel
0, // source start sample
buffer.getNumSamples(), // number of samples
volume // gain to apply
);
}
if (channelPointers[i-2]->isMonitored)
{
buffer.addFrom(0, // destination channel
0, // destination start sample
buffer, // source
i, // source channel
0, // source start sample
buffer.getNumSamples(), // number of samples
volume // gain to apply
);
buffer.addFrom(1, // destination channel
0, // destination start sample
buffer, // source
i, // source channel
0, // source start sample
buffer.getNumSamples(), // number of samples
volume // gain to apply
);
}
}
}
}
......@@ -30,6 +30,7 @@ Channel::Channel(GenericProcessor* p, int n) :
sampleRate(44100.0f), bitVolts(1.0f), eventType(0)
{
nodeId = p->getNodeId();
createDefaultName();
}
......@@ -45,7 +46,14 @@ Channel::Channel(const Channel& ch)
bitVolts = ch.bitVolts;
name = ch.name;
eventType = ch.eventType;
nodeId = ch.nodeId;
num = ch.num;
}
void Channel::setProcessor(GenericProcessor* p)
{
processor = p;
nodeId = p->getNodeId();
}
String Channel::getName()
......@@ -66,5 +74,5 @@ void Channel::reset()
void Channel::createDefaultName()
{
name = String("CH");
name += num;
name += (num + 1);
}
\ No newline at end of file
......@@ -60,9 +60,14 @@ public:
void reset();
void setProcessor(GenericProcessor*);
// channel number:
int num;
// node id
int nodeId;
// event info:
int eventType;
......
......@@ -97,7 +97,7 @@ int FPGAThread::getNumChannels()
int FPGAThread::getNumEventChannels()
{
return 8;
return 16; // 8 inputs, 8 outputs
}
float FPGAThread::getSampleRate()
......@@ -295,7 +295,7 @@ bool FPGAThread::updateBuffer()
if (j % 200 != 0)
{
std::cout << "Buffer not aligned " << j << " " << accumulator << std::endl;
return false;
//return false;
}
if (i == 1)
......@@ -323,7 +323,14 @@ bool FPGAThread::updateBuffer()
eventCode = pBuffer[j+6]; // TTL input
ttl_out = pBuffer[j+7]; // TTL output
ttl_out = pBuffer[j+7];
if (ttl_out > 0)
{
eventCode |= 0x100; // TTL output
//std::cout << "TLL out!" << std::endl;
}
j += 8; //move cursor to 1st data byte
......@@ -486,6 +493,9 @@ bool FPGAThread::initializeFPGA(bool verbose)
printf("FrontPanel support is not enabled.\n");
}
dev->SetWireInValue(0x01, 0);
dev->UpdateWireIns();
return true;
// this is not executed (after returning true)
......
/*
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2012 Open Ephys
------------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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 "RecordControlEditor.h"
#include "../Utilities/RecordControl.h"
#include "ChannelSelector.h"
#include <stdio.h>
RecordControlEditor::RecordControlEditor (GenericProcessor* parentNode)
: GenericEditor(parentNode)
{
desiredWidth = 170;
channelSelector->eventsOnly = true;
chanSel = new Label("Chanel Text","Available Event Channels");
chanSel->setEditable(false);
chanSel->setJustificationType(Justification::centredLeft);
chanSel->setBounds(20,30,120,20);
addAndMakeVisible(chanSel);
availableChans = new ComboBox("Event Channels");
availableChans->setEditableText(false);
availableChans->setJustificationType(Justification::centredLeft);
availableChans->addListener(this);
availableChans->setBounds(20,60,120,20);
availableChans->setSelectedId(0);
addAndMakeVisible(availableChans);
}
RecordControlEditor::~RecordControlEditor()
{
deleteAllChildren();
}
void RecordControlEditor::comboBoxChanged(ComboBox* comboBox)
{
RecordControl *processor = (RecordControl*)getProcessor();
if (comboBox->getSelectedId() > 0)
processor->updateTriggerChannel(processor->eventChannels[comboBox->getSelectedId()-1]->num );
else
processor->updateTriggerChannel(-1);
}
void RecordControlEditor::updateSettings()
{
availableChans->clear();
GenericProcessor* processor = getProcessor();
for (int i = 0; i < processor->eventChannels.size() ; i++)
availableChans->addItem(processor->eventChannels[i]->name,i+1);
}
\ No newline at end of file
/*
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2012 Open Ephys
------------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RECORDCONTROLEDITOR_H_F9C69E2B__
#define __RECORDCONTROLEDITOR_H_F9C69E2B__
#ifdef WIN32
#include <Windows.h>
#endif
#include "../../../JuceLibraryCode/JuceHeader.h"
#include "GenericEditor.h"
class RecordControlEditor : public GenericEditor,
public ComboBox::Listener
{
public:
RecordControlEditor (GenericProcessor* parentNode);
~RecordControlEditor();
void comboBoxChanged(ComboBox* comboBox);
void updateSettings();
private:
ComboBox* availableChans;
Label *chanSel;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RecordControlEditor);
};
#endif
\ No newline at end of file
......@@ -60,7 +60,7 @@ AudioProcessorEditor* FPGAOutput::createEditor()
return editor;
}
void FPGAOutput::handleEvent(int eventType, MidiMessage& event)
void FPGAOutput::handleEvent(int eventType, MidiMessage& event, int sampleNum)
{
if (eventType == TTL && isEnabled)
{
......@@ -71,6 +71,8 @@ void FPGAOutput::handleEvent(int eventType, MidiMessage& event)
int eventId = *(dataptr+2);
int eventChannel = *(dataptr+3);
// std::cout << "FPGA output received event: " << eventNodeId << " " << eventId << " " << eventChannel << std::endl;
if (eventId == 1 && eventChannel == TTLchannel) // channel 3 only at the moment
{
sendActionMessage("HI");
......@@ -78,16 +80,16 @@ void FPGAOutput::handleEvent(int eventType, MidiMessage& event)
if (!continuousStim)
startTimer(5); // pulse width
else
startTimer(10); // pulse width
// else
// startTimer(25); // pulse width
} else if (eventId == 0 && eventChannel == TTLchannel)
} else if (eventId == 0 && eventChannel == TTLchannel)// && eventChannel == TTLchannel)
{
if (!continuousStim)
{
if (continuousStim)
{ /// this isn't working
sendActionMessage("LO");
isEnabled = false;
stopTimer();
isEnabled = true;
// stopTimer();
}
}
......@@ -166,6 +168,7 @@ void FPGAOutput::timerCallback()
isEnabled = true;
stopTimer();
} else {
if (isEnabled)
......
......@@ -56,7 +56,7 @@ public:
void process(AudioSampleBuffer &buffer, MidiBuffer &midiMessages, int& nSamples);
void setParameter (int parameterIndex, float newValue);
void handleEvent(int eventType, MidiMessage& event);
void handleEvent(int eventType, MidiMessage& event, int sampleNum);
AudioProcessorEditor* createEditor();
......
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