Filament Width Sensor singleton (#15191)

This commit is contained in:
Scott Lahteine
2019-09-10 18:48:58 -05:00
committed by GitHub
parent fe6ba4fd70
commit 75927e17dd
9 changed files with 147 additions and 146 deletions

View File

@ -622,14 +622,9 @@ void MarlinUI::draw_status_message(const bool blink) {
// Alternate Status message and Filament display
if (ELAPSED(millis(), next_filament_display)) {
lcd_put_u8str_P(PSTR("Dia "));
lcd_put_u8str(ftostr12ns(filament_width_meas));
lcd_put_u8str(ftostr12ns(filwidth.measured_mm));
lcd_put_u8str_P(PSTR(" V"));
lcd_put_u8str(i16tostr3(100.0 * (
parser.volumetric_enabled
? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
: planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
)
));
lcd_put_u8str(i16tostr3(planner.volumetric_percent(parser.volumetric_enabled)));
lcd_put_wchar('%');
return;
}

View File

@ -349,13 +349,8 @@ void MarlinUI::draw_status_screen() {
strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])));
strcpy(zstring, ftostr52sp( LOGICAL_Z_POSITION(current_position[Z_AXIS])));
#if ENABLED(FILAMENT_LCD_DISPLAY)
strcpy(wstring, ftostr12ns(filament_width_meas));
strcpy(mstring, i16tostr3(100.0 * (
parser.volumetric_enabled
? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
: planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]
)
));
strcpy(wstring, ftostr12ns(filwidth.measured_mm));
strcpy(mstring, i16tostr3(planner.volumetric_percent(parser.volumetric_enabled)));
#endif
}