Commit 4f383a8b authored by nfoy's avatar nfoy
Browse files

Merge branch 'master' into integration-1.2

gtec-bcilab driver added to master branch
parents d438192b 945c04af
......@@ -16,16 +16,16 @@ ENDIF(WIN32)
### Do not enable the commented out sikuli tests unless you
### or your lab commits to keep them passing in the long term.
FIND_PROGRAM(SIKULI NAMES sikuli-ide)
IF(SIKULI)
IF(UNIX)
# ADD_TEST(sikuli_basic_interface_designer "${SIKULI}" -t testStartInterface.UNIX.sikuli)
ADD_TEST(sikuli_boxSetAttribute "${SIKULI}" -t testBoxSetAttribute.UNIX.sikuli)
ADD_TEST(sikuli_DrawPerformance3Boxes_designer "${SIKULI}" -t testDrawPerformance3boxes.UNIX.sikuli)
ADD_TEST(sikuli_DrawPerformance400Boxes_designer "${SIKULI}" -t testDrawPerformance400boxes.UNIX.sikuli)
# ADD_TEST(sikuli_ChangeSettingsOnLine "${SIKULI}" -t testModUI.UNIX.sikuli)
ENDIF(UNIX)
ENDIF(SIKULI)
#FIND_PROGRAM(SIKULI NAMES sikuli-ide)
#IF(SIKULI)
# IF(UNIX)
# ADD_TEST(sikuli_basic_interface_designer "${SIKULI}" -t testStartInterface.UNIX.sikuli)
# ADD_TEST(sikuli_boxSetAttribute "${SIKULI}" -t testBoxSetAttribute.UNIX.sikuli)
# ADD_TEST(sikuli_DrawPerformance3Boxes_designer "${SIKULI}" -t testDrawPerformance3boxes.UNIX.sikuli)
# ADD_TEST(sikuli_DrawPerformance400Boxes_designer "${SIKULI}" -t testDrawPerformance400boxes.UNIX.sikuli)
# ADD_TEST(sikuli_ChangeSettingsOnLine "${SIKULI}" -t testModUI.UNIX.sikuli)
# ENDIF(UNIX)
#ENDIF(SIKULI)
......@@ -38,3 +38,21 @@ IF(WIN32)
MESSAGE(STATUS " FAILED to find gUSBampCAPI")
ENDIF(PATH_GUSBampCAPI)
ENDIF(WIN32)
IF(UNIX)
# To try other versions of the gtec's library, change the number below
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so.1.14")
FIND_LIBRARY(gUSBAmpLinux_LIBRARY NAMES "gusbampapi" PATHS "/usr/lib" "/usr/local/lib")
IF(gUSBAmpLinux_LIBRARY)
MESSAGE(STATUS " Found GUSBAmpAPILinux...")
MESSAGE(STATUS " [ OK ] Third party lib ${gUSBAmpLinux_LIBRARY}")
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGUSBampCAPI_Linux)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${gUSBAmpLinux_LIBRARY} )
ELSE(gUSBAmpLinux_LIBRARY)
MESSAGE(STATUS " FAILED to find GUSBAmpAPI Linux... ")
MESSAGE(STATUS " : If it should be found, see that 'libgusbampapi.so.1.14' link exists on the fs, with no further nemeric suffixes in the filename.")
MESSAGE(STATUS " : e.g. do 'cd /usr/lib/ ; ln -s libgusbampapi.so.1.14'. See gtec-bcilab/README for details.")
ENDIF(gUSBAmpLinux_LIBRARY)
SET(OV_ThirdPartyGUSBAmp "YES")
ENDIF(UNIX)
FIND_PROGRAM(SIKULI NAMES sikuli-ide)
IF(SIKULI)
IF(UNIX)
ADD_TEST(basic_external_stimulator "${SIKULI}" -t testBasicExternalStimulator.UNIX.sikuli)
ENDIF(UNIX)
ENDIF(SIKULI)
### Do not enable the commented out sikuli tests unless you
### or your lab commits to keep them passing in the long term.
#FIND_PROGRAM(SIKULI NAMES sikuli-ide)
#IF(SIKULI)
# IF(UNIX)
# ADD_TEST(basic_external_stimulator "${SIKULI}" -t testBasicExternalStimulator.UNIX.sikuli)
# ENDIF(UNIX)
#ENDIF(SIKULI)
......
......@@ -42,6 +42,7 @@ OV_ADD_CONTRIB_DRIVER("${CMAKE_SOURCE_DIR}/contrib/plugins/server-drivers/cognio
OV_ADD_CONTRIB_DRIVER("${CMAKE_SOURCE_DIR}/contrib/plugins/server-drivers/ctfvsm-meg")
OV_ADD_CONTRIB_DRIVER("${CMAKE_SOURCE_DIR}/contrib/plugins/server-drivers/field-trip-protocol")
OV_ADD_CONTRIB_DRIVER("${CMAKE_SOURCE_DIR}/contrib/plugins/server-drivers/gtec-gipsa")
OV_ADD_CONTRIB_DRIVER("${CMAKE_SOURCE_DIR}/contrib/plugins/server-drivers/gtec-bcilab")
OV_ADD_CONTRIB_DRIVER("${CMAKE_SOURCE_DIR}/contrib/plugins/server-drivers/gtec-gmobilabplus")
OV_ADD_CONTRIB_DRIVER("${CMAKE_SOURCE_DIR}/contrib/plugins/server-drivers/gtec-gusbamp")
OV_ADD_CONTRIB_DRIVER("${CMAKE_SOURCE_DIR}/contrib/plugins/server-drivers/mbt-smarting")
......
......@@ -13,6 +13,7 @@
#include "ovasCDriverCtfVsmMeg.h"
#include "ovasCDriverGTecGUSBamp.h"
#include "ovasCDriverGTecGUSBampLegacy.h"
#include "ovasCDriverGTecGUSBampLinux.h"
#include "ovasCDriverGTecGMobiLabPlus.h"
#include "ovasCDriverFieldtrip.h"
#include "ovasCDriverMBTSmarting.h"
......@@ -38,6 +39,9 @@ namespace OpenViBEContributions {
vDriver->push_back(new OpenViBEAcquisitionServer::CDriverGTecGUSBamp(pAcquisitionServer->getDriverContext()));
vDriver->push_back(new OpenViBEAcquisitionServer::CDriverGTecGUSBampLegacy(pAcquisitionServer->getDriverContext()));
#endif
#if defined TARGET_HAS_ThirdPartyGUSBampCAPI_Linux
vDriver->push_back(new OpenViBEAcquisitionServer::CDriverGTecGUSBampLinux(pAcquisitionServer->getDriverContext()));
#endif
#if defined TARGET_HAS_ThirdPartyGMobiLabPlusAPI
vDriver->push_back(new OpenViBEAcquisitionServer::CDriverGTecGMobiLabPlus(pAcquisitionServer->getDriverContext()));
#endif
......
......@@ -9,98 +9,6 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkListStore" id="SamplingRateModel">
<columns>
<!-- column-name gchararray -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">500</col>
</row>
<row>
<col id="0" translatable="yes">512</col>
</row>
<row>
<col id="0" translatable="yes">1000</col>
</row>
<row>
<col id="0" translatable="yes">1024</col>
</row>
<row>
<col id="0" translatable="yes">2000</col>
</row>
<row>
<col id="0" translatable="yes">2048</col>
</row>
<row>
<col id="0" translatable="yes">4000</col>
</row>
<row>
<col id="0" translatable="yes">4096</col>
</row>
<row>
<col id="0" translatable="yes">8000</col>
</row>
<row>
<col id="0" translatable="yes">8192</col>
</row>
<row>
<col id="0" translatable="yes">16000</col>
</row>
<row>
<col id="0" translatable="yes">16384</col>
</row>
</data>
</object>
<object class="GtkListStore" id="SignalRangeModelBIP">
<columns>
<!-- column-name SignalRanges -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">350</col>
</row>
<row>
<col id="0" translatable="yes">700</col>
</row>
<row>
<col id="0" translatable="yes">1500</col>
</row>
<row>
<col id="0" translatable="yes">4000</col>
</row>
</data>
</object>
<object class="GtkListStore" id="SignalRangeModelEEG">
<columns>
<!-- column-name SignalRanges -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">150</col>
</row>
<row>
<col id="0" translatable="yes">750</col>
</row>
<row>
<col id="0" translatable="yes">1000</col>
</row>
</data>
</object>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="value">18</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkWindow" id="dummy_settings">
<property name="can_focus">False</property>
<child>
......@@ -439,6 +347,171 @@
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton_number_of_channels">
<property name="visible">True</property>
......@@ -456,6 +529,98 @@
</object>
</child>
</object>
<object class="GtkListStore" id="SamplingRateModel">
<columns>
<!-- column-name gchararray -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">500</col>
</row>
<row>
<col id="0" translatable="yes">512</col>
</row>
<row>
<col id="0" translatable="yes">1000</col>
</row>
<row>
<col id="0" translatable="yes">1024</col>
</row>
<row>
<col id="0" translatable="yes">2000</col>
</row>
<row>
<col id="0" translatable="yes">2048</col>
</row>
<row>
<col id="0" translatable="yes">4000</col>
</row>
<row>
<col id="0" translatable="yes">4096</col>
</row>
<row>
<col id="0" translatable="yes">8000</col>
</row>
<row>
<col id="0" translatable="yes">8192</col>
</row>
<row>
<col id="0" translatable="yes">16000</col>
</row>
<row>
<col id="0" translatable="yes">16384</col>
</row>
</data>
</object>
<object class="GtkListStore" id="SignalRangeModelBIP">
<columns>
<!-- column-name SignalRanges -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">350</col>
</row>
<row>
<col id="0" translatable="yes">700</col>
</row>
<row>
<col id="0" translatable="yes">1500</col>
</row>
<row>
<col id="0" translatable="yes">4000</col>
</row>
</data>
</object>
<object class="GtkListStore" id="SignalRangeModelEEG">
<columns>
<!-- column-name SignalRanges -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">150</col>
</row>
<row>
<col id="0" translatable="yes">750</col>
</row>
<row>
<col id="0" translatable="yes">1000</col>
</row>
</data>
</object>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="value">18</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkListStore" id="model1">
<columns>
<!-- column-name gchararray -->
......@@ -570,7 +735,7 @@
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">9</property>
<property name="n_rows">10</property>
<property name="n_columns">2</property>
<property name="homogeneous">True</property>
<child>
......@@ -853,6 +1018,32 @@
<property name="bottom_attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Check impedance :</property>
</object>
<packing>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_impedance">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
......
......@@ -87,51 +87,68 @@ boolean CDriverEEGO::initialize(
if(m_rDriverContext.isConnected()) return false;
if(!m_oHeader.isChannelCountSet()||!m_oHeader.isSamplingFrequencySet()) return false;
// Builds up a buffer to store
// acquired samples. This buffer
// will be sent to the acquisition
// server later...
m_pSample=new float32[m_oHeader.getChannelCount()*ui32SampleCountPerSentBlock];
m_ui32SamplesInBuffer=0;
if(!m_pSample)
try
{
delete [] m_pSample;
m_pSample=NULL;
return false;
}
// To initialize we need to locate the path of the DLL
// Create path to the dll
const OpenViBE::CString l_oLibDir=Directories::getBinDir()+"\\eego-SDK.dll";
auto l_sPath=l_oLibDir.toASCIIString();
// Builds up a buffer to store
// acquired samples. This buffer
// will be sent to the acquisition
// server later...
m_pSample = new float32[m_oHeader.getChannelCount()*ui32SampleCountPerSentBlock];
m_ui32SamplesInBuffer = 0;
if (!m_pSample)
{
throw std::exception("Failed to allocate sample buffer");
}
// create the amplifier factory
es::factory fact(l_sPath);
// create the amplifier factory
// To initialize we need to locate the path of the DLL
// Create path to the dll
const OpenViBE::CString l_oLibDir = Directories::getBinDir() + "\\eego-SDK.dll";
auto l_sPath = l_oLibDir.toASCIIString();
m_rDriverContext.getLogManager() << LogLevel_Debug << "SDK dll path: " << l_sPath << "\n";
es::factory fact(l_sPath);
// to check what is going on case of error; Log version
const auto version=fact.getVersion();
m_rDriverContext.getLogManager()<<LogLevel_Info<<"EEGO RT: Version: "<<version.major<<"."<<version.minor<<"."<<version.micro<<"."<<version.build<<"\n";
// to check what is going on case of error; Log version
const auto version = fact.getVersion();
m_rDriverContext.getLogManager() << LogLevel_Info << "EEGO RT: Version: " << version.major << "." << version.minor << "." << version.micro << "." << version.build << "\n";
// Get the amplifier. If none is connected an exception will be thrown
try
{
m_pAmplifier=fact.getAmplifier();
// Get the amplifier. If none is connected an exception will be thrown
try
{
m_pAmplifier = fact.getAmplifier();
}
catch (const std::exception& ex)
{
m_rDriverContext.getLogManager() << LogLevel_Warning << "Failure to get an amplifier! Reason: " << ex.what() << "\n";
throw;
}
if (m_rDriverContext.isImpedanceCheckRequested())
{
// After init we are in impedance mode until the recording is started
OpenViBE::uint64 l_i64MaskEEG = getRefChannelMask(); // Only the reference channels can be measured
m_pStream = m_pAmplifier->OpenImpedanceStream(l_i64MaskEEG);
}
}
catch (const std::exception& ex)
{
m_rDriverContext.getLogManager()<<LogLevel_Warning<<"Failure to get an amplifier! Reason: "<<ex.what()<<"\n";
m_rDriverContext.getLogManager() << LogLevel_Error << "Failed to initialize the driver. Exception: " << ex.what() << "\n";
// Cleanup
delete[] m_pSample;
m_pSample = NULL;
delete m_pAmplifier;
m_pAmplifier = NULL;
delete m_pStream;
m_pStream = NULL;