BioSignalPi  v2
abstractmenu.cpp
Go to the documentation of this file.
1 #include "abstractmenu.h"
2 #include "pifacecad.h"
3 
5 {
7 }
8 
10  pifacecad_lcd_clear();
11  pifacecad_lcd_set_cursor(0,0);
12  const char * tmp = options.at(currentOption).c_str();
13  pifacecad_lcd_write(tmp);
14 }
15 void AbstractMenu::setUpperText(const char * input){
16  pifacecad_lcd_clear();
17  pifacecad_lcd_set_cursor(0,0);
18  pifacecad_lcd_write(input);
19 }
20 
22  pifacecad_lcd_set_cursor(0,1);
23  const char * tmp = options.at(currentOption).c_str();
24  pifacecad_lcd_write(tmp);
25 }
26 
29  currentOption=0;
30  else
32  pifacecad_lcd_set_cursor(0,1);
33  pifacecad_lcd_write(" ");
34  pifacecad_lcd_set_cursor(0,1);
35  const char * tmp = options.at(currentOption).c_str();
36  pifacecad_lcd_write(tmp);
37 
38 
39 }
virtual void setLowerText()
Sets the second row of the PiFace CAD to the current option choosen Uses the C library pifacecad...
int numberOfOptions
number of elements stored in the options vector. To be set by the derived AbstractMenu object ...
Definition: abstractmenu.h:76
std::vector< std::string > options
std::vector containing the different options to display on the PiFace CAD To be set by the derived Ab...
Definition: abstractmenu.h:70
virtual void next()
Toggles the second row of the PiFace CAD to the next option Uses the C library pifacecad.h to control the display.
virtual void setUpperText()
Sets the first row of the PiFace CAD to the current option choosen Uses the C library pifacecad...
Definition: abstractmenu.cpp:9
int currentOption
Counter that keeps track of the option visible on the PiFace CAD.
Definition: abstractmenu.h:82