Skip to content
Snippets Groups Projects
Commit cbea527f authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Move Electrode Utility Buttons to its own file

parent 564db5c6
Branches
Tags
No related merge requests found
Showing with 3021 additions and 3792 deletions
......@@ -93,6 +93,7 @@ OBJECTS := \
$(OBJDIR)/SpikeDetector_300d85e7.o \
$(OBJDIR)/AudioNode_94606ff3.o \
$(OBJDIR)/EventNode_95c842b7.o \
$(OBJDIR)/ElectrodeButtons_a6064cc.o \
$(OBJDIR)/LfpTriggeredAverageEditor_101d75b.o \
$(OBJDIR)/ChannelMappingEditor_dd803b0.o \
$(OBJDIR)/FileReaderEditor_16fd7744.o \
......@@ -433,6 +434,11 @@ $(OBJDIR)/EventNode_95c842b7.o: ../../Source/Processors/EventNode.cpp
@echo "Compiling EventNode.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/ElectrodeButtons_a6064cc.o: ../../Source/Processors/Editors/ElectrodeButtons.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling ElectrodeButtons.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/LfpTriggeredAverageEditor_101d75b.o: ../../Source/Processors/Editors/LfpTriggeredAverageEditor.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling LfpTriggeredAverageEditor.cpp"
......
This diff is collapsed.
......@@ -306,6 +306,7 @@
<ClCompile Include="..\..\Source\Processors\SpikeDetector.cpp"/>
<ClCompile Include="..\..\Source\Processors\AudioNode.cpp"/>
<ClCompile Include="..\..\Source\Processors\EventNode.cpp"/>
<ClCompile Include="..\..\Source\Processors\Editors\ElectrodeButtons.cpp"/>
<ClCompile Include="..\..\Source\Processors\Editors\LfpTriggeredAverageEditor.cpp"/>
<ClCompile Include="..\..\Source\Processors\Editors\ChannelMappingEditor.cpp"/>
<ClCompile Include="..\..\Source\Processors\Editors\FileReaderEditor.cpp"/>
......@@ -1504,6 +1505,7 @@
<ClInclude Include="..\..\Source\Processors\SpikeDetector.h"/>
<ClInclude Include="..\..\Source\Processors\AudioNode.h"/>
<ClInclude Include="..\..\Source\Processors\EventNode.h"/>
<ClInclude Include="..\..\Source\Processors\Editors\ElectrodeButtons.h"/>
<ClInclude Include="..\..\Source\Processors\Editors\LfpTriggeredAverageEditor.h"/>
<ClInclude Include="..\..\Source\Processors\Editors\ChannelMappingEditor.h"/>
<ClInclude Include="..\..\Source\Processors\Editors\FileReaderEditor.h"/>
......
......@@ -505,6 +505,9 @@
<ClCompile Include="..\..\Source\Processors\EventNode.cpp">
<Filter>open-ephys\Source\Processors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Editors\ElectrodeButtons.cpp">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\Editors\LfpTriggeredAverageEditor.cpp">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClCompile>
......@@ -2034,6 +2037,9 @@
<ClInclude Include="..\..\Source\Processors\EventNode.h">
<Filter>open-ephys\Source\Processors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Editors\ElectrodeButtons.h">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\Editors\LfpTriggeredAverageEditor.h">
<Filter>open-ephys\Source\Processors\Editors</Filter>
</ClInclude>
......
......@@ -28,7 +28,7 @@
#include "../../../JuceLibraryCode/JuceHeader.h"
#include "GenericEditor.h"
#include "SpikeDetectorEditor.h" // for ElectrodeButton and ElectrodeEditorButton
#include "ElectrodeButtons.h" // for ElectrodeButton and ElectrodeEditorButton
#define NUM_REFERENCES 4
......
/*
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2013 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 "ElectrodeButtons.h"
void ElectrodeButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDown)
{
if (getToggleState() == true)
g.setColour(Colours::orange);
else
g.setColour(Colours::darkgrey);
if (isMouseOver)
g.setColour(Colours::white);
g.fillRect(0,0,getWidth(),getHeight());
// g.setFont(buttonFont);
g.setColour(Colours::black);
g.drawRect(0,0,getWidth(),getHeight(),1.0);
if (chan >= 0)
g.drawText(String(chan),0,0,getWidth(),getHeight(),Justification::centred,true);
}
void ElectrodeEditorButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDown)
{
if (getToggleState() == true)
g.setColour(Colours::darkgrey);
else
g.setColour(Colours::lightgrey);
g.setFont(font);
g.drawText(name,0,0,getWidth(),getHeight(),Justification::left,true);
}
\ No newline at end of file
/*
------------------------------------------------------------------
This file is part of the Open Ephys GUI
Copyright (C) 2013 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 __ELECTRODEBUTTONS_H_BDCEE716__
#define __ELECTRODEBUTTONS_H_BDCEE716__
#include "../../../JuceLibraryCode/JuceHeader.h"
/**
Used to select individual electrodes within a multichannel electrode.
@see SpikeDetectorEditor.
*/
class ElectrodeButton : public Button
{
public:
ElectrodeButton(int chan_) : Button("Electrode"), chan(chan_)
{
setClickingTogglesState(true);
//setRadioGroupId(299);
setToggleState(true, false);
}
~ElectrodeButton() {}
int getChannelNum()
{
return chan;
}
void setChannelNum(int i)
{
chan = i;
}
private:
void paintButton(Graphics& g, bool isMouseOver, bool isButtonDown);
int chan;
};
/**
Utility button for Editors.
@see SpikeDetectorEditor
*/
class ElectrodeEditorButton : public Button
{
public:
ElectrodeEditorButton(const String& name_, Font font_) : Button("Electrode Editor"),
name(name_), font(font_)
{
if (name.equalsIgnoreCase("edit") || name.equalsIgnoreCase("monitor"))
setClickingTogglesState(true);
}
~ElectrodeEditorButton() {}
private:
void paintButton(Graphics& g, bool isMouseOver, bool isButtonDown);
const String name;
Font font;
};
#endif // __ELECTRODEBUTTONS_H_BDCEE716__
......@@ -28,7 +28,7 @@
#include "../../../JuceLibraryCode/JuceHeader.h"
#include "GenericEditor.h"
#include "SpikeDetectorEditor.h"
#include "ElectrodeButtons.h"
class DetectorInterface;
class PhaseDetector;
......
......@@ -27,7 +27,7 @@
#include "../../../JuceLibraryCode/JuceHeader.h"
#include "GenericEditor.h"
#include "SpikeDetectorEditor.h" // for ElectrodeButton
#include "ElectrodeButtons.h" // for ElectrodeButton
class HeadstageOptionsInterface;
class SampleRateInterface;
......
......@@ -540,44 +540,6 @@ void SpikeDetectorEditor::drawElectrodeButtons(int ID)
thresholdSlider->setValues(thresholds);
}
void ElectrodeButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDown)
{
if (getToggleState() == true)
g.setColour(Colours::orange);
else
g.setColour(Colours::darkgrey);
if (isMouseOver)
g.setColour(Colours::white);
g.fillRect(0,0,getWidth(),getHeight());
// g.setFont(buttonFont);
g.setColour(Colours::black);
g.drawRect(0,0,getWidth(),getHeight(),1.0);
if (chan >= 0)
g.drawText(String(chan),0,0,getWidth(),getHeight(),Justification::centred,true);
}
void ElectrodeEditorButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDown)
{
if (getToggleState() == true)
g.setColour(Colours::darkgrey);
else
g.setColour(Colours::lightgrey);
g.setFont(font);
g.drawText(name,0,0,getWidth(),getHeight(),Justification::left,true);
}
ThresholdSlider::ThresholdSlider(Font f) : Slider("name"), font(f)
{
......
......@@ -27,71 +27,12 @@
#include "../../../JuceLibraryCode/JuceHeader.h"
#include "GenericEditor.h"
#include "ElectrodeButtons.h"
class TriangleButton;
class UtilityButton;
/**
Used to select individual electrodes within a multichannel electrode.
@see SpikeDetectorEditor.
*/
class ElectrodeButton : public Button
{
public:
ElectrodeButton(int chan_) : Button("Electrode"), chan(chan_)
{
setClickingTogglesState(true);
//setRadioGroupId(299);
setToggleState(true, false);
}
~ElectrodeButton() {}
int getChannelNum()
{
return chan;
}
void setChannelNum(int i)
{
chan = i;
}
private:
void paintButton(Graphics& g, bool isMouseOver, bool isButtonDown);
int chan;
};
/**
Utility button for the SpikeDetectorEditor.
@see SpikeDetectorEditor
*/
class ElectrodeEditorButton : public Button
{
public:
ElectrodeEditorButton(const String& name_, Font font_) : Button("Electrode Editor"),
name(name_), font(font_)
{
if (name.equalsIgnoreCase("edit") || name.equalsIgnoreCase("monitor"))
setClickingTogglesState(true);
}
~ElectrodeEditorButton() {}
private:
void paintButton(Graphics& g, bool isMouseOver, bool isButtonDown);
const String name;
Font font;
};
/**
......
......@@ -324,6 +324,10 @@
<FILE id="hGnGAjh" name="EventNode.cpp" compile="1" resource="0" file="Source/Processors/EventNode.cpp"/>
<FILE id="dUtRN6" name="EventNode.h" compile="0" resource="0" file="Source/Processors/EventNode.h"/>
<GROUP id="AqvwO6w" name="Editors">
<FILE id="E2PXvz" name="ElectrodeButtons.cpp" compile="1" resource="0"
file="Source/Processors/Editors/ElectrodeButtons.cpp"/>
<FILE id="yriJOG" name="ElectrodeButtons.h" compile="0" resource="0"
file="Source/Processors/Editors/ElectrodeButtons.h"/>
<FILE id="wyH6Hs" name="LfpTriggeredAverageEditor.cpp" compile="1"
resource="0" file="Source/Processors/Editors/LfpTriggeredAverageEditor.cpp"/>
<FILE id="GE3VJI" name="LfpTriggeredAverageEditor.h" compile="0" resource="0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment