|
|
@@ -66,6 +66,8 @@ bool CBoxAlgorithmP300TactileVisualization::initialize() |
|
|
|
m_selectedBgColor = CGdkcolorAutoCast(boxContext, this->getConfigurationManager(), 12);
|
|
|
|
m_selectedFgColor = CGdkcolorAutoCast(boxContext, this->getConfigurationManager(), 13);
|
|
|
|
m_selectedFontSize = FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 14);
|
|
|
|
|
|
|
|
m_nTactilos = FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 15);
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
@@ -129,39 +131,65 @@ bool CBoxAlgorithmP300TactileVisualization::initialize() |
|
|
|
m_result = GTK_LABEL(gtk_builder_get_object(m_mainWidgetInterface, "label-result"));
|
|
|
|
m_target = GTK_LABEL(gtk_builder_get_object(m_mainWidgetInterface, "label-target"));
|
|
|
|
|
|
|
|
//Begin TactileMenu Initialization -------------------------------------------------------------------------------------
|
|
|
|
//Create Menus
|
|
|
|
m_MainMenu = new TactileMenu("Ja", "Nein", "Pflege", "Hilfe", "Geräte", "Funktionen");
|
|
|
|
m_CareMenu = new TactileMenu("Ja", "Nein", "Hunger", "Lage", "Müdigkeit", "Hauptmenü");
|
|
|
|
m_HelpMenu = new TactileMenu("Ja", "Nein", "Schmerzen", "Atemnot", "Anderes", "Hauptmenü");
|
|
|
|
m_DevicesMenu = new TactileMenu("Ja", "Nein", "Atemgerät", "Rollstuhl", "Computer", "Hauptmenü");
|
|
|
|
m_FunctionsMenu = new TactileMenu("Ja", "Nein", "befehl1", "befehl2", "befehl3", "Hauptmenü");
|
|
|
|
|
|
|
|
//Initialize MainMenu
|
|
|
|
m_MainMenu->init_Labels(m_mainWidgetInterface);
|
|
|
|
m_MainMenu->set_SubMenu(2, m_CareMenu);
|
|
|
|
m_MainMenu->set_SubMenu(3, m_HelpMenu);
|
|
|
|
m_MainMenu->set_SubMenu(4, m_DevicesMenu);
|
|
|
|
m_MainMenu->set_SubMenu(5, m_FunctionsMenu);
|
|
|
|
//Initialize CareMenu
|
|
|
|
m_CareMenu->init_Labels(m_mainWidgetInterface);
|
|
|
|
m_CareMenu->set_SubMenu(5, m_MainMenu);
|
|
|
|
//Initialize HelpMenu
|
|
|
|
m_HelpMenu->init_Labels(m_mainWidgetInterface);
|
|
|
|
m_HelpMenu->set_SubMenu(5, m_MainMenu);
|
|
|
|
//Initialize DevicesMenu
|
|
|
|
m_DevicesMenu->init_Labels(m_mainWidgetInterface);
|
|
|
|
m_DevicesMenu->set_SubMenu(5, m_MainMenu);
|
|
|
|
//Initialize FunctionsMenu
|
|
|
|
m_FunctionsMenu->init_Labels(m_mainWidgetInterface);
|
|
|
|
m_FunctionsMenu->set_SubMenu(5, m_MainMenu);
|
|
|
|
|
|
|
|
//Set Pointer to active Menu
|
|
|
|
//Load MenuLabels
|
|
|
|
m_CurrentMenu = m_MainMenu;
|
|
|
|
m_CurrentMenu->reloadui();
|
|
|
|
//Begin Menu Initialization -------------------------------------------------------------------------------------
|
|
|
|
if(m_nTactilos == 6) //Create Menus for m_nTactilos = 6
|
|
|
|
{
|
|
|
|
m_Menu.push_back(TactileMenu(6));
|
|
|
|
m_Menu[0].set_LabelText(0, "Ja");
|
|
|
|
m_Menu[0].set_LabelText(1, "Nein");
|
|
|
|
m_Menu[0].set_LabelText(2, "Pflege");
|
|
|
|
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");
|
|
|
|
m_Menu[1].set_LabelText(1, "Nein");
|
|
|
|
m_Menu[1].set_LabelText(2, "Hunger");
|
|
|
|
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]);
|
|
|
|
|
|
|
|
//End TactileMenu Initialization ---------------------------------------------------------------------------------------
|
|
|
|
m_Menu.push_back(TactileMenu(6));
|
|
|
|
m_Menu[2].set_LabelText(0, "Ja");
|
|
|
|
m_Menu[2].set_LabelText(1, "Nein");
|
|
|
|
m_Menu[2].set_LabelText(2, "Schmerzen");
|
|
|
|
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");
|
|
|
|
m_Menu[3].set_LabelText(1, "Nein");
|
|
|
|
m_Menu[3].set_LabelText(2, "Atemgerät");
|
|
|
|
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
|
|
|
|
m_currMenu = &m_Menu[0];
|
|
|
|
|
|
|
|
//Init Gtk Labels
|
|
|
|
for(int i = 0; i < 6; i++)
|
|
|
|
{
|
|
|
|
std::string label_id = "label-" + std::to_string(i+1);
|
|
|
|
std::string label_text = m_currMenu->get_LabelText(i);
|
|
|
|
m_Label.push_back(GTK_LABEL(gtk_builder_get_object(m_mainWidgetInterface, label_id.c_str())));
|
|
|
|
gtk_label_set_text(m_Label[i], label_text.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
//End Menu Initialization ---------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
gtk_builder_connect_signals(m_mainWidgetInterface, nullptr);
|
|
|
|
gtk_builder_connect_signals(m_toolbarWidgetInterface, nullptr);
|
|
|
|
|
|
|
@@ -231,15 +259,7 @@ bool CBoxAlgorithmP300TactileVisualization::initialize() |
|
|
|
}
|
|
|
|
|
|
|
|
bool CBoxAlgorithmP300TactileVisualization::uninitialize()
|
|
|
|
{
|
|
|
|
//Begin Uninitialize TactileMenu -----------------------------------------------------------------------
|
|
|
|
delete m_MainMenu;
|
|
|
|
delete m_CareMenu;
|
|
|
|
delete m_HelpMenu;
|
|
|
|
delete m_DevicesMenu;
|
|
|
|
delete m_FunctionsMenu;
|
|
|
|
//End Uninitialize TactileMenu -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
{
|
|
|
|
if (m_idleFuncTag)
|
|
|
|
{
|
|
|
|
m_stimuliQueue.clear();
|
|
|
@@ -634,10 +654,13 @@ bool CBoxAlgorithmP300TactileVisualization::process() |
|
|
|
this->getLogManager() << Kernel::LogLevel_Warning << "Did not find a unique widget at row : " << size_t(m_selectedRow) <<
|
|
|
|
" column : " << size_t(m_selectedCol) << "\n";
|
|
|
|
}
|
|
|
|
//Toggle Menu
|
|
|
|
m_CurrentMenu->call_SubRoutine(m_selectedRow);
|
|
|
|
m_CurrentMenu = m_CurrentMenu->get_SubMenu(m_selectedRow);
|
|
|
|
m_CurrentMenu->reloadui();
|
|
|
|
//Switch Menu
|
|
|
|
m_currMenu = m_currMenu->get_SubMenu(m_selectedRow);
|
|
|
|
for(int i = 0; i < 6; i++)
|
|
|
|
{
|
|
|
|
std::string label_text = m_currMenu->get_LabelText(i);
|
|
|
|
gtk_label_set_text(m_Label[i], label_text.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|