Browse Source

Dateien hochladen nach „src/TactileVisualization“

master
Tobias Baumann 2 years ago
parent
commit
5a50c85c57

+ 1
- 1
src/TactileVisualization/TactileMenu.cpp View File

@@ -23,7 +23,7 @@ TactileMenu::TactileMenu(int n_Tactilos)
for(int i = 1; i <= n_Tactilos; i++)
{
m_LabelText.push_back("Tactilo" + std::to_string(i));
m_SubMenu.push_back(this);
m_SubMenu.push_back(nullptr);
}
}

+ 30
- 25
src/TactileVisualization/ovpCBoxAlgorithmP300TactileVisualization.cpp View File

@@ -152,9 +152,6 @@ bool CBoxAlgorithmP300TactileVisualization::initialize()
m_Menu[0].set_LabelText(3, "Hilfe");
m_Menu[0].set_LabelText(4, "Geräte");
m_Menu[0].set_LabelText(5, "Funktionen");
m_Menu[0].set_SubMenu(2, &m_Menu[1]);
m_Menu[0].set_SubMenu(3, &m_Menu[2]);
m_Menu[0].set_SubMenu(4, &m_Menu[3]);
m_Menu.push_back(TactileMenu(6));
m_Menu[1].set_LabelText(0, "Ja");
@@ -163,7 +160,6 @@ bool CBoxAlgorithmP300TactileVisualization::initialize()
m_Menu[1].set_LabelText(3, "Lage");
m_Menu[1].set_LabelText(4, "Müdigkeit");
m_Menu[1].set_LabelText(5, "Hauptmenü");
m_Menu[0].set_SubMenu(5, &m_Menu[0]);
m_Menu.push_back(TactileMenu(6));
m_Menu[2].set_LabelText(0, "Ja");
@@ -172,7 +168,6 @@ bool CBoxAlgorithmP300TactileVisualization::initialize()
m_Menu[2].set_LabelText(3, "Atemnot");
m_Menu[2].set_LabelText(4, "Anderes");
m_Menu[2].set_LabelText(5, "Hauptmenü");
m_Menu[0].set_SubMenu(5, &m_Menu[0]);
m_Menu.push_back(TactileMenu(6));
m_Menu[3].set_LabelText(0, "Ja");
@@ -181,9 +176,16 @@ bool CBoxAlgorithmP300TactileVisualization::initialize()
m_Menu[3].set_LabelText(3, "Rollstuhl");
m_Menu[3].set_LabelText(4, "Computer");
m_Menu[3].set_LabelText(5, "Hauptmenü");
m_Menu[0].set_SubMenu(5, &m_Menu[0]);
//Set Pointer to Mainmenu
//Set SubMenu ptr
m_Menu[0].set_SubMenu(2, &m_Menu[1]);
m_Menu[0].set_SubMenu(3, &m_Menu[2]);
m_Menu[0].set_SubMenu(4, &m_Menu[3]);
m_Menu[1].set_SubMenu(5, &m_Menu[0]);
m_Menu[2].set_SubMenu(5, &m_Menu[0]);
m_Menu[3].set_SubMenu(5, &m_Menu[0]);
//Set current menu ptr to Mainmenu
m_currMenu = &m_Menu[0];
}
else //Create default menu for m_nTactilos != 6
@@ -351,6 +353,7 @@ bool CBoxAlgorithmP300TactileVisualization::uninitialize()
m_targetFlaggingStimulationEncoder->uninitialize();
this->getAlgorithmManager().releaseAlgorithm(*m_targetFlaggingStimulationEncoder);
m_targetFlaggingStimulationEncoder = nullptr;
}
if (m_targetStimulationDecoder)
@@ -416,10 +419,10 @@ bool CBoxAlgorithmP300TactileVisualization::process()
if (m_sequenceStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationDecoder_OutputTriggerId_ReceivedBuffer))
{
IStimulationSet* stimulationSet = m_sequenceStimulationSet;
for (size_t j = 0; j < stimulationSet->getStimulationCount(); ++j)
CStimulationSet* stimulationSet = m_sequenceStimulationSet;
for (size_t j = 0; j < stimulationSet->size(); ++j)
{
uint64_t id = stimulationSet->getStimulationIdentifier(j);
uint64_t id = stimulationSet->getId(j);
bool flash = false;
int row = -1;
int col = -1;
@@ -463,12 +466,12 @@ bool CBoxAlgorithmP300TactileVisualization::process()
if (isTarget)
{
m_stimuliQueue.push_back(OVTK_StimulationId_Target);
flaggingStimulationSet.appendStimulation(OVTK_StimulationId_Target, stimulationSet->getStimulationDate(j), 0);
flaggingStimulationSet.push_back(OVTK_StimulationId_Target, stimulationSet->getDate(j), 0);
}
else
{
m_stimuliQueue.push_back(OVTK_StimulationId_NonTarget);
flaggingStimulationSet.appendStimulation(OVTK_StimulationId_NonTarget, stimulationSet->getStimulationDate(j), 0);
flaggingStimulationSet.push_back(OVTK_StimulationId_NonTarget, stimulationSet->getDate(j), 0);
}
}
@@ -501,10 +504,10 @@ bool CBoxAlgorithmP300TactileVisualization::process()
if (m_targetStimulationDecoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationDecoder_OutputTriggerId_ReceivedBuffer))
{
IStimulationSet* stimulationSet = m_targetStimulationSet;
for (size_t j = 0; j < stimulationSet->getStimulationCount(); ++j)
CStimulationSet* stimulationSet = m_targetStimulationSet;
for (size_t j = 0; j < stimulationSet->size(); ++j)
{
uint64_t id = stimulationSet->getStimulationIdentifier(j);
uint64_t id = stimulationSet->getId(j);
bool target = false;
if (id >= m_rowStimulationBase && id < m_rowStimulationBase + m_nRow)
{
@@ -583,7 +586,7 @@ bool CBoxAlgorithmP300TactileVisualization::process()
Kernel::IAlgorithmProxy* decoder = (k == 2 ? m_rowSelectionStimulationDecoder : m_columnSelectionStimulationDecoder);
Kernel::TParameterHandler<const IMemoryBuffer*> selectionMemoryBuffer(
decoder->getInputParameter(OVP_GD_Algorithm_StimulationDecoder_InputParameterId_MemoryBufferToDecode));
Kernel::TParameterHandler<IStimulationSet*> selectionStimulationSet(
Kernel::TParameterHandler<CStimulationSet*> selectionStimulationSet(
decoder->getOutputParameter(OVP_GD_Algorithm_StimulationDecoder_OutputParameterId_StimulationSet));
for (size_t i = 0; i < boxContext.getInputChunkCount(k); ++i)
@@ -597,10 +600,10 @@ bool CBoxAlgorithmP300TactileVisualization::process()
if (decoder->isOutputTriggerActive(OVP_GD_Algorithm_StimulationDecoder_OutputTriggerId_ReceivedBuffer))
{
IStimulationSet* stimulationSet = selectionStimulationSet;
for (size_t j = 0; j < stimulationSet->getStimulationCount(); ++j)
CStimulationSet* stimulationSet = selectionStimulationSet;
for (size_t j = 0; j < stimulationSet->size(); ++j)
{
uint64_t id = stimulationSet->getStimulationIdentifier(j);
uint64_t id = stimulationSet->getId(j);
bool selected = false;
if (id >= m_rowStimulationBase && id < m_rowStimulationBase + m_nRow)
{
@@ -669,12 +672,15 @@ bool CBoxAlgorithmP300TactileVisualization::process()
" column : " << size_t(m_selectedCol) << "\n";
}
//Switch Menu
m_currMenu = m_currMenu->get_SubMenu(m_selectedRow);
for(int i = 0; i < 6; i++)
if(m_currMenu->get_SubMenu(m_selectedRow) != nullptr)
{
std::string label_text = m_currMenu->get_LabelText(i);
gtk_label_set_text(m_Label[i], label_text.c_str());
m_currMenu = m_currMenu->get_SubMenu(m_selectedRow);
for(uint64_t i = 0; i < m_nTactilos; i++)
{
std::string label_text = m_currMenu->get_LabelText(i);
gtk_label_set_text(m_Label[i], label_text.c_str());
}
}
}
else
@@ -703,7 +709,6 @@ bool CBoxAlgorithmP300TactileVisualization::process()
return true;
}
// _________________________________________________________________________________________________________________________________________________________
//

+ 3
- 3
src/TactileVisualization/ovpCBoxAlgorithmP300TactileVisualization.h View File

@@ -56,9 +56,9 @@ private:
Kernel::IAlgorithmProxy* m_columnSelectionStimulationDecoder = nullptr;
Kernel::TParameterHandler<const IMemoryBuffer*> m_sequenceMemoryBuffer;
Kernel::TParameterHandler<const IMemoryBuffer*> m_targetMemoryBuffer;
Kernel::TParameterHandler<const IStimulationSet*> m_targetFlaggingStimulationSet;
Kernel::TParameterHandler<IStimulationSet*> m_sequenceStimulationSet;
Kernel::TParameterHandler<IStimulationSet*> m_targetStimulationSet;
Kernel::TParameterHandler<const CStimulationSet*> m_targetFlaggingStimulationSet;
Kernel::TParameterHandler<CStimulationSet*> m_sequenceStimulationSet;
Kernel::TParameterHandler<CStimulationSet*> m_targetStimulationSet;
Kernel::TParameterHandler<IMemoryBuffer*> m_targetFlaggingMemoryBuffer;
uint64_t m_lastTime = 0;

Loading…
Cancel
Save