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.
menbedMenuParam.h
00001 #ifndef _MENBEDMENUPARAM_H_ 00002 #define _MENBEDMENUPARAM_H_ 00003 #include <string> 00004 class MenbedMenuParam { 00005 public: 00006 // Copy of the initial value; 00007 float initVal; 00008 string initValString; 00009 // Temporary copy of the parameter used to the hold the modified value 00010 // before it is committed. 00011 float tempVal; 00012 00013 MenbedMenuParam (float (*initValFcn)(void), void (*finalValFcn)(float), 00014 bool liveUpdate, float min, float max, 00015 float inc); 00016 00017 float getVal (void); 00018 void setVal (float v); 00019 bool liveUpdate (void) {return _liveUpdate;} 00020 float min (void) {return _min;} 00021 float max (void) {return _max;} 00022 float inc (void) {return _inc;} 00023 00024 protected: 00025 // Pointer to a function returning a float containing the current value of 00026 // the parameter. 00027 float (*initValFcn)(void); 00028 // Pointer to a function taking a float that is called when the parameter 00029 // value is modified. 00030 string (*initValStringFcn)(void); 00031 // Pointer to a function taking a float that is called when the parameter 00032 // value is modified. 00033 void (*finalValFcn)(float); 00034 // Boolean indicating whether the finalValFcn should be called each time 00035 // the user makes a change to the variable or whether it should only be 00036 // called once the user confirms the change. 00037 void (*finalValStringFcn)(string); 00038 // Boolean indicating whether the finalValFcn should be called each time 00039 // the user makes a change to the variable or whether it should only be 00040 // called once the user confirms the change. 00041 bool _liveUpdate; 00042 // Minimum allowable value. 00043 float _min; 00044 // Maximum allowable value. 00045 float _max; 00046 // Amount by which to increment/decrement the parameter with each presses of 00047 // the up/down button. 00048 float _inc; 00049 }; 00050 00051 #endif /* _MENBEDMENUPARAM_H_ */
Generated on Thu Jul 14 2022 12:14:44 by
