Velocity Closed Loop Dynamic error correction

Dependencies:   mbed QEI PID DmTftLibraryEx

Revision:
8:c0a5f53fe196
Parent:
5:a0f5842fb337
Child:
15:ed7ed20b7114
diff -r bc2f0fe8056f -r c0a5f53fe196 Display/Menu.cpp
--- a/Display/Menu.cpp	Wed Apr 19 14:21:05 2017 +0000
+++ b/Display/Menu.cpp	Thu May 11 15:42:05 2017 +0000
@@ -962,7 +962,7 @@
                 if( graphObjectTouched == BTN1_BORDER )
                 {
                     Eeprom.EepromData.DemoSettings.RngRequestCount += 5;
-                    if( Eeprom.EepromData.DemoSettings.RngRequestCount > DEMO_RNG_CHANNELS_COUNT_MAX )
+                    if( Eeprom.EepromData.DemoSettings.RngRequestCount >= DEMO_RNG_CHANNELS_COUNT_MAX )
                     {
                         Eeprom.EepromData.DemoSettings.RngRequestCount = DEMO_RNG_CHANNELS_COUNT_MIN;
                     }
@@ -970,15 +970,6 @@
                 }
                 else if( graphObjectTouched == BTN2_BORDER )
                 {
-                    Eeprom.EepromData.DemoSettings.RngZscoreMax += 1;
-                    if( Eeprom.EepromData.DemoSettings.RngZscoreMax > DEMO_RNG_ZSCORE_MAX )
-                    {
-                        Eeprom.EepromData.DemoSettings.RngZscoreMax = DEMO_RNG_ZSCORE_MIN;
-                    }
-                    ButtonChangeText( BTN2_BORDER, NULL, ( uint8_t* )GetRangingZscore( ) );
-                }
-                else if( graphObjectTouched == BTN3_BORDER )
-                {
                     switch( Eeprom.EepromData.DemoSettings.RngAddress )
                     {
                         case DEMO_RNG_ADDR_1:
@@ -1001,9 +992,9 @@
                             Eeprom.EepromData.DemoSettings.RngAddress = DEMO_RNG_ADDR_1;
                             break;
                     }
-                    ButtonChangeText( BTN3_BORDER, NULL, ( uint8_t* )GetRangingAddress( ) );
+                    ButtonChangeText( BTN2_BORDER, NULL, ( uint8_t* )GetRangingAddress( ) );
                 }
-                else if( graphObjectTouched == BTN4_BORDER )
+                else if( graphObjectTouched == BTN3_BORDER )
                 {
                     switch( Eeprom.EepromData.DemoSettings.RngAntenna )
                     {
@@ -1019,16 +1010,16 @@
                             Eeprom.EepromData.DemoSettings.RngAntenna = DEMO_RNG_ANT_1;
                             break;
                     }
-                    ButtonChangeText( BTN4_BORDER, NULL, ( uint8_t* )GetRangingAntenna( ) );
+                    ButtonChangeText( BTN3_BORDER, NULL, ( uint8_t* )GetRangingAntenna( ) );
                 }
-                else if( graphObjectTouched == BTN5_BORDER )
+                else if( graphObjectTouched == BTN4_BORDER )
                 {
                     Eeprom.EepromData.DemoSettings.RngUnit++;
                     if( Eeprom.EepromData.DemoSettings.RngUnit > DEMO_RNG_UNIT_SEL_MI )
                     {
                         Eeprom.EepromData.DemoSettings.RngUnit = DEMO_RNG_UNIT_SEL_M;
                     }
-                    ButtonChangeText( BTN5_BORDER, NULL, ( uint8_t* )GetRangingUnit( ) );
+                    ButtonChangeText( BTN4_BORDER, NULL, ( uint8_t* )GetRangingUnit( ) );
                 }
                 else if( graphObjectTouched == BTN7_BORDER )
                 {
@@ -1674,7 +1665,7 @@
                 DrawText( LINE6_COL0_TEXT, ( uint8_t* )"Packet   :", ( uint8_t* )GetMenuDemoNumSentPacket( ), NULL );
                 DrawText( LINE7_COL0_TEXT, ( uint8_t* )"FEI [Hz] :", ( uint8_t* )GetFrequencyError( ), NULL );
                 DrawText( LINE8_COL0_TEXT, ( uint8_t* )"Channel  :", ( uint8_t* )GetRngChannelsOk( ), NULL );
-                DrawText( LINE9_COL0_TEXT, ( uint8_t* )"Zscore N :", ( uint8_t* )"     0", NULL );
+
                 DrawActiveButton( BTN7_BORDER, ( uint8_t* )"    EXIT", NULL );
                 DrawActiveButton( BTN8_BORDER, ( uint8_t* )"   START", NULL );
                 DrawActiveButton( BTN9_BORDER, ( uint8_t* )"  SETTINGS", NULL );
@@ -1776,10 +1767,9 @@
                 DrawText( TITLE_TEXT, ( uint8_t* )"    Settings : Ranging", NULL, NULL );
 
                 DrawActiveButton( BTN1_BORDER, ( uint8_t* )"Request:", ( uint8_t* )GetRangingRequestCount( ) );
-                DrawActiveButton( BTN2_BORDER, ( uint8_t* )"Z score:", ( uint8_t* )GetRangingZscore( ) );
-                DrawActiveButton( BTN3_BORDER, ( uint8_t* )"Address:", ( uint8_t* )GetRangingAddress( ) );
-                DrawActiveButton( BTN4_BORDER, ( uint8_t* )"Antenna:", ( uint8_t* )GetRangingAntenna( ) );
-                DrawActiveButton( BTN5_BORDER, ( uint8_t* )"Unit:", ( uint8_t* )GetRangingUnit( ) );
+                DrawActiveButton( BTN2_BORDER, ( uint8_t* )"Address:", ( uint8_t* )GetRangingAddress( ) );
+                DrawActiveButton( BTN3_BORDER, ( uint8_t* )"Antenna:", ( uint8_t* )GetRangingAntenna( ) );
+                DrawActiveButton( BTN4_BORDER, ( uint8_t* )"Unit:", ( uint8_t* )GetRangingUnit( ) );
                 DrawActiveButton( BTN7_BORDER, ( uint8_t* )"   CANCEL", NULL );
                 DrawActiveButton( BTN8_BORDER, ( uint8_t* )" OK & SAVE", NULL );
             }
@@ -2407,7 +2397,7 @@
     {
         Eeprom.EepromData.DemoSettings.CntPacketRxOK /= 2;
     }
-    sprintf( StringText2, " %02d/%02d", Eeprom.EepromData.DemoSettings.CntPacketRxOK, Eeprom.EepromData.DemoSettings.RngRequestCount );
+    sprintf( StringText2, "%03d/%03d", Eeprom.EepromData.DemoSettings.CntPacketRxOK, Eeprom.EepromData.DemoSettings.RngRequestCount );
     return StringText2;
 }
 
@@ -2417,12 +2407,6 @@
     return StringText2;
 }
 
-char* GetRangingZscore( void )
-{
-    sprintf( StringText2, "%d", Eeprom.EepromData.DemoSettings.RngZscoreMax );
-    return StringText2;
-}
-
 char* GetRangingAddress( void )
 {
     sprintf( StringText2, "0x%08x", Eeprom.EepromData.DemoSettings.RngAddress );