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
ZeroPlateScreen.cpp
00001 #include "ZeroPlateScreen.hpp" 00002 00003 ZeroPlateScreen::ZeroPlateScreen(int *nextScreen, float *zeroAlpha, float *zeroBeta, bool *saved) : 00004 Screen(), 00005 _lbTitle( SCREEN_W/2, 0, "Zero Plate", Label::CENTER, Font24), 00006 _btBack( 0, SCREEN_H-30, 100, 30, "Back"), 00007 _btSave( SCREEN_W-100, SCREEN_H-30, 100, 30, "Save"), 00008 _btAlphaUp( (SCREEN_W/2)-26, 28, 72, 72, "U"), 00009 _btAlphaDown( (SCREEN_W/2)-26, 182, 72, 72, "D"), 00010 _btBetaUp( (SCREEN_W/2)-103, 105, 72, 72, "L"), 00011 _btBetaDown( (SCREEN_W/2)+51, 105, 72, 72,"R") // TODO Add custom font 00012 { 00013 _nextScreen = nextScreen; 00014 _zeroAlpha = zeroAlpha; 00015 _zeroBeta = zeroBeta; 00016 _saved = saved; 00017 *_zeroAlpha = 0; 00018 *_zeroBeta = 0; 00019 } 00020 00021 void ZeroPlateScreen::Draw() 00022 { 00023 Clear(); 00024 _lbTitle.Draw(); 00025 _btBack.Draw(); 00026 _btSave.Draw(); 00027 _btAlphaUp.Draw(); 00028 _btAlphaDown.Draw(); 00029 _btBetaUp.Draw(); 00030 _btBetaDown.Draw(); 00031 } 00032 00033 void ZeroPlateScreen::Process() 00034 { 00035 if( _btBack.Touched() ) 00036 *_nextScreen = MAIN_SETTINGS_SCREEN; 00037 00038 if( _btSave.Touched() ) 00039 *_saved = true; 00040 00041 if( _btAlphaUp.Touched() ) 00042 { 00043 *_zeroAlpha += 1; 00044 Thread::wait(200); 00045 _btAlphaUp.Draw(); 00046 } 00047 00048 if( _btAlphaDown.Touched() ) 00049 { 00050 *_zeroAlpha -= 1; 00051 Thread::wait(200); 00052 _btAlphaDown.Draw(); 00053 } 00054 00055 if( _btBetaUp.Touched() ) 00056 { 00057 *_zeroBeta += 1; 00058 Thread::wait(200); 00059 _btBetaUp.Draw(); 00060 } 00061 00062 if( _btBetaDown.Touched() ) 00063 { 00064 *_zeroBeta -= 1; 00065 Thread::wait(200); 00066 _btBetaDown.Draw(); 00067 } 00068 }
Generated on Wed Jul 13 2022 02:28:05 by
1.7.2