Skip to content
Open
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
5 changes: 3 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: setup
id: setup
Expand Down Expand Up @@ -104,7 +106,6 @@ jobs:
path: |
Build
Resources
libONI

deploy-linux:

Expand Down Expand Up @@ -133,7 +134,7 @@ jobs:
mkdir shared
cp Resources/libokFrontPanel.so shared
cp Resources/*.bit shared
cp -r libONI/linux/*.so shared
cp Build/lib/*.so shared
zipfile=${package}_${new_plugin_ver}.zip
zip -r -X $zipfile plugins shared
curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/AcquisitionBoard-plugin/linux/$zipfile"
5 changes: 3 additions & 2 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: setup
id: setup
Expand All @@ -102,7 +104,6 @@ jobs:
path: |
Build
Resources
libONI

deploy-mac:

Expand Down Expand Up @@ -140,7 +141,7 @@ jobs:
mkdir shared
cp -r Resources/libokFrontPanel.1.dylib shared
cp Resources/*.bit shared
cp -r libONI/osx/*.dylib shared
cp -r Build/lib/*.dylib shared

# Turn our base64-encoded certificate back to a regular .p12 file
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: setup
id: setup
Expand All @@ -84,7 +86,7 @@ jobs:
cd ../..
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
cd plugin-GUI/Build
cmake -G "Visual Studio 17 2022" -A x64 ..
cmake -G "Visual Studio 17 2022" -A x64 ..
mkdir Release && cd Release
curl -L https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-v1.0.0.zip --output open-ephys-lib.zip
unzip open-ephys-lib.zip
Expand All @@ -94,16 +96,20 @@ jobs:
- name: configure
run: |
cd Build
cmake -G "Visual Studio 17 2022" -A x64 ..
cmake -G "Visual Studio 17 2022" -A x64 ..
shell: bash

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

# NB: To respect the ReleaseStatic configuration for liboni, we need to build the solution
# first before running INSTALL.vcxproj, otherwise it will build liboni in Release
# configuration and throw linking errors
- name: build-plugin
id: build-plugin
run: |
cd Build
msbuild OE_PLUGIN_acquisition-board.sln -p:Configuration=Release -p:Platform=x64
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
shell: cmd

Expand All @@ -116,7 +122,6 @@ jobs:
path: |
Build
Resources
libONI

deploy-windows:

Expand All @@ -143,7 +148,7 @@ jobs:
mkdir plugins
cp $build_dir/*.dll plugins
mkdir shared
cp libONI/win64/*.dll shared
cp Build/x64/Release/*.dll shared
cp Resources/okFrontPanel.dll shared
cp Resources/*.bit shared
zipfile=${package}_${new_plugin_ver}.zip
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "liboni"]
path = liboni
url = https://github.com/open-ephys/liboni
152 changes: 129 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Release>:NDEBUG=1>
)


set(SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Source)
file(GLOB_RECURSE SRC_FILES LIST_DIRECTORIES false "${SOURCE_PATH}/*.cpp" "${SOURCE_PATH}/*.h")
set(GUI_COMMONLIB_DIR ${GUI_BASE_DIR}/installed_libs)
Expand Down Expand Up @@ -64,7 +63,7 @@ endif()
#Libraries and compiler options
if(MSVC)
target_link_libraries(${PLUGIN_NAME} ${GUI_BIN_DIR}/open-ephys.lib)
target_compile_options(${PLUGIN_NAME} PRIVATE /sdl- /W0)
target_compile_options(${PLUGIN_NAME} PRIVATE /sdl- /W0 /MP)

install(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION ${GUI_BIN_DIR}/plugins CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
install(FILES $<TARGET_PDB_FILE:${PLUGIN_NAME}> DESTINATION ${GUI_BIN_DIR}/plugins OPTIONAL)
Expand All @@ -86,10 +85,6 @@ elseif(APPLE)
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED NO)

add_custom_command(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND
install_name_tool -change "liboni.dylib"
"@rpath/liboni.dylib" $<TARGET_FILE:${PLUGIN_NAME}>)

add_custom_command(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND
install_name_tool -change "libonidriver_ft600.dylib"
"@rpath/libonidriver_ft600.dylib" $<TARGET_FILE:${PLUGIN_NAME}>)
Expand All @@ -114,26 +109,137 @@ elseif(LINUX)
target_link_libraries(${PLUGIN_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/Resources/libokFrontPanel.so")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resources/libokFrontPanel.so DESTINATION ${GUI_BIN_DIR}/shared)
elseif(APPLE)
set(MAC_SHARED_FOLDER $ENV{HOME}/Library/Application\ Support/open-ephys/shared-api10)

target_link_libraries(${PLUGIN_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/Resources/libokFrontPanel.dylib")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resources/libokFrontPanel.1.dylib DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/shared-api10)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resources/libokFrontPanel.1.dylib DESTINATION "${MAC_SHARED_FOLDER}")
endif()

set(LIBONI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libONI)
target_include_directories(${PLUGIN_NAME} PRIVATE ${LIBONI_DIR}/include)
function(vs_set_all_configurations target_name target_config_name)
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} config_upper)
set_property(
TARGET ${target_name}
APPEND PROPERTY MAP_IMPORTED_CONFIG_${config_upper} "${target_config_name}"
)
endforeach()
endfunction()

include(ExternalProject)

if (MSVC)
set(LIBONI_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libONI/win64)
target_link_libraries(${PLUGIN_NAME} "${LIBONI_LIB_DIR}/liboni.lib")
install(FILES ${LIBONI_LIB_DIR}/liboni.dll DESTINATION ${GUI_BIN_DIR}/shared CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
install(FILES ${LIBONI_LIB_DIR}/libonidriver_ft600.dll DESTINATION ${GUI_BIN_DIR}/shared CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
elseif(LINUX)
find_library(LIBONI_LIBRARIES oni liboni PATHS ${CMAKE_CURRENT_SOURCE_DIR}/libONI/linux)
target_link_libraries(${PLUGIN_NAME} ${LIBONI_LIBRARIES})
install(DIRECTORY ${LIBONI_DIR}/linux/ DESTINATION ${GUI_BIN_DIR}/shared FILES_MATCHING PATTERN "*.so")
elseif(APPLE)
set(LIBONI_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libONI/osx)
target_link_libraries(${PLUGIN_NAME} "${LIBONI_LIB_DIR}/liboni.dylib")
target_link_libraries(${PLUGIN_NAME} "${LIBONI_LIB_DIR}/libonidriver_ft600.dylib")
install(FILES ${LIBONI_LIB_DIR}/liboni.dylib DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/shared-api10)
install(FILES ${LIBONI_LIB_DIR}/libonidriver_ft600.dylib DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/shared-api10)
# add liboni project

set(LIBONI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/liboni/api/liboni")
set(LIBONI_NAME liboni)
set(LIBONI_PNAME "submodule_${LIBONI_NAME}")

include_external_msproject (
${LIBONI_PNAME}
"${LIBONI_DIR}/liboni.vcxproj"
PLATFORM ${CMAKE_LIBRARY_ARCHITECTURE}
)

vs_set_all_configurations(${LIBONI_PNAME} "ReleaseStatic")

add_library("${LIBONI_NAME}" STATIC IMPORTED)
set_target_properties("${LIBONI_NAME}" PROPERTIES
IMPORTED_LOCATION "${LIBONI_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}/ReleaseStatic/liboni.lib"
INTERFACE_INCLUDE_DIRECTORIES "${LIBONI_DIR}")

add_dependencies(${LIBONI_NAME} ${LIBONI_PNAME})
target_link_libraries(${PLUGIN_NAME} "${LIBONI_NAME}")

# Add onidriver_ft600 project

set(ONIDRIVER_FT600_DIR "${LIBONI_DIR}/drivers/ft600")
set(ONIDRIVER_FT600_NAME libonidriver_ft600)
set(ONIDRIVER_FT600_PNAME "submodule_${ONIDRIVER_FT600_NAME}")

include_external_msproject(
${ONIDRIVER_FT600_PNAME}
"${ONIDRIVER_FT600_DIR}/onidriver_ft600.vcxproj"
PLATFORM ${CMAKE_LIBRARY_ARCHITECTURE}
)

vs_set_all_configurations(${ONIDRIVER_FT600_PNAME} "Release")

add_dependencies(${ONIDRIVER_FT600_PNAME} ${LIBONI_PNAME})

# Ensure needed DLLs are installed to the shared folder
install(FILES "${CMAKE_BINARY_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}/Release/${ONIDRIVER_FT600_NAME}.dll" DESTINATION ${GUI_BIN_DIR}/shared)
elseif(LINUX OR APPLE)
# Add liboni project

set(LIBONI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/liboni/api/liboni")
set(LIBONI_NAME liboni)
set(LIBONI_PNAME "submodule_${LIBONI_NAME}")

ExternalProject_Add(
${LIBONI_PNAME}
SOURCE_DIR "${LIBONI_DIR}"
CONFIGURE_COMMAND ""
BUILD_COMMAND make "CFLAGS=-Wall -W -Werror -fPIC -O3"
BUILD_IN_SOURCE 1
INSTALL_COMMAND ""
)

add_library("${LIBONI_NAME}" STATIC IMPORTED GLOBAL)
set_target_properties("${LIBONI_NAME}" PROPERTIES
IMPORTED_LOCATION "${LIBONI_DIR}/liboni.a"
INTERFACE_INCLUDE_DIRECTORIES "${LIBONI_DIR}")

add_dependencies(${LIBONI_NAME} ${LIBONI_PNAME})
target_link_libraries(${PLUGIN_NAME} "${LIBONI_NAME}")

# Add onidriver_ft600 project

set(ONIDRIVER_FT600_DIR "${LIBONI_DIR}/drivers/ft600")
set(ONIDRIVER_FT600_NAME libonidriver_ft600)
set(ONIDRIVER_FT600_PNAME "submodule_${ONIDRIVER_FT600_NAME}")

set(INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Build/lib")

if(APPLE)
set(ONIDRIVER_FT600_FILENAME "${ONIDRIVER_FT600_NAME}.dylib")

ExternalProject_Add(
${ONIDRIVER_FT600_PNAME}
SOURCE_DIR "${ONIDRIVER_FT600_DIR}"
CONFIGURE_COMMAND ""
BUILD_COMMAND make
BUILD_IN_SOURCE 1
INSTALL_COMMAND
${CMAKE_COMMAND} -E make_directory("${INSTALL_DIR}")
COMMAND ${CMAKE_COMMAND} -E copy
"${ONIDRIVER_FT600_DIR}/${ONIDRIVER_FT600_FILENAME}"
"${INSTALL_DIR}"
DEPENDS ${LIBONI_PNAME}
)

# Ensure needed shared libraries are installed to the shared folder
install(FILES "${ONIDRIVER_FT600_DIR}/${ONIDRIVER_FT600_FILENAME}"
DESTINATION "${MAC_SHARED_FOLDER}")
elseif(LINUX)
set(ONIDRIVER_FT600_FILENAME "${ONIDRIVER_FT600_NAME}.so")

ExternalProject_Add(
${ONIDRIVER_FT600_PNAME}
SOURCE_DIR "${ONIDRIVER_FT600_DIR}"
CONFIGURE_COMMAND ""
BUILD_COMMAND make
BUILD_IN_SOURCE 1
INSTALL_COMMAND
${CMAKE_COMMAND} -E make_directory("${INSTALL_DIR}")
COMMAND ${CMAKE_COMMAND} -E copy
"${ONIDRIVER_FT600_DIR}/${ONIDRIVER_FT600_FILENAME}.1"
"${INSTALL_DIR}/${ONIDRIVER_FT600_FILENAME}"
DEPENDS ${LIBONI_PNAME}
)

# Ensure needed shared libraries are installed to the shared folder
install(FILES "${ONIDRIVER_FT600_DIR}/${ONIDRIVER_FT600_FILENAME}.1"
DESTINATION ${GUI_BIN_DIR}/shared
RENAME "${ONIDRIVER_FT600_FILENAME}")
endif()
endif()
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

A source that can stream data from any version of the Open Ephys Acquisition Board, plus a sink that can trigger board outputs.

## Installation

This plugin can be added via the Open Ephys GUI Plugin Installer. To access the Plugin Installer, press **ctrl-P** or **⌘P** from inside the GUI. Once the installer is loaded, browse to the "Acquisition Board" plugin and click "Install."

## Usage

Instructions for using the Acquisition Board plugin are available [here](https://open-ephys.github.io/gui-docs/User-Manual/Plugins/Acquisition-Board.html).

## Building from source

First, follow the instructions on [this page](https://open-ephys.github.io/gui-docs/Developer-Guide/Compiling-the-GUI.html) to build the Open Ephys GUI.

**Important:** This plugin is intended for use with a preview of GUI version 1.0. The GUI should be compiled from the [`development-juce8`](https://github.com/open-ephys/plugin-gui/tree/development-juce8) branch, rather than the `main` branch.

Then, clone this repository into a directory at the same level as the `plugin-GUI`, e.g.:

```
Expand All @@ -23,6 +29,12 @@ Code
│ └── ...
```

When first cloning the repository, use `git clone --recurse-submodules` to fetch
the `liboni` submodule as well.

For existing clones of the repo, run `git submodule update --init --recursive`
to initialize the submodule and update it in the same command.

### Windows

**Requirements:** [Visual Studio](https://visualstudio.microsoft.com/) and [CMake](https://cmake.org/install/)
Expand Down
2 changes: 1 addition & 1 deletion Source/OpenEphysLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern "C" EXPORT void getLibInfo(Plugin::LibraryInfo* info)
{
info->apiVersion = PLUGIN_API_VER;
info->name = "Acquisition Board";
info->libVersion = "1.1.6";
info->libVersion = "2.0.0";
info->numPlugins = NUM_PLUGINS;
}

Expand Down
Loading