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_F746NG F746_GUI LCD_DISCO_F746NG SDFileSystem TS_DISCO_F746NG ResistiveTouchController Map CYS8218Controller MedianFilter
Screens/CalibrateScreen.cpp@34:0b308a399f72, 2016-10-03 (annotated)
- Committer:
- Kerneels Bezuidenhout
- Date:
- Mon Oct 03 16:21:01 2016 +0200
- Revision:
- 34:0b308a399f72
- Parent:
- 33:a14bcc3a093f
- Child:
- 35:6baa558d3b86
Testing Calibrate logic
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 1 | #include "CalibrateScreen.hpp" |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 2 | |
| Kerneels Bezuidenhout |
34:0b308a399f72 | 3 | CalibrateScreen::CalibrateScreen(int *nextScreen, float (*t)[2], int *ballOnPlate ) : |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 4 | Screen(), |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 5 | _lbTitle( SCREEN_W/2, 0, "Calibrate", Label::CENTER, Font24), |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 6 | _btBack( 0, SCREEN_H-30, 100, 30, "Back"), |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 7 | _lbMessage( SCREEN_W/2, SCREEN_H/2-10, "Please remove ball from plate", Label::CENTER, Font20) |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 8 | { |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 9 | _nextScreen = nextScreen; |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 10 | _t = t; |
| Kerneels Bezuidenhout |
34:0b308a399f72 | 11 | _ballOnPlate = ballOnPlate; |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 12 | } |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 13 | |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 14 | void CalibrateScreen::Draw() |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 15 | { |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 16 | Clear(); |
| Kerneels Bezuidenhout |
34:0b308a399f72 | 17 | |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 18 | _lbTitle.Draw(); |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 19 | _btBack.Draw(); |
| Kerneels Bezuidenhout |
34:0b308a399f72 | 20 | |
| Kerneels Bezuidenhout |
34:0b308a399f72 | 21 | if( *_ballOnPlate ) |
| Kerneels Bezuidenhout |
34:0b308a399f72 | 22 | _lbMessage.Draw(); |
| Kerneels Bezuidenhout |
34:0b308a399f72 | 23 | else |
| Kerneels Bezuidenhout |
34:0b308a399f72 | 24 | _lbTitle.Draw("Press and hold location 1") |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 25 | } |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 26 | |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 27 | void CalibrateScreen::Process() |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 28 | { |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 29 | if( _btBack.Touched() ) |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 30 | *_nextScreen = MAIN_SETTINGS_SCREEN; |
| Kerneels Bezuidenhout |
32:d490f8ca6d2a | 31 | } |