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

RHD2000Editor can no longer enable/disable headstages while acquisition is active

parent 0557473c
No related branches found
No related tags found
No related merge requests found
......@@ -17,12 +17,12 @@ ifeq ($(CONFIG),Debug)
LIBDIR := build
OBJDIR := build/intermediate/Debug
OUTDIR := build
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3
CXXFLAGS += $(CFLAGS) -export-dynamic -g -pg
LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/ -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt -lftdi -lftgl -pg -ldl -lXext
LDDEPS :=
RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
TARGET := open-ephys
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
endif
......
......@@ -24,7 +24,7 @@
#include "RHD2000Thread.h"
#include "../SourceNode.h"
RHD2000Thread::RHD2000Thread(SourceNode* sn) : DataThread(sn)
RHD2000Thread::RHD2000Thread(SourceNode* sn) : DataThread(sn), isTransmitting(false)
{
evalBoard = new Rhd2000EvalBoard;
dataBlock = new Rhd2000DataBlock(1);
......@@ -123,6 +123,10 @@ RHD2000Thread::~RHD2000Thread()
}
bool RHD2000Thread::isAcquisitionActive()
{
return isTransmitting;
}
int RHD2000Thread::getNumChannels()
{
......@@ -159,7 +163,7 @@ bool RHD2000Thread::foundInputSource()
}
void RHD2000Thread::enableHeadstage(int hsNum, bool enabled)
bool RHD2000Thread::enableHeadstage(int hsNum, bool enabled)
{
evalBoard->enableDataStream(hsNum, enabled);
......@@ -179,6 +183,8 @@ void RHD2000Thread::enableHeadstage(int hsNum, bool enabled)
std::cout << "Enabled data streams: " << evalBoard->getNumEnabledDataStreams() << std::endl;
dataBuffer->resize(getNumChannels(), 10000);
return true;
}
bool RHD2000Thread::isHeadstageEnabled(int hsNum)
......@@ -245,8 +251,7 @@ bool RHD2000Thread::startAcquisition()
startThread();
// isTransmitting = true;
// accumulator = 0;
isTransmitting = true;
return true;
}
......@@ -283,6 +288,8 @@ bool RHD2000Thread::stopAcquisition()
int ledArray[8] = {1, 0, 0, 0, 0, 0, 0, 0};
evalBoard->setLedDisplay(ledArray);
isTransmitting = false;
return true;
}
......
......@@ -63,12 +63,14 @@ public:
bool isHeadstageEnabled(int hsNum);
void enableHeadstage(int hsNum, bool enabled);
bool enableHeadstage(int hsNum, bool enabled);
void setCableLength(int hsNum, float length);
void setNumChannels(int hsNum, int nChannels);
int getNumEventChannels();
bool isAcquisitionActive();
private:
ScopedPointer<Rhd2000EvalBoard> evalBoard;
......@@ -84,6 +86,8 @@ private:
int blockSize;
bool isTransmitting;
bool startAcquisition();
bool stopAcquisition();
......
......@@ -37,7 +37,7 @@ GenericEditor::GenericEditor(GenericProcessor* owner, bool useDefaultParameterEd
: AudioProcessorEditor(owner),
desiredWidth(150), isFading(false), accumulator(0.0),
drawerButton(0), channelSelector(0),
isSelected(false), isEnabled(true), tNum(-1)
isSelected(false), isEnabled(true), tNum(-1), acquisitionIsActive(false)
{
constructorInitialize(owner, useDefaultParameterEditors);
}
......@@ -258,6 +258,8 @@ void GenericEditor::startAcquisition()
}
acquisitionIsActive = true;
}
void GenericEditor::stopAcquisition()
......@@ -273,6 +275,7 @@ void GenericEditor::stopAcquisition()
}
acquisitionIsActive = false;
}
......
......@@ -222,6 +222,9 @@ public:
/** Stores the font used to display the editor's name. */
Font titleFont;
/** True if data acquisition has begun. */
bool acquisitionIsActive;
protected:
......@@ -259,6 +262,7 @@ private:
bool isSelected;
bool isEnabled;
int tNum;
/**initializing function Used to share constructor functions*/
......
......@@ -99,8 +99,11 @@ HeadstageOptionsInterface::~HeadstageOptionsInterface()
void HeadstageOptionsInterface::buttonClicked(Button* button)
{
if (~(board->isThreadRunning()))
if (!(editor->acquisitionIsActive))
{
//std::cout << "Acquisition is not active" << std::endl;
if (isEnabled)
{
isEnabled = false;
......@@ -109,11 +112,12 @@ void HeadstageOptionsInterface::buttonClicked(Button* button)
}
board->enableHeadstage(hsNumber, isEnabled);
}
repaint();
repaint();
editor->getEditorViewport()->makeEditorVisible(editor, false, true);
editor->getEditorViewport()->makeEditorVisible(editor, false, true);
}
}
// void HeadstageOptionsInterface::mouseUp(const MouseEvent& event)
......
......@@ -23,7 +23,7 @@
<LINUX_MAKE targetFolder="Builds/Linux" vstFolder="~/SDKs/vstsdk2.4" juceFolder="JuceLibraryCode"
extraLinkerFlags="-lftdi -lftgl -pg -ldl -lXext" extraCompilerFlags="-export-dynamic -g -pg">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="open-ephys"
<CONFIGURATION name="Debug" isDebug="0" optimisation="3" targetName="open-ephys"
libraryPath="/usr/X11R6/lib/"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="3" targetName="open-ephys"
libraryPath="/usr/X11R6/lib/"/>
......
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