Commit 1759432f authored by PAPADOPOULO Theodore's avatar PAPADOPOULO Theodore

Add a parameter in the DisplayCueImage box to not send the triggers to the acquisition server.

parent 709bbe84
......@@ -61,6 +61,7 @@ namespace OpenViBEPlugins
m_bFullScreen(false),
m_bScaleImages(false),
m_ui64LastOutputChunkDate(0),
m_bSendStimulus(true),
m_pStimulusSender(nullptr),
m_visualizationContext(nullptr)
{
......@@ -92,6 +93,9 @@ namespace OpenViBEPlugins
//Clear screen stimulation:
m_ui64ClearScreenStimulation = FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 2);
//Do we send the stimulus to the acquisition server.
m_bSendStimulus = FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 3);
//Stimulation ID and images file names for each cue
m_vImageNames.resize(m_ui32NumberOfCues);
m_vStimulationsId.resize(m_ui32NumberOfCues);
......@@ -151,11 +155,14 @@ namespace OpenViBEPlugins
}
m_vStimuliQueue.clear();
m_pStimulusSender = TCPTagging::CreateStimulusSender();
if (!m_pStimulusSender->connect("localhost", "15361"))
if (m_bSendStimulus)
{
this->getLogManager() << LogLevel_Warning << "Unable to connect to AS's TCP Tagging plugin, stimuli wont be forwarded.\n";
m_pStimulusSender = TCPTagging::CreateStimulusSender();
if (!m_pStimulusSender->connect("localhost", "15361"))
{
this->getLogManager() << LogLevel_Warning << "Unable to connect to AS's TCP Tagging plugin, stimuli wont be forwarded.\n";
}
}
if (m_bFullScreen)
......@@ -357,8 +364,11 @@ namespace OpenViBEPlugins
}
else
{
// We have not yet queued anything to be drawn, so we can forward immediately.
m_pStimulusSender->sendStimulation(l_ui64StimID);
if (m_bSendStimulus)
{
// We have not yet queued anything to be drawn, so we can forward immediately.
m_pStimulusSender->sendStimulation(l_ui64StimID);
}
}
}
......@@ -542,9 +552,12 @@ namespace OpenViBEPlugins
// Note that we don't need concurrency control here as gtk callbacks run in the main thread
void CDisplayCueImage::flushQueue()
{
for (size_t i = 0; i < m_vStimuliQueue.size(); i++)
if (m_bSendStimulus)
{
m_pStimulusSender->sendStimulation(m_vStimuliQueue[i]);
for(size_t i=0;i<m_vStimuliQueue.size();i++)
{
m_pStimulusSender->sendStimulation(m_vStimuliQueue[i]);
}
}
m_vStimuliQueue.clear();
......
......@@ -95,6 +95,7 @@ namespace OpenViBEPlugins
// For queuing stimulations to the TCP Tagging
std::vector<uint64_t> m_vStimuliQueue;
guint m_uiIdleFuncTag;
bool m_bSendStimulus;
TCPTagging::IStimulusSender* m_pStimulusSender;
private:
......@@ -176,7 +177,7 @@ namespace OpenViBEPlugins
{
public:
OpenViBE::CString getName() const override { return OpenViBE::CString("Display cue image"); }
OpenViBE::CString getAuthorName() const override { return OpenViBE::CString("Joan Fruitet, Jussi T. Lindgren"); }
OpenViBE::CString getAuthorName() const override { return OpenViBE::CString("Joan Fruitet, Jussi T. Lindgren, T. Papadopoulo"); }
OpenViBE::CString getAuthorCompanyName() const override { return OpenViBE::CString("Inria Sophia, Inria Rennes"); }
OpenViBE::CString getShortDescription() const override { return OpenViBE::CString("Display cue images when receiving stimulations"); }
OpenViBE::CString getDetailedDescription() const override { return OpenViBE::CString("Display cue images when receiving specified stimulations. Forwards the stimulations to the AS using TCP Tagging."); }
......@@ -202,6 +203,7 @@ namespace OpenViBEPlugins
rPrototype.addSetting("Display images in full screen", OV_TypeId_Boolean, "false");
rPrototype.addSetting("Scale images to fit", OV_TypeId_Boolean, "false");
rPrototype.addSetting("Clear screen Stimulation", OV_TypeId_Stimulation, "OVTK_StimulationId_VisualStimulationStop");
rPrototype.addSetting("Send stimulations", OV_TypeId_Boolean, "true");
rPrototype.addSetting("Cue Image 1", OV_TypeId_Filename, "${Path_Data}/plugins/simple-visualization/p300-magic-card/01.png");
rPrototype.addSetting("Stimulation 1", OV_TypeId_Stimulation, "OVTK_StimulationId_Label_01");
rPrototype.addFlag(OpenViBE::Kernel::BoxFlag_CanAddSetting);
......
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