Skip to content

Commit 95d4c8b

Browse files
committed
Restore experimental plugins to development branch
1 parent 00fbbd8 commit 95d4c8b

15 files changed

Lines changed: 2715 additions & 0 deletions
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|x64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|Win32">
13+
<Configuration>Release</Configuration>
14+
<Platform>Win32</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<ProjectGuid>{D6A842A4-AC32-4AD0-B6AF-01AF1FBC8661}</ProjectGuid>
23+
<RootNamespace>SpikeRaster</RootNamespace>
24+
</PropertyGroup>
25+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
26+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
27+
<ConfigurationType>DynamicLibrary</ConfigurationType>
28+
<UseDebugLibraries>true</UseDebugLibraries>
29+
<PlatformToolset>v120</PlatformToolset>
30+
<CharacterSet>MultiByte</CharacterSet>
31+
</PropertyGroup>
32+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
33+
<ConfigurationType>DynamicLibrary</ConfigurationType>
34+
<UseDebugLibraries>true</UseDebugLibraries>
35+
<PlatformToolset>v120</PlatformToolset>
36+
<CharacterSet>MultiByte</CharacterSet>
37+
</PropertyGroup>
38+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
39+
<ConfigurationType>DynamicLibrary</ConfigurationType>
40+
<UseDebugLibraries>false</UseDebugLibraries>
41+
<PlatformToolset>v120</PlatformToolset>
42+
<WholeProgramOptimization>true</WholeProgramOptimization>
43+
<CharacterSet>MultiByte</CharacterSet>
44+
</PropertyGroup>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
46+
<ConfigurationType>DynamicLibrary</ConfigurationType>
47+
<UseDebugLibraries>false</UseDebugLibraries>
48+
<PlatformToolset>v120</PlatformToolset>
49+
<WholeProgramOptimization>true</WholeProgramOptimization>
50+
<CharacterSet>MultiByte</CharacterSet>
51+
</PropertyGroup>
52+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
53+
<ImportGroup Label="ExtensionSettings">
54+
</ImportGroup>
55+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
56+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57+
<Import Project="..\Plugin_Debug32.props" />
58+
</ImportGroup>
59+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
60+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61+
<Import Project="..\Plugin_Debug64.props" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
<Import Project="..\Plugin_Release32.props" />
66+
</ImportGroup>
67+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
68+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
69+
<Import Project="..\Plugin_Release64.props" />
70+
</ImportGroup>
71+
<PropertyGroup Label="UserMacros" />
72+
<PropertyGroup />
73+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<ClCompile>
75+
<WarningLevel>Level3</WarningLevel>
76+
<Optimization>Disabled</Optimization>
77+
<SDLCheck>true</SDLCheck>
78+
</ClCompile>
79+
<Link>
80+
<GenerateDebugInformation>true</GenerateDebugInformation>
81+
</Link>
82+
</ItemDefinitionGroup>
83+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
84+
<ClCompile>
85+
<WarningLevel>Level3</WarningLevel>
86+
<Optimization>Disabled</Optimization>
87+
</ClCompile>
88+
<Link>
89+
<GenerateDebugInformation>true</GenerateDebugInformation>
90+
</Link>
91+
</ItemDefinitionGroup>
92+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
93+
<ClCompile>
94+
<WarningLevel>Level3</WarningLevel>
95+
<Optimization>MaxSpeed</Optimization>
96+
<FunctionLevelLinking>true</FunctionLevelLinking>
97+
<IntrinsicFunctions>true</IntrinsicFunctions>
98+
<SDLCheck>true</SDLCheck>
99+
</ClCompile>
100+
<Link>
101+
<GenerateDebugInformation>true</GenerateDebugInformation>
102+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
103+
<OptimizeReferences>true</OptimizeReferences>
104+
</Link>
105+
</ItemDefinitionGroup>
106+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
107+
<ClCompile>
108+
<WarningLevel>Level3</WarningLevel>
109+
<Optimization>MaxSpeed</Optimization>
110+
<FunctionLevelLinking>true</FunctionLevelLinking>
111+
<IntrinsicFunctions>true</IntrinsicFunctions>
112+
<SDLCheck>true</SDLCheck>
113+
</ClCompile>
114+
<Link>
115+
<GenerateDebugInformation>true</GenerateDebugInformation>
116+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
117+
<OptimizeReferences>true</OptimizeReferences>
118+
</Link>
119+
</ItemDefinitionGroup>
120+
<ItemGroup>
121+
<ClCompile Include="..\..\..\..\Source\Plugins\SpikeRaster\OpenEphysLib.cpp" />
122+
<ClCompile Include="..\..\..\..\Source\Plugins\SpikeRaster\SpikeRaster.cpp" />
123+
<ClCompile Include="..\..\..\..\Source\Plugins\SpikeRaster\SpikeRasterEditor.cpp" />
124+
</ItemGroup>
125+
<ItemGroup>
126+
<ClInclude Include="..\..\..\..\Source\Plugins\SpikeRaster\SpikeRaster.h" />
127+
<ClInclude Include="..\..\..\..\Source\Plugins\SpikeRaster\SpikeRasterEditor.h" />
128+
</ItemGroup>
129+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
130+
<ImportGroup Label="ExtensionTargets">
131+
</ImportGroup>
132+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="..\..\..\..\Source\Plugins\SpikeRaster\OpenEphysLib.cpp">
19+
<Filter>Source Files</Filter>
20+
</ClCompile>
21+
<ClCompile Include="..\..\..\..\Source\Plugins\SpikeRaster\SpikeRaster.cpp">
22+
<Filter>Source Files</Filter>
23+
</ClCompile>
24+
<ClCompile Include="..\..\..\..\Source\Plugins\SpikeRaster\SpikeRasterEditor.cpp">
25+
<Filter>Source Files</Filter>
26+
</ClCompile>
27+
</ItemGroup>
28+
<ItemGroup>
29+
<ClInclude Include="..\..\..\..\Source\Plugins\SpikeRaster\SpikeRaster.h">
30+
<Filter>Source Files</Filter>
31+
</ClInclude>
32+
<ClInclude Include="..\..\..\..\Source\Plugins\SpikeRaster\SpikeRasterEditor.h">
33+
<Filter>Source Files</Filter>
34+
</ClInclude>
35+
</ItemGroup>
36+
</Project>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
LIBNAME := $(notdir $(CURDIR))
3+
OBJDIR := $(OBJDIR)/$(LIBNAME)
4+
TARGET := $(LIBNAME).so
5+
6+
7+
SRC_DIR := ${shell find ./ -type d -print}
8+
VPATH := $(SOURCE_DIRS)
9+
10+
SRC := $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp))
11+
OBJ := $(addprefix $(OBJDIR)/,$(notdir $(SRC:.cpp=.o)))
12+
13+
14+
JL_SHARE = $(shell julia -e 'print(joinpath(JULIA_HOME,Base.DATAROOTDIR,"julia"))')
15+
16+
# flags to compile "JuliaProcessor". $(JL_SHARE): toplevel of julia package
17+
#CXXFLAGS += -I $(JL_SHARE)/src -I $(JULIA)/src/support -I $(JULIA)/usr/include
18+
#LDFLAGS += -L $(JL_SHARE)/usr/lib -Wl,-R $(JULIA)/usr/lib -ljulia
19+
CFLAGS += $(shell $(JL_SHARE)/julia-config.jl --cflags)
20+
CXXFLAGS += $(shell $(JL_SHARE)/julia-config.jl --cflags)
21+
LDFLAGS += $(shell $(JL_SHARE)/julia-config.jl --ldflags)
22+
LDLIBS += $(shell $(JL_SHARE)/julia-config.jl --ldlibs)
23+
24+
BLDCMD := $(CXX) -shared -o $(OUTDIR)/$(TARGET) $(OBJ) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
25+
26+
VPATH = $(SRC_DIR)
27+
28+
.PHONY: objdir
29+
30+
$(OUTDIR)/$(TARGET): objdir $(OBJ)
31+
-@mkdir -p $(BINDIR)
32+
-@mkdir -p $(LIBDIR)
33+
-@mkdir -p $(OUTDIR)
34+
@echo "Building $(TARGET)"
35+
@$(BLDCMD)
36+
37+
$(OBJDIR)/%.o : %.cpp
38+
@echo "Compiling $<"
39+
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
40+
41+
objdir:
42+
-@mkdir -p $(OBJDIR)
43+
44+
clean:
45+
@echo "Cleaning $(LIBNAME)"
46+
-@rm -rf $(OBJDIR)
47+
-@rm -f $(OUTDIR)/$(TARGET)
48+
49+
-include $(OBJ:%.o=%.d)
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
/*
2+
------------------------------------------------------------------
3+
4+
This file is part of the Open Ephys GUI
5+
Copyright (C) 2016 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+
#include "JuliaEditor.h"
24+
#include "JuliaProcessor.h"
25+
#include <stdio.h>
26+
27+
JuliaEditor::JuliaEditor(GenericProcessor* parentNode, bool useDefaultParameterEditors=true)
28+
: GenericEditor(parentNode, useDefaultParameterEditors)
29+
{
30+
juliaProcessor = (JuliaProcessor*) parentNode;
31+
32+
lastFilePath = File::getCurrentWorkingDirectory();
33+
34+
fileButton = new UtilityButton("Select file",Font("Small Text", 13, Font::plain));
35+
fileButton->addListener(this);
36+
fileButton->setBounds(10,85,100,25);
37+
addAndMakeVisible(fileButton);
38+
39+
reloadFileButton = new UtilityButton("refresh",Font("Small Text", 13, Font::plain));
40+
reloadFileButton->addListener(this);
41+
reloadFileButton->setBounds(100+10,85,60,25);
42+
addAndMakeVisible(reloadFileButton);
43+
44+
fileNameLabel = new Label("FileNameLabel", "No file selected.");
45+
fileNameLabel->setBounds(10,85+20,140,25);
46+
addAndMakeVisible(fileNameLabel);
47+
48+
bufferSizeSelection = new Label("Buffer Size","30000"); // this is currently set in RHD2000Thread, the cleaner would be to set it here again
49+
bufferSizeSelection->setEditable(true,false,false);
50+
bufferSizeSelection->addListener(this);
51+
bufferSizeSelection->setBounds(120,60,60,20);
52+
bufferSizeSelection->setColour(Label::textColourId, Colours::darkgrey);
53+
addAndMakeVisible(bufferSizeSelection);
54+
55+
bufferSizeSelectionLabel = new Label("","NBuf.:");
56+
bufferSizeSelectionLabel->attachToComponent (bufferSizeSelection,true);
57+
addAndMakeVisible(bufferSizeSelectionLabel);
58+
59+
// Image im;
60+
// im = ImageCache::getFromMemory(BinaryData::JuliaIconActive_png,
61+
// BinaryData::JuliaIconActive_pngSize);
62+
63+
// icon = new ImageIcon(im);
64+
// addAndMakeVisible(icon);
65+
// icon->setBounds(15,25,61,54);
66+
// icon->setOpacity(0.3f);
67+
68+
desiredWidth = 200;
69+
70+
setEnabledState(false);
71+
}
72+
73+
JuliaEditor::~JuliaEditor()
74+
{
75+
76+
}
77+
78+
void JuliaEditor::setFile(String file)
79+
{
80+
File fileToRead(file);
81+
lastFilePath = fileToRead.getParentDirectory();
82+
juliaProcessor->setFile(fileToRead.getFullPathName());
83+
fileNameLabel->setText(fileToRead.getFileName(), dontSendNotification);
84+
85+
86+
// setEnabledState(true);
87+
// icon->setOpacity(1.0f); // tie this to hasJuliaInstance instead of just setting it!
88+
// repaint();
89+
}
90+
91+
void JuliaEditor::buttonEvent(Button* button)
92+
{
93+
if (!acquisitionIsActive)
94+
{
95+
if (button == fileButton)
96+
{
97+
//std::cout << "Button clicked." << std::endl;
98+
//FileChooser chooseJuliaProcessorFile("Please select the file you want to load...", lastFilePath, "*");
99+
100+
101+
// file dialogs are screwed up in current xubuntu, so we'll do this for now.
102+
setFile("/home/jvoigts/Documents/Github/plugin-GUI/Source/Plugins/JuliaProcessor/exampleProcessor.jl");
103+
104+
105+
// if (chooseJuliaProcessorFile.browseForFileToOpen())
106+
{
107+
// Use the selected file
108+
//setFile(chooseJuliaProcessorFile.getResult().getFullPathName());
109+
110+
// lastFilePath = fileToRead.getParentDirectory();
111+
// thread->setFile(fileToRead.getFullPathName());
112+
// fileNameLabel->setText(fileToRead.getFileName(),false);
113+
}
114+
}
115+
if (button == reloadFileButton)
116+
{
117+
juliaProcessor->reloadFile();
118+
}
119+
}
120+
}
121+
122+
void JuliaEditor::labelTextChanged(Label* label)
123+
{
124+
if (!acquisitionIsActive)
125+
{
126+
if (label == bufferSizeSelection)
127+
{
128+
Value val = label->getTextValue();
129+
juliaProcessor->setBuffersize(int(val.getValue()));
130+
}
131+
}
132+
}
133+
134+
void JuliaEditor::saveEditorParameters(XmlElement* xml)
135+
{
136+
// XmlElement* fileName = xml->createNewChildElement("FILENAME");
137+
// fileName->addTextElement(lastFilePath.getFullPathName());
138+
}
139+
140+
void JuliaEditor::loadEditorParameters(XmlElement* xml)
141+
{
142+
// forEachXmlChildElement(*xml, xmlNode)
143+
// {
144+
// if (xmlNode->hasTagName("FILENAME"))
145+
// {
146+
// lastFilePath = File(xmlNode->getText());
147+
// thread->setFile(lastFilePath.getFullPathName());
148+
// fileNameLabel->setText(lastFilePath.getFullPathName(),false);
149+
// }
150+
// }
151+
}

0 commit comments

Comments
 (0)