Menu 0 et 1 fonctionnels 2.0

This commit is contained in:
Cameron Bray 2020-05-25 21:18:47 +02:00
parent 2e71198459
commit f33e08f0d7
2 changed files with 4 additions and 6 deletions

View file

@ -6,8 +6,6 @@
Menu::Menu() : id(0), choice(0), nbreChoices(1) { Menu::Menu() : id(0), choice(0), nbreChoices(1) {
listId.push_back(0);
list.push_back(*(new std::pair<int, list.push_back(*(new std::pair<int,
std::string>(1,"\n Liste tortue "))); std::string>(1,"\n Liste tortue ")));
list.push_back(*(new std::pair<int, list.push_back(*(new std::pair<int,
@ -77,9 +75,9 @@ void Menu::previousChoice() {
} }
void Menu::menuBack() { void Menu::menuBack() {
if(listId.size() > 1){ if(!listId.empty()){
id = listId.back();
listId.pop_back(); listId.pop_back();
id = *listId.end();
} }
} }

View file

@ -48,7 +48,7 @@ void Board::loop() {
PressureManagement(); PressureManagement();
if (i > 2 && menu->getId() == 0 && menu->displayDefault(temperature.getValue(), if (menu->getId() == 0 && menu->displayDefault(temperature.getValue(),
pressure.getValue(), pressure.getValue(),
terrarium.getRadState(), terrarium.getRadState(),
terrarium.getTapState(), terrarium.getTapState(),
@ -58,7 +58,7 @@ void Board::loop() {
terrarium.getRadState(), terrarium.getRadState(),
terrarium.getTapState(), terrarium.getTapState(),
0).c_str()); 0).c_str());
} else if (i > 2 && menu->getMessage().c_str() != NULL){ } else if (menu->getMessage().c_str() != NULL){
strcpy(buf, menu->getMessage().c_str()); strcpy(buf, menu->getMessage().c_str());
} }