Skip to content

Commit ad8ac52

Browse files
committed
Merge branch 'development' of https://github.com/open-ephys/plugin-GUI into development
2 parents bb4b87b + 127d99c commit ad8ac52

34 files changed

Lines changed: 1231 additions & 355 deletions

Builds/Linux/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ OBJECTS := \
106106
$(OBJDIR)/ParameterEditor_112258eb.o \
107107
$(OBJDIR)/Parameter_b3e5ac9e.o \
108108
$(OBJDIR)/ProcessorGraph_8c3a250a.o \
109+
$(OBJDIR)/DataQueue_d6cc297a.o \
110+
$(OBJDIR)/RecordThread_fb797372.o \
109111
$(OBJDIR)/EngineConfigWindow_4fd44ceb.o \
110112
$(OBJDIR)/OriginalRecording_d6dc3293.o \
111113
$(OBJDIR)/RecordEngine_97ef83aa.o \
@@ -444,6 +446,16 @@ $(OBJDIR)/ProcessorGraph_8c3a250a.o: ../../Source/Processors/ProcessorGraph/Proc
444446
@echo "Compiling ProcessorGraph.cpp"
445447
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
446448

449+
$(OBJDIR)/DataQueue_d6cc297a.o: ../../Source/Processors/RecordNode/DataQueue.cpp
450+
-@mkdir -p $(OBJDIR)
451+
@echo "Compiling DataQueue.cpp"
452+
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
453+
454+
$(OBJDIR)/RecordThread_fb797372.o: ../../Source/Processors/RecordNode/RecordThread.cpp
455+
-@mkdir -p $(OBJDIR)
456+
@echo "Compiling RecordThread.cpp"
457+
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
458+
447459
$(OBJDIR)/EngineConfigWindow_4fd44ceb.o: ../../Source/Processors/RecordNode/EngineConfigWindow.cpp
448460
-@mkdir -p $(OBJDIR)
449461
@echo "Compiling EngineConfigWindow.cpp"

Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj

Lines changed: 20 additions & 6 deletions
Large diffs are not rendered by default.

Builds/VisualStudio2012/open-ephys.vcxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@
310310
<ClCompile Include="..\..\Source\Processors\Parameter\ParameterEditor.cpp"/>
311311
<ClCompile Include="..\..\Source\Processors\Parameter\Parameter.cpp"/>
312312
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp"/>
313+
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp"/>
314+
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp"/>
313315
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp"/>
314316
<ClCompile Include="..\..\Source\Processors\RecordNode\OriginalRecording.cpp"/>
315317
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordEngine.cpp"/>
@@ -1527,6 +1529,9 @@
15271529
<ClInclude Include="..\..\Source\Processors\Parameter\ParameterEditor.h"/>
15281530
<ClInclude Include="..\..\Source\Processors\Parameter\Parameter.h"/>
15291531
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h"/>
1532+
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h"/>
1533+
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h"/>
1534+
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h"/>
15301535
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h"/>
15311536
<ClInclude Include="..\..\Source\Processors\RecordNode\OriginalRecording.h"/>
15321537
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordEngine.h"/>

Builds/VisualStudio2012/open-ephys.vcxproj.filters

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,12 @@
571571
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp">
572572
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
573573
</ClCompile>
574+
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp">
575+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
576+
</ClCompile>
577+
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp">
578+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
579+
</ClCompile>
574580
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp">
575581
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
576582
</ClCompile>
@@ -2079,6 +2085,15 @@
20792085
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h">
20802086
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
20812087
</ClInclude>
2088+
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h">
2089+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2090+
</ClInclude>
2091+
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h">
2092+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2093+
</ClInclude>
2094+
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h">
2095+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2096+
</ClInclude>
20822097
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h">
20832098
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
20842099
</ClInclude>

Builds/VisualStudio2013/open-ephys.vcxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@
314314
<ClCompile Include="..\..\Source\Processors\Parameter\ParameterEditor.cpp"/>
315315
<ClCompile Include="..\..\Source\Processors\Parameter\Parameter.cpp"/>
316316
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp"/>
317+
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp"/>
318+
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp"/>
317319
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp"/>
318320
<ClCompile Include="..\..\Source\Processors\RecordNode\OriginalRecording.cpp"/>
319321
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordEngine.cpp"/>
@@ -1531,6 +1533,9 @@
15311533
<ClInclude Include="..\..\Source\Processors\Parameter\ParameterEditor.h"/>
15321534
<ClInclude Include="..\..\Source\Processors\Parameter\Parameter.h"/>
15331535
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h"/>
1536+
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h"/>
1537+
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h"/>
1538+
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h"/>
15341539
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h"/>
15351540
<ClInclude Include="..\..\Source\Processors\RecordNode\OriginalRecording.h"/>
15361541
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordEngine.h"/>

Builds/VisualStudio2013/open-ephys.vcxproj.filters

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,12 @@
571571
<ClCompile Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.cpp">
572572
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
573573
</ClCompile>
574+
<ClCompile Include="..\..\Source\Processors\RecordNode\DataQueue.cpp">
575+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
576+
</ClCompile>
577+
<ClCompile Include="..\..\Source\Processors\RecordNode\RecordThread.cpp">
578+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
579+
</ClCompile>
574580
<ClCompile Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.cpp">
575581
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
576582
</ClCompile>
@@ -2079,6 +2085,15 @@
20792085
<ClInclude Include="..\..\Source\Processors\ProcessorGraph\ProcessorGraph.h">
20802086
<Filter>open-ephys\Source\Processors\ProcessorGraph</Filter>
20812087
</ClInclude>
2088+
<ClInclude Include="..\..\Source\Processors\RecordNode\DataQueue.h">
2089+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2090+
</ClInclude>
2091+
<ClInclude Include="..\..\Source\Processors\RecordNode\EventQueue.h">
2092+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2093+
</ClInclude>
2094+
<ClInclude Include="..\..\Source\Processors\RecordNode\RecordThread.h">
2095+
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
2096+
</ClInclude>
20822097
<ClInclude Include="..\..\Source\Processors\RecordNode\EngineConfigWindow.h">
20832098
<Filter>open-ephys\Source\Processors\RecordNode</Filter>
20842099
</ClInclude>

Source/CoreServices.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ void setAppendTextToRecordingDir(String text)
107107
getControlPanel()->setAppendText(text);
108108
}
109109

110+
String getSelectedRecordEngineId()
111+
{
112+
return getControlPanel()->getSelectedRecordEngineId();
113+
}
114+
115+
bool setSelectedRecordEngineId(String id)
116+
{
117+
return getControlPanel()->setSelectedRecordEngineId(id);
118+
}
119+
110120
namespace RecordNode
111121
{
112122
void createNewrecordingDir()
@@ -145,7 +155,7 @@ int addSpikeElectrode(SpikeRecordInfo* elec)
145155
}
146156
};
147157

148-
PLUGIN_API const char* getApplicationResource(const char* name, int& size)
158+
const char* getApplicationResource(const char* name, int& size)
149159
{
150160
return BinaryData::getNamedResource(name, size);
151161
}

Source/CoreServices.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ PLUGIN_API void setPrependTextToRecordingDir(String text);
7878
/** Manually set the text to be appended to the recording directory */
7979
PLUGIN_API void setAppendTextToRecordingDir(String text);
8080

81+
/** Gets the ID fo the selected Record Engine*/
82+
PLUGIN_API String getSelectedRecordEngineId();
83+
84+
/** Sets a specific RecordEngine to be used based on its id.
85+
Return true if there is an engine with the specified ID and it's possible to
86+
change the current engine or false otherwise. */
87+
PLUGIN_API bool setSelectedRecordEngineId(String id);
88+
8189
namespace RecordNode
8290
{
8391
/** Forces creation of new directory on recording */
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
------------------------------------------------------------------
3+
4+
This file is part of the Open Ephys GUI
5+
Copyright (C) 2013 Open Ephys
6+
7+
------------------------------------------------------------------
8+
9+
This program is free software: you can redistribute it and/or modify
10+
it under the terms of the GNU General Public License as published by
11+
the Free Software Foundation, either version 3 of the License, or
12+
(at your option) any later version.
13+
14+
This program is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License for more details.
18+
19+
You should have received a copy of the GNU General Public License
20+
along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
22+
*/
23+
24+
/*
25+
This file references the CoreServices namespace header, in case a plugin type that usually doesn't
26+
access this namespace (FileSource, for example) needs, as a particular case, use its functionality
27+
*/
28+
29+
#include "../../CoreServices.h"

Source/Plugins/KWIKFormat/FileSource/KwikFileSource.cpp

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
*/
2323
#include <H5Cpp.h>
2424
#include "KwikFileSource.h"
25-
25+
#include <CoreServicesHeader.h>
2626

2727

2828
using namespace H5;
2929

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

32-
KWIKFileSource::KWIKFileSource() : samplePos(0)
32+
KWIKFileSource::KWIKFileSource() : samplePos(0), skipRecordEngineCheck(false)
3333
{
3434
}
3535

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

250+
}
251+
252+
bool KWIKFileSource::isReady()
253+
{
254+
//HDF5 is by default not thread-safe, so we must warn the user.
255+
if ((!skipRecordEngineCheck) && (CoreServices::getSelectedRecordEngineId() == "KWIK"))
256+
{
257+
int res = AlertWindow::showYesNoCancelBox(AlertWindow::WarningIcon, "Record format conflict",
258+
"Both the selected input file for the File Reader and the output file format for recording use the HDF5 library.\n"
259+
"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"
260+
"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"
261+
"More information on:\n"
262+
"https://www.hdfgroup.org/HDF5/doc/TechNotes/ThreadSafeLibrary.html\n"
263+
"https://www.hdfgroup.org/hdf5-quest.html\n\n"
264+
"Do you want to continue acquisition?", "Yes", "Yes and don't ask again", "No");
265+
switch (res)
266+
{
267+
case 2:
268+
skipRecordEngineCheck = true;
269+
case 1:
270+
return true;
271+
break;
272+
default:
273+
return false;
274+
}
275+
}
276+
else
277+
return true;
250278
}

0 commit comments

Comments
 (0)