1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 12:04:19 +00:00

FTDI EVE Touch UI fixes (#21706)

This commit is contained in:
Marcio T 2021-04-26 22:40:59 -06:00 committed by Scott Lahteine
parent 81d7a6b81d
commit e640d9246d
11 changed files with 112 additions and 32 deletions

View File

@ -32,7 +32,7 @@
class MediaFileReader {
private:
#if ENABLED(SDSUPPORT)
Sd2Card card;
DiskIODriver_SPI_SD card;
SdVolume volume;
SdFile root, file;
#endif

View File

@ -40,8 +40,7 @@ using namespace Theme;
#define DISPLAY_POS BTN_POS(1,3), BTN_SIZE(1,1)
#define INTERFACE_POS BTN_POS(2,3), BTN_SIZE(1,1)
#define ENDSTOPS_POS BTN_POS(3,3), BTN_SIZE(1,1)
#define CASE_LIGHT_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define RESTORE_DEFAULTS_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define RESTORE_DEFAULTS_POS BTN_POS(1,4), BTN_SIZE(2,1)
#define BACK_POS BTN_POS(3,4), BTN_SIZE(1,1)
void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
@ -66,9 +65,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
.tag(8) .button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS))
.tag(9) .button(INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE))
.tag(10).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU))
.enabled(ENABLED(CASE_LIGHT_ENABLE))
.tag(11).button(CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT))
.tag(12).button(RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS))
.tag(11).button(RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS))
.colors(action_btn)
.tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK));
}
@ -90,10 +87,7 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
case 8: GOTO_SCREEN(EndstopStatesScreen); break;
case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break;
case 10: GOTO_SCREEN(DisplayTuningScreen); break;
#if ENABLED(CASE_LIGHT_ENABLE)
case 11: GOTO_SCREEN(CaseLightScreen); break;
#endif
case 12: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break;
case 11: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break;
default: return false;
}
return true;

View File

@ -29,7 +29,7 @@
using namespace FTDI;
using namespace Theme;
#define GRID_ROWS 5
#define GRID_ROWS 6
#define GRID_COLS 2
#define ZPROBE_ZOFFSET_POS BTN_POS(1,1), BTN_SIZE(1,1)
@ -37,11 +37,12 @@ using namespace Theme;
#define TEMPERATURE_POS BTN_POS(2,1), BTN_SIZE(1,1)
#define MOVE_E_POS BTN_POS(2,2), BTN_SIZE(1,1)
#define SPEED_POS BTN_POS(1,3), BTN_SIZE(1,1)
#define ADVANCED_SETTINGS_POS BTN_POS(2,3), BTN_SIZE(1,1)
#define DISABLE_STEPPERS_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define LEVELING_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define ABOUT_PRINTER_POS BTN_POS(1,5), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(2,5), BTN_SIZE(1,1)
#define FLOW_POS BTN_POS(2,3), BTN_SIZE(1,1)
#define ADVANCED_SETTINGS_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define DISABLE_STEPPERS_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define LEVELING_POS BTN_POS(1,5), BTN_SIZE(1,1)
#define ABOUT_PRINTER_POS BTN_POS(2,5), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1)
void MainMenu::onRedraw(draw_mode_t what) {
if (what & BACKGROUND) {
@ -60,11 +61,12 @@ void MainMenu::onRedraw(draw_mode_t what) {
.tag( 4).button(ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
.tag( 5).button(MOVE_E_POS, GET_TEXT_F(MSG_E_MOVE))
.tag( 6).button(SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED))
.tag( 7).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS))
.tag( 8).button(DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS))
.tag( 7).button(FLOW_POS, GET_TEXT_F(MSG_FLOW))
.tag( 8).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS))
.tag( 9).button(DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS))
.enabled(HAS_LEVELING)
.tag( 9).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING))
.tag(10).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU))
.tag(10).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING))
.tag(11).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU))
.colors(action_btn)
.tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK));
}
@ -82,12 +84,13 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
#endif
case 5: GOTO_SCREEN(MoveEScreen); break;
case 6: GOTO_SCREEN(FeedratePercentScreen); break;
case 7: GOTO_SCREEN(AdvancedSettingsMenu); break;
case 8: injectCommands_P(PSTR("M84")); break;
case 7: GOTO_SCREEN(FlowPercentScreen); break;
case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;
case 9: injectCommands_P(PSTR("M84")); break;
#if HAS_LEVELING
case 9: GOTO_SCREEN(LevelingMenu); break;
case 10: GOTO_SCREEN(LevelingMenu); break;
#endif
case 10: GOTO_SCREEN(AboutScreen); break;
case 11: GOTO_SCREEN(AboutScreen); break;
default:
return false;
}

View File

@ -0,0 +1,50 @@
/***************************
* flow_percent_screen.cpp *
***************************/
/****************************************************************************
* Written By Marcio Teixeira 2021 - Cocoa Press *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../config.h"
#include "screens.h"
#ifdef FTDI_FLOW_PERCENT_SCREEN
using namespace FTDI;
using namespace ExtUI;
void FlowPercentScreen::onRedraw(draw_mode_t what) {
widgets_t w(what);
w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT));
w.heading(GET_TEXT_F(MSG_FLOW));
w.adjuster(4, GET_TEXT_F(MSG_FLOW), getFlow_percent(E0));
w.increments();
}
bool FlowPercentScreen::onTouchHeld(uint8_t tag) {
const float increment = getIncrement();
switch (tag) {
case 4: UI_DECREMENT(Flow_percent, E0); break;
case 5: UI_INCREMENT(Flow_percent, E0); break;
default:
return false;
}
return true;
}
#endif // FTDI_FLOW_PERCENT_SCREEN

View File

@ -0,0 +1,31 @@
/*************************
* flow_percent_screen.h *
*************************/
/****************************************************************************
* Written By Marcio Teixeira 2021 - Cocoa Press *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#pragma once
#define FTDI_FLOW_PERCENT_SCREEN
#define FTDI_FLOW_PERCENT_SCREEN_CLASS FlowPercentScreen
class FlowPercentScreen : public BaseNumericAdjustmentScreen, public CachedScreen<FLOW_PERCENT_SCREEN_CACHE> {
public:
static void onRedraw(draw_mode_t);
static bool onTouchHeld(uint8_t tag);
};

View File

@ -81,9 +81,8 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
#endif
.font(font_medium).colors(normal_btn)
#if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)
.enabled(EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION))
.tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_LEVEL_X_AXIS))
#endif
.tag(3).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED))
.enabled(ENABLED(HAS_MESH))
.tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH))

View File

@ -80,6 +80,7 @@ SCREEN_TABLE {
DECL_SCREEN_IF_INCLUDED(FTDI_NOZZLE_OFFSETS_SCREEN)
DECL_SCREEN_IF_INCLUDED(FTDI_BACKLASH_COMP_SCREEN)
DECL_SCREEN_IF_INCLUDED(FTDI_FEEDRATE_PERCENT_SCREEN)
DECL_SCREEN_IF_INCLUDED(FTDI_FLOW_PERCENT_SCREEN)
DECL_SCREEN_IF_INCLUDED(FTDI_MAX_VELOCITY_SCREEN)
DECL_SCREEN_IF_INCLUDED(FTDI_MAX_ACCELERATION_SCREEN)
DECL_SCREEN_IF_INCLUDED(FTDI_DEFAULT_ACCELERATION_SCREEN)

View File

@ -55,6 +55,7 @@ enum {
MAX_VELOCITY_SCREEN_CACHE,
MAX_ACCELERATION_SCREEN_CACHE,
DEFAULT_ACCELERATION_SCREEN_CACHE,
FLOW_PERCENT_SCREEN_CACHE,
#if HAS_LEVELING
LEVELING_SCREEN_CACHE,
#if HAS_BED_PROBE
@ -150,6 +151,7 @@ enum {
#include "cocoa_press_preheat_screen.h"
#include "cocoa_press_load_chocolate.h"
#include "move_axis_screen.h"
#include "flow_percent_screen.h"
#include "cocoa_press_move_xyz_screen.h"
#include "cocoa_press_move_e_screen.h"
#include "tune_menu.h"

View File

@ -237,7 +237,7 @@ void NextionTFT::PanelInfo(uint8_t req) {
SEND_VALasTXT("tmppage.tool", getActiveTool());
SEND_VALasTXT("tmppage.fan", ui8tostr3rj(getActualFan_percent(FAN0)));
SEND_VALasTXT("tmppage.speed", getFeedrate_percent());
SEND_VALasTXT("tmppage.flow", getFlowPercentage(getActiveTool()));
SEND_VALasTXT("tmppage.flow", getFlow_percent(getActiveTool()));
SEND_VALasTXT("tmppage.progress", ui8tostr3rj(getProgress_percent()));
SEND_VALasTXT("tmppage.layer", layer);
SEND_VALasTXT("tmppage.x", getAxisPosition_mm(X));
@ -640,9 +640,9 @@ void NextionTFT::UpdateOnChange() {
// tmppage Flow
static uint8_t last_flow_speed = 99;
if (last_flow_speed != getFlowPercentage(getActiveTool())) {
SEND_VALasTXT("tmppage.flow", getFlowPercentage(getActiveTool()));
last_flow_speed = getFlowPercentage(getActiveTool());
if (last_flow_speed != getFlow_percent(getActiveTool())) {
SEND_VALasTXT("tmppage.flow", getFlow_percent(getActiveTool()));
last_flow_speed = getFlow_percent(getActiveTool());
}
// tmppage Progress + Layer + Time

View File

@ -691,7 +691,7 @@ namespace ExtUI {
#endif
feedRate_t getFeedrate_mm_s() { return feedrate_mm_s; }
int16_t getFlowPercentage(const extruder_t extr) { return planner.flow_percentage[extr]; }
int16_t getFlow_percent(const extruder_t extr) { return planner.flow_percentage[extr]; }
feedRate_t getMinFeedrate_mm_s() { return planner.settings.min_feedrate_mm_s; }
feedRate_t getMinTravelFeedrate_mm_s() { return planner.settings.min_travel_feedrate_mm_s; }
float getPrintingAcceleration_mm_s2() { return planner.settings.acceleration; }

View File

@ -129,7 +129,7 @@ namespace ExtUI {
float getRetractAcceleration_mm_s2();
float getTravelAcceleration_mm_s2();
float getFeedrate_percent();
int16_t getFlowPercentage(const extruder_t);
int16_t getFlow_percent(const extruder_t);
inline uint8_t getProgress_percent() { return ui.get_progress_percent(); }