Commit a824f396 authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Boxes : Fix Coding rules, modernize & lisibility

parent f92b1db7
......@@ -34,10 +34,10 @@ namespace
bool CAlgorithmLevelMeasure::initialize()
{
ip_matrix.initialize(getInputParameter(OVP_Algorithm_LevelMeasure_InputParameterId_Matrix));
m_matrix.initialize(getInputParameter(OVP_Algorithm_LevelMeasure_InputParameterId_Matrix));
op_mainWidget.initialize(getOutputParameter(OVP_Algorithm_LevelMeasure_OutputParameterId_MainWidget));
op_toolbarWidget.initialize(getOutputParameter(OVP_Algorithm_LevelMeasure_OutputParameterId_ToolbarWidget));
m_mainWidget.initialize(getOutputParameter(OVP_Algorithm_LevelMeasure_OutputParameterId_MainWidget));
m_toolWidget.initialize(getOutputParameter(OVP_Algorithm_LevelMeasure_OutputParameterId_ToolbarWidget));
m_mainWidgetInterface = gtk_builder_new(); // glade_xml_new(OpenViBE::Directories::getDataDir() + "/plugins/simple-visualization/openvibe-simple-visualization-LevelMeasure.ui", "level-measure-table", NULL);
gtk_builder_add_from_file(m_mainWidgetInterface, Directories::getDataDir() + "/plugins/simple-visualization/openvibe-simple-visualization-LevelMeasure.ui", nullptr);
......@@ -70,10 +70,10 @@ bool CAlgorithmLevelMeasure::uninitialize()
g_object_unref(m_mainWidgetInterface);
m_mainWidgetInterface = nullptr;
op_toolbarWidget.uninitialize();
op_mainWidget.uninitialize();
m_toolWidget.uninitialize();
m_mainWidget.uninitialize();
ip_matrix.uninitialize();
m_matrix.uninitialize();
return true;
}
......@@ -82,14 +82,14 @@ bool CAlgorithmLevelMeasure::process()
{
if (this->isInputTriggerActive(OVP_Algorithm_LevelMeasure_InputTriggerId_Reset))
{
if (ip_matrix->getDimensionCount() != 1 && ip_matrix->getDimensionCount() != 2)
if (m_matrix->getDimensionCount() != 1 && m_matrix->getDimensionCount() != 2)
{
getLogManager() << LogLevel_ImportantWarning << "Input matrix does not have 1 or 2 dimensions (" << ip_matrix->getDimensionCount() << ")\n";
getLogManager() << LogLevel_ImportantWarning << "Input matrix does not have 1 or 2 dimensions (" << m_matrix->getDimensionCount() << ")\n";
return false;
}
const uint32_t rowCount = (ip_matrix->getDimensionCount() == 2 ? ip_matrix->getDimensionSize(0) : 1);
const uint32_t columnCount = (ip_matrix->getDimensionCount() == 2 ? ip_matrix->getDimensionSize(1) : ip_matrix->getDimensionSize(0));
const uint32_t rowCount = (m_matrix->getDimensionCount() == 2 ? m_matrix->getDimensionSize(0) : 1);
const uint32_t columnCount = (m_matrix->getDimensionCount() == 2 ? m_matrix->getDimensionSize(1) : m_matrix->getDimensionSize(0));
GtkTable* table = GTK_TABLE(gtk_builder_get_object(m_mainWidgetInterface, "level-measure-table"));
gtk_table_resize(table, rowCount, columnCount);
......@@ -114,16 +114,16 @@ bool CAlgorithmLevelMeasure::process()
}
}
op_mainWidget = m_mainWindow;
op_toolbarWidget = m_toolbarWidget;
m_mainWidget = m_mainWindow;
m_toolbarWidget = m_toolbarWidget;
}
if (this->isInputTriggerActive(OVP_Algorithm_LevelMeasure_InputTriggerId_Refresh))
{
auto it = m_ProgressBar.begin();
double* inBuffer = ip_matrix->getBuffer();
double* inBuffer = m_matrix->getBuffer();
uint32_t elementCount = ip_matrix->getBufferElementCount();
uint32_t elementCount = m_matrix->getBufferElementCount();
while (elementCount--)
{
double percent = *inBuffer;
......
......@@ -26,9 +26,9 @@ namespace OpenViBEPlugins
protected:
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMatrix*> ip_matrix;
OpenViBE::Kernel::TParameterHandler<GtkWidget*> op_mainWidget;
OpenViBE::Kernel::TParameterHandler<GtkWidget*> op_toolbarWidget;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMatrix*> m_matrix;
OpenViBE::Kernel::TParameterHandler<GtkWidget*> m_mainWidget;
OpenViBE::Kernel::TParameterHandler<GtkWidget*> m_toolWidget;
GtkBuilder* m_mainWidgetInterface = nullptr;
GtkBuilder* m_toolbarWidgetInterface = nullptr;
......
......@@ -111,17 +111,17 @@ namespace OpenViBEPlugins
_IsDerivedFromClass_Final_(OpenViBEToolkit::TBoxAlgorithm < OpenViBE::Plugins::IBoxAlgorithm >, OVP_ClassId_BoxAlgorithm_ErpPlot)
protected:
OpenViBE::CString m_sFigureFileName;
std::vector<GdkColor> m_oLegendColors;
std::vector<OpenViBE::CString> m_oLegend;
GtkWidget* m_pDrawWindow = nullptr;
std::list<Graph*>* m_lGraphList = nullptr;
bool m_bFirstHeaderReceived = false;
std::vector<OpenViBEToolkit::TStreamedMatrixDecoder<CBoxAlgorithmErpPlot>*> m_vDecoders;
std::vector<OpenViBEToolkit::TStreamedMatrixDecoder<CBoxAlgorithmErpPlot>*> m_vVarianceDecoders;
OpenViBEToolkit::TStimulationDecoder<CBoxAlgorithmErpPlot>* m_oStimulationDecoder = nullptr;
uint64_t m_sTriggerToSave = 0;
bool m_bXStartsAt0 = false;
OpenViBE::CString m_figureFileName;
std::vector<GdkColor> m_legendColors;
std::vector<OpenViBE::CString> m_legend;
GtkWidget* m_drawWindow = nullptr;
std::list<Graph*>* m_graphList = nullptr;
bool m_firstHeaderReceived = false;
std::vector<OpenViBEToolkit::TStreamedMatrixDecoder<CBoxAlgorithmErpPlot>*> m_decoders;
std::vector<OpenViBEToolkit::TStreamedMatrixDecoder<CBoxAlgorithmErpPlot>*> m_varianceDecoders;
OpenViBEToolkit::TStimulationDecoder<CBoxAlgorithmErpPlot>* m_stimulationDecoder = nullptr;
uint64_t m_triggerToSave = 0;
bool m_xStartsAt0 = false;
private:
OpenViBEVisualizationToolkit::IVisualizationContext* m_visualizationContext = nullptr;
......
......@@ -11,44 +11,44 @@ using namespace SimpleVisualization;
bool CBoxAlgorithmLevelMeasure::initialize()
{
m_pMatrix = new CMatrix();
m_matrix = new CMatrix();
m_pStreamedMatrixDecoder = &getAlgorithmManager().getAlgorithm(getAlgorithmManager().createAlgorithm(OVP_GD_ClassId_Algorithm_StreamedMatrixStreamDecoder));
m_pLevelMeasure = &getAlgorithmManager().getAlgorithm(getAlgorithmManager().createAlgorithm(OVP_ClassId_Algorithm_LevelMeasure));
m_streamedMatrixDecoder = &getAlgorithmManager().getAlgorithm(getAlgorithmManager().createAlgorithm(OVP_GD_ClassId_Algorithm_StreamedMatrixStreamDecoder));
m_levelMeasure = &getAlgorithmManager().getAlgorithm(getAlgorithmManager().createAlgorithm(OVP_ClassId_Algorithm_LevelMeasure));
m_pStreamedMatrixDecoder->initialize();
m_pLevelMeasure->initialize();
m_streamedMatrixDecoder->initialize();
m_levelMeasure->initialize();
ip_pStreamedMatrixDecoderMemoryBuffer.initialize(m_pStreamedMatrixDecoder->getInputParameter(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_InputParameterId_MemoryBufferToDecode));
op_pStreamedMatrixDecoderMatrix.initialize(m_pStreamedMatrixDecoder->getOutputParameter(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_OutputParameterId_Matrix));
m_streamedMatrixDecoderMemoryBuffer.initialize(m_streamedMatrixDecoder->getInputParameter(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_InputParameterId_MemoryBufferToDecode));
m_streamedMatrixDecoderMatrix.initialize(m_streamedMatrixDecoder->getOutputParameter(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_OutputParameterId_Matrix));
ip_pLevelMeasureMatrix.initialize(m_pLevelMeasure->getInputParameter(OVP_Algorithm_LevelMeasure_InputParameterId_Matrix));
op_pLevelMeasureMainWidget.initialize(m_pLevelMeasure->getOutputParameter(OVP_Algorithm_LevelMeasure_OutputParameterId_MainWidget));
op_pLevelMeasureToolbarWidget.initialize(m_pLevelMeasure->getOutputParameter(OVP_Algorithm_LevelMeasure_OutputParameterId_ToolbarWidget));
m_levelMeasureMatrix.initialize(m_levelMeasure->getInputParameter(OVP_Algorithm_LevelMeasure_InputParameterId_Matrix));
m_levelMeasureMainWidget.initialize(m_levelMeasure->getOutputParameter(OVP_Algorithm_LevelMeasure_OutputParameterId_MainWidget));
m_levelMeasureToolbarWidget.initialize(m_levelMeasure->getOutputParameter(OVP_Algorithm_LevelMeasure_OutputParameterId_ToolbarWidget));
op_pStreamedMatrixDecoderMatrix.setReferenceTarget(m_pMatrix);
ip_pLevelMeasureMatrix.setReferenceTarget(m_pMatrix);
m_streamedMatrixDecoderMatrix.setReferenceTarget(m_matrix);
m_levelMeasureMatrix.setReferenceTarget(m_matrix);
return true;
}
bool CBoxAlgorithmLevelMeasure::uninitialize()
{
op_pLevelMeasureToolbarWidget.uninitialize();
op_pLevelMeasureMainWidget.uninitialize();
ip_pLevelMeasureMatrix.uninitialize();
m_levelMeasureToolbarWidget.uninitialize();
m_levelMeasureMainWidget.uninitialize();
m_levelMeasureMatrix.uninitialize();
op_pStreamedMatrixDecoderMatrix.uninitialize();
ip_pStreamedMatrixDecoderMemoryBuffer.uninitialize();
m_streamedMatrixDecoderMatrix.uninitialize();
m_streamedMatrixDecoderMemoryBuffer.uninitialize();
m_pLevelMeasure->uninitialize();
m_pStreamedMatrixDecoder->uninitialize();
m_levelMeasure->uninitialize();
m_streamedMatrixDecoder->uninitialize();
getAlgorithmManager().releaseAlgorithm(*m_pLevelMeasure);
getAlgorithmManager().releaseAlgorithm(*m_pStreamedMatrixDecoder);
getAlgorithmManager().releaseAlgorithm(*m_levelMeasure);
getAlgorithmManager().releaseAlgorithm(*m_streamedMatrixDecoder);
delete m_pMatrix;
m_pMatrix = nullptr;
delete m_matrix;
m_matrix = nullptr;
if (m_visualizationContext)
{
......@@ -71,17 +71,17 @@ bool CBoxAlgorithmLevelMeasure::process()
for (uint32_t i = 0; i < boxContext.getInputChunkCount(0); ++i)
{
ip_pStreamedMatrixDecoderMemoryBuffer = boxContext.getInputChunk(0, i);
m_pStreamedMatrixDecoder->process();
if (m_pStreamedMatrixDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_OutputTriggerId_ReceivedHeader))
m_streamedMatrixDecoderMemoryBuffer = boxContext.getInputChunk(0, i);
m_streamedMatrixDecoder->process();
if (m_streamedMatrixDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_OutputTriggerId_ReceivedHeader))
{
m_pLevelMeasure->process(OVP_Algorithm_LevelMeasure_InputTriggerId_Reset);
m_levelMeasure->process(OVP_Algorithm_LevelMeasure_InputTriggerId_Reset);
m_visualizationContext = dynamic_cast<OpenViBEVisualizationToolkit::IVisualizationContext*>(this->createPluginObject(OVP_ClassId_Plugin_VisualizationContext));
m_visualizationContext->setWidget(*this, op_pLevelMeasureMainWidget);
m_visualizationContext->setToolbar(*this, op_pLevelMeasureToolbarWidget);
m_visualizationContext->setWidget(*this, m_levelMeasureMainWidget);
m_visualizationContext->setToolbar(*this, m_levelMeasureToolbarWidget);
}
if (m_pStreamedMatrixDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_OutputTriggerId_ReceivedBuffer))
if (m_streamedMatrixDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_OutputTriggerId_ReceivedBuffer))
{
// ----- >8 ------------------------------------------------------------------------------------------------------------------------------------------------------
......@@ -90,8 +90,8 @@ bool CBoxAlgorithmLevelMeasure::process()
double sum = 0;
{
double* matrixBuffer = m_pMatrix->getBuffer();
uint32_t elementCount = m_pMatrix->getBufferElementCount();
double* matrixBuffer = m_matrix->getBuffer();
uint32_t elementCount = m_matrix->getBufferElementCount();
while (elementCount--)
{
sum += *matrixBuffer;
......@@ -101,8 +101,8 @@ bool CBoxAlgorithmLevelMeasure::process()
{
const double factor = (sum != 0 ? 1. / sum : 0.5);
double* matrixBuffer = m_pMatrix->getBuffer();
uint32_t elementCount = m_pMatrix->getBufferElementCount();
double* matrixBuffer = m_matrix->getBuffer();
uint32_t elementCount = m_matrix->getBufferElementCount();
while (elementCount--)
{
*matrixBuffer *= factor;
......@@ -112,9 +112,9 @@ bool CBoxAlgorithmLevelMeasure::process()
// ----- >8 ------------------------------------------------------------------------------------------------------------------------------------------------------
m_pLevelMeasure->process(OVP_Algorithm_LevelMeasure_InputTriggerId_Refresh);
m_levelMeasure->process(OVP_Algorithm_LevelMeasure_InputTriggerId_Refresh);
}
if (m_pStreamedMatrixDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_OutputTriggerId_ReceivedEnd)) { }
if (m_streamedMatrixDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StreamedMatrixStreamDecoder_OutputTriggerId_ReceivedEnd)) { }
boxContext.markInputAsDeprecated(0, i);
}
......
......@@ -24,17 +24,17 @@ namespace OpenViBEPlugins
protected:
OpenViBE::Kernel::IAlgorithmProxy* m_pStreamedMatrixDecoder = nullptr;
OpenViBE::Kernel::IAlgorithmProxy* m_pLevelMeasure = nullptr;
OpenViBE::Kernel::IAlgorithmProxy* m_streamedMatrixDecoder = nullptr;
OpenViBE::Kernel::IAlgorithmProxy* m_levelMeasure = nullptr;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> ip_pStreamedMatrixDecoderMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMatrix*> op_pStreamedMatrixDecoderMatrix;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> m_streamedMatrixDecoderMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMatrix*> m_streamedMatrixDecoderMatrix;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMatrix*> ip_pLevelMeasureMatrix;
OpenViBE::Kernel::TParameterHandler<GtkWidget*> op_pLevelMeasureMainWidget;
OpenViBE::Kernel::TParameterHandler<GtkWidget*> op_pLevelMeasureToolbarWidget;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMatrix*> m_levelMeasureMatrix;
OpenViBE::Kernel::TParameterHandler<GtkWidget*> m_levelMeasureMainWidget;
OpenViBE::Kernel::TParameterHandler<GtkWidget*> m_levelMeasureToolbarWidget;
OpenViBE::IMatrix* m_pMatrix = nullptr;
OpenViBE::IMatrix* m_matrix = nullptr;
private:
OpenViBEVisualizationToolkit::IVisualizationContext* m_visualizationContext = nullptr;
......
......@@ -50,7 +50,7 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::initialize()
{
const IBox& boxContext = this->getStaticBoxContext();
m_pMainWidgetInterface = nullptr;
m_mainWidgetInterface = nullptr;
//get value of settings given in the configuration box
m_interfaceFilename = FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 0);
......@@ -73,18 +73,18 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::initialize()
m_cardSelectionStimulationDecoder = &this->getAlgorithmManager().getAlgorithm(this->getAlgorithmManager().createAlgorithm(OVP_GD_ClassId_Algorithm_StimulationStreamDecoder));
m_cardSelectionStimulationDecoder->initialize();
ip_pSequenceMemoryBuffer.initialize(m_sequenceStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
op_pSequenceStimulationSet.initialize(m_sequenceStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
m_sequenceMemoryBuffer.initialize(m_sequenceStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
m_sequenceStimulationSet.initialize(m_sequenceStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
ip_pTargetMemoryBuffer.initialize(m_targetStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
op_pTargetStimulationSet.initialize(m_targetStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
m_targetMemoryBuffer.initialize(m_targetStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
m_targetStimulationSet.initialize(m_targetStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
ip_pTargetFlaggingStimulationSet.initialize(m_targetFlaggingStimulationEncoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_InputParameterId_StimulationSet));
op_pTargetFlaggingMemoryBuffer.initialize(m_targetFlaggingStimulationEncoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_OutputParameterId_EncodedMemoryBuffer));
m_targetFlaggingStimulationSet.initialize(m_targetFlaggingStimulationEncoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_InputParameterId_StimulationSet));
m_targetFlaggingMemoryBuffer.initialize(m_targetFlaggingStimulationEncoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_OutputParameterId_EncodedMemoryBuffer));
m_lastTime = 0;
m_pMainWidgetInterface = gtk_builder_new(); // glade_xml_new(m_interfaceFilename.toASCIIString(), "p300-Identifier-card-main", NULL);
if (!gtk_builder_add_from_file(m_pMainWidgetInterface, m_interfaceFilename.toASCIIString(), nullptr))
m_mainWidgetInterface = gtk_builder_new(); // glade_xml_new(m_interfaceFilename.toASCIIString(), "p300-Identifier-card-main", NULL);
if (!gtk_builder_add_from_file(m_mainWidgetInterface, m_interfaceFilename.toASCIIString(), nullptr))
{
this->getLogManager() << LogLevel_ImportantWarning << "Could not load interface file [" << m_interfaceFilename << "]\n";
this->getLogManager() << LogLevel_ImportantWarning << "The file may be missing. However, the interface files now use gtk-builder instead of glade. Did you update your files ?\n";
......@@ -92,21 +92,21 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::initialize()
}
// m_toolbarWidgetInterface=glade_xml_new(m_interfaceFilename.toASCIIString(), "p300-Identifier-card-toolbar", NULL);
m_mainWindow = GTK_WIDGET(gtk_builder_get_object(m_pMainWidgetInterface, "p300-Identifier-card-main"));
m_mainWindow = GTK_WIDGET(gtk_builder_get_object(m_mainWidgetInterface, "p300-Identifier-card-main"));
// m_toolbarWidget=gtk_builder_get_object(m_toolbarWidgetInterface, "p300-Identifier-card-toolbar");
m_pTable = GTK_TABLE(gtk_builder_get_object(m_pMainWidgetInterface, "p300-Identifier-card-table"));
m_table = GTK_TABLE(gtk_builder_get_object(m_mainWidgetInterface, "p300-Identifier-card-table"));
gtk_widget_modify_bg(m_mainWindow, GTK_STATE_NORMAL, &m_backgroundColor);
m_targetLabel = GTK_LABEL(gtk_builder_get_object(m_pMainWidgetInterface, "labelTarget"));
m_targetLabel = GTK_LABEL(gtk_builder_get_object(m_mainWidgetInterface, "labelTarget"));
char labelTarget[80];
sprintf(labelTarget, "<span weight=\"bold\" size=\"xx-large\" color=\"#%2x%2x%2x\">Target</span>", (m_targetBackgroundColor.red), (m_targetBackgroundColor.green), (m_targetBackgroundColor.blue));
gtk_label_set_label(m_targetLabel, labelTarget);
m_selectedLabel = GTK_LABEL(gtk_builder_get_object(m_pMainWidgetInterface, "labelResult"));
m_selectedLabel = GTK_LABEL(gtk_builder_get_object(m_mainWidgetInterface, "labelResult"));
char labelSelected[80];
sprintf(labelSelected, "<span weight=\"bold\" size=\"xx-large\" color=\"#%2x%2x%2x\">Selected</span>", (m_selectedBackgroundColor.red), (m_selectedBackgroundColor.green), (m_selectedBackgroundColor.blue));
gtk_label_set_label(m_selectedLabel, labelSelected);
gtk_builder_connect_signals(m_pMainWidgetInterface, nullptr);
gtk_builder_connect_signals(m_mainWidgetInterface, nullptr);
// gtk_builder_connect_signals(m_toolbarWidgetInterface, NULL);
......@@ -118,7 +118,7 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::initialize()
m_targetCard = -1;
m_tableInitialized = false;
this->cacheBuildFromTable(m_pTable);
this->cacheBuildFromTable(m_table);
GtkRequisition size;
gtk_widget_size_request(GTK_WIDGET(m_caches[1].pWidget), &size);
......@@ -148,7 +148,7 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::initialize()
GdkPixbuf* srcPixbuf = gtk_image_get_pixbuf(GTK_IMAGE(foregroundImageWork));
GdkPixbuf* destPixbuf = gdk_pixbuf_scale_simple(srcPixbuf, widthWork, heightWork, GDK_INTERP_HYPER);
gtk_image_set_from_pixbuf(GTK_IMAGE(foregroundImageWork), destPixbuf);
m_vForegroundImageWorks.push_back(foregroundImageWork);
m_foregroundImageWorks.push_back(foregroundImageWork);
GtkWidget* foregroundImageResult = gtk_image_new_from_file(foregroundImageFilename.toASCIIString());
gtk_widget_show(foregroundImageResult);
......@@ -186,20 +186,20 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::uninitialize()
// g_object_unref(m_toolbarWidgetInterface);
// m_toolbarWidgetInterface= nullptr;
if (m_pMainWidgetInterface)
if (m_mainWidgetInterface)
{
g_object_unref(m_pMainWidgetInterface);
m_pMainWidgetInterface = nullptr;
g_object_unref(m_mainWidgetInterface);
m_mainWidgetInterface = nullptr;
}
ip_pTargetFlaggingStimulationSet.uninitialize();
op_pTargetFlaggingMemoryBuffer.uninitialize();
m_targetFlaggingStimulationSet.uninitialize();
m_targetFlaggingMemoryBuffer.uninitialize();
op_pTargetStimulationSet.uninitialize();
ip_pTargetMemoryBuffer.uninitialize();
m_targetStimulationSet.uninitialize();
m_targetMemoryBuffer.uninitialize();
op_pSequenceStimulationSet.uninitialize();
ip_pSequenceMemoryBuffer.uninitialize();
m_sequenceStimulationSet.uninitialize();
m_sequenceMemoryBuffer.uninitialize();
if (m_cardSelectionStimulationDecoder)
{
......@@ -264,9 +264,9 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::process()
{
CStimulationSet flaggingStimulationSet;
ip_pSequenceMemoryBuffer = boxContext.getInputChunk(0, i);
ip_pTargetFlaggingStimulationSet = &flaggingStimulationSet;
op_pTargetFlaggingMemoryBuffer = boxContext.getOutputChunk(0);
m_sequenceMemoryBuffer = boxContext.getInputChunk(0, i);
m_targetFlaggingStimulationSet = &flaggingStimulationSet;
m_targetFlaggingMemoryBuffer = boxContext.getOutputChunk(0);
m_sequenceStimulationDecoder->process();
......@@ -279,7 +279,7 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::process()
if (m_sequenceStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationStreamDecoder_OutputTriggerId_ReceivedBuffer))
{
IStimulationSet* stimulationSet = op_pSequenceStimulationSet;
IStimulationSet* stimulationSet = m_sequenceStimulationSet;
for (uint64_t j = 0; j < stimulationSet->getStimulationCount(); ++j)
{
const uint64_t stimulationIdentifier = stimulationSet->getStimulationIdentifier(j);
......@@ -295,7 +295,7 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::process()
{
flaggingStimulationSet.appendStimulation(OVTK_StimulationId_NonTarget, stimulationSet->getStimulationDate(j), 0);
}
this->cacheChangeImageCB(m_caches[1], m_vForegroundImageWorks[card]);
this->cacheChangeImageCB(m_caches[1], m_foregroundImageWorks[card]);
}
else if (stimulationIdentifier == OVTK_StimulationId_ExperimentStart)
{
......@@ -355,14 +355,14 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::process()
{
if (m_lastTime >= boxContext.getInputChunkStartTime(1, i))
{
ip_pTargetMemoryBuffer = boxContext.getInputChunk(1, i);
m_targetMemoryBuffer = boxContext.getInputChunk(1, i);
m_targetStimulationDecoder->process();
if (m_targetStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationStreamDecoder_OutputTriggerId_ReceivedHeader)) { }
if (m_targetStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationStreamDecoder_OutputTriggerId_ReceivedBuffer))
{
IStimulationSet* stimulationSet = op_pTargetStimulationSet;
IStimulationSet* stimulationSet = m_targetStimulationSet;
for (uint64_t j = 0; j < stimulationSet->getStimulationCount(); ++j)
{
uint64_t stimulationIdentifier = stimulationSet->getStimulationIdentifier(j);
......@@ -419,9 +419,9 @@ bool CBoxAlgorithmP300IdentifierCardVisualization::process()
{
this->getLogManager() << LogLevel_Trace << "Selection Rejected !\n";
std::string label;
label = gtk_label_get_text(m_pResult);
label = gtk_label_get_text(m_result);
label += "*";
gtk_label_set_text(m_pResult, label.c_str());
gtk_label_set_text(m_result, label.c_str());
}
}
}
......
......@@ -57,20 +57,20 @@ namespace OpenViBEPlugins
OpenViBE::Kernel::IAlgorithmProxy* m_targetStimulationDecoder = nullptr;
OpenViBE::Kernel::IAlgorithmProxy* m_targetFlaggingStimulationEncoder = nullptr;
OpenViBE::Kernel::IAlgorithmProxy* m_cardSelectionStimulationDecoder = nullptr;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> ip_pSequenceMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> ip_pTargetMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IStimulationSet*> ip_pTargetFlaggingStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IStimulationSet*> op_pSequenceStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IStimulationSet*> op_pTargetStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMemoryBuffer*> op_pTargetFlaggingMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> m_sequenceMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> m_targetMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IStimulationSet*> m_targetFlaggingStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IStimulationSet*> m_sequenceStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IStimulationSet*> m_targetStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMemoryBuffer*> m_targetFlaggingMemoryBuffer;
uint64_t m_lastTime = 0;
GtkBuilder* m_pMainWidgetInterface = nullptr;
GtkBuilder* m_mainWidgetInterface = nullptr;
//GtkBuilder* m_toolbarWidgetInterface = nullptr;
GtkWidget* m_mainWindow = nullptr;
//GtkWidget* m_toolbarWidget = nullptr;
GtkTable* m_pTable = nullptr;
GtkLabel* m_pResult = nullptr;
GtkTable* m_table = nullptr;
GtkLabel* m_result = nullptr;
//GtkLabel* m_target = nullptr;
GdkColor m_backgroundColor;
GdkColor m_targetBackgroundColor;
......@@ -82,7 +82,7 @@ namespace OpenViBEPlugins
int m_targetCard = 0;
std::vector<GtkWidget*> m_foregroundImageTargets;
std::vector<GtkWidget*> m_vForegroundImageWorks;
std::vector<GtkWidget*> m_foregroundImageWorks;
std::vector<GtkWidget*> m_foregroundImageResults;
GtkWidget* m_backgroundImageTarget = nullptr;
GtkWidget* m_backgroundImageWork = nullptr;
......
......@@ -111,14 +111,14 @@ bool CBoxAlgorithmP300MagicCardVisualization::initialize()
m_cardSelectionStimulationDecoder = &this->getAlgorithmManager().getAlgorithm(this->getAlgorithmManager().createAlgorithm(OVP_GD_ClassId_Algorithm_StimulationStreamDecoder));
m_cardSelectionStimulationDecoder->initialize();
ip_pSequenceMemoryBuffer.initialize(m_sequenceStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
op_pSequenceStimulationSet.initialize(m_sequenceStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
m_sequenceMemoryBuffer.initialize(m_sequenceStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
m_sequenceStimulationSet.initialize(m_sequenceStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
ip_pTargetMemoryBuffer.initialize(m_targetStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
op_pTargetStimulationSet.initialize(m_targetStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
m_targetMemoryBuffer.initialize(m_targetStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
m_targetStimulationSet.initialize(m_targetStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
ip_pTargetFlaggingStimulationSet.initialize(m_targetFlaggingStimulationEncoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_InputParameterId_StimulationSet));
op_pTargetFlaggingMemoryBuffer.initialize(m_targetFlaggingStimulationEncoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_OutputParameterId_EncodedMemoryBuffer));
m_targetFlaggingStimulationSet.initialize(m_targetFlaggingStimulationEncoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_InputParameterId_StimulationSet));
m_targetFlaggingMemoryBuffer.initialize(m_targetFlaggingStimulationEncoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_OutputParameterId_EncodedMemoryBuffer));
m_lastTime = 0;
......@@ -186,14 +186,14 @@ bool CBoxAlgorithmP300MagicCardVisualization::uninitialize()
m_mainWidgetInterface = nullptr;
}
ip_pTargetFlaggingStimulationSet.uninitialize();
op_pTargetFlaggingMemoryBuffer.uninitialize();
m_targetFlaggingStimulationSet.uninitialize();
m_targetFlaggingMemoryBuffer.uninitialize();
op_pTargetStimulationSet.uninitialize();
ip_pTargetMemoryBuffer.uninitialize();
m_targetStimulationSet.uninitialize();
m_targetMemoryBuffer.uninitialize();
op_pSequenceStimulationSet.uninitialize();
ip_pSequenceMemoryBuffer.uninitialize();
m_sequenceStimulationSet.uninitialize();
m_sequenceMemoryBuffer.uninitialize();
if (m_cardSelectionStimulationDecoder)
{
......@@ -263,9 +263,9 @@ bool CBoxAlgorithmP300MagicCardVisualization::process()
{
CStimulationSet flaggingStimulationSet;
ip_pSequenceMemoryBuffer = boxContext.getInputChunk(0, i);
ip_pTargetFlaggingStimulationSet = &flaggingStimulationSet;
op_pTargetFlaggingMemoryBuffer = boxContext.getOutputChunk(0);
m_sequenceMemoryBuffer = boxContext.getInputChunk(0, i);
m_targetFlaggingStimulationSet = &flaggingStimulationSet;
m_targetFlaggingMemoryBuffer = boxContext.getOutputChunk(0);
m_sequenceStimulationDecoder->process();
......@@ -278,7 +278,7 @@ bool CBoxAlgorithmP300MagicCardVisualization::process()
if (m_sequenceStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationStreamDecoder_OutputTriggerId_ReceivedBuffer))
{
IStimulationSet* stimulationSet = op_pSequenceStimulationSet;
IStimulationSet* stimulationSet = m_sequenceStimulationSet;
for (uint64_t j = 0; j < stimulationSet->getStimulationCount(); ++j)
{
uint64_t stimulationIdentifier = stimulationSet->getStimulationIdentifier(j);
......@@ -333,14 +333,14 @@ bool CBoxAlgorithmP300MagicCardVisualization::process()
{
if (m_lastTime >= boxContext.getInputChunkStartTime(1, i))
{
ip_pTargetMemoryBuffer = boxContext.getInputChunk(1, i);
m_targetMemoryBuffer = boxContext.getInputChunk(1, i);
m_targetStimulationDecoder->process();
if (m_targetStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationStreamDecoder_OutputTriggerId_ReceivedHeader)) { }
if (m_targetStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationStreamDecoder_OutputTriggerId_ReceivedBuffer))
{
IStimulationSet* stimulationSet = op_pTargetStimulationSet;
IStimulationSet* stimulationSet = m_targetStimulationSet;
for (uint64_t j = 0; j < stimulationSet->getStimulationCount(); ++j)
{
uint64_t stimulationIdentifier = stimulationSet->getStimulationIdentifier(j);
......
......@@ -62,12 +62,12 @@ namespace OpenViBEPlugins
OpenViBE::Kernel::IAlgorithmProxy* m_targetStimulationDecoder = nullptr;
OpenViBE::Kernel::IAlgorithmProxy* m_targetFlaggingStimulationEncoder = nullptr;
OpenViBE::Kernel::IAlgorithmProxy* m_cardSelectionStimulationDecoder = nullptr;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> ip_pSequenceMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> ip_pTargetMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IStimulationSet*> ip_pTargetFlaggingStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IStimulationSet*> op_pSequenceStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IStimulationSet*> op_pTargetStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMemoryBuffer*> op_pTargetFlaggingMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> m_sequenceMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IMemoryBuffer*> m_targetMemoryBuffer;
OpenViBE::Kernel::TParameterHandler<const OpenViBE::IStimulationSet*> m_targetFlaggingStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IStimulationSet*> m_sequenceStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IStimulationSet*> m_targetStimulationSet;
OpenViBE::Kernel::TParameterHandler<OpenViBE::IMemoryBuffer*> m_targetFlaggingMemoryBuffer;
uint64_t m_lastTime = 0;
GtkBuilder* m_mainWidgetInterface = nullptr;
......
......@@ -110,14 +110,14 @@ bool CBoxAlgorithmP300SpellerVisualization::initialize()
m_columnSelectionStimulationDecoder = &this->getAlgorithmManager().getAlgorithm(this->getAlgorithmManager().createAlgorithm(OVP_GD_ClassId_Algorithm_StimulationStreamDecoder));
m_columnSelectionStimulationDecoder->initialize();
ip_pSequenceMemoryBuffer.initialize(m_sequenceStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
op_pSequenceStimulationSet.initialize(m_sequenceStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
m_sequenceMemoryBuffer.initialize(m_sequenceStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
m_sequenceStimulationSet.initialize(m_sequenceStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
ip_pTargetMemoryBuffer.initialize(m_targetStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
op_pTargetStimulationSet.initialize(m_targetStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
m_targetMemoryBuffer.initialize(m_targetStimulationDecoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_InputParameterId_MemoryBufferToDecode));
m_targetStimulationSet.initialize(m_targetStimulationDecoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamDecoder_OutputParameterId_StimulationSet));
ip_pTargetFlaggingStimulationSet.initialize(m_targetFlaggingStimulationEncoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_InputParameterId_StimulationSet));
op_pTargetFlaggingMemoryBuffer.initialize(m_targetFlaggingStimulationEncoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_OutputParameterId_EncodedMemoryBuffer));
m_targetFlaggingStimulationSet.initialize(m_targetFlaggingStimulationEncoder->getInputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_InputParameterId_StimulationSet));
m_targetFlaggingMemoryBuffer.initialize(m_targetFlaggingStimulationEncoder->getOutputParameter(OVP_GD_Algorithm_StimulationStreamEncoder_OutputParameterId_EncodedMemoryBuffer));
m_lastTime = 0;
......@@ -258,14 +258,14 @@ bool CBoxAlgorithmP300SpellerVisualization::uninitialize()
m_mainWidgetInterface = nullptr;
}
ip_pTargetFlaggingStimulationSet.uninitialize();
op_pTargetFlaggingMemoryBuffer.uninitialize();
m_targetFlaggingStimulationSet.uninitialize();
m_targetFlaggingMemoryBuffer.uninitialize();
op_pTargetStimulationSet.uninitialize();
ip_pTargetMemoryBuffer.uninitialize();
m_targetStimulationSet.uninitialize();
m_targetMemoryBuffer.uninitialize();
op_pSequenceStimulationSet.uninitialize();
ip_pSequenceMemoryBuffer.uninitialize();
m_sequenceStimulationSet.uninitialize();
m_sequenceMemoryBuffer.uninitialize();
if (m_columnSelectionStimulationDecoder)
{
......@@ -336,9 +336,9 @@ bool CBoxAlgorithmP300SpellerVisualization::process()
{
CStimulationSet flaggingStimulationSet;
ip_pSequenceMemoryBuffer = boxContext.getInputChunk(0, i);
ip_pTargetFlaggingStimulationSet = &flaggingStimulationSet;
op_pTargetFlaggingMemoryBuffer = boxContext.getOutputChunk(0);
m_sequenceMemoryBuffer = boxContext.getInputChunk(0, i);
m_targetFlaggingStimulationSet = &flaggingStimulationSet;
m_targetFlaggingMemoryBuffer = boxContext.getOutputChunk(0);
m_sequenceStimulationDecoder->process();
......@@ -351,7 +351,7 @@ bool CBoxAlgorithmP300SpellerVisualization::process()
if (m_sequenceStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationStreamDecoder_OutputTriggerId_ReceivedBuffer))
{
IStimulationSet* stimulationSet = op_pSequenceStimulationSet;
IStimulationSet* stimulationSet = m_sequenceStimulationSet;