Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Builds/Linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ OBJECTS := \
$(OBJDIR)/ParameterEditor_112258eb.o \
$(OBJDIR)/Parameter_b3e5ac9e.o \
$(OBJDIR)/ProcessorGraph_8c3a250a.o \
$(OBJDIR)/DataQueue_d6cc297a.o \
$(OBJDIR)/RecordThread_fb797372.o \
$(OBJDIR)/EngineConfigWindow_4fd44ceb.o \
$(OBJDIR)/OriginalRecording_d6dc3293.o \
$(OBJDIR)/RecordEngine_97ef83aa.o \
Expand Down Expand Up @@ -442,6 +444,16 @@ $(OBJDIR)/ProcessorGraph_8c3a250a.o: ../../Source/Processors/ProcessorGraph/Proc
@echo "Compiling ProcessorGraph.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/DataQueue_d6cc297a.o: ../../Source/Processors/RecordNode/DataQueue.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling DataQueue.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/RecordThread_fb797372.o: ../../Source/Processors/RecordNode/RecordThread.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling RecordThread.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/EngineConfigWindow_4fd44ceb.o: ../../Source/Processors/RecordNode/EngineConfigWindow.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling EngineConfigWindow.cpp"
Expand Down
32 changes: 23 additions & 9 deletions Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Builds/VisualStudio2012/open-ephys.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@
<ClCompile Include="..\..\Source\Processors\Parameter\ParameterEditor.cpp"/>
<ClCompile Include="..\..\Source\Processors\Parameter\Parameter.cpp"/>
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\OriginalRecording.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordEngine.cpp"/>
Expand Down Expand Up @@ -1525,6 +1527,9 @@
<ClInclude Include="..\..\Source\Processors\Parameter\ParameterEditor.h"/>
<ClInclude Include="..\..\Source\Processors\Parameter\Parameter.h"/>
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\OriginalRecording.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordEngine.h"/>
Expand Down
15 changes: 15 additions & 0 deletions Builds/VisualStudio2012/open-ephys.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp">
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClCompile>
Expand Down Expand Up @@ -2073,6 +2079,15 @@
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h">
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClInclude>
Expand Down
20 changes: 15 additions & 5 deletions Builds/VisualStudio2013/open-ephys.sln
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 11.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
Project("{5A05F353-1D63-394C-DFB0-981BB2309002}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
Debug|x64 = Debug|x64
Debug64|Win32 = Debug64|Win32
Debug64|x64 = Debug64|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release64|Win32 = Release64|Win32
Release64|x64 = Release64|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.ActiveCfg = Debug|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.Build.0 = Debug|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|x64.ActiveCfg = Debug|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|Win32.ActiveCfg = Debug64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.ActiveCfg = Debug64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.Build.0 = Debug64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|x64.ActiveCfg = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|Win32.ActiveCfg = Release64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.ActiveCfg = Release64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.Build.0 = Release64|x64
EndGlobalSection
Expand Down
5 changes: 5 additions & 0 deletions Builds/VisualStudio2013/open-ephys.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@
<ClCompile Include="..\..\Source\Processors\Parameter\ParameterEditor.cpp"/>
<ClCompile Include="..\..\Source\Processors\Parameter\Parameter.cpp"/>
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\OriginalRecording.cpp"/>
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordEngine.cpp"/>
Expand Down Expand Up @@ -1529,6 +1531,9 @@
<ClInclude Include="..\..\Source\Processors\Parameter\ParameterEditor.h"/>
<ClInclude Include="..\..\Source\Processors\Parameter\Parameter.h"/>
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\OriginalRecording.h"/>
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordEngine.h"/>
Expand Down
15 changes: 15 additions & 0 deletions Builds/VisualStudio2013/open-ephys.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp">
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClCompile>
Expand Down Expand Up @@ -2073,6 +2079,15 @@
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h">
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h">
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
</ClInclude>
Expand Down
12 changes: 11 additions & 1 deletion Source/CoreServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ void setAppendTextToRecordingDir(String text)
getControlPanel()->setAppendText(text);
}

String getSelectedRecordEngineId()
{
return getControlPanel()->getSelectedRecordEngineId();
}

bool setSelectedRecordEngineId(String id)
{
return getControlPanel()->setSelectedRecordEngineId(id);
}

namespace RecordNode
{
void createNewrecordingDir()
Expand Down Expand Up @@ -145,7 +155,7 @@ int addSpikeElectrode(SpikeRecordInfo* elec)
}
};

PLUGIN_API const char* getApplicationResource(const char* name, int& size)
const char* getApplicationResource(const char* name, int& size)
{
return BinaryData::getNamedResource(name, size);
}
Expand Down
8 changes: 8 additions & 0 deletions Source/CoreServices.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ PLUGIN_API void setPrependTextToRecordingDir(String text);
/** Manually set the text to be appended to the recording directory */
PLUGIN_API void setAppendTextToRecordingDir(String text);

/** Gets the ID fo the selected Record Engine*/
PLUGIN_API String getSelectedRecordEngineId();

/** Sets a specific RecordEngine to be used based on its id.
Return true if there is an engine with the specified ID and it's possible to
change the current engine or false otherwise. */
PLUGIN_API bool setSelectedRecordEngineId(String id);

namespace RecordNode
{
/** Forces creation of new directory on recording */
Expand Down
29 changes: 29 additions & 0 deletions Source/Plugins/Headers/CoreServicesHeader.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
------------------------------------------------------------------

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/>.

*/

/*
This file references the CoreServices namespace header, in case a plugin type that usually doesn't
access this namespace (FileSource, for example) needs, as a particular case, use its functionality
*/

#include "../../CoreServices.h"
32 changes: 30 additions & 2 deletions Source/Plugins/KWIKFormat/FileSource/KwikFileSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
*/
#include <H5Cpp.h>
#include "KwikFileSource.h"

#include <CoreServicesHeader.h>


using namespace H5;

#define PROCESS_ERROR std::cerr << "KwikFilesource exception: " << error.getCDetailMsg() << std::endl

KWIKFileSource::KWIKFileSource() : samplePos(0)
KWIKFileSource::KWIKFileSource() : samplePos(0), skipRecordEngineCheck(false)
{
}

Expand Down Expand Up @@ -247,4 +247,32 @@ void KWIKFileSource::processChannelData(int16* inBuffer, float* outBuffer, int c
*(outBuffer+i) = *(inBuffer+(n*i)+channel) * bitVolts;
}

}

bool KWIKFileSource::isReady()
{
//HDF5 is by default not thread-safe, so we must warn the user.
if ((!skipRecordEngineCheck) && (CoreServices::getSelectedRecordEngineId() == "KWIK"))
{
int res = AlertWindow::showYesNoCancelBox(AlertWindow::WarningIcon, "Record format conflict",
"Both the selected input file for the File Reader and the output file format for recording use the HDF5 library.\n"
"This library is, by default, not thread safe, so running both at the same time might cause unexpected crashes (chances increase with signal complexity and number of recorded channels).\n\n"
"If you have a custom-built hdf5 library with the thread safe features turned on, you can safely continue, but performance will be reduced.\n"
"More information on:\n"
"https://www.hdfgroup.org/HDF5/doc/TechNotes/ThreadSafeLibrary.html\n"
"https://www.hdfgroup.org/hdf5-quest.html\n\n"
"Do you want to continue acquisition?", "Yes", "Yes and don't ask again", "No");
switch (res)
{
case 2:
skipRecordEngineCheck = true;
case 1:
return true;
break;
default:
return false;
}
}
else
return true;
}
15 changes: 9 additions & 6 deletions Source/Plugins/KWIKFormat/FileSource/KwikFileSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,23 @@ class KWIKFileSource : public FileSource
KWIKFileSource();
~KWIKFileSource();

int readData(int16* buffer, int nSamples);
int readData(int16* buffer, int nSamples) override;

void seekTo(int64 sample);
void seekTo(int64 sample) override;

void processChannelData(int16* inBuffer, float* outBuffer, int channel, int64 numSamples);
void processChannelData(int16* inBuffer, float* outBuffer, int channel, int64 numSamples) override;

bool isReady() override;

private:
ScopedPointer<H5::H5File> sourceFile;
ScopedPointer<H5::DataSet> dataSet;
bool Open(File file);
void fillRecordInfo();
void updateActiveRecord();
bool Open(File file) override;
void fillRecordInfo() override;
void updateActiveRecord() override;
int64 samplePos;
Array<int> availableDataSets;
bool skipRecordEngineCheck;
};


Expand Down
15 changes: 13 additions & 2 deletions Source/Plugins/KWIKFormat/RecordEngine/HDF5FileFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "HDF5FileFormat.h"

#ifndef CHUNK_XSIZE
#define CHUNK_XSIZE 640
#define CHUNK_XSIZE 2048
#endif

#ifndef EVENT_CHUNK_SIZE
Expand Down Expand Up @@ -97,7 +97,7 @@ int HDF5FileBase::open(bool newfile, int nChans)
FileAccPropList props = FileAccPropList::DEFAULT;
if (nChans > 0)
{
props.setCache(0, 809, 8 * 2 * 640 * nChans, 1);
props.setCache(0, 809, 8 * 2 * CHUNK_XSIZE * nChans, 1);
//std::cout << "opening HDF5 " << getFileName() << " with nchans: " << nChans << std::endl;
}

Expand Down Expand Up @@ -506,6 +506,8 @@ HDF5RecordingData::HDF5RecordingData(DataSet* data)

HDF5RecordingData::~HDF5RecordingData()
{
//Safety
dSet->flush(H5F_SCOPE_GLOBAL);
}
int HDF5RecordingData::writeDataBlock(int xDataSize, HDF5FileBase::DataTypes type, void* data)
{
Expand Down Expand Up @@ -712,6 +714,15 @@ void KWDFile::writeRowData(int16* data, int nSamples)
curChan++;
}

void KWDFile::writeRowData(int16* data, int nSamples, int channel)
{
if (channel >= 0 && channel < nChannels)
{
CHECK_ERROR(recdata->writeDataRow(channel, nSamples, I16, data));
curChan = channel;
}
}

//KWE File

KWEFile::KWEFile(String basename) : HDF5FileBase()
Expand Down
1 change: 1 addition & 0 deletions Source/Plugins/KWIKFormat/RecordEngine/HDF5FileFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class KWDFile : public HDF5FileBase
void stopRecording();
void writeBlockData(int16* data, int nSamples);
void writeRowData(int16* data, int nSamples);
void writeRowData(int16* data, int nSamples, int channel);
String getFileName();

protected:
Expand Down
Loading