Skip to content

Commit dbe500e

Browse files
committed
Add updates for API9 compat
1 parent 3ea95b1 commit dbe500e

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endif()
1010
get_filename_component(PROJECT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR} ABSOLUTE)
1111
get_filename_component(PLUGIN_NAME ${PROJECT_FOLDER} NAME)
1212

13-
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architecture for Mac OS X" FORCE)
13+
#set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architecture for Mac OS X" FORCE)
1414

1515
project(OE_PLUGIN_${PLUGIN_NAME})
1616
set(CMAKE_SHARED_LIBRARY_PREFIX "")
@@ -66,7 +66,7 @@ if(MSVC)
6666
target_link_libraries(${PLUGIN_NAME} ${GUI_BIN_DIR}/open-ephys.lib)
6767
target_compile_options(${PLUGIN_NAME} PRIVATE /sdl- /W0)
6868

69-
install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${GUI_BIN_DIR}/plugins CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
69+
install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${GUI_BIN_DIR}/plugins-api9 CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
7070

7171
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../libs)
7272

@@ -85,17 +85,17 @@ if(MSVC)
8585
elseif(LINUX)
8686
target_link_libraries(${PLUGIN_NAME} GL X11 Xext Xinerama asound dl freetype pthread rt)
8787
set_property(TARGET ${PLUGIN_NAME} APPEND_STRING PROPERTY LINK_FLAGS
88-
"-fvisibility=hidden -fPIC -rdynamic -Wl,-rpath,'$$ORIGIN/../shared'")
88+
"-fvisibility=hidden -fPIC -rdynamic -Wl,-rpath,'$$ORIGIN/../shared-api9'")
8989
target_compile_options(${PLUGIN_NAME} PRIVATE -fPIC -rdynamic)
9090
target_compile_options(${PLUGIN_NAME} PRIVATE -O3) #enable optimization for linux debug
9191

92-
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION ${GUI_BIN_DIR}/plugins)
92+
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION ${GUI_BIN_DIR}/plugins-api9)
9393
elseif(APPLE)
9494
set_target_properties(${PLUGIN_NAME} PROPERTIES BUNDLE TRUE)
9595
set_property(TARGET ${PLUGIN_NAME} APPEND_STRING PROPERTY LINK_FLAGS
96-
"-undefined dynamic_lookup -rpath @loader_path/../../../../shared")
96+
"-undefined dynamic_lookup -rpath @loader_path/../../../../shared-api9")
9797

98-
install(TARGETS ${PLUGIN_NAME} DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/PlugIns)
98+
install(TARGETS ${PLUGIN_NAME} DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/plugins-api9)
9999
set(CMAKE_PREFIX_PATH /opt/local)
100100
endif()
101101

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ Before starting data acquisition, you will need to press the 'Connect' button in
1717

1818
To initialize the connection on the Matlab side, you will need to call your generated script from Matlab following the instructions below. Once the connection has been initiated on both sides, pressing the Play button in the Open Ephys GUI will automatically stream the incoming data to Matlab, and then back to the GUI for further processing.
1919

20+
## Quickstart
21+
22+
1. Start with the Plotter example in the MatlabInterface/Resources folder. In the Matlab Command Window call:
23+
24+
Plotter(‘127.0.0.1’, 1234)
25+
26+
2. Click the ‘Connect' button in the MatlabInterface plugin in OpenEphys GUI.
27+
28+
3. Start acquisition via the GUI to automatically plot data in Matlab.
29+
2030
### Matlab API
2131

2232
In order to process the incoming data in Matlab, you will need to leverage the included Matlab API. The API was designed specifically to introduce/reinforce object-oriented programming and to encourage Matlab evangelists to consider developing plugins in C++.

Source/MatlabInterface.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ MatlabInterface::MatlabInterface()
99
{
1010
setProcessorType(Plugin::Processor::FILTER);
1111

12-
addStringParameter(Parameter::GLOBAL_SCOPE, "host_address", "Set host address", "127.0.0.1", true);
13-
addStringParameter(Parameter::GLOBAL_SCOPE, "port_number", "Set port number", "1234", true);
14-
addSelectedChannelsParameter(Parameter::STREAM_SCOPE, "Channel", "The continuous channel to analyze", 1);
12+
addStringParameter(Parameter::PROCESSOR_SCOPE, "host_address", "Host address", "Set host address", "127.0.0.1", true);
13+
addStringParameter(Parameter::PROCESSOR_SCOPE, "port_number", "Port number", "Set port number", "1234", true);
14+
addSelectedChannelsParameter(Parameter::STREAM_SCOPE, "channel", "Channel", "The continuous channel to analyze", 1);
1515

1616
}
1717

@@ -59,7 +59,7 @@ AudioProcessorEditor* MatlabInterface::createEditor()
5959

6060
void MatlabInterface::parameterValueChanged(Parameter* param)
6161
{
62-
if (param->getName().equalsIgnoreCase("Channel"))
62+
if (param->getName().equalsIgnoreCase("channel"))
6363
{
6464
Array<var>* array = param->getValue().getArray();
6565

@@ -107,5 +107,5 @@ void MatlabInterface::updateSettings()
107107
isEnabled = connected;
108108

109109
for (auto stream : getDataStreams())
110-
parameterValueChanged(stream->getParameter("Channel"));
110+
parameterValueChanged(stream->getParameter("channel"));
111111
}

Source/MatlabInterfaceEditor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ MatlabInterfaceEditor::MatlabInterfaceEditor(MatlabInterface* parentNode)
6565

6666
desiredWidth = 230;
6767

68-
addTextBoxParameterEditor("host_address", 10, 25);
68+
addTextBoxParameterEditor(Parameter::PROCESSOR_SCOPE, "host_address", 15, 29);
6969

70-
addTextBoxParameterEditor("port_number", 115, 25);
70+
addTextBoxParameterEditor(Parameter::PROCESSOR_SCOPE, "port_number", 15, 54);
7171

7272
connectButton = std::make_unique<UtilityButton>("Connect", Font("Small Text", 13, Font::bold));
7373
connectButton->setRadius(3.0f);
74-
connectButton->setBounds(70, 75, 90, 20);
74+
connectButton->setBounds(15, 79, 90, 20);
7575
connectButton->addListener(this);
7676
addAndMakeVisible(connectButton.get());
7777

78-
addSelectedChannelsParameterEditor("Channel", 75, 100);
78+
addSelectedChannelsParameterEditor(Parameter::STREAM_SCOPE, "channel", 15, 104);
7979

8080
count = 0;
8181
}

0 commit comments

Comments
 (0)