Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F469NI LCD_DISCO_F469NI TS_DISCO_F469NI mbed Motordriver
Fork of Configurable_Robots by
Diff: Classes/RobotMVC/RobotController.cpp
- Revision:
- 9:4ae116881502
- Parent:
- 8:1173b502b316
- Child:
- 10:4dd8b18e07d0
diff -r 1173b502b316 -r 4ae116881502 Classes/RobotMVC/RobotController.cpp
--- a/Classes/RobotMVC/RobotController.cpp Wed Feb 08 20:31:20 2017 +0000
+++ b/Classes/RobotMVC/RobotController.cpp Thu Feb 09 20:46:26 2017 +0000
@@ -18,9 +18,42 @@
//Handles choices made by the user on the robot interface
//input: selection value
-void RobotController::UserSelection(int s)
+void RobotController::userSelection(int s)
{
- //#TODO handle user selections
+ if(s < 0)
+ return;
+ switch(view->getPage())
+ {
+ default:
+ if(s == 0)
+ view->setPage(1);
+ return;
+ case 0:
+ return;
+ case 1:
+ switch(s)
+ {
+ case 0:
+ view->setPage(2);
+ return;
+ case 1:
+ view->setPage(3);
+ return;
+ case 2:
+ view->setPage(4);
+ return;
+ case 3:
+ view->setPage(5);
+ return;
+ case 4:
+ view->setPage(6);
+ return;
+ case 5:
+ view->setPage(7);
+ return;
+ }
+
+ }
}
//Go to main menu
@@ -28,16 +61,10 @@
{
model->setMode(0);
view->setPage(1);
- view->update();
}
//Listens for inputs
void RobotController::listen()
{
- if(view->listen())
- {
- view->clear();
- wait(1);
- view->update();
- }
+ userSelection(view->listen());
}
\ No newline at end of file
