Commit 697dc7b3 authored by Jussi Lindgren's avatar Jussi Lindgren

Merge branch 'wip-jole-core-1071-fix-mensia-library' of...

Merge branch 'wip-jole-core-1071-fix-mensia-library' of gitlab.inria.fr:openvibe/extras into wip-all-openvibe20-base
parents e0a732ce 258631ee
......@@ -123,6 +123,19 @@ namespace OpenViBEAcquisitionServer
virtual OpenViBE::boolean setImpedanceCheckRequested(const OpenViBE::boolean bImpedanceCheckRequested) = 0;
virtual OpenViBE::boolean isImpedanceCheckRequested(void) const = 0;
/**
* \brief Get impedance limit
* \return \e the chosen impedance limit.
*/
virtual OpenViBE::uint32 getImpedanceLimit(void) const = 0;
/**
* \brief Set impedance limit
* \param ui32ImpedanceLimit [in] : the new value for impedance limit
* \return \e true in case of success.
* \return \e false in case of error.
*/
virtual OpenViBE::boolean setImpedanceLimit(const OpenViBE::uint32 ui32ImpedanceLimit) = 0;
//@}
/** \name Chanel information */
//@{
......
......@@ -47,6 +47,8 @@ namespace OpenViBEAcquisitionServer
OpenViBE::uint32 m_ui32TotalSampleCount;
OpenViBE::uint64 m_ui64StartTime;
OpenViBE::uint32* m_pSampleCountPerBuffer;
private:
// Settings
OpenViBE::CString m_sDeviceURL;
......
......@@ -55,6 +55,7 @@
#include <cstring>
#include <cassert>
#include <system/WindowsUtilities.h>
//
#define boolean OpenViBE::boolean
......@@ -203,10 +204,10 @@ CAcquisitionServerGUI::CAcquisitionServerGUI(const IKernelContext& rKernelContex
#endif
// BEGIN MENSIA ACQUISITION DRIVERS
// @FIXME CERT Mensia Acquisition Driver crashes, disabled
#if defined TARGET_OS_Windows && defined TARGET_HasMensiaAcquisitionDriver && defined(false)
#if defined TARGET_OS_Windows && defined TARGET_HasMensiaAcquisitionDriver
m_pAcquisitionServer->getDriverContext().getLogManager() << LogLevel_Trace << "Loading Mensia Driver Collection\n";
m_pLibMensiaAcquisition = nullptr;
CString l_sMensiaDLLPath = m_pAcquisitionServer->getDriverContext().getConfigurationManager().expand("${Path_Bin}/openvibe-driver-mensia-acquisition.dll");
if(!std::ifstream(l_sMensiaDLLPath.toASCIIString()).is_open())
{
......@@ -215,8 +216,8 @@ CAcquisitionServerGUI::CAcquisitionServerGUI(const IKernelContext& rKernelContex
}
else
{
HINSTANCE l_oLibMensiaAcquisition; // Library Handle
l_oLibMensiaAcquisition = ::LoadLibrary(l_sMensiaDLLPath.toASCIIString());
m_pLibMensiaAcquisition = System::WindowsUtilities::utf16CompliantLoadLibrary(l_sMensiaDLLPath.toASCIIString());
HINSTANCE l_oLibMensiaAcquisition = static_cast<HINSTANCE>(m_pLibMensiaAcquisition);
//if it can't be open return FALSE;
if( l_oLibMensiaAcquisition == NULL)
......@@ -243,7 +244,7 @@ CAcquisitionServerGUI::CAcquisitionServerGUI(const IKernelContext& rKernelContex
strcpy(l_sDriverIdentifier, l_fpGetDriverID(l_uiDeviceIndex));
if (strcmp(l_sDriverIdentifier, "") != 0)
{
m_pAcquisitionServer->getDriverContext().getLogManager() << LogLevel_Trace << "Found driver [" << l_sDriverIdentifier << "] in Mensia Driver Collection" << "\n";
m_pAcquisitionServer->getDriverContext().getLogManager() << LogLevel_Info << "Found driver [" << l_sDriverIdentifier << "] in Mensia Driver Collection" << "\n";
m_vDriver.push_back(new CDriverMensiaAcquisition(m_pAcquisitionServer->getDriverContext(), l_sDriverIdentifier));
}
......@@ -346,6 +347,16 @@ CAcquisitionServerGUI::~CAcquisitionServerGUI(void)
m_vDriver.clear();
m_pDriver=NULL;
// BEGIN MENSIA ACQUISITION DRIVERS
// For future implementation
#if defined TARGET_OS_Windows && defined TARGET_HasMensiaAcquisitionDriver
typedef int32 (*MACQ_ReleaseMensiaAcquisitionLibrary)();
MACQ_ReleaseMensiaAcquisitionLibrary l_fpReleaseMensiaAcquisitionLibrary;
l_fpReleaseMensiaAcquisitionLibrary = (MACQ_ReleaseMensiaAcquisitionLibrary)::GetProcAddress(static_cast<HINSTANCE>(m_pLibMensiaAcquisition), "releaseAcquisitionLibrary");
// l_fpReleaseMensiaAcquisitionLibrary();
#endif
// END MENSIA ACQUISITION DRIVERS
delete m_pThread;
m_pThread=NULL;
......
......@@ -85,6 +85,9 @@ namespace OpenViBEAcquisitionServer
std::vector < ::GtkWidget* > m_vLevelMesure;
std::thread* m_pThread;
#if defined TARGET_OS_Windows && defined TARGET_HasMensiaAcquisitionDriver
void* m_pLibMensiaAcquisition;
#endif
};
};
......
......@@ -39,6 +39,8 @@ namespace OpenViBEAcquisitionServer
virtual OpenViBE::boolean setImpedanceCheckRequested(const OpenViBE::boolean bImpedanceCheckRequested);
virtual OpenViBE::boolean isImpedanceCheckRequested(void) const;
virtual OpenViBE::uint32 getImpedanceLimit(void) const;
virtual OpenViBE::boolean setImpedanceLimit(const OpenViBE::uint32 ui32ImpedanceLimit);
// Chanel information
virtual OpenViBE::boolean setChannelCount(const OpenViBE::uint32 ui32ChannelCount);
......@@ -84,6 +86,7 @@ namespace OpenViBEAcquisitionServer
// Impedance check
OpenViBE::boolean m_bIsImpedanceCheckRequested;
OpenViBE::uint32 m_ui32ImpedanceLimit;
};
};
};
......@@ -98,6 +101,7 @@ CHeaderImpl::CHeaderImpl(void)
,m_ui32ChannelCount(_NoValueI_)
,m_ui32SamplingFrequency(_NoValueI_)
,m_bIsImpedanceCheckRequested(false)
,m_ui32ImpedanceLimit(_NoValueI_)
{
}
......@@ -116,6 +120,7 @@ void CHeaderImpl::reset(void)
m_vChannelUnits.clear();
m_ui32SamplingFrequency=_NoValueI_;
m_bIsImpedanceCheckRequested=false;
m_ui32ChannelCount=_NoValueI_;
}
//___________________________________________________________________//
......@@ -166,6 +171,17 @@ boolean CHeaderImpl::isImpedanceCheckRequested(void) const
return m_bIsImpedanceCheckRequested;
}
uint32 CHeaderImpl::getImpedanceLimit(void) const
{
return m_ui32ImpedanceLimit;
}
bool CHeaderImpl::setImpedanceLimit(const uint32 ui32ImpedanceLimit)
{
m_ui32ImpedanceLimit = ui32ImpedanceLimit;
return true;
}
boolean CHeaderImpl::isExperimentIdentifierSet(void) const
{
return m_ui32ExperimentIdentifier!=_NoValueI_;
......@@ -383,6 +399,15 @@ boolean CHeader::isImpedanceCheckRequested(void) const
return m_pHeaderImpl->isImpedanceCheckRequested();
}
uint32 CHeader::getImpedanceLimit(void) const
{
return m_pHeaderImpl->getImpedanceLimit();
}
bool CHeader::setImpedanceLimit(const uint32 ui32ImpedanceLimit)
{
return m_pHeaderImpl->setImpedanceLimit(ui32ImpedanceLimit);
}
//___________________________________________________________________//
// //
......
......@@ -28,6 +28,8 @@ namespace OpenViBEAcquisitionServer
virtual OpenViBE::boolean setImpedanceCheckRequested(const OpenViBE::boolean bImpedanceCheckRequested);
virtual OpenViBE::boolean isImpedanceCheckRequested(void) const;
virtual OpenViBE::uint32 getImpedanceLimit(void) const;
virtual OpenViBE::boolean setImpedanceLimit(const OpenViBE::uint32 ui32ImpedanceLimit);
// Chanel information
virtual OpenViBE::boolean setChannelCount(const OpenViBE::uint32 ui32ChannelCount);
......@@ -83,6 +85,8 @@ namespace OpenViBEAcquisitionServer
virtual OpenViBE::boolean setImpedanceCheckRequested(const OpenViBE::boolean bImpedanceCheckRequested){ return m_rAdaptedHeader.setImpedanceCheckRequested(bImpedanceCheckRequested); }
virtual OpenViBE::boolean isImpedanceCheckRequested(void) const { return m_rAdaptedHeader.isImpedanceCheckRequested(); }
virtual OpenViBE::uint32 getImpedanceLimit(void) const { return m_rAdaptedHeader.getImpedanceLimit(); }
virtual OpenViBE::boolean setImpedanceLimit(const OpenViBE::uint32 ui32ImpedanceLimit) { return m_rAdaptedHeader.setImpedanceLimit(ui32ImpedanceLimit); }
// Channel information
virtual OpenViBE::boolean setChannelCount(const OpenViBE::uint32 ui32ChannelCount) { return m_rAdaptedHeader.setChannelCount(ui32ChannelCount); }
......
......@@ -21,7 +21,7 @@ build/windows/sdk-brainproducts-liveamp.zip;sdk-brainproducts-liveamp;0.0.0
build/windows/sdk-eemagine-eego.zip;sdk-eemagine-eego;0.0.0
build/windows/sdk-enobio3g.zip;sdk-enobio3g;0.0.0
build/windows/sdk-mcs.zip;sdk-mcs;0.0.0
build/windows/sdk-mensia-acquisition-driver.zip;sdk-mensia-acquisition-driver;0.0.0
build/windows/sdk-mensia-acquisition-driver-3.0.99.zip;sdk-mensia-acquisition-driver;3.0.99
build/windows/sdk-micromed.zip;sdk-micromed;0.0.0
build/windows/sdk-mitsar.zip;sdk-mitsar;0.0.0
build/windows/sdk-nexus.zip;sdk-nexus;0.0.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment