@ -59,6 +59,7 @@ static void lcd_control_temperature_menu();
static void lcd_control_temperature_preheat_pla_settings_menu ( ) ;
static void lcd_control_temperature_preheat_abs_settings_menu ( ) ;
static void lcd_control_motion_menu ( ) ;
static void lcd_control_volumetric_menu ( ) ;
# ifdef DOGLCD
static void lcd_set_contrast ( ) ;
# endif
@ -82,6 +83,7 @@ static void menu_action_setting_edit_bool(const char* pstr, bool* ptr);
static void menu_action_setting_edit_int3 ( const char * pstr , int * ptr , int minValue , int maxValue ) ;
static void menu_action_setting_edit_float3 ( const char * pstr , float * ptr , float minValue , float maxValue ) ;
static void menu_action_setting_edit_float32 ( const char * pstr , float * ptr , float minValue , float maxValue ) ;
static void menu_action_setting_edit_float43 ( const char * pstr , float * ptr , float minValue , float maxValue ) ;
static void menu_action_setting_edit_float5 ( const char * pstr , float * ptr , float minValue , float maxValue ) ;
static void menu_action_setting_edit_float51 ( const char * pstr , float * ptr , float minValue , float maxValue ) ;
static void menu_action_setting_edit_float52 ( const char * pstr , float * ptr , float minValue , float maxValue ) ;
@ -90,6 +92,7 @@ static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr,
static void menu_action_setting_edit_callback_int3 ( const char * pstr , int * ptr , int minValue , int maxValue , menuFunc_t callbackFunc ) ;
static void menu_action_setting_edit_callback_float3 ( const char * pstr , float * ptr , float minValue , float maxValue , menuFunc_t callbackFunc ) ;
static void menu_action_setting_edit_callback_float32 ( const char * pstr , float * ptr , float minValue , float maxValue , menuFunc_t callbackFunc ) ;
static void menu_action_setting_edit_callback_float43 ( const char * pstr , float * ptr , float minValue , float maxValue , menuFunc_t callbackFunc ) ;
static void menu_action_setting_edit_callback_float5 ( const char * pstr , float * ptr , float minValue , float maxValue , menuFunc_t callbackFunc ) ;
static void menu_action_setting_edit_callback_float51 ( const char * pstr , float * ptr , float minValue , float maxValue , menuFunc_t callbackFunc ) ;
static void menu_action_setting_edit_callback_float52 ( const char * pstr , float * ptr , float minValue , float maxValue , menuFunc_t callbackFunc ) ;
@ -742,6 +745,8 @@ static void lcd_control_menu()
MENU_ITEM ( back , MSG_MAIN , lcd_main_menu ) ;
MENU_ITEM ( submenu , MSG_TEMPERATURE , lcd_control_temperature_menu ) ;
MENU_ITEM ( submenu , MSG_MOTION , lcd_control_motion_menu ) ;
MENU_ITEM ( submenu , MSG_VOLUMETRIC , lcd_control_volumetric_menu ) ;
# ifdef DOGLCD
// MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
MENU_ITEM ( submenu , MSG_CONTRAST , lcd_set_contrast ) ;
@ -870,6 +875,26 @@ static void lcd_control_motion_menu()
END_MENU ( ) ;
}
static void lcd_control_volumetric_menu ( )
{
START_MENU ( ) ;
MENU_ITEM ( back , MSG_CONTROL , lcd_control_menu ) ;
MENU_ITEM_EDIT ( bool , MSG_VOLUMETRIC_ENABLED , & volumetric_enabled ) ;
if ( volumetric_enabled ) {
MENU_ITEM_EDIT_CALLBACK ( float43 , MSG_FILAMENT_SIZE_EXTRUDER_0 , & filament_size [ 0 ] , DEFAULT_NOMINAL_FILAMENT_DIA - .5 , DEFAULT_NOMINAL_FILAMENT_DIA + .5 , calculate_volumetric_multipliers ) ;
# if EXTRUDERS > 1
MENU_ITEM_EDIT_CALLBACK ( float43 , MSG_FILAMENT_SIZE_EXTRUDER_1 , & filament_size [ 1 ] , DEFAULT_NOMINAL_FILAMENT_DIA - .5 , DEFAULT_NOMINAL_FILAMENT_DIA + .5 , calculate_volumetric_multipliers ) ;
# if EXTRUDERS > 2
MENU_ITEM_EDIT_CALLBACK ( float43 , MSG_FILAMENT_SIZE_EXTRUDER_2 , & filament_size [ 2 ] , DEFAULT_NOMINAL_FILAMENT_DIA - .5 , DEFAULT_NOMINAL_FILAMENT_DIA + .5 , calculate_volumetric_multipliers ) ;
# endif
# endif
}
END_MENU ( ) ;
}
# ifdef DOGLCD
static void lcd_set_contrast ( )
{
@ -1013,6 +1038,7 @@ void lcd_sdcard_menu()
menu_edit_type ( int , int3 , itostr3 , 1 )
menu_edit_type ( float , float3 , ftostr3 , 1 )
menu_edit_type ( float , float32 , ftostr32 , 100 )
menu_edit_type ( float , float43 , ftostr43 , 1000 )
menu_edit_type ( float , float5 , ftostr5 , 0.01 )
menu_edit_type ( float , float51 , ftostr51 , 10 )
menu_edit_type ( float , float52 , ftostr52 , 100 )
@ -1482,7 +1508,24 @@ char *ftostr32(const float &x)
return conv ;
}
// Convert float to string with 1.23 format
// Convert float to string with 1.234 format
char * ftostr43 ( const float & x )
{
long xx = x * 1000 ;
if ( xx > = 0 )
conv [ 0 ] = ( xx / 1000 ) % 10 + ' 0 ' ;
else
conv [ 0 ] = ' - ' ;
xx = abs ( xx ) ;
conv [ 1 ] = ' . ' ;
conv [ 2 ] = ( xx / 100 ) % 10 + ' 0 ' ;
conv [ 3 ] = ( xx / 10 ) % 10 + ' 0 ' ;
conv [ 4 ] = ( xx ) % 10 + ' 0 ' ;
conv [ 5 ] = 0 ;
return conv ;
}
//Float to string with 1.23 format
char * ftostr12ns ( const float & x )
{
long xx = x * 100 ;